tdd
Skill9 starsChanged 3 months agoMITView on GitHub
Canon test-driven development (specify, encode, fulfill) for the host project's test framework. Clarify specifications, one failing test at a time, minimal code to green, approval gates, kitchen-cleaning refactor when needed. Use for TDD, specify-encode-fulfill, or red-green-refactor sessions.
194 other projects use a version of this.
Adopted by
Most recently taken up by
- ishandutta2007/Awesome-Claude-Skillstheir own version, first seen Nov 8, 2026
- trpc/trpctheir own version, first seen Nov 8, 2026
- wowyuarm/dsh-agent-teamtheir own version, first seen Nov 8, 2026
- Contexera/dsh-agent-teamtheir own version, first seen Nov 8, 2026
- Dimon94/dveritytheir own version, first seen Nov 8, 2026
- Dimon94/skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use capture-learning-tools, design-frontend-dev and 10 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.
The-Vibe-CompanySkillcapture-learning-tools
Turn technical conversations, bugs, CI failures, review comments,
Also in 5 projects that use this
The-Vibe-CompanySkilldesign-frontend-dev
Clean Impeccable frontend design skill. Use when the user wants to
Also in 5 projects that use this
tristanphvnSkillketchup-video
Catch the user up like /keel:ketchup, with a short silent video of slides for what happened and the waiting calls as text under it. Use for /keel:ketchup-video.
Also in 14 projects that use this
jaydubya818Skillfigure-it-out
Use when novel or multi-phase work needs an auditable workflow and no narrower playbook fits.
Also in 54 projects that use this
jaydubya818Skillprinciple-laziness-protocol
Apply when a refactor is adding wrappers or abstractions instead of simplifying.
Also in 45 projects that use this
- +2 more from The-Vibe-Company
- +5 more from jaydubya818
Other versions194 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 194
- mattpocock/skills★ 309ksame name
- trpc/trpc★ 41ksame name
- Yeachan-Heo/oh-my-claude-sisyphus★ 41ksame name
- Yeachan-Heo/oh-my-claudecode★ 41ksame name
- QuivrHQ/quivr★ 40ksame name
- The-Vibe-Company/quivr★ 40ksame name
- ccusage/ccusage★ 19ksame name
- ryoppippi/ccusage★ 19ksame name
- MODSetter/SurfSense★ 17ksame name
- GreyDGL/PentestGPT★ 16ksame name
184 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 repository43 other files it gives its agents.
- accessibility-auditSkill
- add-documentationSkill
- add-error-handlingSkill
- address-github-pr-commentsSkill
- agent-risk-reviewSkill
- agent-work-receiptSkill
- automation-roi-auditSkill
- blind-spot-passSkill
- code-reviewSkill
- commit-changes-mainSkill
- commit-same-branchSkill
- commitSkill
- create-pr-mainSkill
- debug-issueSkill
- decision-auditSkill
- define-agent-goalSkill
- design-agent-loopSkill
- fix-compile-errorsSkill
- fix-git-issuesSkill
- gauntlet-loopSkill
- generate-api-docsSkill
- generate-pr-descriptionSkill
- git-sync-workspaceSkill
- instruction-ablationSkill
- light-review-existing-diffsSkill
- lint-fixSkill
- lint-suiteSkill
- merge-open-prsSkill
- optimize-performanceSkill
- pathfinderSkill
- prompt-eval-debugSkill
- refactor-codeSkill
- requirement-to-implementationSkill
- run-all-tests-and-fixSkill
- scoped-auditSkill
- security-auditSkill
- seo-auditSkill
- setup-new-featureSkill
- structure-promptSkill
- thermo-nuclear-code-quality-reviewSkill
- update-memory-bankSkill
- update-readmeSkill
- write-unit-testsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
24 rules. 0 are common, 22 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 186 edited versions we read keep these.
22
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
- could be automatic: a setting could enforce it
- Very specific: line 18
Use when the user invokes /tdd with a draft behavior specification.
- Distinctive: line 30
Fulfill: write production code so the current test passes.
- Distinctive: line 37
Commit the behavior change: before any refactor; never mix behavior changes with refactoring in one commit.
- Distinctive: line 48
Ask the user to confirm or correct.
- Distinctive: line 49
If confirmed, proceed; otherwise revise and repeat from step 1.
- Distinctive: line 56
Use the host repo's test style (imports, factories, matchers).
- Distinctive: line 61
Before writing the next test:
- Distinctive: line 64
If the new behavior does not fit the current conceptual model, propose a restructuring refactor (new branch, clean working state, refactor …
- Distinctive: line 65
If the user approves, abandon the current behavior change until the kitchen is clean, then restart this loop from clarified specifications.
- Distinctive: line 67
Do not add behavior on top of a muddled structure when a small refactor would clarify the design.
- Distinctive: line 71
If the test suite has pre-existing failures unrelated to the current change:
- Distinctive: line 75
Do not commit or push while justifying unrelated reds ("our new specs pass").
- Distinctive: line 79
Write only enough production code to clear the current test failure.
- Distinctive: line 80
Avoid defensive or speculative code not required by the current test.
- Distinctive: line 81
After the test is approved and written, run the inline test review (below).
- Distinctive: line 82
After code is written, run the inline code review (below).
- Distinctive: line 98
No unused paths or defensive branches without test pressure
- Distinctive: line 105
Check kitchen (conceptual fit.
- Distinctive: line 106
Write one failing test → user approves.
- Distinctive: line 113
No force-push to protected branches unless the user explicitly requests it in line with their git rules.
- Distinctive: line 114
Run the host project's test command for affected paths (from README, Makefile, or existing CI).
- Very specific: line 118
write-unit-tests: add tests for existing code, not the one-test Canon loop. - Distinctive: line 127
Keep behavior commits clean: do not commit with unrelated pre-existing failures, and do not mix refactoring into a behavior commit.
- Distinctive: line 128
Commit and push only with the user's approval.
“Common” is measured: kept by at least 6 in 10 of the 186 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-driven development
Role
You guide a specify → encode → fulfill session (Canon TDD): turn agreed specifications into executable tests one at a time, then write only enough production code to make the current failure go away. The user approves each test and each behavior commit. You do not batch-write tests or ship with a dirty test suite.
When to use
Use when the user invokes /tdd with a draft behavior specification. For broad test coverage without the red-green loop, use write-unit-tests. For full feature delivery from a requirement, use requirement-to-implementation. For fixing a broken suite without new behavior, use run-all-tests-and-fix.
Initial specification
Take the initial specification from the user's message (draft scenarios, examples, or file references). If missing, ask one focused question before proceeding.
Specify-encode-fulfill
At session level:
- Specify: agree what to build as concrete scenarios.
- Encode: turn each scenario into one automated test (executable specification).
- Fulfill: write production code so the current test passes.
At fine grain (repeat until the specification list is empty):
- Maintain a numbered specification list for this session.
- Encode exactly one test per cycle: one list item as a failing automated test.
- Fulfill with code just barely enough to make that failure go away, no speculative coding.
- Commit the behavior change before any refactor; never mix behavior changes with refactoring in one commit.
- Optionally refactor after the behavior commit, with user approval.
- Return to step 2 for the next list item.
Reference: Canon TDD (Kent Beck).
Clarifying specifications
Before writing tests:
- Repeat the specifications in your own words (scenario form: under scenario A, X happens; under scenario B, Y happens).
- Ask the user to confirm or correct.
- If confirmed, proceed; otherwise revise and repeat from step 1.
Encoding tests (framework-agnostic)
- Map each scenario to a named example or case in the host project's test framework (e.g. nested group + single case).
- Assert what the correct behavior is, never "works correctly", "works properly", or vague "handles" without stating expected outcomes.
- One behavior per test case where possible.
- Use the host repo's test style (imports, factories, matchers). Detect from existing tests or project docs.
- For RSpec hosts, see appendix-rspec-examples.md.
Cleaning the kitchen
Before writing the next test:
- Picture where the test will live in the test tree and where production code will change.
- If the new behavior does not fit the current conceptual model, propose a restructuring refactor (new branch, clean working state, refactor only, then pause).
- If the user approves, abandon the current behavior change until the kitchen is clean, then restart this loop from clarified specifications.
Do not add behavior on top of a muddled structure when a small refactor would clarify the design.
Pre-existing failures (kitchen rule)
If the test suite has pre-existing failures unrelated to the current change:
- Stop the TDD session.
- Stash or park work, fix the pre-existing failure on a clean baseline, then resume.
- Do not commit or push while justifying unrelated reds ("our new specs pass").
Fulfilling specifications
- Write only enough production code to clear the current test failure.
- Avoid defensive or speculative code not required by the current test.
- After the test is approved and written, run the inline test review (below).
- After code is written, run the inline code review (below).
- Show the test, wait for approval, then show code, wait for approval before commit.
Inline light review
Replace separate design-review commands in v1.
After the test:
- Scenario is visible in the test name or structure
- Assertion states expected outcome, not vague correctness
- One focused behavior; no extra cases in the same commit
After the production code:
- Diff is minimal relative to the test
- No unused paths or defensive branches without test pressure
- Matches host patterns in neighboring code
Workflow summary
- User provides draft specification via
/tdd. - Clarify until specifications are confirmed.
- Check kitchen (conceptual fit; pre-existing failures).
- Write one failing test → user approves.
- Minimal green code → inline reviews → user approves commit.
- Repeat from step 4 or add specifications and continue.
Safety
- Commits and pushes only when the user approves.
- No force-push to protected branches unless the user explicitly requests it in line with their git rules.
- Run the host project's test command for affected paths (from README, Makefile, or existing CI).
Distinction from other commands
write-unit-tests: add tests for existing code, not the one-test Canon loop.requirement-to-implementation: plan and implement a requirement end-to-end, not per-test approval TDD.run-all-tests-and-fix: restore a green suite, not specify-encode-fulfill for new behavior.refactor-code: behavior-preserving refactor; in TDD, refactor only after a behavior commit.
Guardrails
- Encode one test per cycle and write only enough code to pass it; never batch tests or add speculative code.
- Assert concrete expected outcomes, never "works correctly" or "handles properly".
- Keep behavior commits clean: do not commit with unrelated pre-existing failures, and do not mix refactoring into a behavior commit.
- Commit and push only with the user's approval; no force-push to protected branches unless the user explicitly requests it.
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.

