/spwf:migrate-todofrom spwf
Cross-cutting — Audit a todo file, folder, or all of todo/ and bring legacy files into the SPWorkflow convention. Files with compliant frontmatter (source, created, status) are skipped. Legacy files get normalised frontmatter; files marked complete are moved to todo/_done/. Mirrors doc-lint's flag pattern — default reports only, --fix is interactive, --auto-fix applies safe transforms in batch. Pair with /spwf:close which moves completed todos to _done/ prospectively; this skill catches the retroactive backlog.
Ships in spwf. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Audit todo/ (or a scoped subset) and bring legacy files into the
SPWorkflow convention. Compliant files are skipped silently; partial or
legacy files get normalised frontmatter; completed files move to
todo/_done/.
This skill complements /spwf:close — close moves completed todos
prospectively when a change is wrapped up; migrate-todo catches the
retroactive backlog. It also complements /spwf:spec: spec converts
ideation → active OpenSpec; migrate-todo just normalises the file. It
does not fabricate OpenSpec archive entries for legacy completed
work.
# Report only — list classifications, no changes
/spwf:migrate-todo
# Interactive fix — walk each non-compliant file with confirmation
/spwf:migrate-todo --fix
# Auto-fix — apply safe transforms in batch; status: still asked per file
/spwf:migrate-todo --auto-fix
# Quick check — frontmatter only; no _done/ moves
/spwf:migrate-todo --quick
# Scoped to a single file or directory
/spwf:migrate-todo todo/some-file.md
/spwf:migrate-todo legacy-imports/
Read $ARGUMENTS. Strip recognised flags (--fix, --auto-fix,
--quick) and treat anything else as a path:
| Path | Files to consider |
|---|---|
| Empty | todo/*.md (top-level only) |
File path ending .md | The single file |
| Directory path | *.md files at that directory's top level (no recursion) |
Always exclude:
todo/_done/ and any subdirectory.md files (PDFs, archives, design docs that aren't workflow todos)openspec/ or .git/If no .md files match, report "No files in scope." and exit cleanly.
For each file, parse the leading YAML frontmatter block — not by
grepping the whole file. The naive grep ^status: pattern matches body
content like Marketplace_setup.md line 377, which contains
status: ideation in prose.
Block-scoped extraction:
# Extract lines between the first two `---` markers
awk '/^---$/{c++; next} c==1' {file}
Then parse the extracted block as YAML. If parsing fails (no opening
---, no closing ---, malformed YAML inside) → classify as
Malformed (see Step 3).
Required keys: source, created, status. Read their values for
classification.
| Class | Detection | Action driver |
|---|---|---|
| Compliant active | All three required keys present; status != complete | Skip; report ✓ line |
| Compliant complete | All three required keys present; status == complete | Offer to move to todo/_done/ (retroactive case) |
| Partial frontmatter | Frontmatter block exists; missing one or two required keys | Fill missing fields per mode rules |
| No frontmatter | No leading --- block at all | Synthesise full frontmatter per mode rules |
| Malformed frontmatter | Opening --- present but closing missing, or YAML invalid | Report and halt for that file. Do not auto-repair. |
| Looks like a non-todo | No frontmatter AND body opens with reference-doc shape (no ## Context / ## What we know / ## Open questions style headings; reads as an article, design doc, or external import) | Prompt: "This looks like a reference doc, not a workflow todo. Migrate anyway? [y/N]" — default no |
When a field needs filling and the user hasn't provided it:
| Field | Inference (--auto-fix) | Interactive (--fix) |
|---|---|---|
source: | scratch | Ask: "Source for this todo? scratch / jira / youtrack / slack / file (default: scratch)" |
created: | git log --diff-filter=A --format=%ai -- {file} (first commit). Fallback: filesystem mtime via stat -c %y {file} (or stat -f %SB on macOS). Format as YYYY-MM-DD. | Same inference; show the inferred value and confirm |
status: | Never auto-infer. Always prompt. | Ask: "Status for this todo? ideation / analysis / challenged / split / complete / in-progress" |
The asymmetry on status: is deliberate. The difference between
complete and ideation decides whether the file moves to _done/ —
too consequential for --auto-fix to decide silently.
Report only. Do not modify any file. The output is a summary table classifying every file in scope.
--fix modeFor each non-compliant file:
--auto-fix would default to scratch).[Y/n/skip] to apply, decline, or skip without comment.Y: apply via Edit (insert frontmatter at top of file, or replace
existing block).Move to todo/_done/{filename}? [Y/n].--auto-fix modeFor each non-compliant file:
source: scratch,
created from git log)._done/ without prompting.--quick modeFrontmatter check only. Skip the _done/ move action even when a file is
compliant-complete. Useful when triaging without committing to file
moves.
todo/_done/)Only fires for files that have or have-just-acquired status: complete.
mkdir -p todo/_done
git mv todo/{filename} todo/_done/{filename}
Collision check before the move: if todo/_done/{filename} already
exists, halt for that file with:
"Collision:
todo/_done/{filename}already exists. Resolve manually (rename or delete the older file) and re-run /spwf:migrate-todo."
Never overwrite. Continue with other files.
If the file is not tracked by git (git ls-files --error-unmatch {file}
fails), fall back to plain mv and warn that the move isn't recorded in
git history.
## Migrate-todo audit — {scope path}
Compliant (skipped): {N}
✓ todo/{file} (source: {x}, status: {y})
...
Partial frontmatter: {N}
⚠ todo/{file} missing: {keys}
No frontmatter: {N}
⚠ todo/{file} legacy
Malformed: {N}
✗ todo/{file} {reason}
Looks like non-todo: {N}
? todo/{file} reference-doc shape — confirm to migrate
Compliant complete (retroactive _done/ move available): {N}
• todo/{file}
Run with --fix for interactive remediation, --auto-fix for batch (status:
still asked per file), or --quick to check frontmatter without moving
files.
Per-file outcome lines as the skill works:
✓ todo/{file} already compliant
+ todo/{file} filled missing source: scratch
+ todo/{file} filled missing created: 2026-04-25
+ todo/{file} set status: complete (user-provided)
→ todo/{file} moved to todo/_done/{file}
✗ todo/{file} collision in _done/, skipped
- todo/{file} user declined migration
Final summary at the end:
## Migrate-todo summary
{N} files scanned
{N} skipped (compliant)
{N} normalised (frontmatter)
{N} moved to _done/
{N} skipped (declined or collision)
{N} halted (malformed)
After non-trivial changes (any normalisation or move), suggest a commit without auto-running it:
git status --short
git add todo/
git commit -m "chore: migrate-todo — {N} normalised, {N} moved to _done/"
User confirms before commit. Mirrors the workflow's "no surprise commits" discipline.
Re-running on already-compliant files is a no-op. The classification
phase is read-only; the only writes happen inside --fix / --auto-fix
when a file is non-compliant.
Specifically:
✓ compliant and nothing else.todo/_done/ is excluded from scope by the glob._done/ action checks the destination doesn't exist
before moving; never overwrites.--auto-fix produces zero diffs the second time./spwf:spec manually on the now-normalised
todo file.--rename flag could be
added if usage demands it.status: vocabulary. Real values include ideation,
analysis, challenged, split, complete, in-progress. All
non-complete values are treated as "active, skip-the-move". Vocabulary
policing belongs in workflow-lint if anywhere.todo/_done/ file.status: — always interactive.todo/_done/ or any subdirectory..md files in scope.todo-frontmatter-check.sh hook (it fires non-blocking
warnings during normalisation; expected and harmless).What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
38 skills in this plugin
/address-reviewPhase 6.5 — Address Review. Turn review feedback into action. Sources feedback from either a local report file (e.g. {branch}-review.md from /spwf:pr-review or {branch}-self-review.md from /spwf:simplify) or fetched human comments on an open PR/MR. For each item runs READ → VERIFY → EVALUATE → implement-or-push-back, in priority order (blocking → important → nit). Forbids performative agreement ("you're absolutely right"). Use after pr-review, or whenever a reviewer leaves comments./agent-optimiseCross-cutting — Audit both the project .claude/ and personal ~/.claude/ for quality issues. Covers CLAUDE.md scope and length, agent descriptions, skill frontmatter, and settings.json conflicts. Always audits both scopes. Produces a prioritised P1/P2/P3 fix list./npx claudepluginhub simon-potter/spwf --plugin spwf