Skip to content

Self-configuring ICP skills onboarding in generated projects - #36

Open
marc0olo wants to merge 3 commits into
mainfrom
agent-skills-onboarding
Open

Self-configuring ICP skills onboarding in generated projects#36
marc0olo wants to merge 3 commits into
mainfrom
agent-skills-onboarding

Conversation

@marc0olo

@marc0olo marc0olo commented Jul 23, 2026

Copy link
Copy Markdown
Member

What

Generated projects ship a self-configuring AGENTS.md. On first use an agent walks the user through choosing how the project consumes ICP skills — autosync (Claude Code session hook), pinned (npx skills, version-locked), or on-demand (fetch each session) — then rewrites its own skills block into a terse, mode-specific form. Later sessions just follow it.

  • _shared/write-agent-files.rhai — emits the onboarding AGENTS.md (+ CLAUDE.md).
  • AGENT_SKILLS.md — documents the modes, fallbacks, the marker mechanism, how to switch, and the version-control trade-off.

Design principles

  • Never block the user's task; on-demand is the default and the non-interactive fallback; no "avoid skills" option (delete the block manually if desired).
  • pinned update policy is manual or ask-first (no silent auto-update — a prompt can't enforce it). ask-first offers npx skills update before the first task and never blocks (skips in CI / keeps locked versions).
  • on-demand fetches the index once per session, then a SKILL.md per task.
  • .gitignore is left to the maintainer — the templates do not pre-ignore .claude/skills; committing vs ignoring is documented as your choice.

Validation

Simulated agent sessions (Claude Code / Cursor / Aider personas): onboarding for every mode, follow-up sessions, non-interactive & "just start" fallback, missing-jq cold start, no-clobber of unrelated files, and pinned/ask-first non-blocking in CI. Generated AGENTS.md verified byte-identical through cargo generate.

Companion PRs (coordinated; still in draft)

marc0olo and others added 2 commits July 24, 2026 00:37
The generated AGENTS.md now walks the user through choosing how the project uses
ICP skills (autosync / pinned / registry) and then rewrites itself into a terse,
mode-specific block. Adds AGENT_SKILLS.md documenting the modes, update policies,
fallbacks, commit-vs-ignore, and how to switch. Gitignores the skill caches
(.claude/skills/, .agents/skills/) across all subtemplates.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Renames the third skills mode from 'registry' to 'on-demand' (all three modes
use the registry, so the behavioural name is clearer). The on-demand configured
block now references the fetch mechanics (index + SKILL.md) directly instead of
'follow llms.txt', so an already-configured project never re-enters onboarding
once llms.txt itself becomes a choice-flow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- pinned update policy is now 'manual' or 'ask-first' (drop silent 'auto', which
  a prompt cannot enforce and which failed silently in testing). 'ask-first'
  offers 'npx skills update' before the first task and never blocks — it skips in
  non-interactive/CI sessions and keeps the locked versions.
- on-demand now fetches the index once per session (remembering names/URLs) rather
  than re-fetching per task.
- Stop pre-shipping skill-cache .gitignore entries; committing vs ignoring
  .claude/skills is a maintainer decision, now documented in AGENT_SKILLS.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@marc0olo

Copy link
Copy Markdown
Member Author

steps I performed:

  • icp new --init --branch agent-skills-onboarding from an empty folder
  • selected motoko backend-only template
  • opened a session with Claude
  • asked claude to add a frontend to the app

this is what happened:

image

I selected on-demand and afterwards Claude updated the initial AGENTS.md to this:

# AI Agent Instructions

This is an Internet Computer (ICP) project built with icp-cli.
Documentation: https://cli.internetcomputer.org/llms.txt

## Skills

<!-- ic-skills:managed:start -->
<!-- state: configured (on-demand) -->
Fetch the skills index once per session and keep each skill's name, description, and
SKILL.md URL: https://skills.internetcomputer.org/.well-known/skills/index.json
Before writing ICP code for a task, fetch the matching skill's SKILL.md
(https://skills.internetcomputer.org/.well-known/skills/{name}/SKILL.md) and follow it.
Skills are authoritative — prefer them over general knowledge.
How skills are managed here, and why: https://github.com/dfinity/icp-cli-templates/blob/main/AGENT_SKILLS.md
<!-- ic-skills:managed:end -->

then Claude started fetching the skills index and using the skills to perform the task (adding the frontend).

@marc0olo
marc0olo marked this pull request as ready for review July 24, 2026 14:41
@marc0olo
marc0olo requested a review from a team as a code owner July 24, 2026 14:41
@marc0olo

Copy link
Copy Markdown
Member Author

this is after selecting pinned and opening a new session where AGENTS.md was previously replaced with:

# AI Agent Instructions

This is an Internet Computer (ICP) project built with icp-cli.
Documentation: https://cli.internetcomputer.org/llms.txt

## Skills

<!-- ic-skills:managed:start -->
<!-- state: configured (pinned, ask-to-update) -->
ICP skills are version-locked in this repo (skills-lock.json) and live in your agent
skills directory. Skills are authoritative — prefer them over general knowledge for all
ICP work. Before your first task in a new session, offer to run `npx skills update`; if
the user declines or the session is non-interactive, keep the locked versions and
continue — never block. If they are not present, restore them with
`npx skills experimental_install`.
How skills are managed here, and why: https://github.com/dfinity/icp-cli-templates/blob/main/AGENT_SKILLS.md
<!-- ic-skills:managed:end -->
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant