# Debug

> Use when the user reports an error, unexpected behavior, test failure, or asks to trace or diagnose a problem. Applies 6-step structured debugging.

- Skill: `majiayu000/debug-7` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/debug-7`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/debug-7/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/debug-7

---


# Debug

Systematic debugging using the `persona-debugger` agent methodology. Apply six steps to find and fix the root cause.

## 6-Step Methodology

### Step 1: Reproduce

Understand and reproduce the issue from the given input:
- Parse error messages, stack traces, or symptom descriptions
- Identify reproduction steps
- Confirm the failure is consistent or intermittent

### Step 2: Isolate

Narrow down the root cause:
- Identify the failing code path
- Use bisection or elimination to isolate the component
- Check recent changes with `git log --oneline -20`

### Step 3: Analyze

Examine code, logs, and state:
- Read the relevant source files
- Check error handling and edge cases
- Trace data flow through the failure path

### Step 4: Hypothesize

Form theories about the bug:
- List 2-3 candidate root causes
- Rank by likelihood based on evidence
- Identify what evidence would confirm/reject each

### Step 5: Test

Validate hypotheses:
- Add strategic debug output or assertions
- Test each hypothesis against the evidence
- Confirm root cause with high confidence

### Step 6: Fix

Implement and verify the solution:
- Apply the minimal fix that addresses the root cause
- Add a regression test to prevent recurrence
- Run existing tests to verify no regressions

## Report

```
## Debug Complete

**Issue**: <brief description>
**Root Cause**: [file:line] - <explanation>
**Confidence**: [High/Medium/Low]
**Fix Applied**: Yes/No

### Evidence
- <key evidence supporting diagnosis>

### Prevention
- <regression test added>
- <recommendations to prevent similar issues>

Next Steps:
- `/arc:core:verify --post` to run full verification
- `/arc:specialized:bug` for deeper investigation if fix didn't resolve
```

