From 131f24b5cd9014a1e910807565ad522416932053 Mon Sep 17 00:00:00 2001 From: min-k-khant <102896221+min-hinthar@users.noreply.github.com> Date: Fri, 20 Feb 2026 12:41:22 -0800 Subject: [PATCH] =?UTF-8?q?fix:=20auto-advance=20chain=20broken=20?= =?UTF-8?q?=E2=80=94=20Skills=20don't=20resolve=20inside=20Task=20subagent?= =?UTF-8?q?s=20(#669)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `--auto` flag on discuss-phase and plan-phase chains stages automatically: discuss → plan → execute, each in a fresh context window. Currently the chain is broken because auto-advance spawns `Task(prompt="Run /gsd:plan-phase --auto")` which requires the Skill tool — but Skills don't resolve inside Task subagents. Result: plan-phase never runs from discuss's auto-advance, execute-phase never runs from plan's auto-advance, and gsd-executor subagents are never spawned. Fix: Replace `Task(prompt="Run /gsd:XXX")` with Task calls that tell the subagent to read the workflow .md file directly via @file references — the same pattern that already works for gsd-executor spawning in execute-phase. Changes: - execute-phase.md: Add --no-transition flag handling so execute-phase can return status to parent instead of running transition.md when spawned by plan-phase's auto-advance - plan-phase.md: Replace Skill-based Task call with direct @file reference to execute-phase.md, passing --no-transition to prevent transition chaining - discuss-phase.md: Replace Skill-based Task call with direct @file reference to plan-phase.md, with richer return status handling (PHASE COMPLETE, PLANNING COMPLETE, PLANNING INCONCLUSIVE, GAPS FOUND) Nesting depth: discuss → Task(plan) → Task(execute) → Task(executor) = 3 levels max. Each level gets clean 200k context. Co-authored-by: Claude Opus 4.6 --- get-shit-done/workflows/discuss-phase.md | 56 +++++++++++++++++++++--- get-shit-done/workflows/execute-phase.md | 23 ++++++++++ get-shit-done/workflows/plan-phase.md | 30 ++++++++++++- 3 files changed, 100 insertions(+), 9 deletions(-) diff --git a/get-shit-done/workflows/discuss-phase.md b/get-shit-done/workflows/discuss-phase.md index 0abae3a64..6155b216a 100644 --- a/get-shit-done/workflows/discuss-phase.md +++ b/get-shit-done/workflows/discuss-phase.md @@ -460,23 +460,65 @@ Display banner: Context captured. Spawning plan-phase... ``` -Spawn plan-phase as Task: +Spawn plan-phase as Task with direct workflow file reference (do NOT use Skill tool — Skills don't resolve inside Task subagents): ``` Task( - prompt="Run /gsd:plan-phase ${PHASE} --auto", + 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}" ) ``` **Handle plan-phase return:** -- **PLANNING COMPLETE** → Plan-phase handles chaining to execute-phase (via its own auto_advance step) -- **PLANNING INCONCLUSIVE / CHECKPOINT** → Display result, stop chain: +- **PHASE COMPLETE** → Full chain succeeded. Display: + ``` + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + GSD ► PHASE ${PHASE} COMPLETE + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + Auto-advance pipeline finished: discuss → plan → execute + + Next: /gsd:discuss-phase ${NEXT_PHASE} --auto + /clear first → fresh context window + ``` +- **PLANNING COMPLETE** → Planning done, execution didn't complete: + ``` + Auto-advance partial: Planning complete, execution did not finish. + Continue: /gsd:execute-phase ${PHASE} + ``` +- **PLANNING INCONCLUSIVE / CHECKPOINT** → Stop chain: ``` Auto-advance stopped: Planning needs input. - - Review the output above and continue manually: - /gsd:plan-phase ${PHASE} + Continue: /gsd:plan-phase ${PHASE} + ``` +- **GAPS FOUND** → Stop chain: + ``` + Auto-advance stopped: Gaps found during execution. + Continue: /gsd:plan-phase ${PHASE} --gaps ``` **If neither `--auto` nor config enabled:** diff --git a/get-shit-done/workflows/execute-phase.md b/get-shit-done/workflows/execute-phase.md index 5e3397574..4e19abd84 100644 --- a/get-shit-done/workflows/execute-phase.md +++ b/get-shit-done/workflows/execute-phase.md @@ -383,6 +383,29 @@ node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs(phase-{X}): complete **Exception:** If `gaps_found`, the `verify_phase_goal` step already presents the gap-closure path (`/gsd:plan-phase {X} --gaps`). No additional routing needed — skip auto-advance. +**No-transition check (spawned by auto-advance chain):** + +Parse `--no-transition` flag from $ARGUMENTS. + +**If `--no-transition` flag present:** + +Execute-phase was spawned by plan-phase's auto-advance. Do NOT run transition.md. +After verification passes and roadmap is updated, return completion status to parent: + +``` +## PHASE COMPLETE + +Phase: ${PHASE_NUMBER} - ${PHASE_NAME} +Plans: ${completed_count}/${total_count} +Verification: {Passed | Gaps Found} + +[Include aggregate_results output] +``` + +STOP. Do not proceed to auto-advance or transition. + +**If `--no-transition` flag is NOT present:** + **Auto-advance detection:** 1. Parse `--auto` flag from $ARGUMENTS diff --git a/get-shit-done/workflows/plan-phase.md b/get-shit-done/workflows/plan-phase.md index 89e7ef562..c7b023da0 100644 --- a/get-shit-done/workflows/plan-phase.md +++ b/get-shit-done/workflows/plan-phase.md @@ -366,10 +366,36 @@ Display banner: Plans ready. Spawning execute-phase... ``` -Spawn execute-phase as Task: +Spawn execute-phase as Task with direct workflow file reference (do NOT use Skill tool — Skills don't resolve inside Task subagents): ``` Task( - prompt="Run /gsd:execute-phase ${PHASE} --auto", + 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}" )