tdd-protocol
Skill4 starsChanged 3 months agoMITView on GitHub
Use when starting implementation work
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
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
- Very specific: line 16
Red: Write failing test first. Signal: [RED]
- Distinctive: line 18
Run test — confirm it fails for the right reason
- Distinctive: line 19
Only then proceed to Green
- Distinctive: line 22
Write the simplest code that makes the test pass
- Distinctive: line 23
No optimization, no cleanup — just pass
- Very specific: line 24
Mutate: After Green, before Refactor.
- Distinctive: line 26
If a mutated/weakened guard still passes the suite, your tests are theater — go back to Red and strengthen them
- Distinctive: line 41
Discipline-enforced, not hook-enforced: no automated guard blocks implementation writes.
- Distinctive: line 42
Escalation: When diff exceeds threshold, use isolated subagent contexts — one for Red (test writing), one for Green (implementation).
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TDD Protocol (DORA)
Cycle
Plan → Red → Green → Mutate → Refactor. Never skip phases.
Phases
- Plan: Design doc/plan before any code (brainstorm first)
- Red: Write failing test first. Signal:
[RED]- Define the expected behavior as a test
- Run test — confirm it fails for the right reason
- Only then proceed to Green
- Green: Minimum code to pass. Signal:
[GREEN]- Modify tests and implementation in separate turns
- Write the simplest code that makes the test pass
- No optimization, no cleanup — just pass
- Mutate: After Green, before Refactor. Signal:
[MUTATE]- Mutation-check guards by hand: delete or weaken the guard under test (the condition, the regex, the boundary check) and confirm the suite goes red
- If a mutated/weakened guard still passes the suite, your tests are theater — go back to Red and strengthen them
- For non-guard logic, an automated mutation tool (
gremlinsfor Go, Stryker for TS/JS) can supplement hand-checking when available; skip if tools unavailable
- Refactor: Clean up only after green + mutate. Signal:
[REFACTOR]- Checkpoint first if >3 files or >50 LOC changed
- Improve structure, naming, duplication
- Tests must still pass after refactoring
Rules
- Fitness function: Tests are contracts. Fix the implementation when a test fails (unless the test itself has a genuine bug).
- Batch size: Smallest PR-sized chunks. 1 concern = 1 PR
- Tests define "done". Implementation stops when tests pass
Enforcement
- Discipline-enforced, not hook-enforced: no automated guard blocks implementation writes. Catching yourself writing implementation before a failing test exists means you're in the wrong phase — stop and go back to Red.
- Escalation: When diff exceeds threshold, use isolated subagent contexts — one for Red (test writing), one for Green (implementation). Prevents same-author blind spots where the test writer unconsciously shapes tests to match the implementation they're already imagining.
In this repository48 other files it gives its agents.
- .claude/templates/AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- .cursor/rules/core.mdcCursor rule
- .cursor/rules/go.mdcCursor rule
- .cursor/rules/k8s.mdcCursor rule
- .cursor/rules/node.mdcCursor rule
- .cursor/rules/python.mdcCursor rule
- .cursor/rules/rust.mdcCursor rule
- .cursor/rules/tdd.mdcCursor rule
- .cursor/rules/workbench.mdcCursor rule
- llms-full.txtllms.txt
- llms.txtllms.txt
- cmux-sprint-orchestratorSkill
- config-auditSkill
- doneSkill
- eurekaSkill
- goalSkill
- go-reviewSkill
- handoffSkill
- js-reviewSkill
- k8s-debugSkill
- k8s-reviewSkill
- kickoffSkill
- pr-review-ingestSkill
- pr-reviewSkill
- python-reviewSkill
- reflectionSkill
- skill-evalSkill
- team-executeSkill
- team-planSkill
- team-shutdownSkill
- test-reviewSkill
- validate-recommendationSkill
- worktree-guideSkill
- babysitSkill
- canvasSkill
- create-hookSkill
- create-ruleSkill
- create-skillSkill
- create-subagentSkill
- migrate-to-skillsSkill
- sdkSkill
- shellSkill
- split-to-prsSkill
- statuslineSkill
- update-cli-configSkill
- update-cursor-settingsSkill
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.

