Parse --path <dir> from $ARGUMENTS (default: .planning/).
Detect XML files:
ls "$PLANNING_DIR"/*.xml 2>/dev/nullIf none found, report:
No XML files found in <path> — nothing to migrate.Show migration plan:
Migration plan for .planning/ STATE.xml → STATE.md ROADMAP.xml → ROADMAP.md TASK-REGISTRY.xml → (merged into STATE.md performance metrics) REQUIREMENTS.xml → REQUIREMENTS.md Archive: .planning/archive/xml/Confirm before proceeding.
Migrate STATE.xml → STATE.md: Read the XML, extract key fields:
<current-phase>→## Current Position<milestone>→ milestone header<completed-phases>→ completed phase list<active-issues>→ open issues section<performance-metrics>→ metrics table
Write
STATE.mdfollowing the GAD state template format.Migrate ROADMAP.xml → ROADMAP.md: Read
<phase id>,<title>,<status>,<description>elements. WriteROADMAP.mdas a Markdown checklist:# Roadmap ## Milestone N: <name> - [x] **Phase 1: <title>** — <description> - [ ] **Phase 2: <title>** — <description>Migrate TASK-REGISTRY.xml → STATE.md metrics section: Merge task rows into the
## Performance Metricssection of STATE.md.Migrate REQUIREMENTS.xml → REQUIREMENTS.md: Convert requirement nodes to Markdown sections.
Archive originals:
mkdir -p "$PLANNING_DIR/archive/xml" mv "$PLANNING_DIR"/*.xml "$PLANNING_DIR/archive/xml/"Summary:
✓ Migration complete — .planning/ Created: STATE.md, ROADMAP.md, REQUIREMENTS.md Archived: STATE.xml, ROADMAP.xml, TASK-REGISTRY.xml, REQUIREMENTS.xml → .planning/archive/xml/ Review the migrated files before committing.