| name | systematic-debugging |
| description | Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes. Systematic approach to root cause analysis. |
Systematic Debugging
Follow this disciplined process when debugging any issue.
Process
- Reproduce — Confirm the exact steps to reproduce the issue. If you can't reproduce it, you can't fix it.
- Observe — Gather all relevant information: error messages, stack traces, logs, input data.
- Hypothesize — Form a specific hypothesis about the root cause. Write it down.
- Test — Design the smallest possible experiment to confirm or refute the hypothesis.
- Fix — Only fix after confirming the root cause. Write the minimal fix.
- Verify — Run the tests. Confirm the fix works and doesn't break anything else.
Rules
- NEVER propose a fix before identifying the root cause.
- NEVER make more than one change at a time during debugging.
- ALWAYS check logs, error messages, and stack traces first.
- If the hypothesis is wrong, form a new one. Don't patch on top of a wrong assumption.
- Use binary search (comment out half the code) to isolate the problem area.
Checklist