Turbo migrate-turboplans
Migrate legacy plan and shell files in .turbo/ to the current layout. Splits legacy artifacts between .turbo/shells/ (unexpanded shells, needs /expand-shell) and .turbo/plans/ (expanded plans and standalone plans), backfills minimal frontmatter, and deletes legacy prompt-plan indexes. Use when the user asks to \"migrate turboplans\", \"migrate turbo plans\", \"upgrade plan format\", \"add frontmatter to plans\", or \"convert old plans\".
git clone https://github.com/tobihagemann/turbo
T=$(mktemp -d) && git clone --depth=1 https://github.com/tobihagemann/turbo "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/migrate-turboplans" ~/.claude/skills/tobihagemann-turbo-migrate-turboplans && rm -rf "$T"
skills/migrate-turboplans/SKILL.mdMigrate Plans
Current layout: unexpanded shells live in
.turbo/shells/ with spec: and depends_on: frontmatter. Plans live in .turbo/plans/ with status: (required) and optional spec: for provenance. This skill migrates legacy shapes to that layout.
Task Tracking
Use
TaskCreate to create a task for each step:
- Scan and classify existing files
- Migrate prompt plan indexes
- Process remaining files in
.turbo/plans/ - Normalize frontmatter on remaining plans
- Clean up and report
Step 1: Scan and Classify Existing Files
Scan for all legacy shapes:
- Prompt plan indexes — Glob
. Also check for.turbo/prompt-plans/*.md
(oldest legacy format). Parse each index to determine whether prompts are inline (contain.turbo/prompts.md
sections with code blocks) or reference separate shell files (contain### Prompt
fields). Record the set of shell files each index references — Step 3 will skip these.**Shell:** - Files in
— Read each file's first 20 lines and classify:.turbo/plans/*.md- Unexpanded shell — has legacy
frontmatter AND does not containtype: shell
, OR has no frontmatter but contains## Pattern Survey
,## Produces
, and## Consumes
without## Covers Spec Requirements
. Target:## Pattern Survey
..turbo/shells/<filename> - Expanded plan — contains
(with or without## Pattern Survey
marker, with or without legacy<!-- Expanded from:
). Target: stays intype: shell
, frontmatter normalized..turbo/plans/ - Regular plan — no frontmatter or legacy
frontmatter, not shell-shaped, notype: plan
. Target: stays in## Pattern Survey
, frontmatter normalized..turbo/plans/ - Already-current plan — has frontmatter with
and nostatus:
. Skip.type:
- Unexpanded shell — has legacy
- Files in
— if they already have current frontmatter (no.turbo/shells/*.md
, notype:
, juststatus:
andspec:
), they're migrated. Otherwise, queue for normalization in Step 3.depends_on:
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. If nothing needs migration, report and stop.
Step 2: Migrate Prompt Plan Indexes
For each prompt plan index (including
.turbo/prompts.md if present), parse:
- Source — spec path from the
fieldSource: - Prompts — each
entry with its Status, Depends on, and content## Prompt N:
Inline Prompts (Old Format)
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/.
For each prompt entry:
- Generate a slug:
from the spec filename and prompt number/title<spec-slug>-NN-<title-slug> - If
already exists with current frontmatter, skip this entry (collision).turbo/plans/<slug>.md - Map the legacy status to a plan
:status
→done
,done
→pending
,ready
→in-progressready - Write a plan at
:.turbo/plans/<slug>.md
--- status: <mapped status> spec: <source spec path> --- # Plan: <Prompt Title> ## Context <The prompt's **Context** field content. If absent, use "Migrated from legacy prompt plan."> ## Implementation Steps 1. **Execute prompt instructions** - <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.> ## Verification - Verify the implementation matches the prompt's requirements - Run any test commands mentioned in the prompt
Shell-Based Prompt Plans (Newer Format)
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:
- Read the referenced file at its original path. If missing, report the mismatch and skip
- Classify as unexpanded (no
) or expanded (has## Pattern Survey
)## Pattern Survey - Determine target:
- Unexpanded →
, frontmatter carries.turbo/shells/<filename>
andspec:depends_on: - Expanded →
, frontmatter carries.turbo/plans/<filename>
andstatus:spec:
- Unexpanded →
- Build frontmatter:
from the index's Source fieldspec- For unexpanded only:
mapped from the index entry's Depends on field, converting prompt numbers to shell file slugsdepends_on - For expanded only:
mapped from the index entry's Status field (status
→done
,done
→pending
,ready
→in-progress
)ready
- If the target already exists with current frontmatter, skip
- Write the file to the target path with the new frontmatter prepended before the existing
heading (replacing any legacy frontmatter). Delete the original at# Plan:
..turbo/plans/<filename>
Step 3: Process Remaining Files in .turbo/plans/
.turbo/plans/Handles files in
.turbo/plans/ that were not recorded in Step 1 as referenced by a prompt-plan index. Skip index-referenced files even if Step 2 couldn't process them (missing source, collision, target-already-current) — they belong to Step 2's accounting and should not be reprocessed here as unexpanded shells.
For each unexpanded shell:
- Build frontmatter:
inferred from the spec slug embedded in the filename (spec:
) when a matching<spec-slug>-NN-<title>.md
exists (otherwise omit),.turbo/specs/<spec-slug>.mddepends_on: [] - Write to
with the new frontmatter prepended before the.turbo/shells/<filename>
heading (replacing any legacy frontmatter)# Plan: - Delete the original at
.turbo/plans/<filename>
For each expanded plan:
- Build frontmatter:
(default), orstatus: ready
if legacy frontmatter hadstatus: done
, plusstatus: done
inferred from the filename when a matching spec existsspec: - Rewrite the file in place with the normalized frontmatter (dropping legacy
,type:
, and any other fields)depends_on:
For each file in
.turbo/shells/*.md that needs normalization (queued from Step 1):
- Keep
andspec:
if present, synthesize defaults if not (depends_on:
)depends_on: [] - Drop any legacy
ortype:
fieldsstatus: - Rewrite the file in place with the normalized frontmatter
Create
.turbo/shells/ if it does not exist. If a file at a shell target path already exists, report the collision and skip.
Step 4: Normalize Frontmatter on Remaining Plans
For regular plans in
.turbo/plans/ that were not handled by Steps 2 or 3:
- If the file has no frontmatter, prepend
(plans without frontmatter predate the convention and have already been implemented)status: done - If the file has legacy
frontmatter, droptype: plan
and normalizetype:
tostatus:
if alreadydone
, otherwisedone
. If noready
is present, setstatus:
.status: done
The
status: done default here differs from Step 3's ready default for expanded plans. Reasoning: regular plans without frontmatter are old enough that they're assumed implemented; expanded plans may have been expanded but never implemented, so ready is the safer default.
Step 5: Clean Up and Report
After all files are migrated:
- Delete
(the index files are no longer needed).turbo/prompt-plans/ - Delete
if it exists (oldest legacy format).turbo/prompts.md
Report a summary:
- Number of inline prompts converted to plans under
.turbo/plans/ - Number of shells migrated from prompt-plan indexes to
.turbo/shells/ - Number of expanded plans migrated from prompt-plan indexes to
.turbo/plans/ - Number of unexpanded shells relocated from
to.turbo/plans/.turbo/shells/ - Number of expanded plans normalized in place in
.turbo/plans/ - Number of shells normalized in place in
.turbo/shells/ - Number of regular plans that received frontmatter
- Number of files already migrated (skipped)
- Files deleted (indexes and relocated source files)
Rules
- Never modify the spec files in
..turbo/specs/ - Never overwrite a file that already exists at the target path with valid current frontmatter.
- Preserve all existing body content when adding or normalizing frontmatter. The migration is additive, structural (directory moves), and subtractive (legacy index deletion), never content-destructive.
- If a shell file referenced by an index does not exist, report the mismatch and skip that entry.
- If the source spec path in an index does not resolve, still migrate the files but note the missing spec in the report.
- Never write
into any migrated file. The directory is the type signal.type: - Never write
into a plan. The dependency graph lives on shells only.depends_on: - The migration never produces
because legacy artifacts predate the draft concept and cannot retroactively go through refinement;status: draft
is the baseline for migrated expanded plans.ready