Debug Skill
Systematically diagnose and fix bugs, CI failures, and test failures. Integrates with beads for issue tracking.
Argument Parsing
Parse $ARGUMENTS:
- •Beads issue ID (e.g.,
claude-xyz) → debug that specific issue - •Error message or description → debug that problem
- •No args → check for failing tests/CI on current branch
Workflow
1. Issue Setup
If beads issue provided:
bash
bd show <id> bd update <id> --status in_progress
If no beads issue:
bash
bd create "Debug: <problem>" --type bug --priority 1 --description "## Steps to Reproduce - <observed symptoms and error output> ## Acceptance Criteria - Bug is fixed and verified by passing tests"
Validate: bd lint <id> — if it fails, bd edit <id> --description to fix violations.
2. Gather Diagnostics (Parallel)
Run these in parallel:
bash
git branch --show-current git log --oneline -5 git diff --stat gh pr checks # or gh run list --limit 3
If test failure mentioned, run failing tests to reproduce.
3. Investigate Systematically
- •Read error output carefully
- •Trace to root cause (don't guess)
- •Read relevant source files
- •Check recent changes that may have introduced the bug
- •Use Grep/Glob to find related code
4. Fix the Issue
- •Make minimal, targeted changes
- •Re-run failing tests/checks to verify fix
- •If fix works:
bd close <id> - •If fix doesn't work:
bd update <id> --notes "Findings: ..."
5. Report
Output format:
code
## Problem - [what was wrong] ## Root Cause - [traced cause] ## Fix Applied - [minimal changes made] ## Verification - [test results / CI status]
Style Rules
- •Keep concise — bullet points, not prose
- •No emoji
- •Steps numbered and actionable
- •Prefer reading error output over guessing
- •Make minimal fixes — don't refactor surrounding code
- •Use parallel tool calls when gathering independent data