From specialist-agent
Implements 4-phase systematic debugging for bugs, test failures, errors, and unexpected behavior: Gather evidence with git/grep, analyze patterns, hypothesize causes, implement/prove fixes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/specialist-agent:debugThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Investigate and fix the bug using 4-phase methodology.
Investigate and fix the bug using 4-phase methodology.
Target: $ARGUMENTS
Phase 1 Phase 2 Phase 3 Phase 4
┌────────┐ ┌─────────┐ ┌───────────┐ ┌───────────┐
│ GATHER │─►│ ANALYZE │─►│ FORMULATE │─►│ IMPLEMENT │
│Evidence│ │ Patterns│ │ Hypothesis│ │ & Prove │
└────────┘ └─────────┘ └───────────┘ └───────────┘
Read the error completely:
Reproduce the bug:
Check recent changes:
git log --oneline -10
git diff HEAD~3
Search for related code:
grep -r "error message" .
Output:
## Evidence
Error: [full message]
Location: [file:line]
Stack trace: [trace]
Reproduction:
1. [step]
2. [step]
3. Error occurs
Recent changes:
- [commit]: [relevant change]
BLOCKED until evidence collected.
Trace execution path:
Compare with working code:
Identify patterns:
Output:
## Analysis
Execution: [entry] → [fn1] → [fn2] → [error]
Working vs Broken:
| Aspect | Working | Broken |
|--------|---------|--------|
| [X] | [value] | [value]|
Patterns:
- [pattern 1]
- [pattern 2]
BLOCKED until patterns identified.
Generate hypotheses:
Rank by probability:
Design tests:
Output:
## Hypotheses
H1: [most likely] (80%)
Evidence for: [...]
Test: [how to verify]
H2: [second option] (15%)
Test: [how to verify]
BLOCKED until hypotheses formulated.
Test primary hypothesis:
If confirmed:
If rejected:
Create checkpoint:
git add -A && git commit -m "fix: [description]"
git tag checkpoint/bugfix-[name]
Output:
## Resolution
Hypothesis: H1 - CONFIRMED ✓
Root Cause:
[Clear explanation]
Fix:
```diff
- [old code]
+ [new code]
Verification:
## Three-Strike Rule
After 3 failed hypotheses:
⚠️ THREE STRIKES Re-evaluating understanding of the system. Looking for deeper architectural issues.
## Output
──── /debug ──── Bug: [description]
Phase 1: Evidence gathered ✓ Phase 2: Patterns identified ✓ Phase 3: Hypotheses formulated ✓ Phase 4: Fix implemented ✓
──── Debug Summary ──── Root cause: [explanation] Fix: [what changed] Checkpoint: checkpoint/bugfix-[name] Confidence: HIGH
## Anti-Rationalization
| Excuse | Reality |
|--------|---------|
| "I know the fix already" | You have a hypothesis, not a fix. Follow the phases. |
| "It's obviously this line" | Obvious fixes that skip investigation create new bugs. |
| "I'll just try this quickly" | Quick fixes without understanding cause regressions. |
| "Too slow to gather evidence" | Debugging without evidence takes 3x longer. |
| "The error message tells me everything" | Error messages are symptoms, not root causes. |
## Rules
1. **Never guess** - Evidence first
2. **Never fix without understanding** - Know the root cause
3. **Never skip phases** - Each prevents blind spots
4. **Always checkpoint** - Fixes must be reversible
npx claudepluginhub herbertjulio/specialist-agent --plugin specialist-agentEnforces systematic root cause investigation for bugs, test failures, and unexpected behavior through four phases: investigation, pattern analysis, hypothesis testing, and implementation.
Guides four-phase debugging: investigate errors, analyze differences, hypothesize root causes, fix at source. For bugs, crashes, test/build failures.
Enforces systematic root cause analysis before fixes for bugs, test failures, unexpected behavior, performance issues, and build failures.