Skip to content

Skills missing npm versions, Vite config, and complete frontend scaffold #95

@marc0olo

Description

@marc0olo

Context

While using the internet-identity, asset-canister, and icp-cli skills together to add II authentication with a frontend to a Motoko project, an AI agent hit four sequential build/runtime failures before getting a working result. Two of these are already addressed by #91 (wrong II canister ID, missing fetch binding) and the related JS SDK fix. The remaining issues are about missing information in the skills.

Problem

The skills don't contain enough information for an agent (or developer) to produce a working frontend + II integration on the first attempt. Specifically:

  1. No npm package versions anywhere. The internet-identity skill lists @icp-sdk/auth and @icp-sdk/core as prerequisites but without version numbers. The binding-generation.md reference shows @icp-sdk/bindgen usage but no version. An agent guessed ^0.1.0 — the actual versions are 5.x and 0.2.x, causing npm install to fail.

  2. No Vite build.target guidance. The frontend code examples use top-level await (e.g., await AuthClient.create()), but Vite's default build target (es2020) doesn't support it. The build fails with "Top-level await is not available in the configured target environment". No skill mentions that build.target: "esnext" is required.

  3. No complete frontend project scaffold. Building a working frontend requires piecing together fragments from three skills and two reference docs: icp.yaml from asset-canister, auth code from internet-identity, Vite plugin config from icp-cli/references/binding-generation.md, dev server setup from icp-cli/references/dev-server.md, and .ic-assets.json5 from asset-canister. There is no single place that shows a complete, working package.json + vite.config.js + index.html.

Proposed changes

1. internet-identity/SKILL.md — add npm versions to prerequisites

Current:

- Frontend: `@icp-sdk/auth`, `@icp-sdk/core`

Proposed:

- Frontend: `@icp-sdk/auth` (>= 5.0.0), `@icp-sdk/core` (>= 5.0.0)

2. asset-canister/SKILL.md — add complete Vite project scaffold

Add a section with a working minimal frontend setup:

  • package.json with @icp-sdk/core, @icp-sdk/bindgen, and vite at correct versions
  • vite.config.js with:
    • build.target: "esnext" (required for top-level await)
    • @icp-sdk/bindgen plugin configured
    • Dev server config (currently buried in icp-cli/references/dev-server.md)
  • Minimal index.html entry point

This belongs in asset-canister because any frontend on IC needs this base, regardless of auth method.

3. icp-cli/references/binding-generation.md — add @icp-sdk/bindgen version

The reference shows icpBindgen() usage but doesn't state which version to install. Add >= 0.2.0.

Already addressed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions