-
-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
When /mgw:project initializes a new milestone, it writes .planning/ROADMAP.md directly but does not create .planning/STATE.md and does not archive existing phase directories. This leaves GSD workflows in a broken state — STATE.md is required by every GSD workflow (progress, plan, execute, resume) and the stale phase directories cause the roadmap analyzer to mismap completed work.
Current Behavior
Running /mgw:project to create a new milestone roadmap:
- Writes
.planning/ROADMAP.mdwith new phases — correct - Writes
.mgw/project.jsonfor MGW state — correct - Does NOT create
.planning/STATE.md— GSD workflows break - Does NOT archive old
.planning/phases/*/— roadmap analyzer maps stale directories to new phases by number - Does NOT create/update
.planning/MILESTONES.md— no milestone history
Observed Symptoms
/gsd:healthreports BROKEN status (E004: STATE.md not found)/gsd:progressshows 100% complete (8/8 plans) — mapping OLD phase directories to NEW roadmap entries- Phase names don't match: disk has
01-shared-workflow-hardeningbut roadmap Phase 1 is "Community Files" - All GSD workflows that read STATE.md on init will fail or produce incorrect routing
Expected Behavior
When /mgw:project creates a new milestone roadmap, it must also:
- Create
.planning/STATE.mdfrom the GSD template, initialized to "Phase 1 ready to plan" - Archive old phase directories to
.planning/ARCHIVED-phases-{old-milestone}/(or defer to/gsd:complete-milestone) - Create/update
.planning/MILESTONES.mdto track the transition
Root Cause
commands/project.md (the /mgw:project skill definition) has a "CRITICAL BOUNDARY (PROJ-05)" that intentionally stops after writing ROADMAP.md. The design rationale was "fast and deterministic" — but it crosses the GSD boundary by writing ROADMAP.md without maintaining the rest of GSD's state contract.
The GSD new-project workflow expects a roadmapper agent to create ROADMAP.md + STATE.md + REQUIREMENTS.md together as a unit. /mgw:project bypasses the roadmapper and only creates one of the three required files.
Architecture Constraint
MGW must not block GSD workflows. MGW is an orchestration layer that sits on top of GSD. It should either:
- Option A: Delegate roadmap creation to GSD's roadmapper agent (which handles the full state lifecycle)
- Option B: Create all required GSD state files when it writes ROADMAP.md directly
- Option C: Call
/gsd:health --repairafter writing ROADMAP.md to regenerate missing state
The key principle: after any MGW operation, GSD workflows must work correctly. If MGW touches .planning/, it owns the responsibility of leaving it in a valid state.
Affected Files
| File | Role | Status |
|---|---|---|
commands/project.md |
Skill definition for /mgw:project |
Writes ROADMAP.md only |
lib/gsd.cjs |
Bridge to GSD tools | Has invokeGsdTool() but not used for state creation |
lib/state.cjs |
MGW's own .mgw/ state |
Works correctly for MGW state |
Immediate Fix Needed
For the current broken state:
- Archive
01-shared-workflow-hardening/,02-template-engine/,03-project-initialization/,05-standalone-tools/to.planning/ARCHIVED-phases-internal-dev/ - Create
.planning/STATE.mdfrom template, pointing at Phase 1 of current roadmap - Ensure
/gsd:healthreports HEALTHY
Long-term Fix
Modify /mgw:project to maintain the full GSD state contract when writing ROADMAP.md. This means either spawning the roadmapper or explicitly creating STATE.md alongside ROADMAP.md using lib/gsd.cjs.
Reproduction
# In any repo with existing .planning/ phases
/mgw:project # Creates new ROADMAP.md
/gsd:health # Reports BROKEN - STATE.md missing
/gsd:progress # Shows incorrect completion mapping