Systematic debugging with persistent state across context resets
Orchestrator role: Gather symptoms, spawn gsd-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.
Flags:
--diagnose — Diagnose only. Find root cause without applying a fix. Returns a structured Root Cause Report. Use when you want to validate the diagnosis before committing to a fix.
</objective>
<available_agent_types> Valid GSD subagent types (use exact names — do not fall back to 'general-purpose'):
Parse flags from {{GSD_ARGS}}:
--diagnose is present, set diagnose_only=true and remove the flag from the issue description.diagnose_only=false.Check for active sessions:
</context> <process>ls .planning/debug/*.md 2>/dev/null | grep -v resolved | head -5
INIT=$(node "C:/Users/gusta/OneDrive/Documentos/gerenciador-de-quadras/.trae/get-shit-done/bin/gsd-tools.cjs" state load)
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
Extract commit_docs from init JSON. Resolve debugger model:
debugger_model=$(node "C:/Users/gusta/OneDrive/Documentos/gerenciador-de-quadras/.trae/get-shit-done/bin/gsd-tools.cjs" resolve-model gsd-debugger --raw)
If active sessions exist AND no {{GSD_ARGS}}:
If {{GSD_ARGS}} provided OR user describes new issue:
Use AskUserQuestion for each:
After all gathered, confirm ready to investigate.
Fill prompt and spawn:
<objective>
Investigate issue: {slug}
**Summary:** {trigger}
</objective>
<symptoms>