Skip to content
Back to skills

Debug

ASecurity

Root cause analysis for bugs and errors. Use when something is broken and the cause is not obvious. Applies the 5-step investigation method — observe, hypothesize, trace backwards, binary search, prove.

  • 11 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 7, 2026
ai-agentsbashgit

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add brain-bootstrap/claude-code-brain-bootstrap --skill debug --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Debug?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Debug
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/brain-bootstrap-debug/badge)](https://www.skillsdirectory.com/skills/brain-bootstrap-debug)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: debug
description: Root cause analysis for bugs and errors. Use when something is broken and the cause is not obvious. Applies the 5-step investigation method — observe, hypothesize, trace backwards, binary search, prove.
---

# Debug Skill

Systematic root cause analysis.

## When to use
- An error is happening and the cause is not obvious
- A test is failing unexpectedly
- Behavior changed after a refactor
- Production incident requiring root cause identification

## 5-Step Investigation Method

### Step 1 — OBSERVE: Gather exact evidence
Do NOT guess. Collect all available evidence first:
- Exact error message (full stack trace, not summary)
- Exact input that triggers the failure
- Exact expected vs. actual output
- When it started failing (which commit? which change?)
- Environment where it fails (dev? CI? prod? all?)

### Step 2 — HYPOTHESIZE: Form concrete hypotheses
Based on the evidence, generate 2-3 specific hypotheses:
- Each hypothesis must be falsifiable (testable)
- Rank by probability based on evidence
- Do NOT assume the most complex explanation — prefer simple causes

### Step 3 — TRACE BACKWARDS: Follow the execution path
From the failure point, trace backwards:
```bash
grep -rn --color=never '<error_symbol_or_message>' . | head -20
```
- Find the function that threw the error
- Find its caller
- Find the caller's caller
- Keep tracing until you reach user input or a boundary

### Step 4 — BINARY SEARCH: Narrow the scope
If the trace is long, use bisection:
- Does it fail with the same input after reverting X? (git bisect or manual)
- Does it fail with minimal input? (reduce the test case)
- Does it fail in isolation? (extract the failing unit)

### Step 5 — PROVE: Verify the root cause
Before fixing, prove you found the right root cause:
- Write a test that reproduces the bug exactly
- Verify the test fails (red) with the current code
- Apply the fix
- Verify the test passes (green)
- Run the full test suite — no regressions

## Rules
- NEVER fix before proving the root cause
- NEVER submit a fix without a reproducing test
- If two hypotheses remain after Step 4, test the simpler one first
- Document the root cause in `claude/tasks/lessons.md` if it's a non-obvious pattern

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.