← ClaudeAtlas

debugging-strategieslisted

When isolating and fixing unpredictable or complex software bugs.
KraitDev/skiLL.Md · ★ 4 · AI & Automation · score 81
Install: claude install-skill KraitDev/skiLL.Md
# Debugging Strategies ## Purpose "Guess and check" programming wastes hours. This skill replaces randomness with the scientific method: reproduce the bug reliably, isolate the failing component via binary search, formulate testable hypotheses, and apply minimal fixes. The goal is deterministic bug resolution, not random fixes that seem to work. ## When to use - Investigating a defect reported in production - Facing a failing test with no obvious root cause - Understanding unfamiliar or undocumented legacy code - Debugging intermittent failures (flaky tests) ## When NOT to use - Performance optimization (use Caching Strategies or Database Query Optimization) - Code review (use Code Review Guidelines) - Architecture decisions (different concern) ## Inputs required - Failing code, test, or end-to-end scenario - Ability to reproduce the failure - Source code and execution environment ## Workflow 1. **Reproduce the Bug**: Consistently replicate the failure state. If you CANNOT reproduce it, STOP (get more details). Write a failing test. 2. **Isolate the Subsystem**: Use binary search (comment out code halves, use `git bisect`, add logging) to locate the exact module causing the issue 3. **Formulate Hypothesis**: Propose WHY the failure is happening based on logs, stack traces, and code inspection 4. **Test Hypothesis**: Add targeted logging or step through debugger to verify assumptions about state/variables at runtime 5. **Apply Minimal Fix**: Change ONLY what's necessary t