Bug Fixes: Prove It Pattern
When given a bug or error report, the first step is to spawn a subagent to write a test that reproduces the issue. Only proceed once reproduction is confirmed.
Test Level Hierarchy
Reproduce at the lowest level that can capture the bug:
- •Unit test — Pure logic bugs, isolated functions (lives next to the code)
- •Integration test — Component interactions, API boundaries (lives next to the code)
- •UX spec test — Full user flows, browser-dependent behavior (lives in
apps/web/specs/)
For Every Bug Fix
- •Reproduce with subagent — Spawn a subagent to write a test that demonstrates the bug. The test should fail before the fix.
- •Fix — Implement the fix.
- •Confirm — The test now passes, proving the fix works.
If the bug is truly environment-specific or transient, document why a test isn't feasible rather than skipping silently.