# Test Driven Development

> Strict RED-GREEN-REFACTOR cycle enforcement. Tests are never skipped or deferred. Run mode only, never watch mode. Exit code evidence mandatory.

- Skill: `a5c-ai/test-driven-development` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add a5c-ai/test-driven-development`
- Raw SKILL.md: https://api.skillmd.com/api/skills/a5c-ai/test-driven-development/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: a5c-ai (https://skillmd.com/u/a5c-ai)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/a5c-ai/test-driven-development

---


## 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)

