migration-scripts

Installation
SKILL.md

Migration Scripts

Rule: Migrations Are Frozen Snapshots

Migration scripts must NEVER import or reference:

  • Constants, helpers, or utilities from the main codebase
  • Shared types (use any for migration input/output)
  • Factory functions like createXxx()

Why: The codebase evolves. A migration written today references code that may change tomorrow. When that constant changes, the migration silently breaks — it now migrates to the new shape, not the shape that existed when the migration was written.

Rule: Migration Registries Must Validate the Chain

In this repo, config migration registries should auto-discover migration files from src/utils/config/migration-scripts/v*-to-v*.ts (for example via import.meta.glob), and the registry must:

  • Parse both fromVersion and toVersion from the filename
  • Reject invalid steps like v001-to-v003
  • Reject duplicate target versions
  • Reject discontinuous chains
Installs
1
GitHub Stars
8
First Seen
8 days ago
migration-scripts — joeseesun/qiaomu-english-learn