Skip to content

draft: example skills for proposed catalog restructuring#51

Closed
marc0olo wants to merge 7 commits intomainfrom
marc0olo/rfc-skills-restructuring
Closed

draft: example skills for proposed catalog restructuring#51
marc0olo wants to merge 7 commits intomainfrom
marc0olo/rfc-skills-restructuring

Conversation

@marc0olo
Copy link
Member

@marc0olo marc0olo commented Feb 27, 2026

Context

This PR contains two draft SKILL.md files that demonstrate the proposed skill structure from the skills catalog restructuring analysis — see RFC Issue #52 for the full analysis and discussion.

These are not ready to merge into skills/ — the frontmatter uses the new Agent Skills spec-compliant format (metadata:, license, compatibility) which requires #45 to be resolved first.

What's included

_drafts/icp-cli/SKILL.md (273 lines)

  • Tier 1 foundation skill for CLI tooling
  • Covers: project creation, recipes, environments, canister operations, identity, cycles
  • Uses icp-cli v0.2.0 command syntax

_drafts/canister-security/SKILL.md (366 lines)

  • Tier 1 foundation skill for security patterns
  • Covers: access control, inspect_message, anonymous caller rejection, async TOCTOU, freezing threshold, controller backup, root key handling (ic_env cookie, icp network status --json)
  • Both Motoko and Rust implementations including system func inspect and #[inspect_message]

Key design decisions demonstrated

  1. Spec-compliant frontmatter — custom fields under metadata:, license: Apache-2.0, compatibility replaces requires. Lean metadata: only title, category, version (dropped status, dependencies, endpoints, tags)
  2. Self-contained skills — no cross-skill file links. Essential info is inlined where previously a link existed. Follows the same pattern as Anthropic's official skills
  3. Under 500 lines — both skills stay within the recommended limit
  4. "Use when... Do NOT use for..." — descriptions include agent routing trigger phrases
  5. Pitfalls-first — the highest-value content is the "Mistakes That Break Your Build" section
  6. Consistent prerequisite format — follows existing skill convention: tool >= version (install: \command`)`

Related

…er-security)

Two draft SKILL.md files demonstrating the proposed skill structure from the
RFC analysis. These use spec-compliant Agent Skills frontmatter (metadata:,
license, compatibility) and cross-reference each other.

- _drafts/icp-cli/SKILL.md: CLI tooling skill (276 lines)
- _drafts/canister-security/SKILL.md: Security patterns skill (391 lines)

Both are drafts for review — not ready for skills/ directory until Issue #45
(frontmatter alignment) is resolved.
marc0olo and others added 5 commits February 27, 2026 22:19
The endpoints field is a manually maintained count that easily drifts
out of sync. No agent or discovery mechanism uses it. The site can
compute operation counts from content at build time if needed.
The "Frontend — Safe Agent Configuration" section used the deprecated
@dfinity/agent package and is out of scope for a canister security skill.
The fetchRootKey warning remains in pitfall #6.
Replace deprecated fetchRootKey() advice with:
- icp network status --json for local dev agents
- ic_env cookie + getCanisterEnv() for frontends
- Generic language covering all agents, not just frontends
The root key is not baked into @icp-sdk/core. Asset canisters provide
it via ic_env cookie (since SDK v0.32.0). Non-frontend agents must
obtain it via icp network status --json.

## Prerequisites

- `icp-cli` >= 0.2.0 — see [icp-cli](../icp-cli/SKILL.md) for setup
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this type of link is ok.
From the spec it sounds like the directory should be self contained: https://agentskills.io/specification

https://agentskills.io/specification#file-references

- icp-cli
  - SKILL.md
  - references
    - canister-security.md

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — this cross-link violated the spec's self-contained directory requirement. It's been removed in 25cbe9f.

All cross-skill file links (../other-skill/SKILL.md) are now gone from both drafts. Where a link previously pointed to essential info (e.g., freezing threshold command, saga pattern), we inlined the key content directly. Where it was just a "see also" convenience, we dropped it.

Regarding the references/ subdirectory approach you suggested — that makes sense when a skill needs to progressively disclose its own detailed content (e.g., icp-cli/references/recipes.md). But we didn't go that route here because the referenced content (canister-security) is a separate skill with its own scope. Duplicating it as a reference file inside icp-cli/ would create content that drifts out of sync. Instead, the agent runtime handles the connection — when a user's task involves both CLI usage and security patterns, the agent loads both skills based on their description triggers.

- Remove all cross-skill file links (../other-skill/SKILL.md)
- Inline essential info where links were removed (saga pattern,
  freezing threshold, backup controller commands)
- Drop status and dependencies from metadata (no real consumer)
- Follow existing skill convention for prerequisites format
marc0olo added a commit that referenced this pull request Mar 2, 2026
Covers IC-specific security patterns: access control, anonymous
principal rejection, TOCTOU/reentrancy, pre_upgrade traps, cycles
monitoring, controller backup, fetchRootKey risks, admin guards,
secret storage, storage exhaustion, callback trap inconsistency,
and unbounded wait calls. Both Motoko and Rust implementations.

Reviewed against IC interface specification, DFINITY security best
practices, and recent audit findings. Adds @dfinity/security as
CODEOWNER.

Based on the draft from #51, with corrections:
- inspect_message: specify boundary node bypass, not generic node
- freezing_threshold: default is already 30 days, canister is
  uninstalled not deleted
- fetchRootKey: not deprecated, required for local dev
- Added pitfalls: pre_upgrade trap, storage exhaustion, callback
  trap after state mutation, unbounded wait calls
- Links to official security best practices documentation
marc0olo added a commit that referenced this pull request Mar 2, 2026
Covers IC-specific security patterns: access control, anonymous
principal rejection, TOCTOU/reentrancy, pre_upgrade traps, cycles
monitoring, controller backup, fetchRootKey risks, admin guards,
secret storage, storage exhaustion, callback trap inconsistency,
and unbounded wait calls. Both Motoko and Rust implementations.

Reviewed against IC interface specification, DFINITY security best
practices, and recent audit findings. Adds @dfinity/security as
CODEOWNER.

Based on the draft from #51, with corrections:
- inspect_message: specify boundary node bypass, not generic node
- freezing_threshold: default is already 30 days, canister is
  uninstalled not deleted
- fetchRootKey: not deprecated, required for local dev
- Added pitfalls: pre_upgrade trap, storage exhaustion, callback
  trap after state mutation, unbounded wait calls
- Links to official security best practices documentation
@raymondk raymondk closed this in #59 Mar 2, 2026
@marc0olo marc0olo deleted the marc0olo/rfc-skills-restructuring branch March 3, 2026 08:20
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.

2 participants