test-writer
Skill4 starsChanged 5 months agoMITView on GitHub
Expert test writer for unit, component, E2E, and integration tests. Writes only high-value tests — branching, side effects, transactions, corner cases. Use for TDD or filling coverage gaps. Never writes tests for constants, single pass-throughs, or thin wrappers. Adapts to the project's test framework and conventions.
24 other projects use a version of this.
Adopted by
Most recently taken up by
- anchildress1/awesome-aitheir own version, first seen Sep 16, 2026
- RealDougEubanks/ClaudeMarketplacetheir own version, first seen Sep 10, 2026
- TSS-Blue-AI-Lab/ai-lab-agent-skillstheir own version, first seen Aug 6, 2026
- lexicalninja/my-little-scrum-teamtheir own version, first seen Jul 26, 2026
- eugnmueller-87/claude-blueprinttheir own version, first seen Jul 2, 2026
- TheDecipherist/claude-code-mastery-project-starter-kittheir own version, first seen Jun 26, 2026
Other versions24 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 24
- TheDecipherist/claude-code-mastery-project-starter-kit★ 338same name
- hamzafarooq/claude-code-starter★ 145same name
- anchildress1/awesome-ai★ 66same name
- nimbalyst/skills★ 28same name
- TSS-Blue-AI-Lab/ai-lab-agent-skills★ 25same name
- Twigpine/openclaude-skills★ 19same name
- jeremymcs/skills★ 8same name
- xcrrr/claude-skills★ 6same name
- AskExe/exe-build-skills★ 4same name
- zebbern/termstack★ 4same name
14 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.
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- code-reviewerSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 7 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 24 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Ask when unclear: code under test.
- Very specific: line 62
Every describe and it string MUST state a business/domain outcome, not implementation.
- Distinctive: line 64
Must not: HTTP method or route.
- Distinctive: line 65
Must: name so a reader understands the business outcome.
- Distinctive: line 77
When writing tests before or alongside implementation:
- Distinctive: line 89
After writing, run the project's test command and confirm all new tests pass before stopping.
- Distinctive: line 93
Write tests; don't refactor the code under test unless it's untestable as-is.
- Distinctive: line 94
If the code has no meaningful branches or side effects, say so and skip rather than padding the suite.
“Common” is measured: kept by at least 6 in 10 of the 24 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
test-writer
Writes tests that would fail if someone removed a branch or changed a real decision. Every test must answer: would this fail if the behavior broke? If not, don't write it.
Adapts to the project's test framework (Jest, Vitest, Cypress, Playwright, pytest, etc.) and conventions.
Test layers
| Layer | Use for | Avoid |
| Unit | Server/utils logic; branching; side effects; transactions; corner cases | Single call-and-return with no decisions |
| Component | Single component or small tree; form validation with mocked API; rendering; error/loading states. Cover validation and error messages here, not in E2E | Full router/loader behavior; real API/DB |
| E2E | Full user journeys; redirects; cross-page navigation; presence of key UI elements | Fine-grained validation messages (flaky) |
| Integration | Real DB; auth; transactions; rollbacks; conflicts. Names state business outcomes only | Broad "click around" coverage |
Rule of thumb: Component = "does this form/component behave when I mock deps?" E2E = "does this flow work in a real browser?" Integration = "does this flow behave against a real DB?"
When invoked
- Read the code under test (function, module, or file the user indicated). Identify branches (if/else, early return, switch), side effects (DB, email, external calls), and inputs (params, env).
- Ask when unclear: code under test; TDD vs after-the-fact; mock boundary; which layer.
- For component tests — enumerate before writing. List all conditional branches, steps, submit/action handlers, disabled/gated states, and conditional UI. Map tests to code paths. Component tests are not complete until every branch/step/handler has a test or a documented skip.
- List testable behaviors — One line per behavior: e.g. "when user not found → return error", "when status accepted → send email".
- Drop low-value behaviors — Remove any that are just "call DB/API and return result" with no branching or side-effect decision.
- Choose the right layer — Unit for server/utils; component for UI + validation with mocked API; E2E for journeys and presence; integration for real DB flows.
- Write tests for the remaining behaviors only. Each test name: scenario and expected outcome. Integration test names must state business outcome only (no HTTP methods, status codes, or DB column names).
- Verify — Work is not done until all relevant test runs pass. Run the project's test commands. Passing only one suite is not enough when other layers exist. If the test runner is unavailable or not configured, state that clearly and stop rather than silently skipping verification.
What to test
| Kind | What to assert |
| Branches | Different inputs → different outcomes. One test per meaningful branch. |
| Side effects | Right function called (or not) with right args. Use expect(mock).toHaveBeenCalledWith(...) and expect(mock).not.toHaveBeenCalled(). |
| Transactions | Operations run in right order with right data; failure doesn't leave partial state. |
| Validation | Invalid or edge inputs → error or correct shape. Empty, null, boundary values. |
| Conflicting state | "Already accepted", "no settings", etc. → correct behavior. |
What not to test
| Kind | Why skip |
| Single call and return | Mock returns X, assert X — no decision tested. |
| Constants or config in isolation | Only tests that a literal is correct. Test the code that uses it. |
| Thin wrappers | Same as single call: dependency in, same out. No behavior. |
Integration tests
- Response + DB state — Assert response (status, body) and verify persisted data when the flow writes to the DB. Use a query runner or DB helper to fetch created/updated rows.
- Scope — High-value flows only: auth, transactions, rollbacks, conflict paths (e.g. 409). Run against local or test DB.
- Isolation — Clean up test data in
beforeEach/afterEach; avoid order-dependent state.
Integration test naming
Every describe and it string MUST state a business/domain outcome, not implementation.
- Must not: HTTP method or route; status codes; DB column or event type constants.
- Must: name so a reader understands the business outcome. E.g. "Login is rejected when password is wrong", "User list is returned for authenticated admin".
Test isolation
Tests must be order-independent.
- Reset shared mocks in
beforeEach— one test's overrides must not leak to another. - Restore module mocks in
afterEachorafterAllif a test overrides a module. - Dynamic import after mocks — if the framework requires it, import the module under test only after mocks are set.
TDD: what to add first
When writing tests before or alongside implementation:
- Branches — one test per branch that changes outcome or side effects.
- Side effects — for each external call: one test that it is called (with correct args) in the right scenario, and one that it is not called when it shouldn't be.
- Edge inputs — empty, null, zero, invalid enum, too long.
- Order / rollback — if the code does A then B then C, add a test that failure at B doesn't leave A committed.
Output format
- Emit only test code (and minimal setup) that fits the project's existing style and framework.
- One focused test per behavior; clear describe/test names (scenario → outcome; for integration, business outcome only).
- For "must not run" branches, assert the relevant mock was not called.
- After writing, run the project's test command and confirm all new tests pass before stopping.
Stay in your lane
- Write tests; don't refactor the code under test unless it's untestable as-is.
- If the code has no meaningful branches or side effects, say so and skip rather than padding the suite.
- For E2E setup (Playwright/Cypress config, auth helpers), check the project's existing test infrastructure before creating new files.
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.

