TDD Fix Loop
Eliminates wrong-approach / buggy-first-pass friction by forcing red→green→ship.
Phase 1 — RED
- Read issue, reproduce bug locally.
- Write a test that captures expected behavior. Test MUST fail.
- Run
tsc -b && npm test— confirm test fails for the RIGHT reason (not compile error, not wrong assertion). - Commit failing test alone:
test: failing case for #N.
Phase 2 — GREEN
- Implement MINIMAL fix. No refactor, no adjacent cleanup.
- After every edit run full CI parity:
tsc -b && npm test && npm run lint - Loop until all three pass. NEVER skip a step.
- 3 failed attempts → STOP, explain blocker, ask user.
Phase 3 — SHIP
- Commit fix separate from test:
fix: <one line> (#N). git branch --show-currentbefore push.gh pr createreferencing issue.
Hard Rules
- Use
tsc -b(CI parity), NEVERtsc --noEmit. - NEVER edit
prisma/schema.prismawithout explicit user auth. - NEVER bypass hooks (
--no-verify,[skip-verify]) without user say-so. - NEVER claim done without paste of
tsc -b && npm test && npm run lintexit codes.