tdd
Skill22 starsChanged 10 days agoMITView on GitHub
Enforce RED → GREEN → REFACTOR. Write a failing test before any production code; make it pass with the minimum change; then refactor. Refuses to start with a broken baseline.
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 repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- dependency-analyzerSkill
- docsSkill
- handoffSkill
- openai-reviewerSkill
- plugin-homeSkill
- schema-validatorSkill
- security-auditSkill
- session-auditSkill
- test-validatorSkill
- claude-codeSkill
- codexSkill
- opencodeSkill
- chartsSkill
- export-csvSkill
- export-excelSkill
- make-chartSkill
- make-html-reportSkill
- make-pdfSkill
- a2a-communicateSkill
- a2a-handle-inboundSkill
- codebase-inspectionSkill
- ethos-skill-authoringSkill
- native-mcpSkill
- github-authSkill
- github-code-reviewSkill
- github-issuesSkill
- github-pr-workflowSkill
- github-repo-managementSkill
- birth-ritualSkill
- get-to-know-youSkill
- xurlSkill
- arxivSkill
- grounded-citationsSkill
- research-paper-writingSkill
- reddit-researchSkill
- code-reviewSkill
- coding-agentSkill
- planSkill
- requesting-code-reviewSkill
- spikeSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- writing-plansSkill
- no-ai-slopSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. 0 are common, 14 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 186 edited versions we read keep these.
14
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 39
When the change is purely mechanical (rename, formatting, dead-code removal) tests are not the right gate — skip TDD.
- Distinctive: line 43
Before doing anything else, find the project's test runner:
- Very specific: line 53
Use the run_tests tool when available.
- Distinctive: line 57
Run the test suite once before writing anything new.
- Distinctive: line 67
Write the failing test. One concrete assertion at a time.
- Distinctive: line 68
Run the suite. The new test must fail.
- Distinctive: line 70
If it fails for the wrong reason, fix that and re-run before continuing.
- Distinctive: line 73
Write the smallest production change that makes the new test pass.
- Distinctive: line 74
Run the suite. The new test plus all prior tests must be green.
- Distinctive: line 75
If anything regresses, the GREEN step is incomplete — keep going.
- Distinctive: line 79
Run the suite after each refactor — refactors that break tests are no longer refactors, they're behaviour changes.
- Distinctive: line 80
Stop refactoring when no further improvement is obvious.
- Very specific: line 84
If the todo tool is available, write each RED-GREEN-REFACTOR as a todo item.
- Distinctive: line 90
Run the full test suite.
- Very specific: line 91
Run the project's check command (lint + typecheck + test in one) if it exists.
- Distinctive: line 96
No production code without a test that drove it: If you find yourself editing production code with no failing test that needs it, stop — …
- Distinctive: line 98
One cycle, one behaviour: If a single test forces you to write four new methods, the test is too broad — split it.
“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
Discipline, not vibes. Every behaviour change goes through one full RED → GREEN → REFACTOR cycle before the next behaviour begins.
When to use this skill
- The user mentioned TDD, tests-first, "write the test first".
- You are adding behaviour to a codebase that already has tests. Match the established discipline.
- You are about to write production code for a non-trivial change and there is no test that will catch a regression.
When the change is purely mechanical (rename, formatting, dead-code removal) tests are not the right gate — skip TDD.
Step 0 — detect the test command
Before doing anything else, find the project's test runner:
| Marker file | Test command |
package.json with scripts.test | run that script (pnpm test / npm test) |
package.json with scripts.check | run that script first if it composes test + lint + typecheck |
pyproject.toml with pytest config | pytest |
Cargo.toml | cargo test |
go.mod | go test ./... |
Use the run_tests tool when available; fall back to terminal otherwise.
Step 1 — confirm baseline green
Run the test suite once before writing anything new.
- All green → proceed.
- Any failure → stop. Tell the user: "baseline is red — fix existing tests first or pass
baseline_red: trueto override". Refuse to start a TDD cycle on top of pre-existing failures, because GREEN will be ambiguous.
Step 2 — the cycle
For each behaviour:
🔴 RED
- Write the failing test. One concrete assertion at a time.
- Run the suite. The new test must fail. Inspect why it failed:
- It must fail for the expected reason (assertion mismatch), not a syntax error or a missing import.
- If it fails for the wrong reason, fix that and re-run before continuing.
🟢 GREEN
- Write the smallest production change that makes the new test pass. Hardcoding a return value is acceptable here — multiple tests will force generalization.
- Run the suite. The new test plus all prior tests must be green.
- If anything regresses, the GREEN step is incomplete — keep going.
🧹 REFACTOR
- Improve the code without changing behaviour. Extract, rename, simplify.
- Run the suite after each refactor — refactors that break tests are no longer refactors, they're behaviour changes.
- Stop refactoring when no further improvement is obvious.
Step 3 — track the cycle
If the todo tool is available, write each RED-GREEN-REFACTOR as a todo item. The user can see exactly what behaviour each cycle covered. This also forces small, focused cycles.
Step 4 — final pass
Once all behaviours are covered:
- Run the full test suite.
- Run the project's
checkcommand (lint + typecheck + test in one) if it exists. - Report: number of cycles, files touched, tests added.
Hard rules
- No production code without a test that drove it. If you find yourself editing production code with no failing test that needs it, stop — write the test first.
- No fix lands with a red baseline. Override with
baseline_red: trueonly when explicitly told. - One cycle, one behaviour. If a single test forces you to write four new methods, the test is too broad — split it.
Integrates with
processtool — startpnpm test --watch(or the project equivalent) once at the top of the cycle, leave it running, watch the output between iterations. Kill it withprocess_stopat the end.run_tests— use the typed tool when available; cleaner output and better error reporting than parsingterminal.
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.

