| name | tdd-workflow |
| description | Test-driven development workflow enforcing tests FIRST with 80%+ coverage |
Enforce test-driven development methodology for writing new features, fixing bugs, or refactoring code. Scaffold interfaces, generate tests FIRST, then implement minimal code to pass. Ensure 80%+ coverage including unit, integration, and E2E tests.
Triggers on: feature implementation, bug fixes, refactoring, "write tests first", "TDD"
Define the public API (function signatures, types, interfaces) before any implementation.
Write failing tests that describe expected behavior. Cover: happy paths, error paths, edge cases (null, empty, boundaries), integration points.
Execute test suite to confirm tests fail as expected.
Write minimum code to make tests pass. No extra logic beyond what tests require.
Execute test suite to confirm all tests pass.
Remove duplication, improve naming, optimize. Re-run tests to verify no regressions.
Run coverage report. Verify 80%+ across branches, functions, lines, statements. Write additional tests if below threshold.
No code without tests. This is not optional.
Must have unit tests
Must have integration tests
Must have E2E tests
null, empty, invalid types, boundaries, errors, race conditions, large data, special characters
No shared state between tests
Branches, functions, lines, statements
Supabase, Redis, OpenAI, network calls
Testing implementation details (internal state) instead of user-visible behavior
Tests depending on execution order or shared state
Missing edge case tests (only testing happy path)
Writing implementation before tests