You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a follow-up to #35. That issue documented 15 errors building a Rust + React ICP blog app where Claude Code had skills installed locally but ignored them. This issue documents a new session building a Motoko + Vanilla JS blog app where skills were not installed locally but were fetched via WebFetch from skills.internetcomputer.org — and we still hit 8 errors across 8 deploy attempts.
The skills were fetched proactively from the start (before writing any code), which eliminated several error classes from #35 (wrong package versions, wrong import paths). But new gaps emerged, particularly around Motoko APIs and environment-specific pitfalls.
Session Stats
Errors: 8
User prompts to fix: 5 error-fix rounds after initial generation
icp-cli skill doesn't warn about this — agent used cd src/frontend && npm install which icp-cli encoded as &&
2
Missing [toolchain] section in mops.toml
No skill covers mops toolchain setup
3
moc 0.13.6 too old for core@2.0.0 (requires >= 1.0.0)
stable-memory skill pins core = "2.0.0" but doesn't specify compatible moc version
4
mo:core 2.0.0 API hallucinations — List.pushBack, Map.set, Array.thaw/freeze don't exist
No Motoko skill exists. Agent hallucinated from older base library training data. Actual API: List.add, Map.add (for upsert), Map.take, Array.toVarArray
5
fetch Illegal Invocation in production bundle
internet-identity skill shows HttpAgent.create() without fetch: window.fetch.bind(window)
6
Wrong II canister ID fallback (be2us-64aaa-aaaaa-qaabq-cai)
internet-identity skill hardcodes this fallback, but local II is actually at rdmx6-jaaaa-aaaaa-aaadq-cai
7
shouldFetchRootKey cross-origin issue (initial misdiagnosis of #5)
Skills don't explain the relationship between ic_env cookie root key and shouldFetchRootKey
8
No admin init flow in UI (CLI identity ≠ browser II identity)
Not a skill gap per se, but a common pattern that could be documented
mops.toml configuration including [toolchain] section with compatible moc version
persistent actor pattern (currently in stable-memory but incomplete)
Common type patterns ({#less; #equal; #greater} for comparators)
3. icp-cli skill — Build command escaping
Add a warning about special characters in YAML build commands:
# DON'T: && may be HTML-encoded by some toolsbuild:
- cd src/frontend && npm install && npm run build# DO: use a shell script or separate commandsbuild:
- sh src/frontend/build.sh
4. stable-memory skill — Pin compatible toolchain
[package]
name = "my-project"
version = "0.1.0"
+ [toolchain]+ moc = "1.3.0"+
[dependencies]
core = "2.0.0"
Context
This is a follow-up to #35. That issue documented 15 errors building a Rust + React ICP blog app where Claude Code had skills installed locally but ignored them. This issue documents a new session building a Motoko + Vanilla JS blog app where skills were not installed locally but were fetched via WebFetch from
skills.internetcomputer.org— and we still hit 8 errors across 8 deploy attempts.The skills were fetched proactively from the start (before writing any code), which eliminated several error classes from #35 (wrong package versions, wrong import paths). But new gaps emerged, particularly around Motoko APIs and environment-specific pitfalls.
Session Stats
icp-cli,internet-identity,asset-canister,stable-memory) + index.jsonErrors Encountered
&&HTML-encoded by icp-cli in build commandsicp-cliskill doesn't warn about this — agent usedcd src/frontend && npm installwhich icp-cli encoded as&&[toolchain]section inmops.tomlmoc0.13.6 too old forcore@2.0.0(requires >= 1.0.0)stable-memoryskill pinscore = "2.0.0"but doesn't specify compatible moc versionmo:core2.0.0 API hallucinations —List.pushBack,Map.set,Array.thaw/freezedon't existList.add,Map.add(for upsert),Map.take,Array.toVarArrayfetchIllegal Invocation in production bundleinternet-identityskill showsHttpAgent.create()withoutfetch: window.fetch.bind(window)be2us-64aaa-aaaaa-qaabq-cai)internet-identityskill hardcodes this fallback, but local II is actually atrdmx6-jaaaa-aaaaa-aaadq-caishouldFetchRootKeycross-origin issue (initial misdiagnosis of #5)ic_envcookie root key andshouldFetchRootKeyErrors Shared with Issue #35
Two errors appeared in both sessions despite different tech stacks:
fetchIllegal Invocation (Building an ICP Blog App with Claude Code: A Case Study in What Goes Wrong Without Skills #35 error docs: HTTPS outcalls concept page #12, this session error docs: getting-started quickstart page #5) — This is the most impactful recurring issue. Theinternet-identityskill'sHttpAgent.create()example needsfetch: window.fetch.bind(window)added.Wrong II canister ID (Building an ICP Blog App with Claude Code: A Case Study in What Goes Wrong Without Skills #35 error feat: agent-friendly documentation (llms.txt + markdown endpoints) #14, this session error docs: getting-started project structure page #6) — The hardcoded fallback in the skill is wrong for local development.
Errors Eliminated vs Issue #35
Because skills were fetched upfront, these #35 errors did not occur:
@icp-sdk/auth@^0.1.0) — skill had correct versions@icp-sdk/authvs@icp-sdk/auth/client) — skill had correct pathscanister.yamlvsicp.yaml) — skill had correct formatCargo.toml— N/A (Motoko, not Rust)tscbefore bindings — N/A (vanilla JS, no TypeScript)This confirms that skills do prevent errors when used — the remaining errors are gaps in the skills themselves.
Recommended Skill Improvements
1.
internet-identityskill — Fix recurring errorsconst agent = await HttpAgent.create({ identity, host: isLocal ? "http://localhost:8000" : "https://icp-api.io", + fetch: window.fetch.bind(window), ...(isLocal && { shouldFetchRootKey: true, verifyQuerySignatures: false }), });Add a "Common Pitfalls" section:
fetch: window.fetch.bind(window)is required in production Vite/webpack bundlesic_envcookie root key vsshouldFetchRootKey(prefer cookie when available)2. New:
motokoskill (or expandstable-memory)The biggest error source (error #4) was hallucinated Motoko APIs. A Motoko skill should cover:
mo:core2.0.0 API quick reference (at minimumList,Map,Arraymethod names)mops.tomlconfiguration including[toolchain]section with compatiblemocversionpersistent actorpattern (currently instable-memorybut incomplete){#less; #equal; #greater}for comparators)3.
icp-cliskill — Build command escapingAdd a warning about special characters in YAML build commands:
4.
stable-memoryskill — Pin compatible toolchainComparison Summary
fetchbinding, II canister IDTakeaway
Proactively fetching skills via WebFetch cut errors nearly in half (15 → 8). The remaining errors fall into two categories:
fetchbinding, wrong II canister ID) — easily fixable, high impact since they affect every sessionmotokoskillThe
llms.txt→index.json→ on-demand skill fetch pattern discussed in #35 comments works. The skills themselves just need these gaps filled.