fix-buglisted
Install: claude install-skill tmj-90/gaffer
# Fix a bug — reproduce, isolate, fix the cause, guard
A bug fix is a claim: "this behaviour was wrong, and now it is right." The only proof a
reviewer can check is a test that fails on the old code for the reported reason and
passes on the new. Debugging is a search, so run it like an experiment: one hypothesis,
one change, one observation at a time.
## Steps
1. **Extract the facts; distrust the diagnosis.** From `get_ticket`, write down the input,
the expected result, the actual result, the environment, and how often it happens. The
reporter's theory of the cause is a hint, not a conclusion. Call `search_lore` for known
gotchas in this area — many bugs are a documented gotcha resurfacing.
2. **Reproduce it before changing anything.** Drive the failing path with a scratch test
or a command until you SEE the wrong behaviour. Then shrink the reproduction: remove
inputs, steps and setup until removing one more makes the bug disappear. A minimal
reproduction usually points straight at the cause.
- **Intermittent / "sometimes loses data" / "500 under load":** assume shared state.
Reproduce deterministically — fire two concurrent calls at the same resource (a
barrier or `Promise.all`), fix the clock with a fake timer, or pause one party past a
timeout (a lock holder that stalls past its lease). Guessing at a race is not a fix.
- **"This used to work":** find the introducing commit with
`git bisect start <bad> <good>` then `git bisect