---
name: gmd:migrate-to-parallel
description: Migrate .planning/ from sequential -> parallel organizational mode (interactive; single migration commit)
argument-hint: "<first-milestone-slug> [--dry-run] [--yes] [--all-milestone | --all-project]"
allowed-tools:
  - Read
  - Write
  - Bash
  - AskUserQuestion
---
<objective>
Migrate `.planning/` from sequential to parallel organizational mode. Validates preconditions (clean working tree + sequential source + ≤1 milestone In Progress + valid kebab-case slug), runs interactive D7 research-file disposition (or accepts `--all-milestone` / `--all-project` bulk-override), commits as ONE single atomic migration commit.

`--dry-run` flag prints the planned operations report and exits with `EXIT_DRYRUN=10` sentinel without executing any file moves.

**Reads:** `.planning/config.json`, `.planning/MILESTONES.md`, `.planning/STATE.md`, `.planning/research/*`, `.planning/PROJECT.md`, `templates/milestone-manifest.md`.

**Writes (on success):** Single atomic commit moving the 4 root planning artifacts + rewriting PROJECT.md to umbrella shape + flipping config.json + initializing root STATE.md `current_milestone:` pointer + scaffolding `.planning/milestones/<slug>/MILESTONE.md`.

**Refuses (fail-loud, exit 1):** Dirty working tree / already parallel / >1 milestones In Progress / invalid kebab-case slug / `--yes` with research files but no `--all-milestone` or `--all-project` / `--all-milestone` + `--all-project` (mutual exclusivity).
</objective>

<execution_context>
@C:/Users/Christopher/.claude/workflows/migrate-to-parallel.md
</execution_context>

<context>
Positional argument: `<first-milestone-slug>` (kebab-case; rejects reserved `_archive` / `_inbox`).

Flags:
- `--dry-run` — print planned operations to stdout, exit `EXIT_DRYRUN=10`, ZERO file moves
- `--yes` — skip confirmation prompt (must combine with `--all-milestone` OR `--all-project` if research files present)
- `--all-milestone` — bulk-classify all `.planning/research/*` as milestone-specific (moves under `milestones/<slug>/research/`)
- `--all-project` — bulk-classify all `.planning/research/*` as project-level (stays at `.planning/research/`)
- `--all-milestone` and `--all-project` are mutually exclusive

Single-commit atomicity contract (REQUIREMENTS line 91 + 68-CONTEXT.md Area 1 MC-A):
- All file moves + PROJECT.md rewrite + MILESTONES.md rewrite + config flip + STATE.md init + MILESTONE.md scaffold land in ONE commit
- Commit subject LOCKED: `migrate(parallel): v1.5.9 .planning/ organization → parallel`
- On mid-step failure: scoped rollback via `git reset --hard HEAD && git clean -fd <touched-paths>` (NOT global)
</context>

<process>
Execute the migrate-to-parallel workflow from @C:/Users/Christopher/.claude/workflows/migrate-to-parallel.md end-to-end.

Preserve all workflow gates:
- Step 0 mode-load + slug arg capture
- Step 1 dry-run internal validation (surfaces refusals BEFORE prompts)
- Step 2 planned-operations report display
- Step 3 D7 interactive disposition (skip if bulk-override or --yes refused)
- Step 4 `[y/N]` confirmation (skip if --yes)
- Step 5 atomic execution via `node bin/gmd-tools.cjs migrate-to-parallel <slug> <resolved-flags>`
- Step 6 result report + next-action recommendation

LOCKED refusal messages are emitted by the library (byte-for-byte test-asserted); surface them verbatim, never paraphrase.

ZERO `--no-verify` bypasses. Migration commit lands through the pre-commit hook (TD-07 + HF-02 mirror byte-identity enforcement). If the hook fails, executeMigration throws → scoped rollback restores tree.
</process>
