feat: comprehensive icp-cli skill improvements for dfx migration#76
Merged
feat: comprehensive icp-cli skill improvements for dfx migration#76
Conversation
Add coverage for canister environment variables, binding generation, dev server configuration, frontend package migration, and post-migration verification. Address gaps discovered during a real dfx-to-icp migration including port changes, .env file removal, Candid file generation, and multi-canister frontend patterns.
viviveevee
approved these changes
Mar 5, 2026
- Add clarifying comment for `-i` flag in dev server example - Mention `canister_ids.json` in canister ID migration section - Add explicit `rm -f canister_ids.json` step
Custom builds only support name, build, sync, settings, and init_args at the canister level. Show how to use $ICP_WASM_OUTPUT_PATH and ic-wasm for WASM output and candid metadata instead.
raymondk
reviewed
Mar 5, 2026
| EOF | ||
|
|
||
| # Delete the dfx canister ID file — icp-cli uses .icp/data/mappings/ instead | ||
| rm -f canister_ids.json |
Collaborator
There was a problem hiding this comment.
Maybe we play it safe and don't ask for this to be deleted?
Member
Author
There was a problem hiding this comment.
I think it should be fine. The agent using the skill should create and commit the new mapping file. And typically the canister id could be recovered through the git history. If a dev explicitly asks to keep dfx working, I expect the Agent to respect this decision and keep the files required for dfx.
raymondk
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Significantly expands the icp-cli skill to cover real-world dfx-to-icp migration scenarios that were discovered during an actual migration. The original skill covered basic config and commands but missed critical patterns around frontend integration, canister discovery, and binding generation.
New Common Pitfalls (10-12)
#10: No.envfile /output_env_file— icp-cli injects canister IDs via env vars, frontends read theic_envcookie#11: Nodfx generate— use@icp-sdk/bindgenVite plugin with a.didfile on disk#12: Candid file behavior with recipes —candidspecified = must exist, omitted = auto-generated in build cache. Includes commands to generate.didfiles manually for both Rust (candid-extractor) and Motoko (moc --idl)New Configuration Sections
ic_envcookie +@icp-sdk/core) and backends (Rustenv_var_value, MotokoRuntime.envVarwith import) discover each other@icp-sdk/bindgenVite plugin setup for single and multi-canister projects, actor creation pattern, non-Vite CLI fallbackicp network status --jsonforapi_url+root_key, multi-canister cookie setup,ICP_ENVIRONMENTfor multi-environment supportNew Migration Sections
4943→ icp-cli8000, recommends dynamicapi_urlfromicp network status.envfile andoutput_env_file— dfx-specific env vars to clean up@dfinity/*to@icp-sdk/*(bindgen depends on core), step-by-step instructionsUpdated Existing Sections
output_env_fileanddfx generaterowsContext
These gaps were discovered during a real migration of marc0olo/promptathon-showcase from dfx to icp-cli, then validated against the example migration PRs (#1303, #1308, #1309, #1311) in dfinity/examples and the official icp-cli documentation.
References