agentleFS
ArangoGutierrezArangoGutierrez/claude-toolkit/.claude/skills/tdd-protocol/SKILL.md

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
  1. Very specific:

    Red: Write failing test first. Signal: [RED]

    line 16
  2. Distinctive:

    Run test — confirm it fails for the right reason

    line 18
  3. Distinctive:

    Only then proceed to Green

    line 19
  4. Distinctive:

    Write the simplest code that makes the test pass

    line 22
  5. Distinctive:

    No optimization, no cleanup — just pass

    line 23
  6. Very specific:

    Mutate: After Green, before Refactor.

    line 24
  7. Distinctive:

    If a mutated/weakened guard still passes the suite, your tests are theater — go back to Red and strengthen them

    line 26
  8. Distinctive:

    Discipline-enforced, not hook-enforced: no automated guard blocks implementation writes.

    line 41
  9. Distinctive:

    Escalation: When diff exceeds threshold, use isolated subagent contexts — one for Red (test writing), one for Green (implementation).

    line 42

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 (gremlins for 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.