
Debugger
Run a structured reproduce-isolate-root-cause-fix-verify loop when errors or unexpected behavior block your ship path.
Overview
Debugger is an agent skill most often used in Ship (also Build and Operate) that diagnoses bugs and unexpected behavior through reproduce-isolate-analyze-fix verification.
Install
npx skills add https://github.com/charon-fan/agent-playbook --skill debuggerWhat is this skill?
- Three-phase process: understand problem, isolate issue, analyze root cause
- Uses git log, logs tail, and env inspection in the gather-context step
- Supports stack-trace analysis, binary-search narrowing, and minimal repro cases
- Allowed tools: Read, Write, Edit, Bash, Grep, Glob
- Background hooks to session-logger and self-improving-agent after completion
- 3-phase debugging process (understand, isolate, analyze root cause)
Adoption & trust: 610 installs on skills.sh; 58 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You see errors or wrong output but lack a structured way to reproduce, narrow scope, and find root cause before guessing at fixes.
Who is it for?
Solo developers who want agent-led systematic debugging with shell, grep, and git context when CI or chat-only guesses fail.
Skip if: Pure infrastructure outages without code paths, security incident response requiring forensics-only tooling, or tasks where you refuse shell/git access.
When should I use this skill?
User encounters bugs, errors, unexpected behavior, or mentions debugging or help debug this.
What do I get? / Deliverables
You get an isolated minimal repro, a stated root cause, an applied fix, and verification steps—optionally logged for the next debugging session.
- Documented reproduction and expected vs actual behavior
- Isolated scope or minimal repro case
- Root-cause explanation and verified fix
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Testing is the primary shelf because pre-merge reproduction and isolation mirror Ship QA, even though debugging also appears while building and operating. Testing covers systematic verification of fixes before release; this skill formalizes that investigation when tests or manual checks fail.
Where it fits
Trace an API 500 after a schema change by correlating logs with recent git commits.
Shrink a flaky integration test failure to a minimal repro before merge.
Reproduce a production-only race using log tail patterns and env checks.
Investigate reviewer-reported edge-case crashes with binary-search isolation in the branch.
How it compares
Structured multi-phase debugging playbook—not a one-shot linter fixer or passive log summarizer.
Common Questions / FAQ
Who is debugger for?
Indie builders using Claude Code, Cursor, or similar agents who hit runtime or logic bugs and want a documented specialist workflow instead of random edits.
When should I use debugger?
Use it in Ship when tests fail before merge, in Build when integrations misbehave during implementation, and in Operate when production errors need reproduction and log correlation.
Is debugger safe to install?
It can read, edit, and run bash across your repo; review the Security Audits panel on this Prism page and scope allowed-tools before use on production secrets.
SKILL.md
READMESKILL.md - Debugger
# Debugger An advanced debugging specialist that helps diagnose and resolve code issues systematically. ## When This Skill Activates Activates when you: - Report an error or bug - Mention "debug this" or "help debug" - Describe unexpected behavior - Ask why something isn't working ## Debugging Process ### Phase 1: Understand the Problem 1. **Reproduce the issue** - What are the exact steps to reproduce? - What is the expected behavior? - What is the actual behavior? - What error messages appear? 2. **Gather context** ```bash # Check recent changes git log --oneline -10 # Check error logs tail -f logs/error.log # Check environment env | grep -i debug ``` ### Phase 2: Isolate the Issue 1. **Locate the error source** - Stack trace analysis - Error code lookup - Log correlation 2. **Narrow down scope** - Binary search (comment out half) - Minimize reproduction case - Identify affected components ### Phase 3: Analyze the Root Cause #### Common Error Categories | Category | Symptoms | Investigation Steps | |----------|----------|---------------------| | **Null/Undefined** | "Cannot read X of undefined" | Trace the variable origin | | **Type Errors** | "X is not a function" | Check actual vs expected type | | **Async Issues** | Race conditions, timing | Check promise handling, async/await | | **State Issues** | Stale data, wrong state | Trace state mutations | | **Network** | Timeouts, connection refused | Check endpoints, CORS, auth | | **Environment** | Works locally, not in prod | Compare env vars, versions | | **Memory** | Leaks, OOM | Profile memory usage | | **Concurrency** | Deadlocks, race conditions | Check locks, shared state | ### Phase 4: Form Hypotheses For each potential cause: 1. Form a hypothesis 2. Create a test to validate 3. Run the test 4. Confirm or reject ### Phase 5: Fix and Verify 1. **Implement the fix** 2. **Add logging if needed** 3. **Test the fix** 4. **Add regression test** ## Debugging Commands ### General Debugging ```bash # Find recently modified files find . -type f -mtime -1 -name "*.js" -o -name "*.ts" -o -name "*.py" # Grep for error patterns grep -r "ERROR\|FATAL\|Exception" logs/ # Search for suspicious patterns grep -r "TODO\|FIXME\|XXX" src/ # Check for console.log left in code grep -r "console\.log\|debugger" src/ ``` ### Language-Specific **JavaScript/TypeScript:** ```bash # Run with debug output NODE_DEBUG=* node app.js # Check syntax node -c file.js # Run tests in debug mode npm test -- --inspect-brk ``` **Python:** ```bash # Run with pdb python -m pdb script.py # Check syntax python -m py_compile script.py # Verbose mode python -v script.py ``` **Go:** ```bash # Race detection go run -race main.go # Debug build go build -gcflags="-N -l" # Profile go test -cpuprofile=cpu.prof ``` ## Common Debugging Patterns ### Pattern 1: Divide and Conquer ```python # When you don't know where the bug is: def process(): step1() step2() step3() step4() # Comment out half: def process(): step1() # step2() # step3() # step4() # If bug disappears, uncomment half of commented: def process(): step1() step2() # step3() # step4() # Continue until you isolate the bug ``` ### Pattern 2: Add Logging ```typescript // Before (mysterious failure): async function getUser(id: string) { const user = await db.find(id); return transform(user); } // After (with logging): async function getUser(id: stri