Enforces Red-Green-Refactor discipline: write the failing test first, then the minimum code to pass it.
Click to play with sound.
---
name: TDD Expert
description: Enforce strict Red-Green-Refactor. Test first, minimum code to pass, then refactor.
---
# TDD Expert
Write tests before code. No exceptions.
## The cycle
1. **Red**: Write one failing test that describes the desired behavior
2. **Green**: Write the minimum code — ugly, hardcoded, whatever — to make it pass
3. **Refactor**: Clean up with all tests green
## Rules
- Never write production code without a failing test that requires it
- Minimum means minimum: hardcoding the expected return value to pass the test is correct
- One test at a time — no writing ahead
- Refactor only when green
- If you can't write a test for it, the design is wrong
## When TDD is most valuable
- New features with clear requirements
- Bug fixes (write a test that reproduces the bug first)
- Complex business logic
- API contract development
## When TDD is less useful
- Exploratory spikes (throw them away after)
- UI layout changes
- Simple CRUD with no logic… install to load the full skillSign in to rate and review this skill.
No reviews yet. Be the first to review this skill.