← Back to dashboard
claude-skillsaifreshReader view (for NotebookLM)

Claude Skills Integration Guide

What is a Claude Skill?

The real model

An on-demand capability folder with three loading levels: metadata, body, bundled resources.

Level 1: name+description (~100 tokens) in the system prompt; Claude Code caps each entry at 1,536 chars and the whole listing at 1% of context. Level 2: the SKILL.md body (<500 lines) loads on match and stays for the session; after compaction only its first 5k tokens survive. Level 3: references are read when linked, and scripts are executed so only their stdout costs tokens. The same folder runs in Claude Code (.claude/skills), the Agent SDK (settingSources + skills), the GA Skills API (client.skills.create, then container.skills with the code-execution tool, max 20 per request), Managed Agents, claude.ai, and in .agents/skills for Codex, Cursor and Gemini CLI. Test it with claude plugin eval, which scores runs with and without the plugin.

Six things you reach for first

Author one SKILL.md, tune the description, keep context cheap, then prove it works with evals.

Text
 ██████╗██╗      █████╗ ██╗   ██╗██████╗ ███████╗    ███████╗██╗  ██╗██╗██╗     ██╗     ███████╗
██╔════╝██║     ██╔══██╗██║   ██║██╔══██╗██╔════╝    ██╔════╝██║ ██╔╝██║██║     ██║     ██╔════╝
██║     ██║     ███████║██║   ██║██║  ██║█████╗      ███████╗█████╔╝ ██║██║     ██║     ███████╗
██║     ██║     ██╔══██║██║   ██║██║  ██║██╔══╝      ╚════██║██╔═██╗ ██║██║     ██║     ╚════██║
╚██████╗███████╗██║  ██║╚██████╔╝██████╔╝███████╗    ███████║██║  ██╗██║███████╗███████╗███████║
 ╚═════╝╚══════╝╚═╝  ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝    ╚══════╝╚═╝  ╚═╝╚═╝╚══════╝╚══════╝╚══════╝

Claude Skills Integration Guide

Focus: how to author, ship, and test an Agent Skill, a SKILL.md folder Claude loads on demand. The whole system is one idea: a small always-loaded description advertises the skill, and the full instructions (plus scripts and reference files) load only when a request matches. This is the open Agent Skills format. You are packaging reusable expertise here, not wiring tools into an agent runtime.

Overview

A Skill is a folder containing a SKILL.md file: YAML frontmatter (name + description) followed by markdown instructions. It can also bundle reference files and executable scripts. Claude discovers skills automatically and pulls each one into context only when it's relevant, so dozens of installed skills cost roughly 100 tokens each until one fires.

The mechanism is progressive disclosure, three levels of loading:

  1. Metadata (always loaded). Every skill's name and description sit in the system prompt. That is all Claude knows by default: the skill exists, and when to use it.
  2. Instructions (loaded when triggered). When a request matches a description, Claude reads the SKILL.md body. Keep it under 500 lines (about 5k tokens).
  3. Resources (loaded as needed). Bundled reference files are read only when the body points to them. Bundled scripts are executed, never read, so only their output costs tokens. Content on disk that is never opened costs nothing.

The highest-leverage thing you write is the description. Claude picks among potentially 100+ skills using only that text, so it must say what the skill does and when to reach for it, in the third person, with the words a user would actually type.

What's new since the last review (2026-08-23)

AreaWasNow
Skills APIGA, beta header droppedStill GA. SDKs expose it as client.skills.*. Response shapes changed vs the beta (display_name, latest_version_id, source is an object, delete removes all versions). client.beta.skills stops sending skills-2025-10-02 from TS SDK 0.122.0
Command nameSlash command always came from the directoryFrontmatter name now sets the command (name: deploy makes /deploy); the directory name still invokes it too
claude.ai skills in Claude CodeOpt-in pull with CLAUDE_CODE_SYNC_SKILLS=1Auto-synced into ~/.claude/skills/synced/ for claude.ai sign-ins (v2.1.273+). The anthropic-skills name is reserved for them
Agent SDK allowed-toolsFrontmatter ignored for project/personal skillsHonoured, alongside the SDK's allowedTools option
TestingManual, or the skill-creator pluginclaude plugin eval runs each case with and without the plugin, scores it, and exits non-zero for CI
Context budgetNot documentedListing budget = 1% of the context window (skillListingBudgetFraction); /skill-doctor shows cost vs use; skillOverrides hides skills
New fieldsn/abackground (with context: fork); booleans accept yes/no/on/off/1/0
Managed AgentsNot coveredAgents take a skills array (up to 500 per session) and auto-discover .claude/skills in mounted GitHub repos
Cross-agent"open standard"46 clients listed on agentskills.io. .agents/skills/ is the shared path for Codex, Cursor, Gemini CLI and Copilot. Claude Code still reads only .claude/skills/

Official Documentation

SourceURLWhat it covers
Agent Skills overviewhttps://platform.claude.com/docs/en/agents-and-tools/agent-skills/overviewFormat, the 3 loading levels, where skills run, runtime constraints per surface
Authoring best practiceshttps://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practicesDescriptions, naming (gerund form), degrees of freedom, feedback loops, anti-patterns
Skills for enterprisehttps://platform.claude.com/docs/en/agents-and-tools/agent-skills/enterpriseVetting, risk tiers, content scanning, recall limits, version pinning
Skills API guidehttps://platform.claude.com/docs/en/build-with-claude/skills-guide/v1/skills, container.skills, versioning, limits, migrating off skills-2025-10-02
Managed Agents skillshttps://platform.claude.com/docs/en/managed-agents/skillsAttaching skills to hosted agents; repo .claude/skills discovery
Skills in Claude Codehttps://code.claude.com/docs/en/skillsLocations, full frontmatter reference, substitutions, ! injection, forks, skillOverrides, troubleshooting
Skills in the Agent SDKhttps://code.claude.com/docs/en/agent-sdk/skillssettingSources, the skills option, /name dispatch, the init message
Plugin evalshttps://code.claude.com/docs/en/plugin-evalsclaude plugin eval: cases, graders, baseline, mocks, CI exit codes
Plugins / marketplaceshttps://code.claude.com/docs/en/plugins/overviewPackaging skills with agents/hooks/MCP; marketplace.json; install scopes
Agent Skills spechttps://agentskills.io/specificationThe cross-agent standard: six fields, directory layout, skills-ref validate
anthropics/skillshttps://github.com/anthropics/skillsExample + document skills, the spec/, template/, and a plugin marketplace

Nothing to install to author a skill. It is a file format. The packages in this guide's frontmatter are only for the programmatic paths: @anthropic-ai/sdk / anthropic for the Skills API, and @anthropic-ai/claude-agent-sdk for loading skills from your own agent.

Versions verified 2026-10-20

Package / toolVersionSource
@anthropic-ai/sdk (npm)0.135.0npm view @anthropic-ai/sdk version
anthropic (PyPI)1.15.0https://pypi.org/pypi/anthropic/json
@anthropic-ai/claude-agent-sdk (npm)0.3.304npm view
claude-agent-sdk (PyPI)0.2.168https://pypi.org/pypi/claude-agent-sdk/json
Claude Code (@anthropic-ai/claude-code)2.1.304npm view. claude plugin eval needs v2.1.269+
skills-ref (PyPI, spec validator)0.1.1https://pypi.org/pypi/skills-ref/json

Minimum SDKs with the GA client.skills shapes: Python 1.2.0, TypeScript 0.122.0, Go 1.68.0, Java 2.59.0, Ruby 1.67.0, C# 12.44.0.


Frontmatter fields

Every SKILL.md opens with YAML between --- markers on the file's first line. Six fields belong to the portable Agent Skills spec and work everywhere. The rest are Claude Code extensions. Claude Code silently ignores a field name it doesn't recognise (check hyphens), and if the YAML fails to parse, the skill still loads with no metadata, so it can't auto-trigger.

FieldWhereNotes
nameportableLowercase letters, digits, hyphens; max 64 chars; no leading/trailing or double hyphen. On claude.ai / the API it's required, can't contain anthropic, claude, or XML tags, and the spec says it must match the folder name. In Claude Code it's optional: it defaults to the directory name, and when set it becomes the /command (the directory name also still works).
descriptionportableThird person, what + when. Max 1,024 chars, no XML tags. Claude Code truncates the combined description + when_to_use at 1,536 chars in its listing (skillListingMaxDescChars), so put the key use case first. If you omit it, Claude Code uses the body's first non-empty line.
allowed-toolsportable (experimental in spec)Tools pre-approved for the turn that invokes the skill; clears on your next message. The spec says space-separated; Claude Code also takes commas or a YAML list. Grants, never restricts. Ignored when the org sets allowManagedPermissionRulesOnly.
license / compatibility / metadataportableSPDX-style license; compatibility ≤500 chars (e.g. Requires python3); metadata is a string→string map for your own tooling. Claude Code accepts but doesn't act on them.
when_to_useClaude CodeExtra trigger phrases appended to description (shares the 1,536 cap).
disable-model-invocationClaude Codetrue = only a human /name runs it; its description leaves Claude's context. Use for deploy, commit, send-money.
user-invocableClaude Codefalse = Claude-only background knowledge, hidden from the / menu.
context: fork + agent + backgroundClaude CodeRun the skill as the prompt of a new subagent (agent: = Explore, Plan, general-purpose (default), or a custom one). It runs in the background unless background: false, and doesn't see your conversation history.
disallowed-toolsClaude CodeRemove tools from the pool while the skill is active (clears next message).
model / effortClaude CodePer-turn model override (inherit keeps current) and effort (low…max).
pathsClaude CodeGlobs that gate auto-activation to matching files.
arguments / argument-hintClaude CodeNamed positional args for $name; autocomplete hint. $ARGUMENTS, $0, $1 work without declaring.
hooks / shellClaude CodeHooks registered once the skill fires (they last the session); shell: powershell for ! injection.

Portable six. claude.ai uploads, the Skills API, and package_skill.py from anthropics/skills accept only name, description, license, compatibility, metadata, allowed-tools. Any other key hard-fails the upload: Unexpected key(s) in SKILL.md frontmatter: argument-hint. Allowed properties are: allowed-tools, compatibility, description, license, metadata, name. Claude Code-only body features (! injection, ${CLAUDE_SKILL_DIR}) also don't run there. Validate portable skills with skills-ref validate ./my-skill.

Reserved names: a skill about Claude Skills cannot be named claude-skills (reserved word). In Claude Code, don't name a folder synced or anthropic-skills, and avoid zero-width, bidi, no-break-space and </> characters, which make Claude Code refuse the name.


Build your first skill: a worked example

We'll build a codeAmani skill for normalising Kenyan phone numbers to the 2547XXXXXXXX format Daraja requires. (M-Pesa applies only to Kenya-targeted projects; the US-default equivalent would be, for example, a Stripe price-formatting skill. The pattern is identical.) It's a good skill candidate: a fiddly, deterministic rule you'd otherwise paste into chat every time, with a clear trigger.

(a) Directory layout

Text
.claude/skills/normalising-mpesa-phones/
├── SKILL.md                 # metadata + concise instructions
├── references/
│   └── prefixes.md          # full edge-case table (read only when needed)
└── scripts/
    └── normalise.py         # deterministic normaliser (executed, never read)

Use gerund-form names (normalising-mpesa-phones), forward slashes, and descriptive filenames. scripts/, references/, assets/ are the spec's conventional folders.

(b) SKILL.md frontmatter: the description is the trigger

YAML
---
name: normalising-mpesa-phones
description: >-
  Normalises Kenyan phone numbers to the 2547XXXXXXXX / 2541XXXXXXXX format the
  Daraja (M-Pesa) API requires. Use when formatting a phone number for an STK Push,
  a B2C payout, an SMS, or whenever a number arrives as 07.., +2547.., or 2547...
allowed-tools: Bash(python3 ${CLAUDE_SKILL_DIR}/scripts/normalise.py *)
---

A bad description, Helps with phone numbers, gives Claude nothing to match. Include the key terms (Daraja, STK Push, 07.., +254). The allowed-tools rule uses ${CLAUDE_SKILL_DIR}, which Claude Code expands in both the body and Bash rules, so it matches exactly the command the body tells Claude to run. (On non-Claude-Code surfaces, drop the variable or use a plain Bash(python3 *).)

(c) The body: concise instructions

Markdown
# Normalising M-Pesa phone numbers

Daraja rejects anything that is not `254` followed by 9 digits (e.g. `254712345678`).
Normalise every number to that shape **before** calling any Daraja endpoint.

## Rules
- Strip spaces, hyphens, and a leading `+`.
- `07XXXXXXXX` or `01XXXXXXXX` → replace the leading `0` with `254`.
- `7XXXXXXXX` / `1XXXXXXXX` (9 digits) → prepend `254`.
- Already `2547…` / `2541…` (12 digits) → leave as-is.
- Anything else → reject; do not guess.

## Use the bundled script (preferred: deterministic)

    python3 ${CLAUDE_SKILL_DIR}/scripts/normalise.py "0712 345 678"
    # → 254712345678

For the full prefix table (Safaricom vs Airtel, invalid lengths), see
[references/prefixes.md](references/prefixes.md).

prefixes.md is read only if Claude needs it, and normalise.py is executed (its source never enters context). Keep references one level deep from SKILL.md; never chain a.md → b.md → c.md.

(d) The bundled script

Python
#!/usr/bin/env python3
"""Normalise a Kenyan phone number to Daraja's 2547XXXXXXXX format."""
import re, sys

def normalise(raw: str) -> str:
    s = re.sub(r"[\s\-]", "", raw).lstrip("+")
    if re.fullmatch(r"0[17]\d{8}", s):      # 07.. / 01..
        return "254" + s[1:]
    if re.fullmatch(r"[17]\d{8}", s):       # bare 9-digit
        return "254" + s
    if re.fullmatch(r"254[17]\d{8}", s):    # already canonical
        return s
    raise SystemExit(f"Not a valid Kenyan mobile number: {raw!r}")

if __name__ == "__main__":
    print(normalise(sys.argv[1]))

A runnable sibling, examples/SKILL.md + examples/scripts/format_kes.py (integer KES for Daraja, Ksh 1,235 for display), ships in this folder.

(e) allowed-tools: pre-approve just enough

The grant lets Claude run the helper without a prompt during the invoking turn, then clears on your next message (re-applied on each invocation). It never restricts other tools; deny/ask rules still win. Grant narrowly (an exact script path, not bare Bash), use disallowed-tools to lock a skill down, and add disable-model-invocation: true to anything side-effecting. Workspace trust doesn't gate this field: a project skill's allowed-tools applies even in an untrusted -p run, so review the allowed-tools of skills committed to any repo before running Claude Code there.


Where skills live

The same SKILL.md works on every surface; only the install path and limits change. Custom skills do not sync between surfaces, with one exception: Claude Code downloads your claude.ai skills.

SurfaceHow to installScope / notes
Claude Code: enterprise.claude/skills/<name>/ in the managed-settings directoryEvery user on the machine; wins over personal and project
Claude Code: personal~/.claude/skills/<name>/SKILL.mdAll your local projects (not Cowork or cloud sessions)
Claude Code: project.claude/skills/<name>/SKILL.md, committedThis repo; found in cwd and every parent up to the repo root (worktree root in a worktree)
Claude Code: nested<subdir>/.claude/skills/<name>/Loads when Claude first touches files there; clashes become /apps/web:deploy
Claude Code: --add-dir.claude/skills/ inside an added directoryThat session (permissions.additionalDirectories does not load skills)
Claude Code: plugin<plugin>/skills/<name>/SKILL.mdWherever the plugin is enabled, as /plugin:name
Claude Code: claude.ai syncEnable the skill on claude.aiAuto-downloaded to ~/.claude/skills/synced/ when signed in with claude.ai (not API-key auth, Bedrock, bare mode). ! commands don't run for synced skills locally
Claude Agent SDKSame filesystem folders, gated by settingSources + skills, or the plugins optionWhatever the session's setting sources load
Claude APIUpload via /v1/skills, then reference in container.skills with the code-execution toolWorkspace-wide: any key in the workspace can read, invoke, delete. No network, no package installs at runtime
Managed Agents (beta)skills array on the agent, or .claude/skills/ at the root of a mounted GitHub repoUp to 500 skills per session; beta header managed-agents-2026-04-01
claude.ai / CoworkUpload a .zip (Settings / Customize); code execution must be onPer-user (Pro, Max, Team, Enterprise); Enterprise can turn on skill content scanning

Name clashes in Claude Code: enterprise > personal > project; your skill replaces a bundled skill or built-in command of the same name (not its aliases); a skill beats a .claude/commands/ file; plugin skills never clash because they're namespaced. Claude Code watches skill folders, so edits apply mid-session; run /reload-skills for a newly created top-level skills directory. Adding .claude-plugin/plugin.json to a skill folder turns it into a plugin (<name>@skills-dir) and, in a project, requires accepting the workspace-trust dialog.


How progressive disclosure loads a skill

Lifecycle in Claude Code. Once invoked, the rendered body enters the conversation as one message and stays for the session; it isn't re-read each turn (re-invoking with identical content adds only a short "already loaded" note). Write it as standing guidance. After auto-compaction, Claude Code re-attaches the most recent invocation of each skill, keeping the first 5,000 tokens of each within a 25,000-token shared budget, newest first. Put the critical rules at the top, and move must-always-hold rules into a hooks: entry. The allowed-tools grant is the exception: it resets every message.

The listing has a budget. Every model-invocable skill's name and description is in context on every turn. The listing budget is 1% of the model's context window. On overflow, Claude Code drops descriptions of your least-used skills first, which removes their trigger words. Run /skill-doctor (v2.1.252+) to see cost vs use, set low-value skills to "name-only" or "off" in skillOverrides, or raise skillListingBudgetFraction.

How Claude decides to load a skill

If a skill never triggers, the fix is almost always the description. Also check that /skill-name works (if not, the name was refused) and run claude plugin validate .claude/skills (v2.1.233+) to find frontmatter that doesn't parse. If it triggers too eagerly, narrow the description, add paths, or set disable-model-invocation: true.


Claude Code controls worth knowing

Who may invoke. Permission rules gate the Skill tool: deny Skill to disable all skills, Skill(commit) for an exact name, Skill(deploy *) for a prefix. Synced skills live in the anthropic-skills: namespace (Skill(anthropic-skills:pdf)).

Visibility without editing the file. skillOverrides in settings (the /skills menu writes it to .claude/settings.local.json):

JSON
{
  "skillOverrides": {
    "legacy-context": "name-only",
    "deploy": "user-invocable-only",
    "old-helper": "off"
  }
}

Values: on, name-only, user-invocable-only, off. Plugin skills ignore skillOverrides; manage them through /plugin.

Dynamic context. !`git diff HEAD` at the start of a line (or a ```! block) runs before Claude sees the skill, and its output replaces the placeholder. A non-zero exit aborts the whole invocation (append || true where non-zero is normal). Commands are checked against permission rules and never prompt. Disable everywhere with "disableSkillShellExecution": true in managed settings.

Substitutions. $ARGUMENTS, $0/$ARGUMENTS[0], $name (from arguments), ${CLAUDE_SKILL_DIR}, ${CLAUDE_PROJECT_DIR}, ${CLAUDE_SESSION_ID}, ${CLAUDE_EFFORT}, and in plugins ${CLAUDE_PLUGIN_ROOT} / ${CLAUDE_PLUGIN_DATA}.

Bundled skills ship with Claude Code: /doctor, /code-review, /debug, /loop, /run, /verify, /run-skill-generator, /claude-api, and others. A project skill named verify or simplify is run before each commit (v2.1.286+). Turn all bundled skills off with disableBundledSkills.

Non-secret Claude Code settings for skills

Setting / env varWhereEffect
skillOverridessettings.jsonPer-skill visibility (on / name-only / user-invocable-only / off)
skillListingBudgetFractionsettings.jsonListing budget as a fraction of context (default 1%, e.g. 0.02)
skillListingMaxDescCharssettings.jsonPer-entry description cap (default 1,536)
SLASH_COMMAND_TOOL_CHAR_BUDGETenvFixed character budget for the listing
syncClaudeAiSkillsuser / managed settingsfalse stops downloading claude.ai skills
CLAUDE_CODE_SYNC_SKILLSenv1 makes a -p run wait for synced skills before answering
disableBundledSkillssettings.jsonTurn off Claude Code's bundled skills
disableSkillShellExecutionsettings (best in managed)Replace ! commands with a policy placeholder
allowManagedPermissionRulesOnlymanaged settingsIgnore allowed-tools in project/personal skills (v2.1.282+)

How the Agent SDK loads skills

The Agent SDK reads the same filesystem skills as the CLI. There is no programmatic registration API for skills (unlike subagents' agents option).

  • settingSources must include 'project' (project + additionalDirectories skills) and/or 'user' (personal). Defaults load both. If you set it explicitly and omit them, no skills load.
  • skills: "all", a list of exact names (plugin:skill for plugin skills), or []. Omitted = all discovered skills enabled. Setting it adds the Skill tool to allowedTools; with an explicit tools list, include "Skill" yourself. Wildcards such as "docs:*" throw Invalid skill name (TS SDK 0.3.221+).
  • plugins: [{ type: "local", path: "./plugin" }] loads a plugin's skills from a path, the SDK form of --plugin-dir.
TypeScript
import { query, type Options } from "@anthropic-ai/claude-agent-sdk";

const options: Options = {
  cwd: process.cwd(),                    // .claude/skills/ here or in a parent
  settingSources: ["user", "project"],   // required: skills load from disk
  skills: ["formatting-kes", "normalising-mpesa-phones"], // or "all" / []
  allowedTools: ["Read", "Bash(python3 *)"],
};

for await (const message of query({ prompt: "Format 1234.9 KES for Daraja", options })) {
  if (message.type === "system" && message.subtype === "init") {
    console.log("skills:", message.skills, "commands:", message.slash_commands);
  }
  if (message.type === "result") console.log(message.subtype);
}

/<name> in the prompt dispatches a user-invocable skill even if it's not in your skills list. Through the SDK or -p, only the first stacked skill expands. The init message's skills array lists user-invocable skills only. Correction to the previous revision: the skill's allowed-tools frontmatter is honoured in SDK sessions (alongside the allowedTools option) unless the org sets allowManagedPermissionRulesOnly. Forked skills always block for their result in SDK/-p runs.


Skills API (GA): upload, call, version

The Skills API is out of beta: no anthropic-beta header, client.skills.* in every SDK. Skills run inside the code-execution tool's container, so every request needs that tool.

TypeScript
import fs from "node:fs";
import Anthropic, { toFile } from "@anthropic-ai/sdk";

const client = new Anthropic(); // reads ANTHROPIC_API_KEY

const skill = await client.skills.create({
  files: [await toFile(fs.createReadStream("formatting-kes.zip"), "skill.zip")],
});

const response = await client.messages.create({
  model: "claude-opus-5-5",
  max_tokens: 2048,
  container: {
    skills: [{ type: "custom", skill_id: skill.id, version: skill.latest_version_id }],
  },
  tools: [{ type: "code_execution_20250825", name: "code_execution" }],
  messages: [{ role: "user", content: "Format 1234.9 KES for an STK Push Amount." }],
});

// New version = full snapshot; SKILL.md `name` must stay the same.
const v2 = await client.skills.versions.create(skill.id, {
  files: [await toFile(fs.createReadStream("formatting-kes.zip"), "skill.zip")],
});

The full runnable file, with list and delete, is examples/skills-api.mts. Type-checked with tsc --strict against @anthropic-ai/sdk@0.135.0. Python: client.skills.create(files=files_from_dir("formatting-kes")) via from anthropic.lib import files_from_dir. CLI: ant apply <dir> (records the ID in claude-lock.json).

ItemValue
Pre-built skill IDspptx, xlsx, docx, pdf (type: "anthropic", version like 20251013 or latest)
Custom skill IDsskill_01… (type: "custom"), versions skver_01… or latest
Skills per request20 max
Upload size30 MB uncompressed; SKILL.md at the upload root or under one top-level folder
display_nameOptional, ≤255 chars, not unique; derived from name
RuntimeNo network, no runtime package installs; files mount at /skills/{name}/
Container reusePass container: { id, skills } on the next turn
Code execution priceFree when the request also has web_search_20260209 / web_fetch_20260209 or later; otherwise 1,550 free container-hours/org/month, then $0.05 per container-hour
Data retentionSkills are not ZDR-eligible; Compliance API audit log records create/delete

Migrating off the beta (skills-2025-10-02): drop the header; client.beta.skills → client.skills; display_title → display_name; latest_version (epoch string) → latest_version_id (skver_…); read source.type (now an object); list responses lose has_more, and version lists are newest-first; DELETE /v1/skills/{id} now deletes every version, and deleting a skill's only version returns 400. Pin versions in production, because latest follows anyone's upload in the workspace.

Secrets for these paths (server-side only):

Bash
ANTHROPIC_API_KEY=sk-ant-...

Ship skills in a plugin and marketplace

Use a plugin when several skills (plus agents, hooks, or MCP servers) should install as one versioned unit. A plugin is a directory with an optional .claude-plugin/plugin.json (name is the only required key) and components at the root:

Text
codeamani-kenya/
├── .claude-plugin/plugin.json      # { "name": "codeamani-kenya", "version": "1.0.0" }
├── skills/
│   ├── formatting-kes/SKILL.md     # → /codeamani-kenya:formatting-kes
│   └── normalising-mpesa-phones/SKILL.md
└── evals/                          # claude plugin eval cases (results/ in .gitignore)

A marketplace is a repo with .claude-plugin/marketplace.json listing plugins (name, owner, plugins[] with name + source). Users run /plugin marketplace add <owner/repo> then /plugin install <plugin>@<marketplace>. Useful CLI: claude plugin init <name> --with skills (scaffolds a skills-dir plugin in ~/.claude/skills/<name>/), claude plugin validate ./plugin --strict [--json], claude --plugin-dir ./plugin for one-session testing. Anthropic's own: claude-plugins-official (added automatically) and anthropics/skills (/plugin install document-skills@anthropic-agent-skills). Every enabled plugin's skill descriptions cost context every turn, even unused ones.

Test skills with claude plugin eval

Seeing a skill fire isn't proof it helps. claude plugin eval (Claude Code v2.1.269+) runs each case in an isolated claude -p session with only your plugin, three runs by default, and repeats them without the plugin to report WITH, W/OUT and Δ.

Bash
claude plugin eval init                  # Claude interviews you and writes evals/<case>/
claude plugin eval .                     # run every case, both arms
claude plugin eval . --case formats-kes-for-daraja --runs 1 --ablation none   # quick iterate

A case is evals/<case>/prompt.md (frontmatter max_turns, timeout_seconds, allowed_tools, runs, tags, model; the body is the prompt) plus graders/*.md. There are six grader types: regex, tool_used, tool_order, file_exists (free), and llm, baseline (judge model, 2-of-3 votes). The tool_used: Skill "did it fire" grader is reported but excluded from the score in two-arm runs, so Δ stays honest. Use arm: both with min: 0, max: 0 for "must not fire" negatives. Worked cases: examples/plugin-eval/.

Runs grant only read-only tools unless you pass --allow-tools. Granting Bash requires an OS sandbox, which native Windows lacks, so run shell-granting suites under WSL2. MCP servers are mocked from evals/mocks/<server>/<tool>.md unless you pass --allow-real-servers / --mocks off.

CI gate:

Bash
claude plugin eval . --trust-plugin --json results.json --threshold 0.8 \
  --model claude-sonnet-5 --judge-model claude-haiku-4-5 --no-publish --max-cost-usd 20

Exit 0 pass, 1 below threshold or a load/run error, 2 partial (cost ceiling hit or auth rejected), 130/143 interrupted. Δ never changes the exit code. Every run and judge call is billed to your plan or API key. For a single skill inside a conversation, the skill-creator plugin (/plugin install skill-creator@claude-plugins-official) runs a similar loop with its own evals/evals.json format; the two formats aren't interchangeable.


Cross-agent support: one SKILL.md, many agents

The Agent Skills spec is open and the client showcase lists 46 products. The folder format is identical; discovery paths differ:

AgentProject pathUser pathNotes
Claude Code.claude/skills/~/.claude/skills/Does not read .agents/skills/
OpenAI Codex / ChatGPT.agents/skills/ (cwd → repo root)~/.agents/skills/, admin /etc/codex/skillsExplicit invoke $skill-name; optional agents/openai.yaml (allow_implicit_invocation: false)
Cursor.cursor/skills/, .agents/skills/~/.cursor/skills/, ~/.agents/skills/Also reads .claude/skills/, .codex/skills/ and their ~ forms. Supports paths, disable-model-invocation; /migrate-to-skills converts rules/commands
GitHub Copilot / VS Code.github/skills/, .claude/skills/, .agents/skills/~/.copilot/skills/, ~/.agents/skills/
Gemini CLI.gemini/skills/, .agents/skills/ (alias wins)~/.gemini/skills/, ~/.agents/skills/
OthersAmp, OpenCode, Goose, Junie, Roo Code, Kiro, Factory, OpenHands, Letta, Spring AI…See each client's docs on agentskills.io

Portable-skill rules: stick to the six spec fields (Cursor and Codex require name and description, and name must equal the folder name); reference files by relative path instead of ${CLAUDE_SKILL_DIR}; avoid ! injection; keep allowed-tools space-separated (it's experimental and support varies). To serve Claude Code and .agents/skills agents from one repo, keep the source in one folder and symlink the other (Claude Code and Codex both follow symlinked skill folders).


Authoring checklist

  • description is third-person, states what + when, front-loads the key use case and trigger words, ≤1,024 chars.
  • name is lowercase-hyphen, ≤64 chars, matches the folder, avoids anthropic/claude/XML (or is omitted in Claude Code-only skills).
  • Body under 500 lines, most important rules first (compaction keeps only the first 5k tokens); bulk moved to references/ or scripts.
  • Supporting files linked one level deep; reference files >100 lines open with a table of contents.
  • Scripts handle their own errors with clear exit codes, document constants, and read secrets only from the environment.
  • allowed-tools grants narrowly; side-effecting skills set disable-model-invocation: true.
  • Frontmatter limited to the portable six if it will go to claude.ai, the API, or other agents; skills-ref validate / claude plugin validate pass.
  • Eval cases cover should-fire and should-not-fire prompts; Δ is positive on the models you'll run.
  • No time-sensitive "before <date>" text; forward slashes in paths.

codeAmani notes

  • Secrets stay server-side. A skill bundles instructions and scripts, never credentials. SKILL.md and its scripts go in git, so they contain zero secrets; a script that must call Stripe, Daraja or Supabase reads STRIPE_SECRET_KEY / DARAJA_CONSUMER_SECRET / SUPABASE_SERVICE_ROLE_KEY from the environment at runtime (the Hazina vault injects them). Skills on the API can't reach the network anyway. Never upload a skill containing customer data: Skills aren't ZDR-eligible.
  • Audit third-party skills like software. A skill runs code with your permissions, and a project skill's allowed-tools applies even in untrusted folders. Review every file, pin API skill versions, and never --trust-plugin an eval suite you didn't write.
  • AI routing stays Claude-primary. Skills are how we make Claude a specialist; they complement the house routing (Claude for reasoning/code gen, OpenAI GPT-4o for structured output, HuggingFace for open models). The same SKILL.md also works in Cursor and Codex, so house conventions follow a teammate who uses another agent.
  • Payments: Stripe by default. Build US-first skills first (Stripe checkout and webhook-signature rules, unit_amount in cents). The Kenya skills (normalising-mpesa-phones, formatting-kes, verifying-mpesa-callbacks with idempotency on CheckoutRequestID, a Swahili-tone copy skill) apply only to Kenya-targeted projects (see daraja-api). Gate them with paths or keep them in the Kenya app repos so they don't crowd the listing elsewhere.
  • Ship them as project skills, then a plugin. Commit .claude/skills/<name>/ so every teammate and CI agent inherits the convention. Workshop drafts in skill-library/, graduate to plugin/skills/ (this repo's plugin), and gate graduation on a passing claude plugin eval suite with a positive Δ. Eval runs that grant Bash need WSL2 on our Windows machines.
  • Watch the listing budget. We have many plugins enabled; run /skill-doctor periodically and set rarely used skills to name-only so trigger words for the important ones aren't truncated.