local-data-migrations
БесплатноБез исполняемых скриптовНе проверенRules for changing Klex config schemas, SQLite schemas, persisted JSON, store metadata, local-data definitions, or migration and recovery code.
от stagewise-io★ 44 звезды на GitHubОб этом скилле
Local data migrations
Read apps/klex/src/local-data/architecture.md before changing persistent state.
Required workflow
- Establish the released baseline before editing. Inspect release tags and the store definition, schemas, nested schemas, defaults, and migration helpers at the relevant released commits. Compare against the latest release and the release that introduced the affected version. Do not infer release status from comments, the branch name, the current package version, or an agent's earlier claim. A withdrawn or deleted release still counts. If history is unavailable or ambiguous, treat the contract as released and report the uncertainty.
- Classify the change as one of:
- No representation change.
- Compatible additive change.
- Schema migration.
- Compatibility-floor increase.
- Update the store definition in its owning module as required by the classification. For a schema migration, add a new schema and one new forward step from the current version. Compatible additive changes may retain versions only when older readers preserve and safely ignore the addition. Keep the old schema and old steps intact. Review shared dependencies for accidental changes to historical behavior.
- Confirm the definition remains present in
local-data-registry. - Add old/current/newer fixtures and downgrade, failure, and recovery tests appropriate to the classification. Follow the regression checklist below.
- Run local-data tests, the owning module tests, typecheck, lint, executable build, and native smoke verification. Report failures and skipped checks explicitly. Do not describe a parser-only test as startup verification.
- Include the released baseline, change classification, old and new schema/compatibility versions, minimum supported binary version, and validation results in the PR or handoff. Explain any manual recovery needed before the updater can start.
Released contracts are immutable
A stored version is a permanent contract with data already on users' machines. Never fix a new feature by rewriting that contract.
- History freezes on merge, including nightly-only migrations. Never edit an existing file in
apps/klex/src/local-data-migrations/(except append-only updates to the literalLOCAL_DATA_MIGRATIONSregistry) orapps/klex/src/local-data-migration-fixtures/, or reuse its version number. Append a new contiguous step inlocal-data-migrations/<store>/vN-to-vN+1/, containingmigration.tsand self-contained raw input/output schemas and helpers. Name exports by persisted version, such asconfigV6SchemaandconfigV6ToV7. Do not share contracts across transitions. The live config schema belongs inconfig/schema.ts, without migration-only parsers or historical schemas. - Append imports and array entries in the literal
LOCAL_DATA_MIGRATIONSregistry; retain every existing import identity and array prefix. Wire the owning store directly to those arrays and increment its latest schema version. Register new stores with migrations in history as well. - Historical files may import only helpers/schemas inside the same transition folder, Zod, and type-only
JsonMigration/SqliteMigrationinterfaces from@/local-data. Never import current application code, even a pure helper or nested schema. Do not userequire, side-effect imports or dynamic imports. Deliberate schema duplication is required. - Run
node --test scripts/check-local-data-migrations.test.mjsandnode scripts/check-local-data-migrations.mjs <trusted-target-ref>as well as startup/owning-module tests. CI compares with the trusted PR base, not a PR-editable manifest. See the architecture document for the bootstrap and branch-protection requirement. - Never narrow a historical validator to the current runtime shape. Keep explicit historical schemas, including their nested schemas and defaults. A shared helper or schema edit can change old versions even when the version registry is untouched.
- Removing an optional property, rejecting an empty legacy list, changing a persisted enum or discriminator, or moving a field is a representation change. Runtime code no longer using a field does not make existing stored data invalid.
- Keep historical fixtures as evidence. Do not remove legacy fields, change their metadata to the new version, or regenerate their expected shape from the current parser just to make tests pass. Add a separate current fixture.
- If a broken binary has already shipped, account for both the pre-existing released shape and any shape the broken binary could have written. Preserve valid data in each case. Do not silently accept arbitrary corruption.
Required regression checks
Use literal or frozen fixtures whose expected historical shape is independent of the current parser. Include realistic selections and options, not just an empty default config.
- Validate the old fixture with its historical schema and assert that any existing migration still produces its released outp
Установить local-data-migrations в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл local-data-migrations?
Rules for changing Klex config schemas, SQLite schemas, persisted JSON, store metadata, local-data definitions, or migration and recovery code.
Как установить скилл local-data-migrations?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл local-data-migrations запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic