Workflow TDD
Purpose
Apply a strict test-first loop to implementation and bug-fix tasks.
Mandatory Loop
- Reproduce first:
- If an issue is reported, add or update a focused test that demonstrates the current failure.
- If no test exists, create the narrowest failing test that captures the expected behavior.
- Implement second:
- Make the smallest code change that turns the focused test green.
- Verify third:
- Run the focused test again.
- Run the relevant broader suite to catch regressions.
- Update process artifacts last:
- Only update instructions, skills, or automation after the implementation and verification loop is green.
Hard Rules
- No implementation without a failing test or an explicit reason the behavior cannot be tested.
- No commit while tests are red.
- When an issue changes expected behavior, the test case changes before the code change.
- Keep the first failing test small so debugging cost stays low.