If you're building on Internet Computer, this is your guide to not losing user data when you upgrade a canister. It covers the persistent actor pattern in Motoko (where `let` and `var` just work automatically) and StableBTreeMap with MemoryManager in Rust (because thread_local RefCell gets wiped on every deploy). The mistakes section is genuinely useful: it walks through the pre_upgrade instruction trap that bricks canisters, the type change gotchas in Motoko, and why Bound::Unbounded beats Bound::Bounded for forward compatibility. Includes working code for both languages with CBOR serialization. Read this before your first canister upgrade, not after you've lost production data.
npx skills add https://github.com/dfinity/icskills --skill stable-memory