tdd
Skill0 starsChanged 8 months agoMITView on GitHub
Enforce Test-Driven Development workflow for bug fixes and features. Red-Green-Refactor cycle: write failing test FIRST, confirm RED, then implement, confirm GREEN. Triggers: "tdd", "test first", "red green refactor".
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 repository20 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ci-watchSkill
- commitSkill
- discovery-interview-prepSkill
- doc-generateSkill
- incident-responseSkill
- opportunity-solution-treeSkill
- polarisSkill
- prd-developmentSkill
- prioritization-advisorSkill
- reviewSkill
- roadmapSkill
- security-auditSkill
- session-wrapSkill
- spec-updateSkill
- tech-debt-auditSkill
- test-runnerSkill
- user-storySkill
- uxSkill
- workshop-facilitationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. 0 are common, 17 are distinctive, and 2 are 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Before running tests, resolve the actual commands for this project:
- Distinctive: line 32
Multi-stack: if CLAUDE.md has "Active Stacks", resolve per-stack commands based on the file path being tested
- Distinctive: line 34
Use the resolved commands throughout all steps below.
- Distinctive: line 40
Before writing any test, check if a functional spec exists for the domain:
- Very specific: line 42
Look in docs/specs/ for a file matching the domain being modified
- Distinctive: line 50
Write ONE test that describes the expected behavior
- Distinctive: line 51
Run the project's test command (resolved in "Project Commands" above)
- Distinctive: line 53
If the test passes immediately → the test is wrong OR the behavior already exists.
- Distinctive: line 54
DO NOT proceed to GREEN until failure is confirmed and shown to the user
- Distinctive: line 57
Write the MINIMUM code to make the failing test pass
- Distinctive: line 59
CONFIRM: all tests pass
- Distinctive: line 60
Do NOT add extra logic "while you're at it"
- Distinctive: line 61
Coverage check: after GREEN, run the project's coverage command and show coverage for the modified file.
- Distinctive: line 64
Only if there is clear duplication or code smell
- Distinctive: line 65
Run tests after refactor → must still be green
- Distinctive: line 70
Test PUBLIC behavior, not implementation details
- Distinctive: line 72
Always show the user: RED output first, then GREEN output
- Distinctive: line 73
Never skip RED confirmation
- Very specific: line 77
If CLAUDE.md has an ## Active Stacks section, determine which stack the current file belongs to based on its path, then use that stack's …
“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 Workflow — Red-Green-Refactor
When to use
- Bug fixes: always (prove the bug exists with a failing test first)
- New features in source directories: always
- Config files, scripts, documentation: skip
Project Commands (auto-detected)
Before running tests, resolve the actual commands for this project:
- Read CLAUDE.md — look for explicit commands in "Workflow" or "Active Stacks" sections
- If not found, detect from project marker files:
| Marker file | Test | Single test | Coverage |
package.json | npm test | npx jest <path> / npx vitest <path> | npm test -- --coverage |
pyproject.toml | pytest | pytest <path> | pytest --cov |
go.mod | go test ./... | go test <path> | go test -cover ./... |
Cargo.toml | cargo test | cargo test <name> | cargo tarpaulin |
Makefile (test target) | make test | — | make coverage |
- Multi-stack: if CLAUDE.md has "Active Stacks", resolve per-stack commands based on the file path being tested
Use the resolved commands throughout all steps below.
Cycle
0. SPEC — Read the functional spec
Before writing any test, check if a functional spec exists for the domain:
- Look in
docs/specs/for a file matching the domain being modified - Spec exists → read User Stories / Behavior sections. Use acceptance criteria as test source. If spec conflicts with the requested change → flag to user before writing code.
- No spec exists → flag to user. For new features, run
/spec-updatefirst (advisory — user can proceed without). - Behavior not in spec → spec gap. After GREEN, run
/spec-updateto document it.
Skip for: pure bug fixes contradicting spec, pure refactors (no behavior change), config/docs files.
1. RED — Write the failing test
- Write ONE test that describes the expected behavior
- Run the project's test command (resolved in "Project Commands" above)
- CONFIRM the test FAILS (output must show FAIL/error)
- If the test passes immediately → the test is wrong OR the behavior already exists. Investigate.
- DO NOT proceed to GREEN until failure is confirmed and shown to the user
2. GREEN — Minimal implementation
- Write the MINIMUM code to make the failing test pass
- Run the project's test command (resolved in "Project Commands" above)
- CONFIRM all tests pass
- Do NOT add extra logic "while you're at it"
- Coverage check: after GREEN, run the project's coverage command and show coverage for the modified file. Informational only — confirms the new test covers the new code.
3. REFACTOR (optional)
- Only if there is clear duplication or code smell
- Run tests after refactor → must still be green
- Skip if the code is already clean
Rules
- 1 test → 1 fix → repeat (vertical slicing, never batch tests)
- Test PUBLIC behavior, not implementation details
- Tests must survive refactoring — if they break during refactor, they test internals
- Always show the user: RED output first, then GREEN output
- Never skip RED confirmation
Multi-stack projects
If CLAUDE.md has an ## Active Stacks section, determine which stack the current file belongs to based on its path, then use that stack's test command. Read the corresponding .claude/stacks/<stack>.md for language-specific testing conventions.
Anti-patterns to avoid
| Anti-pattern | Why it's bad |
| Write fix first, add passing test after | NOT TDD — test doesn't prove anything |
| Batch 5 tests then implement all | Loses RED-GREEN signal per test |
| Mock internal methods | Tests break at refactor |
| Skip RED ("I know it will fail") | Always run and show the output |
| Test private methods/implementation | Couples tests to internals |
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.

