| name | tdd |
| description | Use when implementing with test-driven development. Triggers on "TDD", "테스트 먼저", "test first", or when the plan specifies TDD. |
TDD — Test-Driven Development
Iron Law
No production code without a failing test. No exceptions.
Cycle
RED — Write a Failing Test
- Write a test that describes the desired behavior
- Run the test — it MUST fail
- If it passes, the test is wrong or the feature already exists
GREEN — Make It Pass
- Write the minimum code to make the test pass
- Do not add anything beyond what the test requires
- Run the test — it MUST pass now
REFACTOR — Clean Up
- Improve code quality without changing behavior
- Run tests — they MUST still pass
- Only refactor if there is a clear improvement
Rules
- One test at a time. Write one failing test, make it pass, then write the next.
- Test behavior, not implementation. Tests should describe what, not how.
- No test? No code. If you cannot write a test for it, reconsider if it is needed.
- Delete wrong tests. If a test is testing the wrong thing, delete it and start over. Do not patch a bad test.
- Keep tests fast. Each test should run in under 1 second.
Anti-Patterns to Avoid
- Testing implementation details — testing private methods, internal state
- Brittle tests — tests that break when implementation changes but behavior does not
- Test duplication — multiple tests verifying the same behavior
- Missing edge cases — only testing the happy path
- Mock overuse — mocking everything instead of testing real behavior
Delegation
- Dispatch
executor agent (standard) to write tests and implementation
- After GREEN phase, run
agmo:verification to confirm