autoupgrade-icp-cli
Set up automatic icp CLI upgrades
A one-time installer: it adds a SessionStart hook that checks whether icp and
ic-wasm are current and — if the user wants — upgrades them before work starts. Once
these steps are done the user never needs this skill again.
ic-wasm is covered alongside icp because the official recipes (@dfinity/motoko,
@dfinity/rust, @dfinity/static-site, @dfinity/asset-canister) invoke it on every
build. An ic-wasm left behind while icp moves forward produces build failures that
read as recipe bugs, so upgrading only one of the pair is the worse default.
icp has its own check (icp settings update-check) that is worth leaving on, but it
only speaks once the user runs an icp command — by which point the agent has already
chosen what to write. This hook runs before the session's first prompt, so the version
reaches Claude's context up front, and it covers ic-wasm too.
Step 1 — Ask the user which mode they want
The installer cannot make this call for the user, so ask before writing anything: