Systematic 4-phase debugging methodology for complex, intermittent, or mysterious issues. Use when investigating bugs, race conditions, or unexplained failures.
A disciplined, evidence-based approach to debugging that prevents guessing and ensures root cause discovery.
Goal: Create reliable reproduction steps before ANY investigation.
Actions:
Key Questions:
Output: Clear reproduction steps that reliably trigger the issue.
Goal: Reduce the search space from "entire codebase" to "specific component."
Techniques:
Binary Search:
Git Bisect (for regressions):
git bisect start
git bisect bad HEAD
git bisect good <known-good-commit>
# Git will checkout commits for testing
# After each test:
git bisect good # or git bisect bad
# Continue until culprit found
Code Elimination:
Environment Isolation:
Output: "The bug is in [specific component/function/line range]"
Goal: Know exactly WHY the bug occurs, not just WHERE.
Scientific Method:
Logging Strategy:
// Add strategic logging at boundaries
console.log("[DEBUG] Function entry:", { input, state });
console.log("[DEBUG] After processing:", { result, sideEffects });
console.log("[DEBUG] Function exit:", { returnValue });
Common Root Causes:
| Symptom | Likely Causes | | -------------------------- | -------------------------------------------------- | | Works locally, fails in CI | Environment differences, timing, resources | | Intermittent failure | Race condition, flaky network, resource contention | | Works then stops working | State mutation, memory leak, cache poisoning | | Wrong data | Type coercion, encoding, timezone, precision | | Silent failure | Swallowed exception, async error, missing await |
Output: Clear explanation of the root cause with evidence.
Goal: Fix the issue and prevent regression.
Fix Process:
Verification Checklist:
Prevention:
DO NOT:
DO:
1. REPRODUCE → Can I reliably trigger this?
2. ISOLATE → Where exactly is it failing?
3. DIAGNOSE → Why is it failing?
4. FIX → How do I fix it permanently?
## Bug Investigation: [Title]
### Reproduction
- Steps to reproduce
- Environment details
- Frequency
### Isolation
- Search method used
- Scope narrowed to
### Root Cause
- What's actually wrong
- Why it happens
- Evidence
### Fix
- Code changes made
- Test added
### Prevention
- How to prevent similar bugs
- Documentation updates
npx skills add travisjneuman/debug-systematic下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer