From kata
Systematically debugs issues: gathers symptoms, spawns isolated subagents for root cause analysis, maintains persistent sessions across context resets. Auto-activates on debug/troubleshoot triggers.
npx claudepluginhub withmartian-sandbox/ghrc-x-73d04e3c2aae45e2ac89d7e8506d8eaaThis skill uses the workspace's default tool permissions.
<objective>
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Orchestrator role: Gather symptoms, spawn kata-debugger agent, handle checkpoints, spawn continuations.
Why subagent: Investigation burns context fast (reading files, forming hypotheses, testing). Fresh 200k context per investigation. Main context stays lean for user interaction.
User's issue: $ARGUMENTSCheck for active sessions:
find .planning/debug -maxdepth 1 -name "*.md" 2>/dev/null | grep -v resolved | head -5
Read model profile for agent spawning:
MODEL_PROFILE=$(node scripts/kata-lib.cjs read-config "model_profile" "balanced")
Default to "balanced" if not set.
Model lookup table:
| Agent | quality | balanced | budget |
|---|---|---|---|
| kata-debugger | opus | sonnet | sonnet |
Store resolved model for use in Task calls below.
If active sessions exist AND no $ARGUMENTS:
If $ARGUMENTS provided OR user describes new issue:
Use AskUserQuestion for each:
After all gathered, confirm ready to investigate.
Before spawning agents, read agent instructions using the Read tool:
references/debugger-instructions.md (relative to skill base directory) — store as debugger_instructions_contentFill prompt and spawn:
<objective>
Investigate issue: {slug}
**Summary:** {trigger}
</objective>
<symptoms>
expected: {expected}
actual: {actual}
errors: {errors}
reproduction: {reproduction}
timeline: {timeline}
</symptoms>
<mode>
symptoms_prefilled: true
goal: find_and_fix
</mode>
<debug_file>
Create: .planning/debug/{slug}.md
</debug_file>
Task(
prompt="<agent-instructions>\n{debugger_instructions_content}\n</agent-instructions>\n\n" + filled_prompt,
subagent_type="general-purpose",
model="{debugger_model}",
description="Debug {slug}"
)
If ## ROOT CAUSE FOUND:
If ## CHECKPOINT REACHED:
If ## INVESTIGATION INCONCLUSIVE:
When user responds to checkpoint, spawn fresh agent:
<objective>
Continue debugging {slug}. Evidence is in the debug file.
</objective>
<prior_state>
Debug file: @.planning/debug/{slug}.md
</prior_state>
<checkpoint_response>
**Type:** {checkpoint_type}
**Response:** {user_response}
</checkpoint_response>
<mode>
goal: find_and_fix
</mode>
Task(
prompt="<agent-instructions>\n{debugger_instructions_content}\n</agent-instructions>\n\n" + continuation_prompt,
subagent_type="general-purpose",
model="{debugger_model}",
description="Continue debug {slug}"
)
<success_criteria>