fix(execute): restore offer_next routing to orchestrator commands
The orchestrator pattern conversion (8ed6a8f) removed workflow context
loading for context efficiency but inadvertently removed the offer_next
step that presents copy/paste-ready next commands after plan/phase
completion.
Added explicit <offer_next> sections to both commands:
- execute-plan.md: routes to next plan, next phase, or milestone complete
- execute-phase.md: routes to next phase or milestone complete
Both include /clear hints and copy/paste-ready command paths.
Fixes #69
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -64,10 +64,83 @@ Phase: $ARGUMENTS
|
||||
- Update ROADMAP.md
|
||||
|
||||
6. **Offer next steps**
|
||||
- More phases → `/gsd:plan-phase {next}`
|
||||
- Milestone complete → `/gsd:complete-milestone`
|
||||
- Route to next action (see `<offer_next>`)
|
||||
</process>
|
||||
|
||||
<offer_next>
|
||||
**MANDATORY: Present copy/paste-ready next command.**
|
||||
|
||||
After phase completes, determine what's next:
|
||||
|
||||
**Step 1: Check milestone status**
|
||||
|
||||
Read ROADMAP.md. Find current phase number and highest phase in milestone.
|
||||
|
||||
| Condition | Action |
|
||||
|-----------|--------|
|
||||
| current < highest | More phases → Route A |
|
||||
| current = highest | Milestone complete → Route B |
|
||||
|
||||
---
|
||||
|
||||
**Route A: More phases remain in milestone**
|
||||
|
||||
```
|
||||
## ✓ Phase {Z}: {Name} Complete
|
||||
|
||||
All {Y} plans finished.
|
||||
|
||||
---
|
||||
|
||||
## ▶ Next Up
|
||||
|
||||
**Phase {Z+1}: {Name}** — {Goal from ROADMAP.md}
|
||||
|
||||
`/gsd:plan-phase {Z+1}`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
---
|
||||
|
||||
**Also available:**
|
||||
- `/gsd:verify-work {Z}` — manual acceptance testing before continuing
|
||||
- `/gsd:discuss-phase {Z+1}` — gather context first
|
||||
- `/gsd:research-phase {Z+1}` — investigate unknowns
|
||||
|
||||
---
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Route B: Milestone complete**
|
||||
|
||||
```
|
||||
🎉 MILESTONE COMPLETE!
|
||||
|
||||
## ✓ Phase {Z}: {Name} Complete
|
||||
|
||||
All {N} phases finished.
|
||||
|
||||
---
|
||||
|
||||
## ▶ Next Up
|
||||
|
||||
**Complete Milestone** — archive and prepare for next
|
||||
|
||||
`/gsd:complete-milestone`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
---
|
||||
|
||||
**Also available:**
|
||||
- `/gsd:verify-work` — manual acceptance testing before completing milestone
|
||||
- `/gsd:add-phase <description>` — add another phase before completing
|
||||
|
||||
---
|
||||
```
|
||||
</offer_next>
|
||||
|
||||
<wave_execution>
|
||||
**Parallel spawning:**
|
||||
|
||||
|
||||
@@ -85,12 +85,111 @@ Plan path: $ARGUMENTS
|
||||
- If contains "## CHECKPOINT REACHED": Execute checkpoint_handling
|
||||
- If contains "## PLAN COMPLETE": Verify SUMMARY exists, report success
|
||||
|
||||
7. **Report completion**
|
||||
7. **Report completion and offer next steps**
|
||||
- Show SUMMARY path
|
||||
- Show commits from subagent return
|
||||
- Offer next steps
|
||||
- Route to next action (see `<offer_next>`)
|
||||
</process>
|
||||
|
||||
<offer_next>
|
||||
**MANDATORY: Present copy/paste-ready next command.**
|
||||
|
||||
After plan completes, determine what's next:
|
||||
|
||||
**Step 1: Count plans vs summaries in current phase**
|
||||
```bash
|
||||
ls -1 .planning/phases/[phase-dir]/*-PLAN.md 2>/dev/null | wc -l
|
||||
ls -1 .planning/phases/[phase-dir]/*-SUMMARY.md 2>/dev/null | wc -l
|
||||
```
|
||||
|
||||
**Step 2: Route based on counts**
|
||||
|
||||
| Condition | Action |
|
||||
|-----------|--------|
|
||||
| summaries < plans | More plans remain → Route A |
|
||||
| summaries = plans | Phase complete → Check milestone (Step 3) |
|
||||
|
||||
---
|
||||
|
||||
**Route A: More plans remain in phase**
|
||||
|
||||
Find next PLAN.md without matching SUMMARY.md. Present:
|
||||
|
||||
```
|
||||
Plan {phase}-{plan} complete.
|
||||
Summary: .planning/phases/{phase-dir}/{phase}-{plan}-SUMMARY.md
|
||||
|
||||
{Y} of {X} plans complete for Phase {Z}.
|
||||
|
||||
---
|
||||
|
||||
## ▶ Next Up
|
||||
|
||||
**{phase}-{next-plan}: [Plan Name]** — [objective from PLAN.md]
|
||||
|
||||
`/gsd:execute-plan .planning/phases/{phase-dir}/{phase}-{next-plan}-PLAN.md`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
---
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Step 3: Check milestone status (only when phase complete)**
|
||||
|
||||
Read ROADMAP.md. Find current phase number and highest phase in milestone.
|
||||
|
||||
| Condition | Action |
|
||||
|-----------|--------|
|
||||
| current < highest | More phases → Route B |
|
||||
| current = highest | Milestone complete → Route C |
|
||||
|
||||
---
|
||||
|
||||
**Route B: Phase complete, more phases remain**
|
||||
|
||||
```
|
||||
## ✓ Phase {Z}: {Name} Complete
|
||||
|
||||
All {Y} plans finished.
|
||||
|
||||
---
|
||||
|
||||
## ▶ Next Up
|
||||
|
||||
**Phase {Z+1}: {Name}** — {Goal from ROADMAP.md}
|
||||
|
||||
`/gsd:plan-phase {Z+1}`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
---
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Route C: Milestone complete**
|
||||
|
||||
```
|
||||
🎉 MILESTONE COMPLETE!
|
||||
|
||||
## ✓ Phase {Z}: {Name} Complete
|
||||
|
||||
All {N} phases finished.
|
||||
|
||||
---
|
||||
|
||||
## ▶ Next Up
|
||||
|
||||
`/gsd:complete-milestone`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
---
|
||||
```
|
||||
</offer_next>
|
||||
|
||||
<checkpoint_handling>
|
||||
When subagent returns with checkpoint:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user