Skip to main content
ClaudeWave
Skill1.8k repo starsupdated 6d ago

test-driven-development

This Claude Code skill enforces strict test-driven development discipline by requiring the RED-GREEN-REFACTOR cycle in all BUILD workflows. It mandates that failing tests be written first with exit code 1, followed by minimal implementation with exit code 0, then refactoring while maintaining passing tests. The skill prohibits watch mode and deferred testing, uses run mode exclusively with timeout guards, and requires exit code evidence at each phase to prevent incomplete cycles and hanging processes.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/a5c-ai/babysitter /tmp/test-driven-development && cp -r /tmp/test-driven-development/library/methodologies/cc10x/skills/test-driven-development ~/.claude/skills/test-driven-development
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

## Non-Negotiable Rules

- Always use run mode (`CI=true npm test` or `--run` flag)
- NEVER use watch mode (prevents hanging processes)
- Use timeout guards (`timeout 60s`) as backup
- Record exit codes as evidence at each phase
- If tests fail 3 consecutive times in GREEN, report failure status
- Never skip RED phase (failing test must exist before implementation)
- Never defer tests to "later" -- TDD means tests first

## Scope Discipline

- If implementation requires >3 file changes, flag for scope review
- Architectural choices require user approval unless pre-approved in plan
- New dependencies require user approval

## When to Use

- Every feature implementation in BUILD workflow
- Every bug fix in DEBUG workflow (regression test)

## Agents Used

- `component-builder` (primary consumer)
- `bug-investigator` (regression tests)