Skip to content

feat: orchestrate full GSD lifecycle in execute_gsd_milestone#53

Merged
snipcodeit merged 3 commits intomainfrom
issue/52-mgw-run-gsd-phase-dirs
Feb 27, 2026
Merged

feat: orchestrate full GSD lifecycle in execute_gsd_milestone#53
snipcodeit merged 3 commits intomainfrom
issue/52-mgw-run-gsd-phase-dirs

Conversation

@snipcodeit
Copy link
Owner

Summary

  • Rewrites execute_gsd_milestone step in commands/run.md with a concrete per-phase loop that discovers phases via roadmap analyze, creates .planning/phases/ directories via init plan-phase + init execute-phase, and spawns gsd-planner / gsd-executor / gsd-verifier agents per phase
  • Adds gsd:complete-milestone hook to commands/milestone.md post_loop (resolves EXECUTOR_MODEL before spawn, guarded by .planning/phases existence check)
  • Expands skeletal GSD Milestone Pipeline Pattern in workflows/gsd.md to full 6-step lifecycle documentation

Closes #52

Changes

commands/run.md

  • Replaced vague "spawn discuss + plan" prose in execute_gsd_milestone with concrete per-phase loop
  • Each phase: init plan-phasemkdir -pgsd-planner Task() → plan count guard → init execute-phasegsd-executor Task() → gsd-verifier Task() → phase comment post
  • Phase discovery via node gsd-tools.cjs roadmap analyze
  • All agent spawns include mandatory CLAUDE.md injection

commands/milestone.md

  • Added sub-step 3 to post_loop (between draft release and advance pointer)
  • Resolves EXECUTOR_MODEL via resolve-model gsd-executor before spawning agent
  • gsd-executor agent runs gsd:complete-milestone workflow to archive phase directories
  • Guarded by .planning/phases existence check (no-op if no phases exist)

.claude/commands/mgw/workflows/gsd.md

  • Expanded GSD Milestone Pipeline Pattern from 3-step skeleton to full 6-step lifecycle
  • Documents: phase discovery, per-phase init/plan/execute/verify, artifact listings, milestone completion
  • Updated Consumers table to include milestone.md

Test Plan

  • Run /mgw:run on an issue that routes to gsd:new-milestone — verify .planning/phases/ directories are created per ROADMAP phase
  • Run /mgw:milestone completion flow — verify gsd:complete-milestone hook fires and archives phase directories
  • Verify gsd:progress shows correct phase state after milestone execution
  • Confirm model resolution (resolve-model gsd-executor) resolves correctly in milestone.md context

Verification

5/5 must-haves verified:

  1. execute_gsd_milestone orchestrates full lifecycle (plan → execute → verify per phase)
  2. Phase directories created via init plan-phase + mkdir -p
  3. milestone.md calls gsd:complete-milestone via executor agent
  4. EXECUTOR_MODEL resolved before Task() spawn in milestone.md
  5. gsd.md documents full lifecycle pattern

Stephen Miller added 2 commits February 26, 2026 22:41
…lifecycle

- Add roadmap analyze to discover phases from ROADMAP.md
- Add init plan-phase per phase with mkdir -p for directory creation
- Spawn gsd-planner agents with plan-phase workflow reference
- Add init execute-phase before spawning gsd-executor agents
- Spawn gsd-verifier agents with verify-phase workflow reference
- Add plan count check after planning to guard against empty phases
- Preserve existing preamble (model resolution, milestone init, ROADMAP creation checkpoint)
…line pattern

- Add sub-step 3 in milestone.md post_loop to call gsd:complete-milestone
  when .planning/phases exists, with EXECUTOR_MODEL resolved via gsd-tools
  before Task() spawn; renumber former steps 3-5 to 4-6, former 6 to 7
- Expand GSD Milestone Pipeline Pattern in gsd.md from 3-step skeleton
  to full lifecycle with phase discovery, per-phase init/plan/execute/verify
  loop, explicit init execute-phase call, artifact listing per phase, and
  milestone completion artifacts
- Update gsd.md Consumers table to include milestone.md
@github-actions github-actions bot added the slash-commands Changes to slash command files label Feb 27, 2026
@snipcodeit
Copy link
Owner Author

Testing Procedures

Pre-requisites

  • A GitHub repo with MGW initialized (/mgw:init)
  • An issue that would route to gsd:new-milestone (large scope, multi-system)

Test 1: execute_gsd_milestone creates phase directories

  1. Create a large-scope issue (or use an existing one)
  2. Run /mgw:run <issue_number> — ensure it routes to gsd:new-milestone
  3. After ROADMAP.md creation, verify .planning/phases/ directories are created for each phase
  4. Verify each phase directory contains PLAN.md after planner completes
  5. Verify SUMMARY.md is created after executor completes

Test 2: milestone.md completion hook

  1. Complete all issues in a milestone via /mgw:milestone
  2. After the draft release step, verify gsd:complete-milestone hook fires
  3. Verify .planning/phases/ directories are archived to .planning/milestones/
  4. Verify gsd:progress routes correctly after cleanup

Test 3: Model resolution

  1. Verify EXECUTOR_MODEL is not empty when the complete-milestone Task() spawns
  2. Check gsd-tools responds to resolve-model gsd-executor --raw

Test 4: Regression — quick route unaffected

  1. Run /mgw:run on a small issue (routes to gsd:quick)
  2. Verify .planning/quick/ artifacts are created normally
  3. Verify no .planning/phases/ directories are created for quick tasks

init plan-phase returns phase_dir: null when the directory doesn't exist
yet, causing mkdir -p to silently fail. Use scaffold phase-dir first
(which creates the directory from ROADMAP data and returns the path),
then call init plan-phase for model resolution.

Found during mgw-test pipeline run (issue #91, PR #92).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@snipcodeit snipcodeit merged commit cd24ba2 into main Feb 27, 2026
1 check passed
@snipcodeit snipcodeit deleted the issue/52-mgw-run-gsd-phase-dirs branch February 27, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

slash-commands Changes to slash command files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mgw:run must create GSD phase directories when routing to gsd:new-milestone

1 participant