test-writer
Skill19 starsChanged 6 months agoMITView on GitHub
Writes unit, integration, and end-to-end tests for existing or new code.
28 other projects use a version of this.
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/upboxtheir own version, first seen Oct 11, 2026
- poshan0126/dotclaudetheir own version, first seen Oct 8, 2026
Used with
Projects with it also use debug-fix, changelog-writer and 9 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.
zebbernSkilldebug-fix
Find and fix a bug or issue — from any source (GitHub issue, error message, user report, or observed behavior)
Also in 4 projects that use this
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
get-proofpilotSkillcontext-budget
Audits Claude Code context window consumption across agents, skills, MCP servers, and rules. Identifies bloat, redundant components, and produces prioritized token-savings recommendations.
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
Other versions28 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 28
- leonardomso/33-js-concepts★ 67ksame name
- Devolutions/IronRDP★ 3.3ksame name
- poshan0126/dotclaude★ 871same 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
- jeremymcs/skills★ 8same name
- xcrrr/claude-skills★ 6same name
18 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 repository9 other files it gives its agents.
- ci-fixSkill
- codeql-fixSkill
- database-reviewSkill
- debuggingSkill
- frontend-implementationSkill
- git-conflict-resolveSkill
- provider-debugSkill
- pr-reviewSkill
- security-auditSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 27 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Add tests that catch real regressions.
- Distinctive: line 66
Write tests that test the contract, not the implementation.
- Distinctive: line 79
Run the test in two states to prove it actually checks something: first with the implementation broken (assert the test fails), then with …
- Very specific: line 83
Keep test runtime in mind.
- Very specific: line 126
Write a test that pins exactly that input and assertion.
- Distinctive: line 149
Do the assertions describe observable behavior, not internal implementation details?
“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
Test Writer
Add tests that catch real regressions. Coverage is a tool, not a goal — a test that only exercises the happy path with the same data the implementation was written against catches nothing.
Use this skill when
- The user asks to write tests for an existing function, class, or module.
- The user wants to add coverage for a feature or bug fix.
- The user describes a behavior they want pinned down so it does not regress.
- The user is writing new code TDD-style and wants the tests first.
Do NOT use this skill when
- The user is debugging a known failure. Use
debugging— once the root cause is clear, come back here to write the regression test. - The user has not yet implemented the behavior and the design is unsettled. Use a coding skill to pin the design first.
- The user wants tests for code they are about to delete.
Procedure
- Identify the unit under test. Be explicit: "the
parseDatefunction insrc/date.ts", "the/users/:idGET handler", "the checkout flow from add-to-cart to receipt". Vague targets produce vague tests. - Pick the right test type:
- Unit: pure function, single class, mockable boundary. Fastest to run, cheapest to maintain. Default to unit tests when the logic is mostly in-process.
- Integration: code that crosses a boundary you cannot reasonably mock (database, queue, file system). Use a real dependency in a controlled environment (testcontainers, in-memory SQLite if the queries match).
- End-to-end: whole-system behaviors the user sees (full HTTP request, full UI click path). Expensive — reserve for the handful of flows that earn the cost. Each level has a place. Pushing logic into unit-testable functions is usually a better answer than writing more e2e tests.
- Enumerate cases before writing assertions. For each behavior list:
- Happy path — typical input, typical output.
- Boundaries — empty, single, max, just-over-max.
- Edge cases — null, undefined, negative numbers, unicode, duplicates, ordering, concurrency.
- Error paths — invalid input, dependency failures, timeouts.
- Idempotency / side effects — does running twice change the result? Should it?
- Write tests that test the contract, not the implementation. Assert on observable behavior (return values, emitted events, written rows) — not on which internal method was called. Tests that over-specify implementation break on every refactor and teach future readers nothing.
- Pick fixtures and factories deliberately. Prefer minimal, purpose-built fixtures over shared "kitchen sink" objects. A test that fails for unclear reasons usually started with a fixture that carries more state than the test needs.
- Choose assertions that fail descriptively.
expect(result).toEqual(expected)beatsexpect(result.length > 0).toBe(true)— when the second one fails, you learn nothing. Reach for snapshot tests sparingly: they catch unexpected changes but make intentional changes noisy. - Run the test in two states to prove it actually checks something: first with the implementation broken (assert the test fails), then with the implementation correct (assert the test passes). A test that passes against both implementations is decorative.
- Keep test runtime in mind. A suite that takes 20 minutes to run
gets skipped. Move slow setup behind
beforeAll, parallelize what is parallel-safe, prefer in-memory fakes for unit-level tests of code that talks to a slow boundary. - Be deliberate about what to mock. Mock external services you do not own; do not mock the code under test or its immediate collaborators if you can use the real thing cheaply. Over-mocked tests pass without exercising any real code path.
- For each test, write a name that describes the behavior, not the
function.
parses an ISO date in UTCreads better thantest_parseDate_1. The test runner output becomes a readable spec of the system. - Group related tests with
describeblocks that name the unit under test. Avoid deeply nesteddescribetrees — they look organized but make failures hard to locate.
Examples
In scope: "Add unit tests for parseDate in src/date.ts."
→ Read parseDate. Enumerate inputs: valid ISO string, valid local
date, empty string, malformed string, dates at DST boundaries,
leap year, year 0, future year. Write one assertion per case.
Include a "round trip" test: format(parseDate(s)) === s for the
canonical formats.
In scope: "Pin down the behavior of the checkout flow."
→ This is integration- or e2e-shaped. Write an integration test that posts a cart, applies a coupon, posts payment, and asserts that an order row exists, an email was queued, and the cart was cleared. Skip the UI rendering details — those belong in a separate UI test.
Out of scope: "Why is this test flaky?"
→ Flakes are a debugging task. Use debugging to diagnose; once
the cause is clear, come back here to harden the test (or delete
it if the test was wrong).
In scope: "We just fixed a bug — add a regression test."
→ The diagnosis already produced the smallest input that reproduces.
Write a test that pins exactly that input and assertion. Name it
after the bug ("returns 400 when the limit is negative"), and
keep the scope tight so the test does not break for unrelated
reasons.
Out of scope: "Write tests for code I'm about to delete."
→ Don't.
Out of scope: "Generate 100% coverage for this module."
→ Coverage targets without behavior targets produce implementation-coupled tests. Ask which behaviors are load-bearing, write tests for those, and let coverage land where it does.
Self-check before responding
- Is the unit under test stated precisely?
- Did I pick the smallest test type that meaningfully exercises the behavior?
- Did I enumerate happy-path, boundary, edge-case, and error-path cases before writing assertions?
- Do the assertions describe observable behavior, not internal implementation details?
- Did I confirm the test fails when the implementation is broken?
- Are fixtures minimal and purpose-built, not shared kitchen-sink objects?
- Will the test still pass on a refactor that preserves behavior?
- Will the test fail descriptively, so a future reader can diagnose from the failure message alone?
- Is the total runtime cost worth the regression protection?
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.

