Skip to content
Skills Library
Programming · Conversion & formats

migrate-spec

/migrate-spec

Move one existing spec onto the SpecForge component library. Use when the user asks to "migrate <spec> to the component library", "put this spec on the new components", or "adopt the design system in <spec>". Runs the deterministic renames in code, reads the callouts that carry no type and assigns one to each, and leaves a migration report in the spec's store directory.

Repository
specforge ↗
Licence
MIT
Last repository change
23.09.2026

Assessment and security

95/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content30 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 23.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Move one existing spec onto the SpecForge component library. Use when the user asks to "migrate <spec> to the component library", "put this spec on the new components", or "adopt the design system in <spec>". Runs the deterministic renames in code, reads the callouts that carry no type and assigns one to each, and leaves a migration report in the spec's store directory.

Triggers from the description

migrate <spec> to the component libraryput this spec on the new componentsadopt the design system in <spec>
Original author description

Move one existing spec onto the SpecForge component library. Use when the user asks to "migrate <spec> to the component library", "put this spec on the new components", or "adopt the design system in <spec>". Runs the deterministic renames in code, reads the callouts that carry no type and assigns one to each, and leaves a migration report in the spec's store directory.

How it works

  1. 1. See what the codemod would do
  2. 2. Read the blocks that need a type
  3. 3. Apply
  4. 4. Check it
  5. 5. Report
Original SKILL.md headings · 113 lines, 819 words
SKILL.md preview
---
name: migrate-spec
user-invocable: true
description: |
  Move one existing spec onto the SpecForge component library. Use when the user
  asks to "migrate <spec> to the component library", "put this spec on the new
  components", or "adopt the design system in <spec>". Runs the deterministic
  renames in code, reads the callouts that carry no type and assigns one to each,
  and leaves a migration report in the spec's store directory.
allowed-tools: Read, Write, Bash, Grep
---

# migrate-spec

Migration is never automatic (design D5). It runs on one spec, because a person
asked for that spec.

`${CLAUDE_PLUGIN_ROOT}` below denotes the installed plugin directory. Claude and
Pi export it; Codex provides the exact value in SpecForge SessionStart context.
Substitute that value in every path and shell command. Specs live at
`~/.specforge/specs/<id>/spec.html`; you address them by **id**.

**Never paste what the user typed into a command.** A store id is 10 hex
characters. If what you were given is anything else, look the spec up first and
use the id that reports:

```
node "${CLAUDE_PLUGIN_ROOT}/lib/specforge-cli.mjs" listall
```

The CLI refuses an id outside `[A-Za-z0-9_-]`, but that check runs after the
shell has already parsed the line, so it is the second guard and not the first.

Two passes. The codemod is code, because a class rename is mechanical. Choosing
between `warning`, `assumption` and `risk` for a block requires reading it, and
that is your pass.

## 1. See what the codemod would do

```
node "${CLAUDE_PLUGIN_ROOT}/lib/specforge-cli.mjs" components migrate <id> --dry
```

Writes nothing. `codemod` lists the deterministic renames with counts;
`assignments` shows what the classifier would fall back to if you did nothing;
`conflicts` names any class the spec's own stylesheet redefines under a library
name, which is the one case where migrating changes how the spec looks.

**Stop and tell the user if `conflicts` is non-empty.** The spec's own rule wins
over the library's, so the block will render in the old style under a new name.
That is theirs to decide, not yours.

## 2. Read the blocks that need a type

```
node "${CLAUDE_PLUGIN_ROOT}/lib/specforge-cli.mjs" components migrate <id> --plan
```

Returns `{ id, blocks: [{ index, key, source, text }] }` — every callout the
codemod could not type. `source` is the legacy variant: `warn`, `good`, `bad`, or
`""` for a bare callout. `key` is a hash of the block's source and text, and is
how you name a block in step 3: it follows the block if the spec is edited
between the plan and the apply, and an assignment whose key matches nothing stops
the run rather than landing on the wrong block. If that happens, the spec moved
under you: re-run `--plan` and read the blocks again.

Assign a type to each from its text. Stay within the source's group: the tone is
part of what the original said, and moving a block from `good` to `risk` reverses
a claim its author made.

| Source | What the text says | Assign |
|---|---|---|
| `warn` | names a trigger and a consequence | `risk` |
| `warn` | states a belief that is not verified, or what would falsify it | `assumption` |
| `warn` | states a limit, with a unit or a source | `constraint` |
| `warn` | none of the above | `warning` |
| `""` | names a choice and an alternative | `decision` |
| `""` | gives a concrete instance of a rule stated nearby | `example` |
| `""` | none of the above | `note` |
| `good` | recommends an action the reader may take or skip | `tip` |
| `good` | none of the above | `success` |
| `bad` | departs from a stated rule or principle | `deviation` |
| `bad` | none of the above | `danger` |

The defaults are the weakest claim in each group on purpose. When the text does
not decide it, take the default rather than guessing: an understatement is
recoverable and the report names it for a later pass.

## 3. Apply

Write your decisions as `{ "assignments": { "<key>": "<type>", ... } }`, keyed by
the `key` from the plan, and apply them:

```
node "${CLAUDE_PLUGIN_ROOT}/lib/specforge-cli.mjs" components migrate <id> --assign /tmp/<id>-assign.json
```

Anything you leave out takes the classifier's default, so the spec is never left
half on each vocabulary. The run stamps the component block, sets
`data-sf-components`, and writes `migration.json` into the spec's directory
recording every rename and every assignment with `by: "agent"` or
`by: "classifier"`.

## 4. Check it

```
node "${CLAUDE_PLUGIN_ROOT}/lib/lint-spec.mjs" ~/.specforge/specs/<id>/spec.html
```

Expect no untyped notices and no tone class used as a type. **Classes outside the
library are expected and are not yours to remove**: a class only this spec uses
is not drift, and deleting it changes how the spec renders. The same goes for the
CSS behind it, which the migration leaves in place.

Open the spec in the browser and look at it. The renames change which stylesheet
paints each block, so a visual check is the only thing that catches a spec whose
own rules were doing more than they appeared to.

## 5. Report

Say what was renamed, how many blocks you typed and on what evidence, and name
anything you took a default on. If `conflicts` was non-empty, say which classes
and what the user should look at.

Versions

The database has no other skills named migrate-spec.

Database snapshot: 13.11.2026 · package version 41f6399ed14a (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100convert-spec
    Convert an existing design/spec file into a SpecForge spec in the store. Use when the user asks to "convert <file> to a spec", "import this design doc", or "turn this markdown/HTML into a SpecForge spec". Handles two cases: an existing SpecForge-style .html is ingested as-is; a…
  • 100write-review
    Review a SpecForge spec as a reviewer agent, and file the review as a child spec of the spec being reviewed. Use when asked to "review spec <id>", "critique this spec", "give a second opinion on <spec>", or when a workflow hands you a spec to review. Creates the review with…
  • 90specforge-project
    Use when the user wants to build, create, plan, architect, scope, or spec a software project, app, platform, agent, API, tool, SaaS product, or major development feature. This skill requires routing development-project requests through the SpecForge tool before implementation.
  • 100core-components
    Core component library and design system patterns. Use when building UI, using design tokens, or working with the component library.
  • 90spec-migration
    Decide whether a change to the spec format needs a migration, and write it so `agnostic-ai migrate` rewrites old specs safely. Use when a change renames, replaces, deprecates, removes, or tightens any field users write under .agnostic-ai/ or in agnostic-ai.yaml.
  • 100port-spec
    Turn a complete written specification into working code or a vault artifact. Use when implementing a spec, building from a brief, or porting a spec to code.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.