From b3e3e3ddc3fe438942039cb5bbde22e7072f9c2b Mon Sep 17 00:00:00 2001 From: Tibsfox Date: Sat, 28 Feb 2026 05:42:21 -0800 Subject: [PATCH] fix(workflow): use Skill instead of Task for auto-advance phase transitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The auto-advance chain (discuss → plan → execute) was spawning each subsequent phase as a Task(subagent_type="general-purpose"), creating 3-4 levels of nested agent sessions. At that nesting depth, the Claude Code runtime hits resource limits or stdio contention, causing the execute-phase to freeze or attempt to shell out to `claude` as a subprocess (which is explicitly blocked). The fix replaces Task spawns with Skill invocations for phase transitions: - discuss-phase auto-advance: Skill("gsd:plan-phase") instead of Task(general-purpose) - plan-phase auto-advance: Skill("gsd:execute-phase") instead of Task(general-purpose) The Skill tool runs in the same process context as the caller, keeping the entire auto-advance chain flat at a single nesting level. Each phase still spawns its own worker agents (gsd-executor, gsd-planner, etc.) as Tasks, but the orchestration chain itself no longer creates unnecessary depth. Closes #686 Co-Authored-By: Claude Opus 4.6 --- get-shit-done/workflows/discuss-phase.md | 36 ++++------------------ get-shit-done/workflows/plan-phase.md | 38 ++++-------------------- 2 files changed, 10 insertions(+), 64 deletions(-) diff --git a/get-shit-done/workflows/discuss-phase.md b/get-shit-done/workflows/discuss-phase.md index 225dd0713..13c79cad0 100644 --- a/get-shit-done/workflows/discuss-phase.md +++ b/get-shit-done/workflows/discuss-phase.md @@ -530,42 +530,16 @@ Display banner: GSD ► AUTO-ADVANCING TO PLAN ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Context captured. Spawning plan-phase... +Context captured. Launching plan-phase... ``` -Spawn plan-phase as Task with direct workflow file reference (do NOT use Skill tool — Skills don't resolve inside Task subagents): +Launch plan-phase using the Skill tool to avoid nested Task sessions (which cause runtime freezes due to deep agent nesting — see #686): ``` -Task( - prompt=" - - You are the plan-phase orchestrator. Create executable plans for Phase ${PHASE}: ${PHASE_NAME}, then auto-advance to execution. - - - - @~/.claude/get-shit-done/workflows/plan-phase.md - @~/.claude/get-shit-done/references/ui-brand.md - @~/.claude/get-shit-done/references/model-profile-resolution.md - - - - PHASE=${PHASE} - ARGUMENTS='${PHASE} --auto' - - - - 1. Read plan-phase.md from execution_context for your complete workflow - 2. Follow ALL steps: initialize, validate, load context, research, plan, verify, auto-advance - 3. When spawning agents (gsd-phase-researcher, gsd-planner, gsd-plan-checker), use Task with specified subagent_type and model - 4. For step 14 (auto-advance to execute): spawn execute-phase as a Task with DIRECT file reference — tell it to read execute-phase.md. Include @file refs to execute-phase.md, checkpoints.md, tdd.md, model-profile-resolution.md. Pass --no-transition flag so execute-phase returns results instead of chaining further. - 5. Do NOT use the Skill tool or /gsd: commands. Read workflow .md files directly. - 6. Return: PHASE COMPLETE (full pipeline success), PLANNING COMPLETE (planning done but execute failed/skipped), PLANNING INCONCLUSIVE, or GAPS FOUND - - ", - subagent_type="general-purpose", - description="Plan Phase ${PHASE}" -) +Skill(skill="gsd:plan-phase", args="${PHASE} --auto") ``` +This keeps the auto-advance chain flat — discuss, plan, and execute all run at the same nesting level rather than spawning increasingly deep Task agents. + **Handle plan-phase return:** - **PHASE COMPLETE** → Full chain succeeded. Display: ``` diff --git a/get-shit-done/workflows/plan-phase.md b/get-shit-done/workflows/plan-phase.md index 7bf31efba..f2fd2d53e 100644 --- a/get-shit-done/workflows/plan-phase.md +++ b/get-shit-done/workflows/plan-phase.md @@ -454,44 +454,16 @@ Display banner: GSD ► AUTO-ADVANCING TO EXECUTE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Plans ready. Spawning execute-phase... +Plans ready. Launching execute-phase... ``` -Spawn execute-phase as Task with direct workflow file reference (do NOT use Skill tool — Skills don't resolve inside Task subagents): +Launch execute-phase using the Skill tool to avoid nested Task sessions (which cause runtime freezes due to deep agent nesting): ``` -Task( - prompt=" - - You are the execute-phase orchestrator. Execute all plans for Phase ${PHASE}: ${PHASE_NAME}. - - - - @~/.claude/get-shit-done/workflows/execute-phase.md - @~/.claude/get-shit-done/references/checkpoints.md - @~/.claude/get-shit-done/references/tdd.md - @~/.claude/get-shit-done/references/model-profile-resolution.md - - - - PHASE=${PHASE} - ARGUMENTS='${PHASE} --auto --no-transition' - - - - 1. Read execute-phase.md from execution_context for your complete workflow - 2. Follow ALL steps: initialize, handle_branching, validate_phase, discover_and_group_plans, execute_waves, aggregate_results, close_parent_artifacts, verify_phase_goal, update_roadmap - 3. The --no-transition flag means: after verification + roadmap update, STOP and return status. Do NOT run transition.md. - 4. When spawning executor agents, use subagent_type='gsd-executor' with the existing @file pattern from the workflow - 5. When spawning verifier agents, use subagent_type='gsd-verifier' - 6. Preserve the classifyHandoffIfNeeded workaround (spot-check on that specific error) - 7. Do NOT use the Skill tool or /gsd: commands - - ", - subagent_type="general-purpose", - description="Execute Phase ${PHASE}" -) +Skill(skill="gsd:execute-phase", args="${PHASE} --auto --no-transition") ``` +The `--no-transition` flag tells execute-phase to return status after verification instead of chaining further. This keeps the auto-advance chain flat — each phase runs at the same nesting level rather than spawning deeper Task agents. + **Handle execute-phase return:** - **PHASE COMPLETE** → Display final summary: ```