Merge pull request #826 from Tibsfox/fix/auto-advance-nesting
fix(workflow): use Skill instead of Task for auto-advance phase transitions
This commit is contained in:
@@ -607,42 +607,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="
|
||||
<objective>
|
||||
You are the plan-phase orchestrator. Create executable plans for Phase ${PHASE}: ${PHASE_NAME}, then auto-advance to execution.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
@~/.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
|
||||
</execution_context>
|
||||
|
||||
<arguments>
|
||||
PHASE=${PHASE}
|
||||
ARGUMENTS='${PHASE} --auto'
|
||||
</arguments>
|
||||
|
||||
<instructions>
|
||||
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
|
||||
</instructions>
|
||||
",
|
||||
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:
|
||||
```
|
||||
|
||||
@@ -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="
|
||||
<objective>
|
||||
You are the execute-phase orchestrator. Execute all plans for Phase ${PHASE}: ${PHASE_NAME}.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
@~/.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
|
||||
</execution_context>
|
||||
|
||||
<arguments>
|
||||
PHASE=${PHASE}
|
||||
ARGUMENTS='${PHASE} --auto --no-transition'
|
||||
</arguments>
|
||||
|
||||
<instructions>
|
||||
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
|
||||
</instructions>
|
||||
",
|
||||
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:
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user