realign

Migrate persisted data when domain-model enum or state vocabulary changes meaning.

121|2|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/AgentSystemLabs/core --skill realign
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: realign
Source: https://github.com/AgentSystemLabs/core/tree/main/plugins/agentsystem-core/skills/realign
Command: npx skills add https://github.com/AgentSystemLabs/core --skill realign

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Realignments rename a domain model’s meaning (e.g., enum/state vocabulary) and may require migrating persisted data so old values are transformed into the new meaning without corrupting behavior.

Core Features & Use Cases

  • Confirm realignment scope: Distinguishes realignment from refactor (behavior-preserving) and cleanup (no requirement change) to prevent under-scoping migration work.
  • Explicit old→new mapping: Forces an agreed mapping (mapped, collapsed, dropped, and newly introduced values) that drives both code changes and migration logic.
  • Type-first then grep sweep: Renames at the type/enum root, uses the type checker to fix leaks, then audits non-typed string usages, payloads, and fixtures (including docs and UI-related named constants).
  • Production-grade migration guidance: Ensures persisted data migration is done via the project’s existing migration pattern (or adds a minimal tracked migration runner if missing), with verification and an optional data-integrity review pass.

Quick Start

Ask your agent to realign a renamed enum/state vocabulary and migrate any persisted rows from the old values to the new values while updating all non-typed string leaks.

Frequently Asked Questions about realign

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate persisted data when renaming enum values in my domain model?

Migrating persisted data during an enum realignment requires an explicit old→new mapping to drive both code changes and database migration logic. You must map, collapse, drop, or introduce values, then verify the migration safely transforms old rows without corrupting behavior.

What is the difference between a behavior-preserving refactor and a state vocabulary realignment?

A state vocabulary realignment changes the semantic meaning of domain model enums due to business requirement updates, requiring persisted data migration. A refactor preserves behavior, while cleanup involves no requirement change, so realignment prevents under-scoping migration work.

How do I catch non-typed string leaks after renaming an enum at the type root?

After renaming an enum at the type root, use the type checker to fix type leaks, then run a grep-based audit to find non-typed string usages, payloads, fixtures, docs, and UI-related named constants that reference the old state values.

How do I handle collapsed or dropped enum values during a schema migration?

Handling collapsed or dropped enum values during schema migration requires an explicit old→new mapping that defines how old values transform into the new meaning. Use the project's existing migration pattern to version and verify the persisted data transformation safely.

Do I need an existing migration runner to realign persisted state and semantics?

You can use the project's existing migration pattern if available, or add a minimal tracked migration runner if one is missing. The realignment process requires safe versioned migration verification to ensure persisted rows transform correctly.

Why does my data integrity break when I rename state machine values without a mapping?

Renaming state machine values without an explicit old→new mapping corrupts behavior because persisted rows still hold old values that no longer match the new semantic meaning. A realignment distinguishes semantic changes from refactors to ensure data migration logic matches code changes.