Skip to content

feat: skills canister — list_skills, get_skill, search_skills#148

Open
dfinityianblenke wants to merge 1 commit intomainfrom
ianblenke/skills-canister
Open

feat: skills canister — list_skills, get_skill, search_skills#148
dfinityianblenke wants to merge 1 commit intomainfrom
ianblenke/skills-canister

Conversation

@dfinityianblenke
Copy link
Copy Markdown

@dfinityianblenke dfinityianblenke commented Apr 2, 2026

Summary

Adds a Rust IC canister that exposes the 19 IC skill documents as callable query methods. Skill content is embedded at compile time from skills/*/SKILL.md via build.rs — no runtime filesystem access, no data migration.

Three query methods (see canisters/skills/skills.did):

  • list_skills() → vec SkillSummary — names, titles, descriptions, categories
  • get_skill(name: text) → opt SkillDetail — full SKILL.md content + metadata
  • search_skills(query: text) → vec SkillSummary — substring match across name, title, description, and content

How skill data is embedded (build.rs):

  • Parses YAML frontmatter (title, description, category, license, compatibility) from each skills/*/SKILL.md at compile time
  • Generates skills_data.rs into $OUT_DIR with a static SKILLS_DATA: &[StaticSkillData] array
  • Full SKILL.md content is embedded as escaped string literals
  • cargo:rerun-if-changed=../../skills ensures incremental rebuilds when any skill changes

dfx.json includes a webmcp config block (used by ic-webmcp-codegen dfx in the follow-up manifest PR) with per-method descriptions and param descriptions for AI agents.

Test plan

  • cargo check -p ic-skills-canister — passes (verified locally)
  • dfx deploy skills --network local — deploys canister
  • dfx canister call skills list_skills — returns all skill summaries
  • dfx canister call skills get_skill '("motoko")' — returns full SKILL.md
  • dfx canister call skills search_skills '("ckbtc")' — returns matching skills
  • dfx canister call skills get_skill '("nonexistent")' — returns null

This should be followed by merging PR 149 and optionally (but ideally) PR 150

…ry methods

Adds a Rust IC canister that exposes the skill collection as callable query
methods. Skill content is embedded at compile time via build.rs so there
is no runtime filesystem dependency and no separate data migration needed.

- `canisters/skills/src/lib.rs` — three query methods: list_skills(),
  get_skill(name), search_skills(query); returns SkillSummary / SkillDetail
- `canisters/skills/build.rs` — parses SKILL.md frontmatter at build time,
  embeds names/titles/descriptions/categories/content as static data
- `canisters/skills/skills.did` — Candid interface (SkillSummary, SkillDetail)
- `canisters/skills/Cargo.toml` — ic-cdk 0.19.0, candid 0.10.22
- `Cargo.toml` — workspace root with release profile
- `dfx.json` — dfx config for skills canister + webmcp method descriptions
  (input for ic-webmcp-codegen dfx when generating /.well-known/webmcp.json)
- `.gitignore` — add target/ and Cargo.lock

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dfinityianblenke dfinityianblenke requested review from a team and JoshDFN as code owners April 2, 2026 14:38
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Skill Validation Report

No skill files were changed in this PR — validation skipped.

dfinityianblenke added a commit that referenced this pull request Apr 2, 2026
Registers list_skills, get_skill, and search_skills with
navigator.modelContext so AI agents can call them as tools regardless of
browser: Chrome 146+ uses the native WebMCP API, all others pick up the
inline polyfill installed by this script.

- public/webmcp-setup.js — self-contained polyfill + tool registration
  Uses the existing /.well-known/skills/ static API endpoints (no canister
  or @dfinity/webmcp dependency required). When PR #148 is deployed and
  @dfinity/webmcp is published, the execute() functions can be upgraded to
  use ICWebMCP for full Candid canister calls with certified responses.

- src/layouts/BaseLayout.astro
  <link rel="modelcontext" href="/.well-known/webmcp.json"> — signals
  Chrome 146+ to load the manifest automatically.
  <script src="/webmcp-setup.js" defer> — loads the polyfill on every page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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