bug-debugger
Installation
SKILL.md
Bug Debugger
Overview
Find the root cause before changing code. Reproduce, narrow down with evidence, fix the cause, and prove the fix with a test that failed before and passes after. Guess-and-patch loops waste more time than they save.
Method
- Reproduce. Get the exact command, input or steps that show the bug. Write it down. If it is intermittent, find the condition that makes it frequent (load, timing, data, order).
- Read the evidence fully. The whole error message and stack trace, the first error in the logs (not the last), the failing assertion's expected vs actual.
- Check what changed.
git log -p --since=<date> -- <path>, recent dependency updates, config or environment differences. For a known good commit,git bisect run <test command>. - Form one hypothesis that explains all the evidence. State it in one sentence.
- Test the hypothesis cheaply: a log line, a breakpoint, a minimal script, or a failing unit test. Confirm or discard it. Never change two things at once.
- Trace to the root. Ask why the bad value or state exists, and keep asking until you reach the place where it was first wrong. Fix there, not where it crashed.
- Write a failing test that reproduces the bug, then fix, then watch the test pass and run the full suite.
- Remove debugging code (temporary logs, prints, breakpoints).