tdd
Skill1 starsChanged 3 months agoMITView on GitHub
Red-green-refactor loop. Use when user wants to build features using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
194 other projects use a version of this, 30 of them edited.
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 · 30
- GreyDGL/PentestGPT★ 16k22% same
- sanity-io/sanity★ 6.4k26% same
- openstatusHQ/data-table-filters★ 2.3k26% same
- truffle-ai/dexto★ 65926% same
- amazingloft999-droid/mattpocock-skills★ 42225% same
- brianlovin/claude-config★ 37626% same
- ninehills/skills★ 28022% same
- InditexTech/weavejs★ 26625% same
- letehaha/moneymatter★ 22125% same
- heyongjun666/AICU-Graph★ 20022% same
20 more not listed
Wrote their own version · 164
- 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
- open-metadata/OpenMetadata★ 16ksame name
154 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 repository10 other files it gives its agents.
- blueprintSkill
- codebase-designSkill
- diagnoseSkill
- grill-with-docsSkill
- improve-codebase-architectureSkill
- integrateSkill
- quickSkill
- setup-runtimeSkill
- setupSkill
- setup-styleSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. 0 are common, 13 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 186 edited versions we read keep these.
13
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
If the user named a blueprint file, use that file.
- Very specific: line 14
If no blueprint exists in docs/plans/, tell the user — recommend running /blueprint first, or if they prefer, proceed by driving RED→GREEN …
- Very specific: line 19
When every Acceptance Criterion in the slice is green and refactored, tick its TDD done checkbox in the blueprint, then move to the next …
- Very specific: line 22
When reading domain terminology, if CONTEXT-MAP.md exists, read it and read each context relevant to the topic.
- Distinctive: line 29
If you find yourself writing implementation without a preceding failing test:
- Distinctive: line 32
Delete the implementation code you just wrote.
- Distinctive: line 33
Write the test first.
- Distinctive: line 35
Only then write the implementation again.
- Distinctive: line 69
Write ONE test for ONE behaviour from the current slice's Acceptance Criteria.
- Distinctive: line 73
Run the test immediately.
- Distinctive: line 76
If it passes immediately → the behaviour already exists, rewrite the test.
- Distinctive: line 77
If it fails with syntax/import errors → fix those, re-run, re-verify.
- Very specific: line 83
Read docs/house-style.md if it exists, then write the minimal code to make this single test pass.
- Distinctive: line 87
No anticipating the next test.
- Distinctive: line 89
VERIFY: Run the test. It must pass.
- Distinctive: line 93
After the test is green, look for refactor opportunities:
- Distinctive: line 102
Run tests after each refactor step
- Very specific: line 122
When all slices are complete and the full test suite passes, verify every TDD done checkbox in the blueprint is ticked, then tell the user:
“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
Before You Start
Select the blueprint
- If the user named a blueprint file, use that file.
- Otherwise ask the user which blueprint to use, listing what is in
docs/plans/. Never guess —/tddtakes exactly one blueprint. - If no blueprint exists in
docs/plans/, tell the user — recommend running/blueprintfirst, or if they prefer, proceed by driving RED→GREEN directly from their description.
Slice completion checkboxes
- Pick the first slice whose
TDD donecheckbox is unchecked. - When every Acceptance Criterion in the slice is green and refactored, tick its
TDD donecheckbox in the blueprint, then move to the next slice. - No
in-progressmarker is maintained. After an interruption, resume at the first unchecked slice and re-run its existing tests before continuing. - Slices with
Blocked by: Nonemay be run in parallel at the agent's discretion; keep one RED→GREEN→REFACTOR cycle per slice and tick each checkbox independently. - When reading domain terminology, if
CONTEXT-MAP.mdexists, read it and read each context relevant to the topic; if unclear which context applies, ask the user.
Non-Negotiable Gate
You must witness a test fail for the expected reason before writing any implementation code.
If you find yourself writing implementation without a preceding failing test:
- STOP immediately.
- Delete the implementation code you just wrote.
- Write the test first.
- Watch it fail.
- Only then write the implementation again.
This is not advice. This is the rule.
Philosophy
Core principle: Tests should verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't.
Good tests are integration-style: they exercise real code paths through public APIs. They describe what the system does, not how it does it. They survive refactors because they don't care about internal structure.
Bad tests are coupled to implementation. They mock internal collaborators, test private methods, or verify through external means. The warning sign: your test breaks when you refactor, but behavior hasn't changed.
See tests.md for examples and mocking.md for mocking guidelines.
Anti-Pattern: Horizontal Slices
DO NOT write all tests first, then all implementation. This is "horizontal slicing."
WRONG (horizontal):
RED: test1, test2, test3, test4
GREEN: impl1, impl2, impl3, impl4
RIGHT (vertical):
RED→GREEN: test1→impl1
RED→GREEN: test2→impl2
RED→GREEN: test3→impl3
...Workflow
1. RED — Write a Failing Test
Write ONE test for ONE behaviour from the current slice's Acceptance Criteria.
MANDATORY VERIFICATION:
- Run the test immediately.
- It must fail.
- The failure must be because the behaviour is missing — NOT a syntax error, NOT a test setup problem.
- If it passes immediately → the behaviour already exists, rewrite the test.
- If it fails with syntax/import errors → fix those, re-run, re-verify.
Do not write implementation code until you have witnessed the test fail for the right reason.
2. GREEN — Minimal Code to Pass
Read docs/house-style.md if it exists, then write the minimal code to make this single test pass.
- No extra features.
- No "I'll need this later."
- No anticipating the next test.
VERIFY: Run the test. It must pass. Run all existing tests — they must also pass.
3. REFACTOR — Clean Up
After the test is green, look for refactor opportunities:
- Duplication → Extract function/class
- Long methods → Break into private helpers (keep tests on public interface)
- Shallow modules → Combine or deepen — see
/codebase-designfor the deletion test, depth assessment, and seam discipline - Feature envy → Move logic to where data lives
- Primitive obsession → Introduce value objects
- Improve names
- Existing code the new code reveals as problematic
- Run tests after each refactor step
Never refactor while RED. Get to GREEN first.
4. Next Behaviour
Return to RED for the next behaviour within this slice. When all Acceptance Criteria for the slice are green and refactored, tick the slice's TDD done checkbox in the blueprint, then move to the next slice.
Checklist Per Cycle
[ ] RED witnessed — test failed for the expected reason before implementation
[ ] Test describes behaviour, not implementation
[ ] Test uses public interface only
[ ] Code is minimal for this test — no speculative additions
[ ] All existing tests still passHandoff
When all slices are complete and the full test suite passes, verify every TDD done checkbox in the blueprint is ticked, then tell the user:
"TDD complete for docs/plans/{filename}. All module tests pass. Ready for /integrate — run it without a filename to verify this blueprint."
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.

