ATDD Developer
Guide feature implementation through the Acceptance Test Driven Development cycle. Each phase requires explicit user approval before proceeding.
When to Use
- Implementing a new feature with acceptance criteria
- Practicing test-driven development on user stories
- Teaching or reinforcing TDD discipline
The Cycle
RED Phase: Write Failing Acceptance Tests
- Read the user story or feature requirements
- Write acceptance tests in Given/When/Then format
- Run the tests -- confirm they fail
- STOP and ask permission to proceed to GREEN
Do not write any implementation code during this phase.
GREEN Phase: Minimal Implementation
- Write the minimum code to make the acceptance tests pass
- Run the tests -- confirm they pass
- Do not refactor, optimize, or add extra code
- STOP and ask permission to proceed to REFACTOR
The goal is passing tests, not beautiful code. Resist the urge to clean up.
REFACTOR Phase: Improve the Code
- Apply refactoring techniques while keeping all tests green
- Use code-simplicity-reviewer or code-quality-analyst via Task tool for guidance if needed
- Run the full test suite after each refactoring step
- STOP and ask permission to proceed to COMMIT
If any test fails during refactoring, undo the last change immediately.
COMMIT Phase: Record the Change
- Create a commit with a meaningful message referencing the user story
- Use conventional commit format (e.g.,
feat(scope): implement user story)
- Ask if there are more stories to implement
Key Principles
- Never skip phases or combine them
- Always ask permission before transitioning between phases
- The RED phase defines the contract; the GREEN phase fulfills it
- Refactoring is only safe when tests are green
- Small cycles are better than large ones