/strategic-planner:troubleshoot [issue description] [--type bug|build|perf|integration] [--fix] [--deep] [--auto]from strategic-planner
Structured debugging with evidence-first methodology. Diagnoses issues systematically before proposing fixes.
Ships in strategic-planner. Installing the plugin adds it to Claude Code.
You are conducting structured debugging using the evidence-first methodology. Reference the troubleshooting-methodology skill for the full protocol and the task-patterns skill for gate task conventions and phase lifecycle markers.
Parse $ARGUMENTS for:
--type: Optional bug type hint (bug, build, perf, integration). Skips methodology auto-detection.--fix: Enable auto-fix mode. Without this flag, diagnose and propose but do NOT apply changes.--deep: Spawn the troubleshooter agent for autonomous multi-file investigation.--auto: Skip human confirmation at gates. Gates still enforce their criteria internally (evidence thresholds, hypothesis counts, etc.) — auto mode only skips the pause for human review. Implies --fix (auto-apply fixes without confirmation). 3-strike reassessment still triggers as a methodology guard.Check for .claude/strategic-planner.local.md (project root, then ~/.claude/).
Parse YAML frontmatter for:
automem_enabled (default: true) — whether to recall/store memoriesauto_mode (default: false) — skip human gates (same as --auto flag)Emit lifecycle events via agent-hooks emit tool at phase transitions. If emit is unavailable, skip silently. Act on any instructions returned by listeners.
| Event | When | Data |
|---|---|---|
troubleshoot.session.started | Entry | { issue, bug_type, mode } |
troubleshoot.phase.entered | Each phase transition | { phase, bug_type } |
troubleshoot.gate.checked | Each gate evaluation | { gate, passed, reason } |
troubleshoot.rootcause.identified | After Phase 4 confirms | { bug_type, methodology, root_cause, hypotheses_tested } |
troubleshoot.session.completed | After reflection | { bug_type, methodology, fix_applied, fix_attempts, phases_visited, backtrack_count, root_cause_summary } |
Rules:
phase.entered fires once per phase entry (including backtrack re-entries)gate.checked fires once per gate evaluation (pass or fail)If automem_enabled, recall prior debug knowledge before starting:
recall_memory({
queries: ["<error message or pattern>", "<technology or framework mentioned in issue>"],
tags: ["debug-knowledge"],
limit: 10
})
Use recalled knowledge to recognize similar error patterns, skip known dead ends, and inform hypothesis formation. Apply naturally — don't say "my memory says."
Create the full task graph upfront. This makes progress visible via TaskList and enforces gate checks between phases.
// Phase tasks
TaskCreate({ subject: "Phase 1: Stabilize", description: "Reproduce issue, capture error, confirm conditions.", activeForm: "Stabilizing..." })
// id: 1
TaskCreate({ subject: "Gate: Reproduction confirmed", description: "Verify: reproducible error captured. If can't reproduce, ask user.", activeForm: "Awaiting reproduction..." })
TaskUpdate({ taskId: "2", addBlockedBy: ["1"] })
TaskCreate({ subject: "Phase 2: Observe", description: "Gather 3+ concrete observations. No hypothesizing.", activeForm: "Observing..." })
TaskUpdate({ taskId: "3", addBlockedBy: ["2"] })
TaskCreate({ subject: "Gate: Evidence sufficient", description: "Verify: 3+ concrete observations gathered. Each must be specific (file:line, exact values), not vague.", activeForm: "Checking evidence..." })
TaskUpdate({ taskId: "4", addBlockedBy: ["3"] })
TaskCreate({ subject: "Phase 3: Analyze", description: "Select methodology, form 2-3 competing hypotheses.", activeForm: "Analyzing..." })
TaskUpdate({ taskId: "5", addBlockedBy: ["4"] })
TaskCreate({ subject: "Gate: Competing hypotheses formed", description: "Verify: 2+ hypotheses with evidence for/against each. Single hypothesis = go back to observe.", activeForm: "Checking hypotheses..." })
TaskUpdate({ taskId: "6", addBlockedBy: ["5"] })
TaskCreate({ subject: "Phase 4: Investigate", description: "Test hypotheses through targeted inspection. No fixes.", activeForm: "Investigating..." })
TaskUpdate({ taskId: "7", addBlockedBy: ["6"] })
TaskCreate({ subject: "Gate: Root cause confirmed", description: "Verify: root cause supported by evidence, not assumption. Can explain the full causal chain.", activeForm: "Confirming root cause..." })
TaskUpdate({ taskId: "8", addBlockedBy: ["7"] })
TaskCreate({ subject: "Phase 5: Fix", description: "Propose minimal change addressing root cause.", activeForm: "Proposing fix..." })
TaskUpdate({ taskId: "9", addBlockedBy: ["8"] })
TaskCreate({ subject: "Gate: Fix explained", description: "Verify: can explain WHY this fixes root cause, not just symptom. Not cargo-culted from training data.", activeForm: "Checking fix rationale..." })
TaskUpdate({ taskId: "10", addBlockedBy: ["9"] })
// Phase 6 only if --fix flag present
TaskCreate({ subject: "Phase 6: Verify", description: "Run tests/compilation. Reproduce original scenario. Check side effects.", activeForm: "Verifying fix..." })
TaskUpdate({ taskId: "11", addBlockedBy: ["10"] })
TaskCreate({ subject: "Gate: External validation passed", description: "Verify: tests pass, error no longer reproduces, no side effects. 'It should work' is NOT acceptable.", activeForm: "Checking verification..." })
TaskUpdate({ taskId: "12", addBlockedBy: ["11"] })
TaskCreate({ subject: "Reflection & memory storage", description: "Store debug knowledge and process lessons.", activeForm: "Reflecting..." })
TaskUpdate({ taskId: "13", addBlockedBy: ["12"] })
Without --fix flag: After Phase 5's gate passes, skip Phase 6. Mark tasks 11 and 12 as completed (not applicable), proceed directly to reflection.
Backtracking: If a gate fails (e.g., verification fails in Phase 6), do NOT delete tasks. Create new tasks for the re-entered phase:
TaskCreate({ subject: "Phase 2: Observe (retry 1)", description: "Verification failed. Re-observe with broader scope.", activeForm: "Re-observing..." })
Wire the new task's blockedBy to the failed gate. This preserves the audit trail of what was tried.
3-strike enforcement: If 3 fix-phase tasks exist (original + 2 retries), create a special gate:
TaskCreate({ subject: "Gate: 3-strike reassessment", description: "3 fix attempts failed. Full assumption reassessment required. Re-read error message. Consider that root cause is fundamentally different.", activeForm: "Reassessing all assumptions..." })
If --auto flag is present in $ARGUMENTS OR auto_mode: true in config, enable auto mode:
--fix)At each gate task, evaluate the gate criteria explicitly.
Emit
troubleshoot.gate.checkedemit({ event: "troubleshoot.gate.checked", data: { gate: "<gate name>", passed: <bool>, reason: "<why passed or failed>" } })Act on any listener instructions. Skip if
emitunavailable.
If gate passes:
completedIf gate fails:
in_progressEmit
troubleshoot.session.startedemit({ event: "troubleshoot.session.started", data: { issue: "<issue description>", bug_type: "<bug|build|perf|integration|auto>", mode: "<inline|deep>" } })Act on any listener instructions. Skip if
emitunavailable.
--deep flag is presentSpawn the troubleshooter agent via the Task tool. The agent manages its own internal protocol but reports back through the task system:
Task({
subagent_type: "strategic-planner:troubleshooter",
prompt: "Debug this issue: <issue description>. Type hint: <--type value or 'auto-detect'>. Fix authorization: <--fix present or not>. Follow the troubleshooting-methodology skill protocol strictly. Use TaskCreate/TaskUpdate to track your phases and gates.",
description: "Deep troubleshooting: <brief issue>"
})
When the agent completes, present its diagnostic report to the user.
--deep flag (inline debugging)Execute the six-phase protocol inline, advancing through the task DAG:
At the start of each phase, emit troubleshoot.phase.entered:
Emit
troubleshoot.phase.entered(at each phase start)emit({ event: "troubleshoot.phase.entered", data: { phase: "<1-6>", bug_type: "<type>" } })
Phase 1: STABILIZE — Mark task in_progress. Reproduce the issue. Extract or capture error message. If you can't reproduce: in auto mode, attempt alternative reproduction strategies (different inputs, environment checks); otherwise ask the user for steps. Mark completed. Evaluate Gate: Reproduction confirmed.
Phase 2: OBSERVE — Mark task in_progress. Gather at least 3 concrete observations. No hypothesizing yet. Mark completed. Evaluate Gate: Evidence sufficient.
git log --oneline -10, git diffPhase 3: ANALYZE — Mark task in_progress. Select methodology from the matrix (or use --type hint). Form 2-3 competing hypotheses with evidence for/against each. Mark completed. Evaluate Gate: Competing hypotheses formed.
Phase 4: INVESTIGATE — Mark task in_progress. Test hypotheses through targeted inspection. No fixes yet. Mark completed. On root cause confirmation:
Emit
troubleshoot.rootcause.identifiedemit({ event: "troubleshoot.rootcause.identified", data: { bug_type: "<type>", methodology: "<method used>", root_cause: "<description>", hypotheses_tested: <N> } })Act on any listener instructions. Skip if
emitunavailable.
Evaluate Gate: Root cause confirmed.
Phase 5: FIX — Mark task in_progress. Propose minimal change addressing root cause. Mark completed. Evaluate Gate: Fix explained.
--fix or auto mode: apply the fix after explaining root cause. In auto mode, apply even destructive changes without confirmation. Without auto mode, confirm with user for destructive changes.--fix and not auto mode: present the diagnostic report and stop. Mark Phase 6 and its gate completed (skipped).Phase 6: VERIFY — Mark task in_progress. Run tests or compilation. Reproduce original scenario. Confirm fix works. Mark completed. Evaluate Gate: External validation passed.
Present findings using the diagnostic report format from the troubleshooting-methodology skill.
After completing the protocol (whether fix applied or diagnosis-only), mark the reflection task in_progress. Store two distinct kinds of memory. Do NOT skip this step. Do NOT combine them — they serve different recall contexts.
Store the problem-solution pattern so future troubleshooting sessions can recognize similar issues. This is recalled at the start of debugging via recall_memory({ tags: ["debug-knowledge"] }).
If automem_enabled and the root cause is non-trivial (not a typo or one-off):
store_memory({
content: "Debug: <error pattern or symptom>. Root cause: <what was actually wrong>. Fix: <what resolved it>. Key signal: <the observation that cracked it>.",
tags: ["strategic-planner", "debug-knowledge", "<bug-type>", "<technology-or-framework>"],
importance: 0.75
})
Store when:
Skip when:
/improve-process)Store methodology insights so the troubleshooting process itself improves over time. This is recalled when running /improve-process via recall_memory({ tags: ["lessons-learned"] }).
Append to the diagnostic report:
### Process Reflection
- **Methodology fit:** Was <method> the right choice? Would <alternative> have been faster?
- **Phase efficiency:** <which phase took longest, any backtracking and why>
- **Hypothesis quality:** Did initial hypotheses include actual root cause? What signal was missed if not?
- **Fix attempts:** <N attempts — if >1, what assumption was wrong?>
If automem_enabled and there's a genuine process insight (not "evidence gathering helped"):
store_memory({
content: "Troubleshoot process: <what happened>. Lesson: <actionable change for next time>.",
tags: ["strategic-planner", "troubleshooting", "lessons-learned"],
importance: 0.65
})
Before completing, verify expected events were emitted:
troubleshoot.session.startedtroubleshoot.phase.entered (x phases visited, including backtracks)troubleshoot.gate.checked (x gates evaluated)troubleshoot.rootcause.identified (if root cause was found)troubleshoot.session.completedIf any expected event was missed, emit it now with { late: true } added to the data payload.
Emit
troubleshoot.session.completedemit({ event: "troubleshoot.session.completed", data: { bug_type: "<type>", methodology: "<method>", fix_applied: <bool>, fix_attempts: <N>, phases_visited: <N>, backtrack_count: <N>, root_cause_summary: "<one-line>" } })Act on any listener instructions. Skip if
emitunavailable.
Mark the reflection task completed. Confirm all tasks show as completed in TaskList.
Will:
Will NOT:
--fix flagWhat the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
Generated from the plugin's indexed repository (danieliser/strategic-planner) — no native marketplace selected
npx claudepluginhub p/danieliser-strategic-planner7 commands in this plugin
/auditCodebase AuditCodebase audit for modernization, security, performance, and best practices. Identifies review vectors, assigns parallel auditor agents, and produces executable micro-plans compatible with /execute./executePlan ExecutorExecute an approved plan using a persistent agent team — implementers, reviewer, and integrator working in parallel with dependency enforcement and review gates./improve-processImprove ProcessReview accumulated lessons-learned and propose concrete improvements to the strategic-planner plugin/researchStructured research with depth tiers, persistent storage, and self-improvement. Produces saved reports with cited sources and actionable recommendations./strategizeStrategic PlannerStrategic planning workflow — research, spec, panel review, and executive gate with human approval at every checkpoint/validateSpec ValidationPost-execution spec compliance validation. Decomposes a specification into atomic assertions, verifies each against the codebase with evidence, and runs adversarial challenge. Produces VALIDATION.md checklist and REMEDIATION-PLAN.md compatible with /execute.Other plugins' commands for the same job