| name | debugging |
| description | Apply systematic debugging patterns and strategies to identify and fix software issues efficiently. |
Debugging
Overview
Debugging is the systematic process of finding and fixing defects in software. This skill should be invoked when encountering bugs, errors, or unexpected behavior that requires methodical investigation and resolution.
Core Principles
- Reproducibility: Create consistent reproduction steps before fixing
- Evidence-Based: Use logs, breakpoints, and error messages as clues
- Hypothesis Testing: Form theories, then test them systematically
- Isolation: Narrow down the problem space through binary search
Preparation Checklist
Step-by-Step Process
- Reproduce: Create minimal steps to reproduce consistently
- Gather: Collect error messages, logs, and relevant code
- Isolate: Use binary search to narrow down the problem
- Hypothesize: Form theories about root cause
- Test: Verify hypothesis with targeted experiments
- Fix: Implement minimal fix
- Verify: Confirm fix resolves the issue
Do's and Don'ts
- ✅ Do read stack traces from bottom to top
- ✅ Do check recent git changes when issues appear suddenly
- ✅ Do use binary search to isolate problem areas
- ❌ Don't randomly change code hoping something works
- ❌ Don't ignore warning messages
- ❌ Don't fix symptoms instead of root causes
Anti-Patterns
- Shotgun Debugging: Making random changes everywhere
- Confirmation Bias: Only looking for evidence that supports your theory
- Assuming: Believing you know the cause without verification
- Ignoring Warnings: Treating warnings as unimportant