<purpose>

Switch the active milestone in parallel mode. Pure pointer flip on root `.planning/STATE.md` `current_milestone:` field. No file moves; no scaffolding; no commits required (unless `commit_docs: true`).

Phase 66-01 (v1.5.9 Parallel Milestone Organization) ships this command end-to-end:
- Atomic helper `setCurrentMilestone(cwd, slug)` in `bin/lib/state.cjs`
- gmd-tools subcommand `state set-current-milestone <slug>`
- Slash-command shim at `C:/Users/Christopher/.claude/commands/gmd/switch-milestone.md`
- 4-tier active-milestone resolver in `bin/lib/active-milestone.js` consumes the pointer at tier 2

</purpose>

<required_reading>

Read all files referenced by the invoking prompt's execution_context before starting.

</required_reading>

<process>

## 0. Validate Mode + Slug Existence

Read `.planning/config.json::organizational_mode`. If absent or set to `"sequential"`, refuse:

```
Error: /gmd:switch-milestone requires parallel mode.
Current mode: <sequential|absent>.
Run /gmd:migrate-to-parallel to switch organizational modes (Phase 68 work).
```

Validate `<slug>` exists at `.planning/milestones/<slug>/`. If not:

```
Error: milestone slug '<slug>' not found under .planning/milestones/.
Run /gmd:list-milestones to see available slugs (Phase 67 work).
```

## 1. Read Current Pointer + Slug Validation

Read root `.planning/STATE.md` frontmatter. Note the current `current_milestone:` value (may be null on first switch). Validate `<slug>` is kebab-case via `bin/lib/scaffold-parallel.js::validateKebabSlug` — `bin/lib/state.cjs::setCurrentMilestone` delegates to this validator (same error-message shape as `/gmd:new-milestone` and `/gmd:new-project` Step 3.6).

## 2. Atomic Pointer Flip

Invoke the gmd-tools subcommand:

```bash
node bin/gmd-tools.cjs state set-current-milestone <slug>
```

This routes to `bin/lib/state.cjs::setCurrentMilestone(cwd, slug)`, which performs a single-payload `fs.writeFileSync` on root `STATE.md` (atomicity mirrors `bin/lib/planning-config.js::setOrganizationalMode` from Phase 65-01 MODE-05). Only the TOP frontmatter block is mutated; downstream shipped-milestone retrospective archive blocks are preserved untouched (STATE-01 authority boundary preview).

## 3. Report Next Action

Read per-milestone `.planning/milestones/<slug>/STATE.md`:
- `current_phase:` frontmatter field → use for "Current phase: N"
- Most recent `last_activity:` line + presence of `phases/<N>-*/.../*-PLAN.md` vs `*-SUMMARY.md` → derive next action ("plan-phase" if no PLAN.md for current phase, else "execute-phase")

Print single-line summary:

```
Switched to <slug>. Current phase: <N>. Next: /gmd:<plan-phase|execute-phase> <N>
```

If the per-milestone STATE.md is missing or has no `current_phase` field (a freshly-scaffolded milestone awaiting its first phase), print:

```
Switched to <slug>. No current phase yet. Next: /gmd:plan-phase 01
```

## 4. Commit (no-op if commit_docs: false)

If `.planning/config.json::commit_docs === true`:

```bash
git add .planning/STATE.md && git commit -m "chore: switch active milestone to <slug>"
```

If `commit_docs: false` (the GMD default), skip the commit. The pointer flip is durable on disk; users commit at their own cadence.

</process>

<carryforward>

DEFER-65-01 (per Phase 65 VERIFICATION carry-forward #3): this workflow does NOT add new templates. The slash-command shim at `C:/Users/Christopher/.claude/commands/gmd/switch-milestone.md` is the only new authoring surface beyond the `workflows/` file. Per-plan `cp + diff -q + git add -f` discipline holds; no SCOPES extension needed (Phase 69 DOC-01 work).

</carryforward>
