Skip to content

icp-cli skill: list exact recipe type strings to prevent LLM hallucination #120

@marc0olo

Description

@marc0olo

Problem

When building a Motoko + React hello-world project using the ICP skills, Claude hallucinated an invalid recipe type in icp.yaml:

# What was generated (wrong)
recipe:
  type: "motoko"

# What it should have been
recipe:
  type: "@dfinity/motoko@v4.1.0"

This happened because the icp-cli skill mentions recipe categories in prose ("Rust, Motoko, asset-canister, prebuilt") but never lists the actual @scope/name@version strings. The only concrete recipe type shown is @dfinity/asset-canister@v2.1.0 in the asset-canister skill. Without an explicit reference, the LLM guessed a plausible-looking bare name.

A second issue followed from the first: the candid: configuration field was omitted from the Motoko recipe, which meant the .did file wasn't at a stable path. The frontend's bindgen plugin then failed at build time because it couldn't find it. The binding-generation skill does warn about this, but the connection to the recipe config isn't obvious when the recipe itself isn't documented.

Proposed fix

Add a recipe reference table to the icp-cli skill listing each recipe's exact type string and its key configuration fields. For example:

Recipe Type string Key config fields
Motoko @dfinity/motoko@v4.1.0 main, candid
Rust @dfinity/rust@v... cargo_toml, candid
Asset @dfinity/asset-canister@v2.1.0 dir, build
Prebuilt @dfinity/prebuilt@v... wasm, candid

This single addition would have prevented both issues — the correct type string would be used directly, and seeing candid as a config field makes it clear the .did file needs to exist.

What's NOT needed

  • A full end-to-end tutorial in the skill (too much maintenance burden)
  • Duplicating .did file guidance across multiple skills (binding-generation already covers it)
  • Moving the .did warning to a "critical pitfalls" section (unnecessary if the recipe table shows candid as a field)

The goal is minimal, high-signal additions — just the exact strings an LLM (or human) needs to write a correct icp.yaml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions