tdd-cycle
This skill contains shell command directives (!`command`) that may execute system commands. Review carefully before installing.
TDD Cycle
Value: Feedback -- short cycles with verifiable outcomes keep AI-generated code honest. Each phase produces evidence (test output, compiler output) that confirms progress or exposes drift.
Purpose
Teaches the red-green-domain-commit cycle: write one failing test, review it for domain integrity, implement minimally, review the implementation, commit. This five-step rhythm prevents primitive obsession, over-engineering, and untested complexity from accumulating. Works with any language and test framework.
Practices
Detect the Test Runner
!if [ -f Cargo.toml ]; then echo "Language: Rust | Test runner: cargo test"; elif [ -f package.json ]; then if grep -q vitest package.json 2>/dev/null; then echo "Language: TypeScript/JavaScript | Test runner: npx vitest"; elif grep -q jest package.json 2>/dev/null; then echo "Language: TypeScript/JavaScript | Test runner: npx jest"; else echo "Language: TypeScript/JavaScript | Test runner: npm test"; fi; elif [ -f pyproject.toml ] || [ -f setup.py ]; then echo "Language: Python | Test runner: pytest"; elif [ -f go.mod ]; then echo "Language: Go | Test runner: go test ./..."; elif [ -f mix.exs ]; then echo "Language: Elixir | Test runner: mix test"; else echo "Language: unknown | Test runner: unknown (configure manually)"; fi