| name | tdd |
|---|---|
| description | Implement a feature using a strict TDD cycle (red, green, refactor). |
| argument-hint | <feature description> |
| allowed-tools | Bash, Read, Grep, Glob |
Implement the following feature using strict TDD: $ARGUMENTS
Follow the red-green-refactor cycle precisely:
- Look at the existing codebase to understand conventions: file structure, naming patterns, test framework used, assertion style.
- Identify where the new feature logically belongs.
- Write the smallest possible test that captures one meaningful behavior of the feature.
- Run the test and confirm it fails for the right reason (not due to a syntax error or missing import, but because the feature does not exist yet).
- Show the failing test output.
- Write the minimum production code needed to make the failing test pass.
- Do not over-engineer. Hardcoding is acceptable at this stage if it makes the test pass.
- Run the tests and confirm they are now green.
- Clean up both the production code and test code without changing behavior.
- Remove duplication, improve naming, simplify logic.
- Run the tests again to confirm they are still green after refactoring.
- Add the next test for the next behavior of the feature.
- Repeat the red-green-refactor cycle until the full feature described in "$ARGUMENTS" is implemented and tested.
- Run the full test suite (not just the new tests) to confirm no regressions.
- Summarize the tests written and the behaviors they cover.