test-writer
Skill871 starsChanged 5 months agoMITView on GitHub
Write comprehensive tests for new or changed code. Use automatically after adding a function, endpoint, or component, or changing behavior, when the change has no corresponding test changes. Not for config, docs, or test-only diffs. For judging whether existing tests adequately verify a change, use the pr-test-analyzer agent instead.
28 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- seankoji-com/.agentstheir own version, first seen Nov 8, 2026
- Devolutions/IronRDPtheir own version, first seen Nov 1, 2026
- WST2002/claude-code-skillstheir own version, first seen Oct 17, 2026
- anchildress1/awesome-aitheir own version, first seen Oct 13, 2026
- krishnamallam/upboxedited, first seen Oct 11, 2026
- leonardomso/33-js-conceptstheir own version, first seen Oct 8, 2026
Used with
Projects with it also use changelog-writer, readme-generator and 4 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
zbruhnkeSkillchangelog-writer
Maintain CHANGELOG.md with properly categorized entries. Use after implementing features, fixing bugs, or making any notable changes. Follows Keep a Changelog format.
Also in 5 projects that use this
glinckerSkillreadme-generator
Generates comprehensive README.md files for software projects by analyzing codebase structure
Also in 4 projects that use this
JohnJBorenSkilldebugger
Systematic debugging workflows, root cause analysis, and troubleshooting patterns
Also in 3 projects that use this
nimbalystSkillprd-writer
Create structured Product Requirements Documents (PRDs) with prioritized requirements. Use when writing product specs, feature requirements, or project briefs.
Also in 3 projects that use this
GoogleSkillcode-reviewer
Also in 4 projects that use this
ElasticSkillaccessibility
Accessibility guidance for Kibana. Use this skill when working with or reviewing EUI components, resolving a11y-related (@elastic/eui) ESLint issues, and ensuring proper use of ARIA attributes, focus management, keyboard interactions, and accessible naming conventions.
Also in 3 projects that use this
Other versions28 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- zebbern/termstack★ 493% same
- krishnamallam/upbox★ 293% same
Wrote their own version · 26
- leonardomso/33-js-concepts★ 67ksame name
- Devolutions/IronRDP★ 3.3ksame name
- TheDecipherist/claude-code-mastery-project-starter-kit★ 337same name
- hamzafarooq/claude-code-starter★ 145same name
- anchildress1/awesome-ai★ 67same name
- anchildress1/awesome-github-copilot★ 67same name
- nimbalyst/skills★ 28same name
- Twigpine/openclaude-skills★ 19same name
- jeremymcs/skills★ 8same name
- xcrrr/claude-skills★ 6same name
16 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 14 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 27 edited versions we read keep these.
14
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Write comprehensive tests for the code that was just added or changed.
- Distinctive: line 29
Read each changed file to understand the behavior being added
- Distinctive: line 31
Place new test files next to the source files or in the project's established test directory.
- Distinctive: line 52
One assertion per test: If a test name needs "and", split it into two tests
- Distinctive: line 53
Descriptive names: Test names read as sentences describing the behavior:
- Distinctive: line 62
Every branch (if/else, switch, ternary)
- Distinctive: line 63
Every thrown error with exact error type and message
- Distinctive: line 96
Prefer real implementations over mocks
- Distinctive: line 97
Only mock at system boundaries: network, filesystem, clock, random
- Distinctive: line 98
Never mock the code under test
- Distinctive: line 99
If you mock, verify the mock was called with expected arguments
- Distinctive: line 104
Run the new tests. Confirm they all pass
- Distinctive: line 106
If no test fails when code is broken, the tests are useless.
- Distinctive: line 107
Check coverage: every new function should have at least one test, every branch should be exercised
“Common” is measured: kept by at least 6 in 10 of the 27 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Write comprehensive tests for the code that was just added or changed.
Step 1: Discover What Changed
Change under test (injected at load — already in front of you, no tool call needed):
git diff --stat HEAD 2>/dev/null || echo "(no diff vs HEAD — inspect git status manually)"git diff HEAD 2>/dev/null || true- The diff above is the change under test. If it is empty (already committed or amended elsewhere), run
git diff,git diff --cached, orgit show HEADto locate the change - Read each changed file to understand the behavior being added
- Identify the project's existing test framework, patterns, and conventions by finding existing test files
- Place new test files next to the source files or in the project's established test directory. Match whatever the project already does
Step 2: Analyze Every Code Path
For each new or modified function/method/component, map out:
- Happy path. Normal input, expected output
- Edge cases. Empty input, single element, boundary values (0, 1, -1, MAX_INT)
- Null/undefined/nil. What happens with missing data
- Type boundaries. Wrong types, type coercion traps
- Error paths. Invalid input, network failures, timeouts, permission denied
- Concurrency. Race conditions, parallel calls with shared state
- State transitions. Initial state, intermediate states, final state
- Integration points. How this code interacts with its dependencies
Step 3: Write the Tests
For EACH scenario identified above, write a test. No skipping.
Structure
- One assertion per test. If a test name needs "and", split it into two tests
- Descriptive names. Test names read as sentences describing the behavior:
should return empty array when input is emptyshould throw ValidationError when email format is invalidshould retry 3 times before failing on network timeout
- Arrange-Act-Assert. Set up, execute, verify. Clear separation.
What to Test
Pure functions / business logic:
- Every branch (if/else, switch, ternary)
- Every thrown error with exact error type and message
- Return value types and shapes
- Side effects (mutations, calls to external services)
API endpoints / handlers:
- Success response (status code, body shape, headers)
- Validation errors for each field (missing, wrong type, out of range)
- Authentication/authorization failures
- Rate limiting behavior if applicable
- Idempotency for non-GET methods
UI components (if applicable):
- Renders without crashing with required props
- Renders correct content for each state (loading, error, empty, populated)
- User interactions trigger correct callbacks (click, submit, type, select)
- Accessibility: focusable, keyboard navigable, correct ARIA attributes
- Conditional rendering. Each branch shows/hides correct elements
Database / data layer:
- CRUD operations return correct data
- Unique constraints reject duplicates
- Cascade deletes work as expected
- Transactions roll back on failure
Async operations:
- Successful resolution
- Rejection / error handling
- Timeout behavior
- Cancellation if supported
- Concurrent calls don't interfere
Mocking Rules
- Prefer real implementations over mocks
- Only mock at system boundaries: network, filesystem, clock, random
- Never mock the code under test
- If you mock, verify the mock was called with expected arguments
- Reset mocks between tests. No shared state leaking
Step 4: Verify
- Run the new tests. Confirm they all pass
- Temporarily break the code (change a return value or condition). Confirm at least one test fails
- If no test fails when code is broken, the tests are useless. Rewrite them
- Check coverage: every new function should have at least one test, every branch should be exercised
Output
- Complete, runnable test file(s). Not snippets
- Tests grouped by the function/component they cover
- A brief summary: how many tests, what scenarios covered, any gaps you couldn't cover and why
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

