migrating-motoko-enhanced

Installation
SKILL.md

Enhanced Multi-Migration

Manage canister state evolution through a chain of migration modules. Each migration captures one logical change (add, rename, drop, transform a field) and the compiler verifies the entire chain is consistent.

When to Use

  • Adding, removing, or renaming persistent actor fields
  • Changing a field's type
  • Restructuring state across canister upgrades
  • Project has [canisters.<name>.migrations] configured in mops.toml

Critical Rules

  • Never use stable keyword, preupgrade/postupgrade, or inline (with migration = ...)
  • Actor variables are declared without initializers — values come from the migration chain
  • The actor body must be static (no top-level side effects except <system> calls like timers)
  • Each migration file exports public func migration({...}) : {...}
  • Files are applied in lexicographic order — use timestamp prefixes
Installs
41
GitHub Stars
26
First Seen
May 10, 2026
migrating-motoko-enhanced — dfinity/icskills