tdd
Skill0 starsChanged 5 months agoMITView on GitHub
Strict test-driven development (Beck-style). Use when writing new code, adding features, or fixing bugs with TDD discipline. TRIGGER when: user asks to use TDD, write tests first, or red/green/refactor. DO NOT TRIGGER when: writing tests after the fact, or user explicitly opts out of TDD.
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.
- CLAUDE.mdCLAUDE.md
- clean-codeSkill
- create-design-briefSkill
- dddSkill
- goosSkill
- ingest-designSkill
- kaizenSkill
- panelSkill
- researchSkill
- review-loopSkill
- software-designSkill
- sopSkill
- synthesizeSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. 0 are common, 17 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 186 edited versions we read keep these.
17
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 12
Write new code only when an automated test has failed.
- Distinctive: line 19
Red: Write a small test that fails (or doesn't compile).
- Distinctive: line 21
Refactor: Remove duplication introduced by getting to green.
- Distinctive: line 23
Run the relevant test(s) after every Red and Green step — not the full suite.
- Distinctive: line 27
First test: Start with the simplest degenerate case — empty input, zero, identity, null.
- Distinctive: line 31
Regression test: When a defect is found, write the smallest failing test that reproduces it *before* writing the fix.
- Distinctive: line 33
When to delete tests: Only when a test is redundant with another test and removing it does not reduce confidence or clarity.
- Distinctive: line 51
Smaller steps: when uncertain, surprised, or dealing with unfamiliar territory.
- Distinctive: line 52
Bigger steps: when confident.
- Distinctive: line 58
Assert first: Start with the assertion (expected outcome), then work backward to the setup and action needed to produce that outcome.
- Very specific: line 59
Evident data: Use literal, readable values so the relationship between input and output is obvious from the test alone (e.g., …
- Distinctive: line 61
Stop writing tests: when every branch and boundary condition is exercised and adding more tests teaches you nothing new.
- Distinctive: line 67
If a test requires too many changes to get to green, write a smaller child test for one piece, get that green, then return to the original …
- Distinctive: line 79
Before modifying something, isolate it (Extract Method, Extract Object, Method Object) so the change is surgical.
- Distinctive: line 99
All tests must pass before committing to shared code.
- Distinctive: line 112
Do not design ahead. Solve "works" first via red/green, then solve "clean" via refactoring.
- Distinctive: line 118
If stuck: backtrack. Revert to the last green state and take a smaller step.
- Distinctive: line 122
If a step is pure wiring with no testable behaviour (e.g., bumping a library version, pure refactorings, etc.): implement directly.
“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
TDD — Test-Driven Development
You write code using strict test-driven development. Follow these rules exactly.
The Two Rules
- Write new code only when an automated test has failed.
- Eliminate duplication.
These imply: write tests before code, then refactor to remove duplication. Design emerges from this process.
The Cycle: Red → Green → Refactor
- Red: Write a small test that fails (or doesn't compile). Run it. Confirm it fails.
- Green: Make it pass using the simplest possible change. Shortcuts within the current scope are fine — hardcoded values, copy-paste, temporary variables. The only goal is green.
- Refactor: Remove duplication introduced by getting to green. This includes duplication between test and production code (e.g., a constant in both).
Run the relevant test(s) after every Red and Green step — not the full suite. Commit at green. Refactor at green. Never refactor while red.
Choosing Tests
First test: Start with the simplest degenerate case — empty input, zero, identity, null.
Next test: Pick from the to-do list a test you are confident you can get passing in one step and that will teach you something new about the problem.
Regression test: When a defect is found, write the smallest failing test that reproduces it before writing the fix.
When to delete tests: Only when a test is redundant with another test and removing it does not reduce confidence or clarity.
The to-Do List
Maintain a running list of tests to write (as comments in the test file or inline notes). When a tangential idea arises mid-cycle, add it to the list and stay focused on the current test. Cross off items as done. Add new items as discovered.
Three Strategies to Get to Green
Choose based on confidence:
| Strategy | When | How |
| Fake It | Uncertain or complex | Return a constant. The constant duplicates a value in the test — remove that duplication by replacing constants with variables/computation until real code emerges. |
| Triangulation | Unsure how to generalize | Write a second test that demands different output. Generalize only when 2+ examples force it. |
| Obvious Implementation | Confident you know the answer | Type the real implementation directly. If you get an unexpected red, back up to Fake It. |
Step Size
- Smaller steps when uncertain, surprised, or dealing with unfamiliar territory.
- Bigger steps when confident.
- An unexpected red bar means: shift down to smaller steps.
- An unexpected green bar means: review your test — it may be wrong. AI-written tests often mirror what the code does rather than what it should do.
Writing Tests
- Assert first: Start with the assertion (expected outcome), then work backward to the setup and action needed to produce that outcome.
- Evident data: Use literal, readable values so the relationship between input and output is obvious from the test alone (e.g.,
assertEquals(2.5, five.times(0.5))). - Test anything that could break: conditionals, loops, operations, polymorphism. Do not test library/framework code or trivial getters/setters.
- Stop writing tests when every branch and boundary condition is exercised and adding more tests teaches you nothing new.
Key Patterns
Child Test
If a test requires too many changes to get to green, write a smaller child test for one piece, get that green, then return to the original test.
Value Objects
Make objects immutable. Operations return new instances. Implement equality and hashing. Eliminates aliasing bugs.
One to Many
Implement for a single element first, then generalize to a collection.
Isolate Change
Before modifying something, isolate it (Extract Method, Extract Object, Method Object) so the change is surgical.
Reconcile Differences
To unify two similar pieces of code: make them identical through tiny changes, then merge.
Mock Objects
For expensive or slow dependencies (DB, network), use fakes that implement the same interface.
Log String
To verify a sequence of calls, append to a log string in each method and assert the final string.
Crash Test Dummy
To test error paths, create a subclass that overrides a method to throw an exception.
Clean Check-In
All tests must pass before committing to shared code. Always.
Test Quality Signals
These smells indicate design problems, not test problems:
- Long setup: Objects are too big. Break them apart.
- Duplicate setup: Too many tightly-coupled objects.
- Long-running tests: Design problem (usually coupling to slow resources).
- Fragile tests: Action at a distance — one change breaks distant tests.
Design Emerges
Do not design ahead. Solve "works" first via red/green, then solve "clean" via refactoring. Design patterns emerge naturally from removing duplication. You don't plan them; you discover them.
The Rhythm
The cycle should be fast — minutes (for a human) per cycle, not hours. Run tests constantly.
If stuck: backtrack. Revert to the last green state and take a smaller step. The tests are your safety net — use them.
Pure Wiring Steps
If a step is pure wiring with no testable behaviour (e.g., bumping a library version, pure refactorings, etc.): implement directly. No test needed.
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.

