writing-tests
Skill by potahtml
Explains how to write and extend pota's own tests, covering browser tests under tests/api/ and typecheck-only tests under tests/typescript/. Aimed at contributors to the pota repository.
Install writing-tests
Built from the published package, never by AI.
git clone --depth 1 https://github.com/potahtml/pota /tmp/pota && mkdir -p ~/.claude/skills && cp -r /tmp/pota/.claude/skills/writing-tests ~/.claude/skills/writing-testsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/potahtml/pota /tmp/pota && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/pota/.claude/skills/writing-tests ~/.gemini/antigravity-cli/skills/writing-testsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill is a step-by-step procedure for adding test coverage to the pota library. It explains where new test files belong, mirroring the src/ layout, and gives the anatomy of a test that uses the #test harness. Browser tests run in a real Chromium browser through a custom Puppeteer runner, and type-level assertions go in separate typecheck-only files.
The skill also sets rules for timing and failing tests. Signal writes update the DOM synchronously, while promise content and use:* plugins need await microtask(). If a new test fails, the skill says not to delete or weaken it. The failing assertion should be reported as a possible library bug instead. It is written for contributors working on the pota repository.
Written from the project's SKILL.md and checked against it.
What it can do
- File placementMaps test files to src/ folders such as components, reactivity, dom, store, use, forms and jsx.
- Test anatomyShows the required pragma, top-level await test() calls and the expect helpers.
- Disposal ruleRequires calling the dispose function returned by render at the end of each test.
- Timing rulesExplains when to assert synchronously and when to use microtask, macrotask or sleep.
- Failing test workflowSays to report failing assertions rather than delete or weaken them.
- Run commandsLists npm scripts for filtered runs, the full API suite, watch mode and coverage.
What you need
- Node.js and npm
- Chromium browser for the Puppeteer runner
- A local clone of the pota repository
Try asking
- Write a browser test for the Show component under tests/api/components/
- Add a regression test for a bug in a reactive primitive in pota
- Run the pota API tests filtered to the store folder
Good to know
- Written for the pota repository's own tests, not for general app testing
- Type-level tests run separately with the typecheck script
- Depends on repo files such as tests/readme.md and tools/test-runner/readme.md
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .claude/skills/writing-tests/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to writing-tests
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
writing-tests: common questions
Where do pota browser tests go?
They go under tests/api/ in a folder that mirrors src/, such as components/, reactivity/ or use/. Type-level assertions go in tests/typescript/ instead.
How do I run the pota test suite?
Run npm run test:api with a path substring to filter, then npm run test:api for the full run. npm test is the full pre-release gate.
Should I change a test that fails?
No. The skill says not to delete, weaken or rewrite a failing test. Report the failing assertion, the observed behavior and a hypothesis instead.
How do I install writing-tests?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is writing-tests free?
The code is public, but no licence file was found, so check the repository before commercial use.
Is writing-tests safe to use?
It scores 48 of 100. Grades: maintenance C, licence F, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to writing-tests?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
