$npx -y skills add tobihagemann/turbo --skill migrate-turbo-filesMigrate legacy files in .turbo/ to current formats. Covers plans and shells (layout split, frontmatter normalization, prompt-plan index cleanup) and improvements.md (legacy trivial/standard Type values rewritten to direct/plan). Use when the user asks to \"migrate turbo f
| 1 | # Migrate Turbo Files |
| 2 | |
| 3 | Current layouts: |
| 4 | |
| 5 | - Unexpanded shells live in `.turbo/shells/` with `spec:` and `depends_on:` frontmatter. |
| 6 | - Plans live in `.turbo/plans/` with `status:` (required) and optional `spec:` for provenance. |
| 7 | - `.turbo/improvements.md` entries use Type values `direct`, `investigate`, or `plan`. Legacy values `trivial` and `standard` map to `direct` and `plan` respectively. |
| 8 | |
| 9 | This skill migrates legacy shapes to those layouts. |
| 10 | |
| 11 | ## Task Tracking |
| 12 | |
| 13 | Use `TaskCreate` to create a task for each step: |
| 14 | |
| 15 | 1. Scan and classify existing files |
| 16 | 2. Migrate prompt plan indexes |
| 17 | 3. Process remaining files in `.turbo/plans/` |
| 18 | 4. Normalize frontmatter on remaining plans |
| 19 | 5. Migrate `improvements.md` Type values |
| 20 | 6. Clean up and report |
| 21 | |
| 22 | ## Step 1: Scan and Classify Existing Files |
| 23 | |
| 24 | Scan for all legacy shapes: |
| 25 | |
| 26 | - **Prompt plan indexes** — Glob `.turbo/prompt-plans/*.md`. Also check for `.turbo/prompts.md` (oldest legacy format). Parse each index to determine whether prompts are inline (contain `### Prompt` sections with code blocks) or reference separate shell files (contain `**Shell:**` fields). Record the set of shell files each index references — Step 3 will skip these. |
| 27 | - **Files in `.turbo/plans/*.md`** — Read each file's first 20 lines and classify: |
| 28 | - **Unexpanded shell** — has legacy `type: shell` frontmatter AND does not contain `## Pattern Survey`, OR has no frontmatter but contains `## Produces`, `## Consumes`, and `## Covers Spec Requirements` without `## Pattern Survey`. Target: `.turbo/shells/<filename>`. |
| 29 | - **Expanded plan** — contains `## Pattern Survey` (with or without `<!-- Expanded from:` marker, with or without legacy `type: shell`). Target: stays in `.turbo/plans/`, frontmatter normalized. |
| 30 | - **Regular plan** — no frontmatter or legacy `type: plan` frontmatter, not shell-shaped, no `## Pattern Survey`. Target: stays in `.turbo/plans/`, frontmatter normalized. |
| 31 | - **Already-current plan** — has frontmatter with `status:` and no `type:`. Skip. |
| 32 | - **Files in `.turbo/shells/*.md`** — if they already have current frontmatter (no `type:`, no `status:`, just `spec:` and `depends_on:`), they're migrated. Otherwise, queue for normalization in Step 3. |
| 33 | - **`.turbo/improvements.md`** — read the file if it exists. Count entries whose `- **Type**:` line carries the legacy values `trivial` or `standard`. Queue these for rewriting in Step 5. |
| 34 | |
| 35 | Report what was found: number of indexes, unexpanded shells in `.turbo/plans/`, expanded plans in `.turbo/plans/`, regular plans, already-current plans, already-current shells, and improvements entries with legacy Type values. If nothing needs migration, report and stop. |
| 36 | |
| 37 | ## Step 2: Migrate Prompt Plan Indexes |
| 38 | |
| 39 | For each prompt plan index (including `.turbo/prompts.md` if present), parse: |
| 40 | |
| 41 | - **Source** — spec path from the `Source:` field |
| 42 | - **Prompts** — each `## Prompt N:` entry with its Status, Depends on, and content |
| 43 | |
| 44 | ### Inline Prompts (Old Format) |
| 45 | |
| 46 | Indexes where each prompt contains a `### Prompt` section with a code block of concrete instructions. These are equivalent to expanded plans, so migrate them to `.turbo/plans/`. |
| 47 | |
| 48 | For each prompt entry: |
| 49 | |
| 50 | 1. Generate a slug: `<spec-slug>-NN-<title-slug>` from the spec filename and prompt number/title |
| 51 | 2. If `.turbo/plans/<slug>.md` already exists with current frontmatter, skip this entry (collision) |
| 52 | 3. Map the legacy status to a plan `status`: `done` → `done`, `pending` → `ready`, `in-progress` → `ready` |
| 53 | 4. Write a plan at `.turbo/plans/<slug>.md`: |
| 54 | |
| 55 | ````markdown |
| 56 | --- |
| 57 | status: <mapped status> |
| 58 | spec: <source spec path> |
| 59 | --- |
| 60 | |
| 61 | # Plan: <Prompt Title> |
| 62 | |
| 63 | ## Context |
| 64 | |
| 65 | <The prompt's **Context** field content. If absent, use "Migrated from legacy prompt plan."> |
| 66 | |
| 67 | ## Implementation Steps |
| 68 | |
| 69 | 1. **Execute prompt instructions** |
| 70 | - <The prompt's code block content, converted from a monolithic block into numbered sub-steps where natural boundaries exist. Preserve the concrete file references and instructions.> |
| 71 | |
| 72 | ## Verification |
| 73 | |
| 74 | - Verify the implementation matches the prompt's requirements |
| 75 | - Run any test commands mentioned in the prompt |
| 76 | ```` |
| 77 | |
| 78 | ### Shell-Based Prompt Plans (Newer Format) |
| 79 | |
| 80 | Indexes where each prompt references a separate shell file via a `**Shell:**` field. The referenced files may live in `.turbo/plans/` under the old layout. For each prompt entry: |
| 81 | |
| 82 | 1. Read the referenced file at its original path. If missing, report the mismatch and skip |
| 83 | 2. Classify as unexpanded (no `## Pattern Survey`) or expanded (has `## Pattern Survey`) |
| 84 | 3. Determi |