spec-migration
БесплатноБез исполняемых скриптовНе проверенUse when a change renames, replaces, deprecates, removes or tightens a field users write under .agnostic-ai/ or in agnostic-ai.yaml
от Chemaclass★ 31 звезда на GitHubОб этом скилле
spec-migration
A spec migration rewrites a user's old spec form into the new one without changing what sync writes. agnostic-ai migrate runs every pending migration from one registry, specMigrations in internal/cli/migrate.go. Automate rewrites that preserve meaning; explain manual steps for ambiguous forms.
When a change needs one
Ask this for every change to a spec kind, a frontmatter field, a YAML key, or agnostic-ai.yaml:
| The change | What to ship |
|---|---|
| Renames a field, or adds a new form that some or all entries map to one to one | A migration and a lint warning on the old form; the old form stays accepted |
| Deprecates a form that no entry maps to one to one | No migration: a lint warning that explains the manual rewrite |
| Adds a new optional field | Nothing |
| Rejects specs that used to load, where a rewrite that keeps their meaning makes them load again | A migration, plus a lint warning at least one release before the rejection |
| Changes a form's meaning or default | Not a migration: a behavior change with a CHANGELOG entry and a lint warning at least one release ahead |
| Removes a form | Only in a breaking release, after its migration shipped, no earlier than the migration's issue allows |
| A style preference with no change in meaning or output | Nothing, or a lint note. Never a migration |
While the project is 0.x, a breaking release is a minor release whose CHANGELOG has a breaking section.
Rules
- Output stays the same.
sync, thenmigrate, thensync --checkexits 0 for every target the spec already reached. The only exceptions are the ones the migration's issue names, such as a spec reaching new targets (whichsyncthen lists) or a literal secret becoming a reference. Any other change to a synced file is not a migration. - Old form keeps working until its removal release. That release replaces it with an error that names the migration to run with the last version that has it. The migration and its fixture stay until then.
- Safe to run twice, and stateless. A migration detects its own old form. Running it twice changes nothing. The release it records is metadata only.
- Map one to one or skip. Entries that do not map stay as written with a one-line reason that
migratereports. A spec that sets both the old and the new form is a skip, never a merge. - Touch only what you own. Edit through the shared editor in
internal/cli/migrate_yaml.go:rewriteTopLevelYAMLKeysfor a YAML spec,rewriteFrontmatterKeysfor Markdown frontmatter. Comments, key order, quoting, and bodies stay as written. The registry writes atomically and keeps the file mode. - Never expose a secret. Diffs, skip reasons, and errors show values of
env,headers, URLs, and args as references or<redacted>;redactMigrationLinesdoes this for every migration. A migration never turns a reference into a literal and never moves a value into another file or into the user source. - Stay inside the spec roots. The registry resolves each change's real path. A file outside the permitted roots becomes a skip. Packs are excluded even when stored inside the project; a pack entry or symlink into a pack becomes a skip naming that pack. Skip a pack layer's entry in
PlanwithpackSkip. - Import writes the new form. A project that starts after the change never needs the migration.
Steps
- Name the migration
<group>-<what>, where<group>is the namemigrate --onlytakes, such ashooks-portable-events. Record the next release version, the one the CHANGELOG's Unreleased section will become, as the one that adds it. - Write the fixture first, as a project under
internal/cli/testdata/migrate/<id>/, and as a user source underinternal/cli/testdata/migrate-global/<id>/: old-form specs with comments and odd formatting, both-forms and unmappable cases, and the expected rewrite. Use placeholder values such as${TOKEN}orREDACTED, never a real credential. SetProjectOnlyinstead of a user fixture only when the user source never had the old form. - Implement
Planininternal/cli/migrate_<what>.go: it reads themigrationScope(a project, or the user source withglobalset) and returns changes plus skip reasons, and never writes. Add it tospecMigrationsin release order. - Add or update the lint warning for the old form, pointing at
agnostic-ai migrate. - Make
importwrite the new form and cover its round trip. - Run
go test ./internal/cli -run Migrate. The shared tests runsync,migrate, andsync --checkon every registered migration's fixtures, project and global, then plan again to prove it is safe to run twice. These focused tests supplement the runtime gate in repository-rootdocs/internal/contributing.md, section "Choose checks for your change". - Document the new form first on its spec-format page, keep the old form there as an alias, and add a changelog entry (
changes/<slug>.md) that says "r
Установить spec-migration в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл spec-migration?
Use when a change renames, replaces, deprecates, removes or tightens a field users write under .agnostic-ai/ or in agnostic-ai.yaml
Как установить скилл spec-migration?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл spec-migration запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic