What problem does it solve? Upgrading a Motoko canister often requires renaming fields, changing field types, or restructuring actor state, and doing this incorrectly can abort the upgrade or lose on-chain data. This Skill guides you through writing a single inline migration function attached to the actor so state transforms safely during upgrades. ## Core Features & Use Cases - Inline migration syntax: Attach a migration function with (with migration = Migration.run) directly before the actor declaration. - Migration module pattern: Define old actor types inline in a separate migration.mo module and map them to new types. - Common transformations: Add fields with defaults, convert Bool to variant, rename fields, drop fields, and transform collection values. - Use Case: You need to change a completed : Bool field into a status variant across all tasks in stable storage. The Skill shows how to write a migration function that maps old records to new ones and verifies the result with mops check and mops build. ## Quick Start Ask the AI to write a Motoko inline migration that renames an actor field and converts a Bool flag into a variant type using the (with migration = ...) syntax.