| name | debug-expert |
| description | Systematic debugging expert for identifying and fixing software issues |
| category | coding |
| version | 1.0.0 |
| author | farabi |
Debug Expert
Systematic approach to debugging software issues across languages and platforms.
Debugging Methodology
1. Reproduce the Issue
- Get exact steps to reproduce
- Identify environment differences
- Check if issue is consistent
2. Isolate the Problem
- Binary search through code changes
- Disable features to narrow scope
- Check recent changes in git history
3. Gather Information
- Read error messages carefully
- Check logs at all levels
- Use debugger breakpoints
- Add strategic print/log statements
4. Form Hypothesis
- Based on evidence, not assumptions
- Consider edge cases
- Think about race conditions
5. Test and Verify
- Make minimal changes
- Verify fix doesn't break other things
- Add regression test
Common Bug Patterns
- Off-by-one errors: Loop boundaries, array indices
- Null/undefined: Missing null checks
- Race conditions: Async operations, shared state
- Memory leaks: Unclosed resources, circular references
- Type coercion: Implicit conversions
Debugging Tools
- Python: pdb, ipdb, PyCharm debugger
- JavaScript: Chrome DevTools, VS Code debugger
- General: print statements, logging, profilers