Orchestrates systematic debugging across any technology stack by detecting the environment, analyzing errors, tracing root causes, applying fixes, and validating results.
Ships in dev. Installing the plugin adds it to Claude Code.
<user_request> $ARGUMENTS </user_request>
<critical_override> THIS COMMAND OVERRIDES THE CLAUDE.md TASK ROUTING TABLE FOR AGENT SELECTION.
WHY: The CLAUDE.md routing table maps "Investigation" to code-analysis:detective, but this command needs dev:debugger for error analysis and dev:developer for applying fixes. code-analysis:detective is READ-ONLY and cannot fix bugs.
AGENT RULES FOR THIS COMMAND:
DO NOT use code-analysis:detective (READ-ONLY — cannot apply fixes or write code). DO NOT use dev:researcher (researches topics, does NOT debug code). DO NOT use dev:architect (plans architecture, does NOT debug or fix code). </critical_override>
You MUST use Tasks to track debugging workflow. Before starting, create todo list with all 6 phases:
0. Initialize (understand issue)
1. Error Analysis
2. Root Cause Investigation
3. Fix Implementation
4. Validation
5. Documentation
Update continuously as you progress.
</todowrite_requirement>
<orchestrator_role>
**You are an ORCHESTRATOR, not IMPLEMENTER.**
**You MUST:**
- Use Task tool to delegate ALL debugging work
- Use Tasks to track investigation steps
- Document findings systematically
- Trace root cause before fixing
**You MUST NOT:**
- Write or edit code directly
- Apply fixes yourself
- Skip root cause analysis
</orchestrator_role>
<delegation_rules>
- ALL error analysis -> debugger agent
- ALL fixes -> developer agent
- ALL validation -> run tests via Bash
</delegation_rules>
</critical_constraints>
Setup session and understand the issue Mark PHASE 0 as in_progress Initialize session with increased entropy: ```bash SESSION_BASE="dev-debug-$(date +%Y%m%d-%H%M%S)-$(head -c4 /dev/urandom | xxd -p)" SESSION_PATH="ai-docs/sessions/${SESSION_BASE}" mkdir -p "${SESSION_PATH}" echo "Session: ${SESSION_BASE}" echo "Path: ${SESSION_PATH}" ``` Capture error context: - Error message or description from user - Stack trace (if available) - Reproduction steps - Environment details Launch stack-detector to understand project stack: ``` SESSION_PATH: ${SESSION_PATH} Detect technology stack for this project.
Save results to: ${SESSION_PATH}/context.json
```
</step>
<step>Mark PHASE 0 as completed</step>
</steps>
<quality_gate>Issue understood, stack detected</quality_gate>
</phase>
<phase number="1" name="Error Analysis">
<objective>Analyze error and identify potential causes</objective>
<steps>
<step>Mark PHASE 1 as in_progress</step>
<step>
Launch debugger agent:
```
SESSION_PATH: ${SESSION_PATH}
DETECTED_STACK: {stack}
Analyze this error:
{error_description}
Steps:
1. Parse stack trace/error message
2. Identify error type and category
3. List potential root causes (ranked by likelihood)
4. Identify relevant code files
5. Suggest investigation paths
Save analysis to: ${SESSION_PATH}/error-analysis.md
```
</step>
<step>Review analysis (read ${SESSION_PATH}/error-analysis.md)</step>
<step>Mark PHASE 1 as completed</step>
</steps>
<quality_gate>Error analyzed, potential causes identified</quality_gate>
</phase>
<phase number="2" name="Root Cause Investigation">
<objective>Trace the actual root cause</objective>
<steps>
<step>Mark PHASE 2 as in_progress</step>
<step>
For each potential cause (in order of likelihood):
- Use Read tool on relevant source files
- Use Grep to search for related patterns
- Check related configurations
- Trace data/control flow
- Verify assumptions
</step>
<step>
Launch debugger with investigation findings:
```
SESSION_PATH: ${SESSION_PATH}
Confirm root cause from investigation:
- Files checked: {file_list}
- Findings: {investigation_notes}
Identify the actual root cause and required fix.
Save to: ${SESSION_PATH}/root-cause.md
```
</step>
<step>
**User Confirmation** (AskUserQuestion):
```
Root Cause Identified:
{root_cause_description}
Proposed Fix:
{fix_approach}
Options:
1. Proceed with fix [RECOMMENDED]
2. Investigate further
3. Manual debugging
```
</step>
<step>Mark PHASE 2 as completed</step>
</steps>
<quality_gate>Root cause confirmed by user</quality_gate>
</phase>
<phase number="3" name="Fix Implementation">
<objective>Apply the fix</objective>
<steps>
<step>Mark PHASE 3 as in_progress</step>
<step>
Launch developer agent:
```
SESSION_PATH: ${SESSION_PATH}
Read these skills:
- {skill_path_1}
- {skill_path_2}
Apply fix based on: ${SESSION_PATH}/root-cause.md
Requirements:
1. Minimal change to fix the issue
2. Add regression test if applicable
3. Document the fix
4. Run quality checks for this stack
```
</step>
<step>Verify fix applied</step>
<step>Mark PHASE 3 as completed</step>
</steps>
<quality_gate>Fix applied, quality checks pass</quality_gate>
</phase>
<phase number="4" name="Validation">
<objective>Verify fix resolves the issue</objective>
<steps>
<step>Mark PHASE 4 as in_progress</step>
<step>Run reproduction steps to verify fix works</step>
<step>Run quality checks for the detected stack</step>
<step>Run test suite via Bash</step>
<step>
If issue persists:
- Return to PHASE 2 for further investigation
- Max 2 iterations before escalating to user
</step>
<step>Mark PHASE 4 as completed</step>
</steps>
<quality_gate>Issue resolved, tests pass</quality_gate>
</phase>
<phase number="5" name="Documentation">
<objective>Document the debugging session</objective>
<steps>
<step>Mark PHASE 5 as in_progress</step>
<step>
Create debug report at ${SESSION_PATH}/debug-report.md:
- Issue summary
- Root cause explanation
- Fix applied
- Files modified
- Prevention recommendations
- Related patterns from debugging-strategies skill
</step>
<step>Present summary to user with git status</step>
<step>Mark ALL tasks as completed</step>
</steps>
<quality_gate>Debug session documented</quality_gate>
</phase>
<debugging_strategies_by_stack> Check React DevTools for component state Inspect Network tab for API failures Look for hydration mismatches (SSR) Check TanStack Query devtools for cache issues Review TypeScript errors in IDE
Add debug logging with log/slog Use delve debugger for step-through Check goroutine leaks with pprof Trace database queries Review error wrapping chain Use RUST_BACKTRACE=1 for full stack trace Add debug!()/trace!() with tracing crate Check for unwrap() calls on None/Err Review borrow checker errors Use cargo expand for macro debugging Add breakpoint() or pdb.set_trace() Check traceback module for async traces Review import order for circular imports Check environment and dependencies Use logging module with DEBUG level /dev:debug TypeError: Cannot read property 'map' of undefined PHASE 0: Capture stack trace, detect React stack PHASE 1: Analyze - likely data is undefined before fetch completes PHASE 2: Find component, verify useQuery loading state handling PHASE 3: Add loading check before .map() PHASE 4: Verify rendering works, tests pass PHASE 5: Document pattern for data guards /dev:debug panic: runtime error: invalid memory address or nil pointer dereference PHASE 0: Parse panic stack trace, detect Go stack PHASE 1: Identify file:line from trace, list nil pointer sources PHASE 2: Trace variable initialization, find missing nil check PHASE 3: Add nil check before dereference + test PHASE 4: Run tests, verify no panic PHASE 5: Document nil safety pattern /dev:debug ImportError: cannot import name 'UserService' from 'services' PHASE 0: Capture error, detect Python stack PHASE 1: Check for circular import, missing __init__.py PHASE 2: Trace import chain, find circular dependency PHASE 3: Refactor to break circular import PHASE 4: Verify import works, run pytest PHASE 5: Document import pattern to avoid circularity - Be systematic in investigation approach - Show progress through debugging phases - Explain root cause clearly - Document prevention recommendations - Provide actionable next steps<completion_message>
Issue: {issue_summary} Root Cause: {root_cause} Fix Applied: {fix_summary}
Files Modified:
Validation:
Prevention Recommendations: {prevention_recommendations}
Artifacts:
Session: ${SESSION_PATH} </completion_message>
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
/madappgang-dev-plugins-dev-2:debugfrom dev
Claude Code refuses to install this plugin
plugin.json: dependencies: Invalid input: expected array, received object
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
15 commands in this plugin
/architectUniversal architecture planning for any stack with trade-off analysis/brainstormCollaborative ideation and planning with multi-model exploration and consensus scoring/create-styleInteractive wizard to create and update project design style guides.
Supports reference image capture, style updates, and visual reference management.
Actions: create, update, capture, add-reference, remove-reference, list-references
/deep-researchDeep research with convergence-based finalization and parallel exploration/delegateRoute a task to the best specialized agent using the task routing table/docDocumentation command - generate, analyze, fix, or validate docs. Use for README, API docs, tutorials, changelogs.Other plugins' commands for the same job