tdd
Skill72 starsChanged 6 months agoMITView on GitHub
Use this skill when implementing or changing behavior with test-driven development. Follow red-green-refactor one behavior at a time, confirm a real failure before writing production code, and keep the test command the project's own.
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 repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skill-creatorSkill
- agent-readySkill
- bufferSkill
- codebase-readinessSkill
- code-snippetSkill
- conventional-commentsSkill
- conventional-commitsSkill
- herdr-code-reviewSkill
- stacked-prsSkill
- team-code-reviewSkill
- webhook-receiverSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. 0 are common, 22 are distinctive, and 1 is 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.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill when:
- Distinctive: line 24
Read the repository instructions (AGENTS.md, CLAUDE.md, or the equivalent) and find the test command.
- Very specific: line 25
If no command is documented, detect it from the project: task runner scripts, Makefile, pytest / go test / cargo test / mvn test / gradle …
- Distinctive: line 26
Run the existing suite, or the relevant subset, once.
- Distinctive: line 29
If the test command cannot be found or cannot be executed, stop and say so.
- Distinctive: line 37
Write the smallest test that expresses the next behavior and nothing else.
- Distinctive: line 41
Use the project's existing test style.
- Distinctive: line 43
Run that test alone when the runner allows it.
- Distinctive: line 47
If the new test passes immediately, the behavior already exists or the test does not exercise it.
- Distinctive: line 51
Write the minimum production code that makes this test pass.
- Distinctive: line 59
Only refactor while the tests are green.
- Distinctive: line 61
Remove duplication introduced by the last green step.
- Distinctive: line 63
Leave behavior unchanged. A refactor that needs a new test is a new behavior.
- Distinctive: line 65
Run the same tests again after refactoring.
- Distinctive: line 69
Keep a short list of behaviors, ordered so each test teaches one new fact.
- Distinctive: line 76
Do not write that list as a finished test file.
- Distinctive: line 78
Prefer several small cycles over one test that asserts an entire feature.
- Distinctive: line 82
Never write a full test file up front and then implement against it.
- Distinctive: line 83
Never implement more than the current failing test requires.
- Distinctive: line 84
Never delete or skip a failing test to get to green.
- Distinctive: line 85
Never change a test and the production code in the same step unless the test itself was wrong (bad assertion, wrong setup).
- Distinctive: line 86
Keep tests deterministic. No sleeps, no order dependence, no hidden network calls unless the project already uses a fake or fixture for …
- Distinctive: line 87
Leave the suite green at the end of every cycle, including the last one.
“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
Implement behavior one failing test at a time. The cycle is red, green, refactor. Do not write the production code for a behavior before a test has failed for that behavior, and do not start the next behavior until the current one is green and cleaned up.
This skill is agent-neutral. It does not install hooks, slash commands, or a required subagent. Run the project's existing test command from the current agent.
When to use
Use this skill when:
- Adding a feature, bugfix, or behavior change that can be expressed as an executable check
- The user asks for TDD, red-green-refactor, or "test first"
- A change is small enough to slice into separately verifiable behaviors
Skip the cycle only when the user explicitly asks for a spike or a non-behavioral change (formatting, comments, generated files). Say that the cycle was skipped and why.
Before the first test
- Read the repository instructions (
AGENTS.md,CLAUDE.md, or the equivalent) and find the test command. Prefer a documented command over guessing. - If no command is documented, detect it from the project: task runner scripts,
Makefile,pytest/go test/cargo test/mvn test/gradle test/phpunit/bin/rspec, or the language's usual runner. Run the narrowest command that executes one example or one file. - Run the existing suite, or the relevant subset, once. If it is already red, stop and report that. Do not stack new work on a broken baseline unless the user asks to fix that baseline first.
- Name the next behavior in one sentence: the input, the observable output, and the boundary that makes it the smallest next step.
If the test command cannot be found or cannot be executed, stop and say so. Do not claim a cycle completed without a run.
The cycle
Repeat until the requested behavior is complete. Each iteration covers exactly one behavior.
1. Red
Write the smallest test that expresses the next behavior and nothing else.
- One new example, case, or assertion. Do not scaffold the rest of the file "while here."
- Assert on observable behavior (return value, state change, response, emitted event), not on private structure.
- Use the project's existing test style. Match names, fixtures, and helpers already in the tree.
Run that test alone when the runner allows it.
The test must fail, and it must fail because the behavior is missing or wrong — not because of a typo, a missing import, a wrong path, or a setup error. Read the failure. If the failure is not the expected one, fix the test and run it again before writing production code.
If the new test passes immediately, the behavior already exists or the test does not exercise it. Do not treat that as success. Adjust the test or choose a behavior that is not already covered, then re-run until the failure is real.
2. Green
Write the minimum production code that makes this test pass. Do not implement the next behavior, the general case, or "what we'll need later."
Hard-coding a single return value is acceptable when it is the smallest change that turns this test green. The following test is what forces the code to become general.
Run the same test again. It must pass. If it fails, change the production code or correct a bad test — do not weaken the assertion to hide a real miss. Then run the relevant surrounding tests to confirm the change did not break an existing behavior.
3. Refactor
Only refactor while the tests are green.
- Remove duplication introduced by the last green step.
- Rename for the domain language already used in the code.
- Leave behavior unchanged. A refactor that needs a new test is a new behavior; stop and start another red step.
Run the same tests again after refactoring. If they fail, undo the refactor or fix it before continuing. Do not begin the next behavior on a red suite.
Slicing work
Keep a short list of behaviors, ordered so each test teaches one new fact. Typical order:
- The simplest happy path
- The next variation that forces the hard-coded branch to become real logic
- Boundaries (empty, zero, one, limits)
- Failure and error paths the caller can actually hit
Do not write that list as a finished test file. Track it as a plan, then turn one item into a test at a time.
Prefer several small cycles over one test that asserts an entire feature. A cycle that touches many files is a signal to slice again.
Rules
- Never write a full test file up front and then implement against it.
- Never implement more than the current failing test requires.
- Never delete or skip a failing test to get to green.
- Never change a test and the production code in the same step unless the test itself was wrong (bad assertion, wrong setup). When the test was wrong, return to red and show the corrected failure before continuing.
- Keep tests deterministic. No sleeps, no order dependence, no hidden network calls unless the project already uses a fake or fixture for that dependency.
- Leave the suite green at the end of every cycle, including the last one.
Done
The work is done when every requested behavior has been through red, green, and refactor, the tests that cover those behaviors pass, and the relevant existing suite still passes. Summarize the behaviors added and the command used to run them. Do not claim coverage that was not executed.
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.

