If no arguments provided:
ERROR: Phase description required
Usage: /gsd-add-phase <description>
Example: /gsd-add-phase Add authentication system
Exit.
INIT=$(gsd-sdk query init.phase-op "0")
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
Check roadmap_exists from init JSON. If false:
ERROR: No roadmap found (.planning/ROADMAP.md)
Run /gsd-new-project to initialize.
Exit.
RESULT=$(gsd-sdk query phase.add "${description}")
The CLI handles:
- Finding the highest existing integer phase number
- Calculating next phase number (max + 1)
- Generating slug from description
- Creating the phase directory (
.planning/phases/{NN}-{slug}/) - Inserting the phase entry into ROADMAP.md with Goal, Depends on, and Plans sections
Extract from result: phase_number, padded, name, slug, directory.
- Read
.planning/STATE.md - Under "## Accumulated Context" → "### Roadmap Evolution" add entry:
- Phase {N} added: {description}
If "Roadmap Evolution" section doesn't exist, create it.
Phase {N} added to current milestone:
- Description: {description}
- Directory: .planning/phases/{phase-num}-{slug}/
- Status: Not planned yet
Roadmap updated: .planning/ROADMAP.md
---
## ▶ Next Up — [${PROJECT_CODE}] ${PROJECT_TITLE}
**Phase {N}: {description}**
`/clear` then:
`/gsd-plan-phase {N}`
---
**Also available:**
- `/gsd-add-phase <description>` — add another phase
- Review roadmap
---