Skip to content
Back to skills

Creating A New Skill

CSecurity

This document contains ALL the information needed to create effective Agent Skills for Claude Code, Claude.ai, and the Claude Developer Platform. > Agent Skills are now a formal open standard at **[agentskills.io](https://agentskills.io)**, adopted by 35+ tools (Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenAI Codex, Goose, Kiro, OpenHands, Letta, Amp, Junie, Databricks Genie, Snowflake Cortex Code, Spring AI, Laravel Boost, Factory, OpenCode, Roo Code, and more). **Claude Code implements ...

  • 8 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 18, 2026
ai-agentstypescriptpythonrustgoshellbashreactvuenoderails

Works with

  • claude code
  • claude desktop
  • cursor
  • terminal
  • cli
  • api
  • mcp

Security analysis

C71/100
  • criticalPipes output to a shell interpreter
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned December 1, 2026

npx -y skills add ventz/ai-skills-agents-context --skill creating-a-new-skill --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Creating A New Skill?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Creating A New Skill
[![Security: C — Skills Directory](https://www.skillsdirectory.com/api/skills/ventz-creating-a-new-skill/badge)](https://www.skillsdirectory.com/skills/ventz-creating-a-new-skill)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Comprehensive Agent Skills Documentation

This document contains ALL the information needed to create effective Agent Skills for Claude Code, Claude.ai, and the Claude Developer Platform.

> Agent Skills are now a formal open standard at **[agentskills.io](https://agentskills.io)**, adopted by 35+ tools (Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenAI Codex, Goose, Kiro, OpenHands, Letta, Amp, Junie, Databricks Genie, Snowflake Cortex Code, Spring AI, Laravel Boost, Factory, OpenCode, Roo Code, and more). **Claude Code implements a superset** of the standard — see [Agent Skills Open Standard](#agent-skills-open-standard-agentskillsio) for the spec and the Claude-Code-only extensions.

## Start Here — Task Router

**How to use this file.** This is the single file to point an agent at for anything about Agent Skills: planning, writing, testing, packaging, shipping and securing a skill on Claude Code, claude.ai/Cowork, the Claude API, Managed Agents and the Agent SDK, plus the agentskills.io standard that other tools follow. Find your task in the router, read only the sections it names, and finish with the [Checklist](#checklist-for-effective-skills).

- **Coverage:** the [agentskills.io spec](https://agentskills.io/specification); [Claude Code skills docs](https://code.claude.com/docs/en/skills); the platform [overview][overview], [best practices][best-practices], [enterprise][enterprise] and [Skills API][skills-guide] pages; [Agent SDK skills][sdk-skills]; Anthropic's [*The Complete Guide to Building Skills for Claude*][pdf-guide] (PDF, January 2026); the [`skill-creator`][skill-creator] plugin (claude-plugins-official @ `a2e251d`); the post [*Equipping agents for the real world with Agent Skills*][eng-post]; and *field lessons* from shipping a skill to non-technical external users.
- **Last verified:** 2026-11-21 for platform pages, the PDF and skill-creator; Claude Code specifics last checked 2026-10-03 (see the version notes at the end).
- **When sources disagree:** live product docs (code.claude.com, platform.claude.com) > agentskills.io spec > what skill-creator's scripts actually enforce > the PDF (dated January 2026) > field lessons. Each disagreement is marked **Sources differ** where it matters.
- **Rule words:** MUST / MUST NOT = an upload, validator or API rejects it otherwise. SHOULD = official guidance. *Field lesson* = learned shipping a real skill; not official, and labeled wherever it extends the official guidance.

| I want to… | Read | Verify with |
|---|---|---|
| Decide whether this should be a skill, and scope it | [Planning a Skill](#planning-a-skill-use-cases-categories-and-success-criteria), [Skills vs Prompts](#skills-vs-prompts) | 2–3 written use cases with trigger, steps, result |
| Write a minimal valid skill now | [Skill Structure](#skill-structure), [YAML Frontmatter Reference](#yaml-frontmatter-reference), [Complete Examples](#complete-examples) | `skills-ref validate ./my-skill`, or skill-creator `scripts/quick_validate.py` |
| Make it trigger, or stop it over-triggering | [Writing Effective Descriptions](#writing-effective-descriptions), [Triggering in Practice](#triggering-in-practice) | Trigger eval: 8–10 should and 8–10 near-miss should-not queries |
| Decide what goes in a script vs. instructions | [Degrees of Freedom](#2-set-appropriate-degrees-of-freedom), [Code for Facts, Claude for Judgment](#code-for-facts-claude-for-judgment) | Same input twice gives identical numbers; validator passes |
| Keep SKILL.md small | [Progressive Disclosure Patterns](#progressive-disclosure-patterns) | Body under 500 lines; references one level deep |
| Write instructions Claude actually follows | [Writing Style: Explain the Why](#writing-style-explain-the-why), [Workflows and Feedback Loops](#workflows-and-feedback-loops) | Fresh-session run follows every step |
| Wrap an MCP server's tools in a workflow | [Skills + MCP Workflow Patterns](#skills--mcp-workflow-patterns), [MCP Tool References](#mcp-tool-references) | The MCP tool works when called directly, without the skill |
| Use Claude Code features (arguments, `` !`cmd` ``, fork, hooks, permissions) | [Invocation Control](#invocation-control) through [Reference vs Task Content](#reference-vs-task-content), [Skill Permission Control](#skill-permission-control-claude-code) | `/skills`, `claude plugin validate`, `--debug` |
| Run it on claude.ai, the API, Managed Agents or the Agent SDK | [Using Skills Across Platforms](#using-skills-across-platforms), [Frontmatter Outside Claude Code](#frontmatter-outside-claude-code-portability) | Upload succeeds with only the six spec fields |
| Test and improve it | [Evaluation and Iteration](#evaluation-and-iteration) | skill-creator benchmark: with-skill vs baseline |
| Ship it to other people | [Distribution, Versioning and Shipping](#distribution-versioning-and-shipping) | Clone-and-run passes; installed copy diffs clean against the build |
| Review someone else's skill | [Security Considerations](#security-considerations) | Risk-tier table and 8-step review checklist |
| Fix "doesn't trigger", "ignores instructions", "upload fails" | [Troubleshooting](#troubleshooting) | — |
| Final pre-ship pass | [Checklist for Effective Skills](#checklist-for-effective-skills) | Every box ticked |

[pdf-guide]: https://resources.anthropic.com/hubfs/The-Complete-Guide-to-Building-Skill-for-Claude.pdf
[skill-creator]: https://github.com/anthropics/claude-plugins-official/tree/a2e251d9b97b909bf728b3e84fc8d17e6aba0063/plugins/skill-creator/skills/skill-creator
[overview]: https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview
[best-practices]: https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices
[enterprise]: https://platform.claude.com/docs/en/agents-and-tools/agent-skills/enterprise
[skills-guide]: https://platform.claude.com/docs/en/build-with-claude/skills-guide
[sdk-skills]: https://code.claude.com/docs/en/agent-sdk/skills
[eng-post]: https://www.anthropic.com/research/equipping-agents-for-the-real-world-with-agent-skills

---

## Table of Contents

0. [Start Here — Task Router](#start-here--task-router)
1. [Introduction](#introduction)
2. [What are Agent Skills?](#what-are-agent-skills)
3. [How Skills Work](#how-skills-work)
4. [Core Principles for Creating Skills](#core-principles-for-creating-skills)
4a. [Planning a Skill: Use Cases, Categories and Success Criteria](#planning-a-skill-use-cases-categories-and-success-criteria)
5. [Skill Structure](#skill-structure)
6. [Invocation Control](#invocation-control)
7. [String Substitutions](#string-substitutions)
8. [Dynamic Context Injection](#dynamic-context-injection)
9. [Running Skills in a Subagent](#running-skills-in-a-subagent)
9a. [Skill Content Lifecycle (Claude Code)](#skill-content-lifecycle-claude-code)
9b. [Reference vs Task Content](#reference-vs-task-content)
10. [Writing Effective Descriptions](#writing-effective-descriptions)
11. [Progressive Disclosure Patterns](#progressive-disclosure-patterns)
12. [Workflows and Feedback Loops](#workflows-and-feedback-loops)
13. [Content Guidelines](#content-guidelines)
14. [Common Patterns](#common-patterns)
14a. [Skills + MCP Workflow Patterns](#skills--mcp-workflow-patterns)
15. [Anti-Patterns to Avoid](#anti-patterns-to-avoid)
16. [Advanced: Skills with Executable Code](#advanced-skills-with-executable-code)
16a. [Code for Facts, Claude for Judgment](#code-for-facts-claude-for-judgment)
17. [Using Skills Across Platforms](#using-skills-across-platforms)
17a. [Distribution, Versioning and Shipping](#distribution-versioning-and-shipping)
18. [Bundled Skills (Claude Code)](#bundled-skills-claude-code)
19. [Skill Permission Control (Claude Code)](#skill-permission-control-claude-code)
20. [Evaluation and Iteration](#evaluation-and-iteration)
21. [Security Considerations](#security-considerations)
22. [Troubleshooting](#troubleshooting)
23. [Complete Examples](#complete-examples)
24. [Agent Skills Open Standard (agentskills.io)](#agent-skills-open-standard-agentskillsio)
25. [Checklist for Effective Skills](#checklist-for-effective-skills)

---

## Introduction

Agent Skills are organized folders of instructions, scripts, and resources that agents can discover and load dynamically to perform better at specific tasks. Skills provide Claude with domain-specific expertise, workflows, context, and best practices that transform general-purpose agents into specialists.

### Why Use Skills

**Skills are reusable, filesystem-based resources** that provide:

- **Specialize Claude**: Tailor capabilities for domain-specific tasks
- **Reduce repetition**: Create once, use automatically across multiple conversations
- **Compose capabilities**: Combine Skills to build complex workflows
- **Efficient context usage**: Only loads what's needed, when it's needed
- **Portable**: Same format works across Claude.ai, Claude API, Claude Code, and Claude Agent SDK

### Key Characteristics

**Skills are:**

- **Dual-invocable**: Both model-invoked (Claude autonomously decides when to use them) AND user-invocable (type `/skill-name` to invoke directly). Frontmatter fields let you restrict to one or the other
- **Composable**: Skills stack together. Claude automatically identifies which skills are needed and coordinates their use
- **Portable**: Skills use the same format everywhere. Build once, use across Claude apps, Claude Code, and API
- **Efficient**: Progressive disclosure - only loads what's needed, when it's needed
- **Powerful**: Skills can include executable code for tasks where traditional programming is more reliable than token generation

> **Note**: Custom commands (`.claude/commands/`) have been merged into skills. A file at `.claude/commands/review.md` and a skill at `.claude/skills/review/SKILL.md` both create `/review` and work the same way. Your existing `.claude/commands/` files keep working. Skills add optional features: a directory for supporting files, frontmatter to control invocation, and the ability for Claude to load them automatically when relevant. If a skill and a command share the same name, the skill takes precedence.

---

## What are Agent Skills?

Agent Skills package expertise into discoverable capabilities. Each Skill consists of:

1. **SKILL.md file** (required) with YAML frontmatter containing name and description
2. **Instructions** in the body of SKILL.md that Claude reads when relevant
3. **Optional supporting files** like additional markdown documentation, scripts, templates, and resources

Skills leverage Claude's VM environment to provide capabilities beyond what's possible with prompts alone. Claude operates in a virtual machine with filesystem access, allowing Skills to exist as directories containing instructions, executable code, and reference materials.

### Skills vs Prompts

| Feature | Skills | Prompts |
|---------|--------|---------|
| **Scope** | Reusable across conversations | Single conversation |
| **Invocation** | Both user (`/name`) and Claude (automatic) | Manual only |
| **Loading** | On-demand, progressive | All upfront |
| **Discovery** | Automatic based on metadata | Manual invocation |
| **Context** | Minimal until triggered | Consumes context immediately |
| **Updates** | Edit files, changes persist | Re-type each time |
| **Code** | Can bundle executable scripts | Only generated on-the-fly |
| **Arguments** | Support `$ARGUMENTS` substitution | N/A |

---

## How Skills Work

### Three Levels of Loading (Progressive Disclosure)

Skills leverage **progressive disclosure**: Claude loads information in stages as needed, rather than consuming context upfront.

#### Level 1: Metadata (always loaded)

**Content type: Instructions**. The Skill's YAML frontmatter provides discovery information:

```yaml
---
name: pdf-processing
description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
---
```

Claude loads this metadata at startup and includes it in the system prompt. This lightweight approach means you can install many Skills without context penalty; Claude only knows each Skill exists and when to use it.

**Token cost**: ~100 tokens per Skill

#### Level 2: Instructions (loaded when triggered)

**Content type: Instructions**. The main body of SKILL.md contains procedural knowledge: workflows, best practices, and guidance.

When you request something that matches a Skill's description, Claude reads SKILL.md from the filesystem via bash. Only then does this content enter the context window.

**Token cost**: Under 5k tokens (keep SKILL.md body under 500 lines)

> **Sources differ on body size:** the [overview][overview] says under 5k tokens, [skill-creator] says under 500 lines is ideal (add a layer of hierarchy with clear pointers as you approach it; give reference files over 300 lines a table of contents), and the [PDF][pdf-guide] says under 5,000 words. Aim for the tightest: under 500 lines and about 5k tokens.

#### Level 3: Resources and Code (loaded as needed)

**Content types: Instructions, code, and resources**. Skills can bundle additional materials:

```
pdf-skill/
├── SKILL.md (main instructions)
├── FORMS.md (form-filling guide)
├── REFERENCE.md (detailed API reference)
└── scripts/
    └── fill_form.py (utility script)
```

- **Instructions**: Additional markdown files containing specialized guidance and workflows
- **Code**: Executable scripts that Claude runs via bash; scripts provide deterministic operations without consuming context
- **Resources**: Reference materials like database schemas, API documentation, templates, or examples

Claude accesses these files only when referenced.

**Token cost**: Effectively unlimited. Files executed via bash don't load into context; only output consumes tokens.

| Level | When Loaded | Token Cost | Content |
|-------|-------------|------------|---------|
| **Level 1: Metadata** | Always (at startup) | ~100 tokens per Skill | `name` and `description` from YAML frontmatter |
| **Level 2: Instructions** | When Skill is triggered | Under 5k tokens | SKILL.md body with instructions and guidance |
| **Level 3+: Resources** | As needed | Effectively unlimited | Bundled files executed via bash without loading contents into context |

### The Skills Architecture

Skills run in a code execution environment where Claude has filesystem access, bash commands, and code execution capabilities.

**How Claude accesses Skill content:**

1. **Metadata pre-loaded**: At startup, name and description from all Skills' YAML frontmatter are loaded into the system prompt
2. **Files read on-demand**: Claude uses bash to access SKILL.md and other files from the filesystem when needed
3. **Scripts executed efficiently**: Utility scripts can be executed via bash without loading their full contents into context. Only the script's output consumes tokens
4. **No context penalty for large files**: Reference files, data, or documentation don't consume context tokens until actually read

**What this architecture enables:**

- **On-demand file access**: Claude reads only the files needed for each specific task
- **Efficient script execution**: When Claude runs `validate_form.py`, the script's code never loads into the context window. Only the script's output consumes tokens
- **No practical limit on bundled content**: Because files don't consume context until accessed, Skills can include comprehensive documentation, large datasets, extensive examples, or any reference materials

### Example: Loading a PDF Processing Skill

Here's how Claude loads and uses a PDF processing skill:

1. **Startup**: System prompt includes: `PDF Processing - Extract text and tables from PDF files, fill forms, merge documents`
2. **User request**: "Extract the text from this PDF and summarize it"
3. **Claude invokes**: `bash: read pdf-skill/SKILL.md` → Instructions loaded into context
4. **Claude determines**: Form filling is not needed, so FORMS.md is not read
5. **Claude executes**: Uses instructions from SKILL.md to complete the task

Only relevant content occupies the context window at any given time.

---

## Core Principles for Creating Skills

### 1. Concise is Key

The context window is a public good. Your Skill shares it with everything else Claude needs to know.

**Default assumption**: Claude is already very smart. Only add context Claude doesn't already have.

Challenge each piece of information:
- "Does Claude really need this explanation?"
- "Can I assume Claude knows this?"
- "Does this paragraph justify its token cost?"

**Good example: Concise** (approximately 50 tokens):

````markdown
## Extract PDF text

Use pdfplumber for text extraction:

```python
import pdfplumber

with pdfplumber.open("file.pdf") as pdf:
    text = pdf.pages[0].extract_text()
```
````

**Bad example: Too verbose** (approximately 150 tokens):

```markdown
## Extract PDF text

PDF (Portable Document Format) files are a common file format that contains
text, images, and other content. To extract text from a PDF, you'll need to
use a library. There are many libraries available for PDF processing, but we
recommend pdfplumber because it's easy to use and handles most cases well.
First, you'll need to install it using pip. Then you can use the code below...
```

### 2. Set Appropriate Degrees of Freedom

Match the level of specificity to the task's fragility and variability.

**High freedom** (text-based instructions):
- Multiple approaches are valid
- Decisions depend on context
- Heuristics guide the approach

**Medium freedom** (pseudocode or scripts with parameters):
- A preferred pattern exists
- Some variation is acceptable
- Configuration affects behavior

**Low freedom** (specific scripts, few or no parameters):
- Operations are fragile and error-prone
- Consistency is critical
- A specific sequence must be followed

**Analogy**: Think of Claude as a robot exploring a path:
- **Narrow bridge with cliffs**: Only one safe way forward. Provide specific guardrails (low freedom)
- **Open field**: Many paths lead to success. Give general direction and trust Claude (high freedom)

### 3. Test with All Models You Plan to Use

Skills act as additions to models, so effectiveness depends on the underlying model. Test with:

- **Claude Haiku** (fast, economical): Does the Skill provide enough guidance?
- **Claude Sonnet** (balanced): Is the Skill clear and efficient?
- **Claude Opus** (powerful reasoning): Does the Skill avoid over-explaining?

### 4. Build Evaluations First

**Create evaluations BEFORE writing extensive documentation.** This ensures your Skill solves real problems.

**Evaluation-driven development:**

1. **Identify gaps**: Run Claude on representative tasks without a Skill. Document specific failures or missing context
2. **Create evaluations**: Build three scenarios that test these gaps
3. **Establish baseline**: Measure Claude's performance without the Skill
4. **Write minimal instructions**: Create just enough content to address the gaps and pass evaluations
5. **Iterate**: Execute evaluations, compare against baseline, and refine

### 5. Code for Facts, Claude for Judgment

Counting, thresholds, ranking, format conversion and validation belong in bundled scripts; interpretation, explanation and writing belong to Claude; and a script checks Claude's structured output before anyone acts on it. "Code is deterministic; language interpretation isn't" ([PDF][pdf-guide]). Full rules: [Code for Facts, Claude for Judgment](#code-for-facts-claude-for-judgment).

---

## Planning a Skill: Use Cases, Categories and Success Criteria

Sources: [PDF][pdf-guide] ch. 2; [skill-creator][skill-creator] "Capture Intent"; [engineering post][eng-post].

**Start from observed gaps, not imagined ones.** Run Claude on representative tasks without a skill, note where it struggles or needs context you had to supply, and build the skill to close those gaps ([eng-post]). Fastest signal: iterate on **one hard task** until Claude succeeds, extract the winning approach into a skill, then widen to more cases ([PDF][pdf-guide]). If the workflow just happened in the conversation ("turn this into a skill"), mine it first: tools used, step order, corrections the user made, input and output formats ([skill-creator]).

**Write 2–3 concrete use cases before any instructions:**

```text
Use case: Project sprint planning
Trigger:  "help me plan this sprint", "create sprint tasks"
Steps:    1. Fetch project status (Linear MCP)  2. Analyze velocity and capacity
          3. Propose prioritization             4. Create tasks with labels and estimates
Result:   Planned sprint, tasks created
```

Answer before drafting ([skill-creator]): What should Claude be able to do? When should it trigger (phrases, contexts)? What is the output format? Is the output objectively checkable (file transforms, extraction, fixed steps → write test cases) or subjective (style, design → human review)?

**Pick the category**; it decides the techniques ([PDF][pdf-guide]):

| Category | For | Key techniques | Example |
|---|---|---|---|
| 1. Document and asset creation | Consistent output: documents, decks, designs, code | Embedded style guide, templates, quality checklist before finalizing; built-in tools only | `frontend-design`, `docx`, `pptx`, `xlsx` |
| 2. Workflow automation | Multi-step processes with a fixed method, possibly across MCP servers | Ordered steps with validation gates, templates, review-and-refine loops | `skill-creator` |
| 3. MCP enhancement | Turning raw MCP tool access into reliable workflows | Sequenced MCP calls, embedded domain rules, context users would otherwise supply, MCP error handling | `sentry-code-review` |

Also decide **problem-first** (the user states an outcome; the skill picks and orders the tools) or **tool-first** (the user has a connector; the skill teaches the best way to use it). Most skills lean one way ([PDF][pdf-guide]).

**Define success criteria up front.** The PDF calls these rough targets ("an element of vibes-based assessment"), not thresholds:

| Criterion | Target | How to measure |
|---|---|---|
| Triggers when it should | ~90% of relevant queries | 10–20 should-trigger queries; count auto-loads vs explicit invocations |
| Efficiency | Fewer tool calls and tokens than without the skill | Same task with and without the skill |
| Reliability | 0 failed API/MCP calls per workflow | Server logs during test runs: retries, error codes |
| No steering | User never has to prompt the next step | Count redirects and clarifications during testing |
| Consistency | Same structure and quality across runs | Run the same request 3–5 times and compare |
| First-try success | A new user succeeds with minimal guidance | Beta users |

**Composability:** Claude can load several skills at once; don't write yours as if it were the only capability available ([PDF][pdf-guide]).

---

## Skill Structure

### Basic Directory Structure

```
my-skill/
├── SKILL.md              (required)
├── reference.md          (optional documentation)
├── examples.md           (optional examples)
├── scripts/
│   └── helper.py         (optional utility)
└── templates/
    └── template.txt      (optional template)
```

The standard and the [PDF][pdf-guide] name the optional folders `scripts/` (executable code), `references/` (docs loaded on demand) and `assets/` (templates, fonts, icons used in output). The file MUST be named exactly `SKILL.md`; don't put a `README.md` inside the skill folder ([Packaging rules](#distribution-versioning-and-shipping)).

### SKILL.md Format

Every Skill requires a `SKILL.md` file with YAML frontmatter:

```yaml
---
name: your-skill-name
description: Brief description of what this Skill does and when to use it
---

# Your Skill Name

## Instructions
[Clear, step-by-step guidance for Claude to follow]

## Examples
[Concrete examples of using this Skill]
```

### YAML Frontmatter Reference

All fields are optional. Only `description` is recommended so Claude knows when to use the skill.

| Field | Required | Description |
|-------|----------|-------------|
| `name` | No | Display name for the skill. If omitted, uses the directory name. 1–64 chars, lowercase `a-z`, digits, hyphens only. No leading/trailing hyphen, no consecutive `--`. Must match the parent directory name. |
| `description` | Recommended | What the skill does and when to use it. Claude uses this to decide when to apply the skill. If omitted, Claude Code uses the first non-empty line of the markdown body. **Claude Code**: `description + when_to_use` combined is capped at **1,536 chars** in the skill listing (tunable via the `skillListingMaxDescChars` setting). **agentskills.io standard**: `description` alone capped at **1,024 chars**. Front-load the key use case. |
| `when_to_use` | No | *(Claude Code)* Additional trigger phrases / example requests, appended to `description` in the skill listing. Counts toward the 1,536-char cap. |
| `argument-hint` | No | Hint shown during autocomplete to indicate expected arguments. Example: `[issue-number]` or `[filename] [format]`. |
| `arguments` | No | *(Claude Code)* Named positional arguments for `$name` substitution. Space-separated string or YAML list; names map to positions in order. |
| `disable-model-invocation` | No | Set to `true` to prevent Claude from automatically loading this skill. Use for workflows you want to trigger manually with `/name`. Also prevents preloading into subagents. Default: `false`. |
| `user-invocable` | No | Set to `false` when only Claude should invoke the skill: it's hidden from the `/` menu and typing `/name` doesn't run it. Use for background knowledge users shouldn't invoke directly. Default: `true`. |
| `allowed-tools` | No | Tools Claude can use without asking **during the turn that invokes the skill**; the grant clears when the user sends the next message (re-invoking re-applies it). Space- or comma-separated string, or YAML list. Doesn't restrict other tools. **Not gated by workspace trust** — a repo skill's grant applies even in an untrusted folder, so review `allowed-tools` in checked-in skills. Ignored when the org sets `allowManagedPermissionRulesOnly` (v2.1.282+). |
| `disallowed-tools` | No | *(Claude Code)* Tools removed from Claude's pool while the skill is active, e.g. `AskUserQuestion` for an autonomous loop. Space/comma string or YAML list. Clears on the next user message. Can't remove `EndConversation` while any other tool remains. |
| `model` | No | *(Claude Code)* Model for the rest of the current turn; not saved, the session model resumes on the next prompt. Accepts `/model` values or `inherit`. Ignored if the org's `availableModels` excludes it (or auto mode doesn't support it). With `context: fork`, sets the forked subagent's model instead. |
| `effort` | No | *(Claude Code)* Effort level: `low`, `medium`, `high`, `xhigh`, `max` (availability depends on model). Overrides session effort while skill is active. |
| `context` | No | *(Claude Code)* Set to `fork` to run in a forked subagent context. See [Running Skills in a Subagent](#running-skills-in-a-subagent). |
| `agent` | No | *(Claude Code)* Which subagent type to use when `context: fork` is set. Built-in (`Explore`, `Plan`, `general-purpose`) or custom from `.claude/agents/`. |
| `background` | No | *(Claude Code, v2.1.218+)* Only with `context: fork`. Default `true`: the fork runs in the background and its result arrives later. Set `false` to wait for the result in the invoking turn (and keep the full tool set). |
| `hooks` | No | *(Claude Code)* Hooks registered when the skill is invoked; they **keep running for the rest of the session**. Format and the `once` option: [Hooks in skills and agents](https://code.claude.com/docs/en/hooks#hooks-in-skills-and-agents). |
| `paths` | No | *(Claude Code)* Glob patterns that limit auto-activation. Comma-separated string or YAML list. When set, Claude auto-loads the skill only when working with matching files. Same format as path-specific rules. |
| `shell` | No | *(Claude Code)* Shell for `` !`cmd` `` and ` ```! ` blocks: `bash` (default) or `powershell`. `powershell` needs the PowerShell tool enabled (on by default on Windows; `CLAUDE_CODE_USE_POWERSHELL_TOOL=1` on macOS/Linux/WSL and on Bedrock/Vertex/Foundry). `shell: bash` with no bash available (Windows without Git Bash) fails the invocation. |
| `license` | No | *(agentskills.io standard)* License name or reference to a bundled license file. |
| `compatibility` | No | *(agentskills.io standard)* Environment requirements (intended product, system packages, network access). Max 500 chars. |
| `metadata` | No | *(agentskills.io standard)* Free-form map for your own tooling (catalog, entitlement, version). Claude Code doesn't act on it and drops a non-map value. Don't reuse frontmatter field names (e.g. `paths`) as keys. |

**Full example with all optional fields:**

```yaml
---
name: deploy
description: Deploy the application to production
argument-hint: [environment]
disable-model-invocation: true
allowed-tools: Bash(npm *), Bash(git *)
context: fork
agent: general-purpose
---

Deploy $ARGUMENTS to production:
1. Run the test suite
2. Build the application
3. Push to the deployment target
```

**How Claude Code parses frontmatter** (from the live docs):
- The opening `---` must be the file's **first line**; otherwise the whole file, markers included, is treated as skill content.
- **Unknown field names are ignored silently** — a typo like `allowed_tools` just does nothing. Field names must match exactly (hyphens; only `when_to_use` uses underscores).
- If the YAML doesn't parse, the skill still loads **with no fields set**: `/name` works but Claude can't match the description. Find these with `claude plugin validate .claude/skills` (v2.1.233+) or `--debug`.
- Booleans accept `true/false/yes/no/on/off/1/0` in any case (v2.1.218+; earlier only `true`/`false`).
- Files in `.claude/commands/` accept the same fields except `name` and `paths`.

**Field validation for `name`:**
- 1–64 characters
- Lowercase `a-z`, digits, and hyphens only
- No leading or trailing hyphen
- No consecutive hyphens (`--`)
- Must match the parent directory name *(agentskills.io / upload requirement; in Claude Code a different `name` simply sets the command name — see [Command Names, Collisions and Reserved Names](#command-names-collisions-and-reserved-names))*
- Cannot contain XML tags
- **Claude API / claude.ai uploads**: cannot contain the reserved words `anthropic` or `claude`
- **Claude Code**: `anthropic-skills` (and anything in that namespace) is reserved for synced claude.ai skills — a local skill with that name doesn't load

**Field validation for `description`:**
- agentskills.io standard: max 1,024 characters
- Claude Code: `description + when_to_use` combined max 1,536 chars (tunable via `skillListingMaxDescChars`)
- Cannot contain XML tags
- Should include both what the Skill does AND when Claude should use it
- Front-load the key use case — text is truncated to fit the listing budget

### Naming Conventions

Use consistent naming patterns. Recommended: **gerund form** (verb + -ing).

**Good naming examples (gerund form)**:
- `processing-pdfs`
- `analyzing-spreadsheets`
- `managing-databases`
- `testing-code`
- `writing-documentation`

**Acceptable alternatives**:
- Noun phrases: `pdf-processing`, `spreadsheet-analysis`
- Action-oriented: `process-pdfs`, `analyze-spreadsheets`

**Avoid**:
- Vague names: `helper`, `utils`, `tools`
- Overly generic: `documents`, `data`, `files`
- Reserved words: `anthropic-helper`, `claude-tools`
- Inconsistent patterns within your skill collection

### Frontmatter Outside Claude Code (Portability)

Claude Code accepts every field above. Other distribution paths accept **only the six agentskills.io fields** and fail hard on anything else:

| Distribution path | Allowed frontmatter |
|---|---|
| Claude Code skills at any level, including plugin skills | Every field in the reference table |
| claude.ai uploads, the Skills API, `package_skill.py` from anthropics/skills — and enabling a personal skill on your claude.ai account (it gets uploaded) | `name`, `description`, `license`, `compatibility`, `metadata`, `allowed-tools` |

The failure is an error, not a warning:

```
Unexpected key(s) in SKILL.md frontmatter: argument-hint. Allowed properties are: allowed-tools, compatibility, description, license, metadata, name
```

Claude Code-only body features (`` !`cmd` `` injection, `${CLAUDE_*}` substitutions) don't function in claude.ai chat or via the API. **Rule of thumb**: if a skill will ever be shared through claude.ai or the API, keep its frontmatter to the six spec fields.

### Command Names, Collisions and Reserved Names

**Where the command name comes from** (Claude Code):

| Skill location | Command | Example |
|---|---|---|
| `~/.claude/skills/<dir>/` or `.claude/skills/<dir>/` | frontmatter `name`, else dir name (the dir name also works) | `deploy-staging/` → `/deploy-staging`, or `/deploy` with `name: deploy` |
| Nested `.claude/skills/` whose name clashes | path-qualified | `apps/web/.claude/skills/deploy/` → `/apps/web:deploy` |
| `.claude/commands/<file>.md` (subdirs become `:`) | file name | `commands/frontend/component.md` → `/frontend:component` |
| Plugin `skills/<dir>/` | plugin-namespaced | `/my-plugin:review` (or `/my-plugin:fancy` with `name: fancy`) |
| Plugin-root `SKILL.md` | `name`, else plugin dir | `/my-plugin:review` |
| Synced from claude.ai | `anthropic-skills:` prefix | `/anthropic-skills:deploy`, or `/deploy` while nothing else uses the name |

**When two skills share a name:**

| Same name in | Which runs |
|---|---|
| Enterprise / personal / project | Enterprise > personal > project |
| Your skill vs a bundled skill or built-in command | Yours replaces it, **but not its aliases** (a `code-review` skill replaces `/code-review`; `/review` still runs the bundled one) |
| A skill vs a `.claude/commands/` file | The skill |
| Project-root vs nested skill | Both load |
| Plugin skill vs any other | Both (plugins are namespaced) |
| Anything vs a synced claude.ai skill's short name | The other one; the synced skill runs only as `/anthropic-skills:<name>` |

Name comparison ignores case, spacing, invisible characters and compatibility forms (fullwidth letters, dash variants), so `Commit` and `commit` collide (v2.1.228+).

**Reserved**: `anthropic-skills` and everything inside it. A skill folder, frontmatter `name`, commands file or saved workflow using it doesn't load and triggers a startup notice.

---

## Invocation Control

By default, both you and Claude can invoke any skill. You can type `/skill-name` to invoke it directly, and Claude can load it automatically when relevant to your conversation. Two frontmatter fields let you restrict this:

### Three Invocation Modes

**Default (both user and Claude can invoke)**:
Best for general-purpose skills like code explanations, analysis tools, or reference knowledge. Both `/skill-name` and automatic invocation work.

**`disable-model-invocation: true` (only user can invoke)**:
Use for workflows with side effects or that you want to control timing: deploy, commit, send-slack-message, database migrations. You don't want Claude deciding to deploy because your code looks ready.

```yaml
---
name: deploy
description: Deploy the application to production
disable-model-invocation: true
---
```

**`user-invocable: false` (only Claude can invoke)**:
Use for background knowledge that isn't actionable as a command. A `legacy-system-context` skill explains how an old system works. Claude should know this when relevant, but `/legacy-system-context` isn't a meaningful action for users to take.

```yaml
---
name: legacy-system-context
description: Context about the legacy billing system architecture. Use when working with billing code or migrating from the old system.
user-invocable: false
---
```

### Invocation Matrix

| Frontmatter | User can invoke | Claude can invoke | When loaded into context |
|-------------|-----------------|-------------------|--------------------------|
| (default) | Yes | Yes | Description always in context, full skill loads when invoked |
| `disable-model-invocation: true` | Yes | No | Description not in context, full skill loads when user invokes |
| `user-invocable: false` | No | Yes | Description always in context, full skill loads when invoked |

> **Note**: In a regular session, skill descriptions are loaded into context so Claude knows what's available, but full skill content only loads when invoked.

---

## String Substitutions

Skills support string substitution for dynamic values in the skill content. Arguments are passed when invoking a skill (e.g., `/fix-issue 123`).

### Available Variables

| Variable | Description |
|----------|-------------|
| `$ARGUMENTS` | All arguments passed when invoking the skill. If `$ARGUMENTS` is not present in the content, arguments are appended as `ARGUMENTS: <value>`. |
| `$ARGUMENTS[N]` | Access a specific argument by 0-based index, such as `$ARGUMENTS[0]` for the first argument. |
| `$N` | Shorthand for `$ARGUMENTS[N]`, such as `$0` for the first argument or `$1` for the second. |
| `$name` | Named positional argument declared in the `arguments` frontmatter. With `arguments: [issue, branch]`, `$issue` = first arg, `$branch` = second. |
| `${CLAUDE_SESSION_ID}` | The current session ID. Useful for logging, creating session-specific files, or correlating skill output with sessions. |
| `${CLAUDE_EFFORT}` | The current effort level (`low`, `medium`, `high`, `xhigh`, `max`). Use to adapt skill instructions to the active effort setting. |
| `${CLAUDE_SKILL_DIR}` | Directory containing the skill's `SKILL.md`. For plugin skills, the skill's subdirectory within the plugin (not the plugin root). **Use this in bash injection commands and script paths so they resolve regardless of cwd.** |
| `${CLAUDE_PROJECT_DIR}` | The project root (same value hooks and MCP servers get). For project-local scripts, e.g. `${CLAUDE_PROJECT_DIR}/.claude/hooks/helper.sh`. v2.1.196+. |
| `${CLAUDE_PLUGIN_ROOT}` | *(plugin skills only)* The plugin's install directory — for resources shared across the plugin's skills. |
| `${CLAUDE_PLUGIN_DATA}` | *(plugin skills only)* The plugin's persistent data directory, which survives plugin updates — for installed deps, caches, generated files. |

**Substitution also happens in `allowed-tools` Bash rules.** `${CLAUDE_SKILL_DIR}` and `${CLAUDE_PROJECT_DIR}` (plus `${CLAUDE_PLUGIN_ROOT}`/`${CLAUDE_PLUGIN_DATA}` in plugin skills) expand in both the body and `allowed-tools`, so a skill can run its bundled script with no prompt:

```yaml
---
name: render-chart
description: Render a chart from a CSV file
allowed-tools: Bash(${CLAUDE_SKILL_DIR}/scripts/render.sh *)
---
Run `${CLAUDE_SKILL_DIR}/scripts/render.sh <csv-file>` to render the chart.
```

**Edge cases:**
- Arguments are appended as `ARGUMENTS: <value>` only when **no** placeholder (`$ARGUMENTS`, `$N`, or a named argument) receives one.
- A missing indexed argument (`$2` with one arg) stays as literal `$2`; a missing named argument expands to an empty string.
- Argument values are inserted literally — `$1` or `$ARGUMENTS` inside a passed value is not expanded. `${CLAUDE_*}` variables are still substituted afterwards.
- Escape a literal dollar before a digit or argument name with one backslash: `\$1.00`. The backslash doesn't stop `${CLAUDE_*}` substitution.
- **Synced claude.ai skills** running on your machine get no `${CLAUDE_PROJECT_DIR}`/`${CLAUDE_SESSION_ID}` substitution (they arrive literal).

Indexed arguments use shell-style quoting: `/my-skill "hello world" second` → `$0` = `hello world`, `$1` = `second`. `$ARGUMENTS` always expands to the full raw argument string.

### Stacking Skills in One Message

`/write-tests /fix-issue 123` loads both skills and passes `123` as `$ARGUMENTS` to each. Claude Code expands the first skill **plus up to five more**. Expansion stops at the first token that isn't an inline user-invocable skill — a forked skill such as `/code-review` (forked since v2.1.218) or one like `/loop` ends the run, and that token plus everything after becomes the argument text.

### Example: Using `${CLAUDE_SKILL_DIR}` for bundled scripts

```yaml
---
name: codebase-visualizer
description: Generate an interactive HTML tree of the codebase
allowed-tools: Bash(python3 *)
---

Run: `python3 ${CLAUDE_SKILL_DIR}/scripts/visualize.py .`
```

This resolves correctly whether the skill lives at the personal, project, or plugin level.

### Example: Fix a GitHub Issue

```yaml
---
name: fix-issue
description: Fix a GitHub issue
disable-model-invocation: true
---

Fix GitHub issue $ARGUMENTS following our coding standards.

1. Read the issue description
2. Understand the requirements
3. Implement the fix
4. Write tests
5. Create a commit
```

When you run `/fix-issue 123`, Claude receives "Fix GitHub issue 123 following our coding standards..."

### Example: Positional Arguments

```yaml
---
name: migrate-component
description: Migrate a component from one framework to another
---

Migrate the $ARGUMENTS[0] component from $ARGUMENTS[1] to $ARGUMENTS[2].
Preserve all existing behavior and tests.
```

Running `/migrate-component SearchBar React Vue` replaces `$ARGUMENTS[0]` with `SearchBar`, `$ARGUMENTS[1]` with `React`, and `$ARGUMENTS[2]` with `Vue`.

The same skill using the `$N` shorthand:

```yaml
---
name: migrate-component
description: Migrate a component from one framework to another
---

Migrate the $0 component from $1 to $2.
Preserve all existing behavior and tests.
```

### Example: Session Logging

```yaml
---
name: session-logger
description: Log activity for this session
---

Log the following to logs/${CLAUDE_SESSION_ID}.log:

$ARGUMENTS
```

> **Note**: If you invoke a skill with arguments but the skill doesn't include `$ARGUMENTS`, Claude Code appends `ARGUMENTS: <your input>` to the end of the skill content so Claude still sees what you typed.

---

## Dynamic Context Injection

The `` !`command` `` syntax runs shell commands **before** the skill content is sent to Claude. The command output replaces the placeholder, so Claude receives actual data, not the command itself.

This is **preprocessing**, not something Claude executes. Claude only sees the final result.

### Example: PR Summary Skill

This skill summarizes a pull request by fetching live PR data with the GitHub CLI:

```yaml
---
name: pr-summary
description: Summarize changes in a pull request
context: fork
agent: Explore
allowed-tools: Bash(gh *)
---

## Pull request context
- PR diff: !`gh pr diff`
- PR comments: !`gh pr view --comments`
- Changed files: !`gh pr diff --name-only`

## Your task
Summarize this pull request. Include:
1. What changed and why
2. Key files affected
3. Potential risks or concerns
```

When this skill runs:

1. Each `` !`command` `` executes immediately (before Claude sees anything)
2. The output replaces the placeholder in the skill content
3. Claude receives the fully-rendered prompt with actual PR data

### Multi-Line Shell Injection

For multi-line commands, use a fenced code block opened with ` ```! ` instead of the inline form:

````markdown
## Environment
```!
node --version
npm --version
git status --short
```
````

### How Injected Commands Run

- **Tool**: the Bash tool (or the PowerShell tool with `shell: powershell` and that tool enabled).
- **Working directory**: the session shell's current directory, which moves when Claude runs `cd` — use `${CLAUDE_SKILL_DIR}` / `${CLAUDE_PROJECT_DIR}` for paths that must be stable.
- **stderr** is merged into stdout (bash), so it appears in the injected text.
- **Timeout**: the Bash tool's 2-minute default. A command the tool auto-backgrounds still lets the skill render (the text names the background task); one it kills fails the invocation.
- **Large output** arrives as a file path plus preview, not truncated text.

### When an Injected Command Fails

**A failed command aborts the whole invocation** — Claude never sees the skill content. The error reads `Shell command failed for pattern "..."` with the command's `[stderr]`.

- Any non-zero exit fails, **except exit code 1 from search/comparison commands** (`grep`, `git diff`, `find`, `diff`, …), which is treated as a normal result. Exit ≥2 still fails. (PowerShell's carve-out set differs: includes `grep`/`git diff`, not `find`/`diff`.)
- For any other command that may exit non-zero (a check script that exits 1 on findings), append `|| true`.

### Permission Checks on Injected Commands

Injected commands **never prompt** while the skill renders. Each is checked against permission rules first:
- A matching **deny** rule aborts: `Shell command permission check failed for pattern "..."`.
- Outside auto mode, **anything other than allow** (including an "ask" rule) also aborts. Pre-approve the command in the skill's `allowed-tools` to avoid this; deny/ask rules still override `allowed-tools`.
- In auto mode an unapproved command doesn't abort: the skill loads with an instruction for Claude to run it, under auto mode's checks (except in forked skills that set `agent`).

### Disabling Shell Injection

Set `"disableSkillShellExecution": true` in settings to block `` !`cmd` `` and ` ```! ` execution from user/project/plugin/`--add-dir` skills. Each command is replaced with `[shell command execution disabled by policy]`. Bundled and managed skills are unaffected. Most useful in managed settings where users cannot override it.

---

## Running Skills in a Subagent

Add `context: fork` to your frontmatter when you want a skill to run in isolation. The skill content becomes the prompt that drives the subagent. The subagent won't have access to your conversation history.

> **Not a conversation fork**: despite the name, `context: fork` starts a fresh subagent with only the skill content. If the task depends on what you've discussed, fork the conversation instead.

**Background by default (v2.1.218+)**: the forked subagent runs in the background — you keep working and its result arrives when done. Set `background: false` to wait for it in the invoking turn (before v2.1.218 forks always blocked). Claude Code also waits regardless in `-p`/Agent SDK runs, with `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1`, when the same skill is already running, and when a scheduled task fires the skill.

**Background-fork caveats:**
- It runs with the **narrower tool set** of background subagents — if a step needs a tool outside it, set `background: false`.
- Its edits happen **outside your session's checkpoints**, so `/rewind` won't undo them; use git.

> **Important**: `context: fork` only makes sense for skills with explicit task instructions. If your skill contains guidelines like "use these API conventions" without a task, the subagent receives the guidelines but no actionable prompt, and returns without meaningful output.

### Example: Research Skill

```yaml
---
name: deep-research
description: Research a topic thoroughly
context: fork
agent: Explore
---

Research $ARGUMENTS thoroughly:

1. Find relevant files using Glob and Grep
2. Read and analyze the code
3. Summarize findings with specific file references
```

When this skill runs:

1. A new isolated context is created
2. The subagent receives the skill content as its prompt ("Research $ARGUMENTS thoroughly...")
3. The `agent` field determines the execution environment (model, tools, and permissions)
4. Results are summarized and returned to your main conversation

The `agent` field specifies which subagent configuration to use. Options include built-in agents (`Explore`, `Plan`, `general-purpose`) or any custom subagent from `.claude/agents/`. If omitted, uses `general-purpose`.

### Skills vs Subagents Comparison

Skills with `context: fork` and subagents work together in two directions:

| Approach | System prompt | Task | Also loads |
|----------|---------------|------|------------|
| Skill with `context: fork` | From agent type (`Explore`, `Plan`, etc.) | SKILL.md content | CLAUDE.md, per the agent's startup context — **`Explore` and `Plan` skip CLAUDE.md and git status**, so they see only SKILL.md + their own system prompt |
| Subagent with `skills` field | Subagent's markdown body | Claude's delegation message | Preloaded skills + CLAUDE.md |

With `context: fork`, you write the task in your skill and pick an agent type to execute it. For the inverse (defining a custom subagent that uses skills as reference material), see the Claude Code subagents documentation.

### When to Use `context: fork`

- **Isolation needed**: The skill's work shouldn't pollute your conversation context
- **Explicit task**: The skill defines a complete, self-contained task
- **Parallel execution**: Multiple forked skills can run concurrently
- **Specialized tools**: The agent type provides appropriate tools for the task

---

## Skill Content Lifecycle (Claude Code)

When you or Claude invoke a skill, the rendered `SKILL.md` content enters the conversation **as a single message and stays for the rest of the session**. Claude Code does **not** re-read the skill file on later turns.

**Implication**: Write guidance that should apply throughout a task as **standing instructions**, not one-time steps.

- The **instructions persist; the permissions don't**: an `allowed-tools` grant clears on the next user message.
- Re-invoking with **identical** rendered content adds only a short "already loaded" note; if arguments or injected output changed, the full content is appended again.

### Auto-Compaction Behavior

When the conversation is summarized to free context, Claude Code re-attaches the **most recent invocation** of each skill after the summary:

- Keeps the **first 5,000 tokens** of each re-attached skill
- Combined re-attachment budget: **25,000 tokens** total
- Filled most-recently-invoked first; older skills may be dropped entirely if you invoked many

### Debugging "Skill Stopped Working"

If Claude follows a skill in its first response and stops later, match the case:

1. **It skipped a rule that must hold every time** → make it a **hook**. To keep it with the skill, define it in the skill's `hooks` frontmatter; it applies from invocation until the session ends.
2. **It skipped guidance that needs judgment** → reword it to cover the whole task ("Run the tests after every edit", not "Run the tests"). The file is not re-read on later turns.
3. **The conversation was compacted** → re-invoke the skill. Only the first 5,000 tokens survive compaction, so **put the most important instructions at the top of `SKILL.md`**.

---

## Reference vs Task Content

Two patterns for SKILL.md content. Choose based on how you want it invoked and where it runs.

### Reference Content (inline, model-invocable)

Knowledge Claude applies alongside your conversation: conventions, patterns, style guides, domain knowledge. Runs inline with conversation context.

```yaml
---
name: api-conventions
description: API design patterns for this codebase
---

When writing API endpoints:
- Use RESTful naming conventions
- Return consistent error formats
- Include request validation
```

### Task Content (action, usually user-only)

Step-by-step instructions for a specific action: deploy, commit, code-generation pipelines. Often paired with `disable-model-invocation: true` and frequently `context: fork`.

```yaml
---
name: deploy
description: Deploy the application to production
context: fork
disable-model-invocation: true
---

Deploy the application:
1. Run the test suite
2. Build the application
3. Push to the deployment target
```

---

## Writing Effective Descriptions

The `description` field enables Skill discovery and should include both what the Skill does and when to use it.

### Critical Rules

**Always write in third person**. The description is injected into the system prompt.

- **Good:** "Processes Excel files and generates reports"
- **Avoid:** "I can help you process Excel files"
- **Avoid:** "You can use this to process Excel files"

**Be specific and include key terms**. Each Skill has exactly one description field. The description is critical for skill selection: Claude uses it to choose the right Skill from potentially 100+ available Skills.

### Effective Examples

**PDF Processing skill:**

```yaml
description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
```

**Excel Analysis skill:**

```yaml
description: Analyze Excel spreadsheets, create pivot tables, generate charts. Use when analyzing Excel files, spreadsheets, tabular data, or .xlsx files.
```

**Git Commit Helper skill:**

```yaml
description: Generate descriptive commit messages by analyzing git diffs. Use when the user asks for help writing commit messages or reviewing staged changes.
```

### Bad Examples (Too Vague)

```yaml
description: Helps with documents
```

```yaml
description: Processes data
```

```yaml
description: Does stuff with files
```

### Triggering in Practice

- **How the decision is made.** Claude sees each skill's name and description in its available-skills list and consults a skill only for tasks it can't easily handle alone. A simple one-step ask ("read this PDF") may not trigger even with a perfect description; substantive, multi-step or specialized asks do ([skill-creator], "How skill triggering works"). Test with realistic, detailed prompts.
- **Formula:** `[what it does] + [when to use it: phrases users say, file types] + [key capabilities]` ([PDF][pdf-guide]). Use the **user's vocabulary** (the file kinds they attach, the verbs and domain terms they say), not your internal names (*field lesson*).
- **Claude tends to under-trigger**, so skill-creator recommends descriptions that are "a little bit pushy": end with "Use this whenever the user mentions X, Y or Z, even if they don't explicitly ask for …" ([skill-creator]).
- **Over-triggering:** add negative triggers and narrow the scope, e.g. `… Do NOT use for simple data exploration (use data-viz instead).` ([PDF][pdf-guide]).
- **Debug:** ask Claude "When would you use the <name> skill?"; it quotes the description back. Add what's missing ([PDF][pdf-guide]).
- **Length:** the description MUST be ≤ 1,024 characters for the standard, the API and claude.ai; skill-creator's optimizer aims for about 100–200 words. Claude Code caps `description` + `when_to_use` at 1,536 characters in the listing.
- **No `<` or `>`** in frontmatter: uploads and skill-creator's validator reject it, because frontmatter lands in the system prompt ([PDF][pdf-guide]; `quick_validate.py`).
- **Sources differ on voice:** best practices says third person ("Processes Excel files…"), and the PDF's good examples agree; skill-creator's "pushy" sentence addresses the situation ("Use this whenever…"). Combine them: third-person *what*, then an explicit *when*.

| Signal | Means | Fix |
|---|---|---|
| Doesn't load when it should; users enable it by hand; "when do I use this?" questions | Under-triggering | More detail, trigger phrases, technical keywords, file types |
| Loads for unrelated queries; users disable it; confusion about purpose | Over-triggering | Negative triggers; narrower, more specific scope |

To tune a description against measured trigger rates, use the [Description Optimization Loop](#description-optimization-loop).

---

## Progressive Disclosure Patterns

SKILL.md serves as an overview that points Claude to detailed materials as needed, like a table of contents in an onboarding guide.

### Practical Guidance

- Keep SKILL.md body under 500 lines for optimal performance
- Split content into separate files when approaching this limit
- Use the patterns below to organize instructions, code, and resources effectively

### Pattern 1: High-Level Guide with References

````markdown
---
name: pdf-processing
description: Extracts text and tables from PDF files, fills forms, and merges documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
---

# PDF Processing

## Quick start

Extract text with pdfplumber:
```python
import pdfplumber
with pdfplumber.open("file.pdf") as pdf:
    text = pdf.pages[0].extract_text()
```

## Advanced features

**Form filling**: See [FORMS.md](FORMS.md) for complete guide
**API reference**: See [REFERENCE.md](REFERENCE.md) for all methods
**Examples**: See [EXAMPLES.md](EXAMPLES.md) for common patterns
````

Claude loads FORMS.md, REFERENCE.md, or EXAMPLES.md only when needed.

### Pattern 2: Domain-Specific Organization

For Skills with multiple domains, organize content by domain to avoid loading irrelevant context.

```
bigquery-skill/
├── SKILL.md (overview and navigation)
└── reference/
    ├── finance.md (revenue, billing metrics)
    ├── sales.md (opportunities, pipeline)
    ├── product.md (API usage, features)
    └── marketing.md (campaigns, attribution)
```

````markdown
# BigQuery Data Analysis

## Available datasets

**Finance**: Revenue, ARR, billing → See [reference/finance.md](reference/finance.md)
**Sales**: Opportunities, pipeline, accounts → See [reference/sales.md](reference/sales.md)
**Product**: API usage, features, adoption → See [reference/product.md](reference/product.md)
**Marketing**: Campaigns, attribution, email → See [reference/marketing.md](reference/marketing.md)

## Quick search

Find specific metrics using grep:

```bash
grep -i "revenue" reference/finance.md
grep -i "pipeline" reference/sales.md
grep -i "api usage" reference/product.md
```
````

### Pattern 3: Conditional Details

Show basic content, link to advanced content:

```markdown
# DOCX Processing

## Creating documents

Use docx-js for new documents. See [DOCX-JS.md](DOCX-JS.md).

## Editing documents

For simple edits, modify the XML directly.

**For tracked changes**: See [REDLINING.md](REDLINING.md)
**For OOXML details**: See [OOXML.md](OOXML.md)
```

Claude reads REDLINING.md or OOXML.md only when the user needs those features.

### Avoid Deeply Nested References

Claude may partially read files when they're referenced from other referenced files.

**Keep references one level deep from SKILL.md**. All reference files should link directly from SKILL.md.

**Bad example: Too deep**:

```markdown
# SKILL.md
See [advanced.md](advanced.md)...

# advanced.md
See [details.md](details.md)...

# details.md
Here's the actual information...
```

**Good example: One level deep**:

```markdown
# SKILL.md

**Basic usage**: [instructions in SKILL.md]
**Advanced features**: See [advanced.md](advanced.md)
**API reference**: See [reference.md](reference.md)
**Examples**: See [examples.md](examples.md)
```

### Structure Longer Reference Files with Table of Contents

For reference files longer than 100 lines, include a table of contents at the top.

**Example**:

```markdown
# API Reference

## Contents
- Authentication and setup
- Core methods (create, read, update, delete)
- Advanced features (batch operations, webhooks)
- Error handling patterns
- Code examples

## Authentication and setup
...

## Core methods
...
```

---

## Workflows and Feedback Loops

### Use Workflows for Complex Tasks

Break complex operations into clear, sequential steps. For particularly complex workflows, provide a checklist that Claude can copy and check off as it progresses.

**Example 1: Research synthesis workflow** (for Skills without code):

````markdown
## Research synthesis workflow

Copy this checklist and track your progress:

```
Research Progress:
- [ ] Step 1: Read all source documents
- [ ] Step 2: Identify key themes
- [ ] Step 3: Cross-reference claims
- [ ] Step 4: Create structured summary
- [ ] Step 5: Verify citations
```

**Step 1: Read all source documents**

Review each document in the `sources/` directory. Note the main arguments and supporting evidence.

**Step 2: Identify key themes**

Look for patterns across sources. What themes appear repeatedly? Where do sources agree or disagree?

**Step 3: Cross-reference claims**

For each major claim, verify it appears in the source material. Note which source supports each point.

**Step 4: Create structured summary**

Organize findings by theme. Include:
- Main claim
- Supporting evidence from sources
- Conflicting viewpoints (if any)

**Step 5: Verify citations**

Check that every claim references the correct source document. If citations are incomplete, return to Step 3.
````

**Example 2: PDF form filling workflow** (for Skills with code):

````markdown
## PDF form filling workflow

Copy this checklist and check off items as you complete them:

```
Task Progress:
- [ ] Step 1: Analyze the form (run analyze_form.py)
- [ ] Step 2: Create field mapping (edit fields.json)
- [ ] Step 3: Validate mapping (run validate_fields.py)
- [ ] Step 4: Fill the form (run fill_form.py)
- [ ] Step 5: Verify output (run verify_output.py)
```

**Step 1: Analyze the form**

Run: `python scripts/analyze_form.py input.pdf`

This extracts form fields and their locations, saving to `fields.json`.

**Step 2: Create field mapping**

Edit `fields.json` to add values for each field.

**Step 3: Validate mapping**

Run: `python scripts/validate_fields.py fields.json`

Fix any validation errors before continuing.

**Step 4: Fill the form**

Run: `python scripts/fill_form.py input.pdf fields.json output.pdf`

**Step 5: Verify output**

Run: `python scripts/verify_output.py output.pdf`

If verification fails, return to Step 2.
````

### Implement Feedback Loops

**Common pattern**: Run validator → fix errors → repeat

This pattern greatly improves output quality.

**Example 1: Style guide compliance** (for Skills without code):

```markdown
## Content review process

1. Draft your content following the guidelines in STYLE_GUIDE.md
2. Review against the checklist:
   - Check terminology consistency
   - Verify examples follow the standard format
   - Confirm all required sections are present
3. If issues found:
   - Note each issue with specific section reference
   - Revise the content
   - Review the checklist again
4. Only proceed when all requirements are met
5. Finalize and save the document
```

**Example 2: Document editing process** (for Skills with code):

```markdown
## Document editing process

1. Make your edits to `word/document.xml`
2. **Validate immediately**: `python ooxml/scripts/validate.py unpacked_dir/`
3. If validation fails:
   - Review the error message carefully
   - Fix the issues in the XML
   - Run validation again
4. **Only proceed when validation passes**
5. Rebuild: `python ooxml/scripts/pack.py unpacked_dir/ output.docx`
6. Test the output document
```

---

## Content Guidelines

### Avoid Time-Sensitive Information

Don't include information that will become outdated.

**Bad example: Time-sensitive** (will become wrong):

```markdown
If you're doing this before August 2025, use the old API.
After August 2025, use the new API.
```

**Good example** (use "old patterns" section):

```markdown
## Current method

Use the v2 API endpoint: `api.example.com/v2/messages`

## Old patterns

<details>
<summary>Legacy v1 API (deprecated 2025-08)</summary>

The v1 API used: `api.example.com/v1/messages`

This endpoint is no longer supported.
</details>
```

### Use Consistent Terminology

Choose one term and use it throughout the Skill:

**Good - Consistent**:
- Always "API endpoint"
- Always "field"
- Always "extract"

**Bad - Inconsistent**:
- Mix "API endpoint", "URL", "API route", "path"
- Mix "field", "box", "element", "control"
- Mix "extract", "pull", "get", "retrieve"

### Use Forward Slashes for Paths

Always use forward slashes in file paths, even on Windows:

- ✓ **Good**: `scripts/helper.py`, `reference/guide.md`
- ✗ **Avoid**: `scripts\helper.py`, `reference\guide.md`

Unix-style paths work across all platforms.

### Writing Style: Explain the Why

- **Imperative and concrete.** "Run `python scripts/validate.py --input {file}`. If it fails with a missing column, …", not "validate the data properly" ([PDF][pdf-guide]; [skill-creator]).
- **Give the reason with every rule.** Models generalize from reasons; a bare rule is applied literally or argued around. A growing pile of ALL-CAPS ALWAYS/NEVER is a yellow flag: reframe and explain why it matters ([skill-creator]; the *field lesson* agrees).
- **Critical steps at the top**, under a clear heading such as `## Important`, and spelled out as exact checks ([PDF][pdf-guide]).
- **Keep the body lean.** Remove what isn't pulling its weight. Read the run transcripts, not only the outputs, and cut instructions that make Claude waste steps ([skill-creator]).
- **Generalize, don't overfit** to the few test prompts you iterate on ([skill-creator]).
- **Script the hard moments.** When a script refuses, give Claude the exact sentence to say to a non-technical user (*field lesson*).
- **Name the forbidden workaround** with its reason: "Do not parse the spreadsheet yourself; the engine's column checks are the point" (*field lesson*).
- **Include error handling and examples:** a `## Troubleshooting` block of *Error → Cause → Solution*, and 1–2 examples of *User says → Actions → Result* ([PDF][pdf-guide] template).
- **Skipped steps ("laziness").** The PDF suggests encouragement ("Take your time; quality over speed; do not skip validation") and notes it works **better in the user prompt than in SKILL.md**. Where a step must not be skipped, enforce it with a script that fails.
- **Lack of surprise.** A skill's contents should not surprise the user given its stated purpose ([skill-creator]).

---

## Common Patterns

### Template Pattern

Provide templates for output format. Match the level of strictness to your needs.

**For strict requirements** (like API responses or data formats):

````markdown
## Report structure

ALWAYS use this exact template structure:

```markdown
# [Analysis Title]

## Executive summary
[One-paragraph overview of key findings]

## Key findings
- Finding 1 with supporting data
- Finding 2 with supporting data
- Finding 3 with supporting data

## Recommendations
1. Specific actionable recommendation
2. Specific actionable recommendation
```
````

**For flexible guidance** (when adaptation is useful):

````markdown
## Report structure

Here is a sensible default format, but use your best judgment based on the analysis:

```markdown
# [Analysis Title]

## Executive summary
[Overview]

## Key findings
[Adapt sections based on what you discover]

## Recommendations
[Tailor to the specific context]
```

Adjust sections as needed for the specific analysis type.
````

### Examples Pattern

For Skills where output quality depends on seeing examples, provide input/output pairs:

````markdown
## Commit message format

Generate commit messages following these examples:

**Example 1:**
Input: Added user authentication with JWT tokens
Output:
```
feat(auth): implement JWT-based authentication

Add login endpoint and token validation middleware
```

**Example 2:**
Input: Fixed bug where dates displayed incorrectly in reports
Output:
```
fix(reports): correct date formatting in timezone conversion

Use UTC timestamps consistently across report generation
```

**Example 3:**
Input: Updated dependencies and refactored error handling
Output:
```
chore: update dependencies and refactor error handling

- Upgrade lodash to 4.17.21
- Standardize error response format across endpoints
```

Follow this style: type(scope): brief description, then detailed explanation.
````

### Conditional Workflow Pattern

Guide Claude through decision points:

```markdown
## Document modification workflow

1. Determine the modification type:

   **Creating new content?** → Follow "Creation workflow" below
   **Editing existing content?** → Follow "Editing workflow" below

2. Creation workflow:
   - Use docx-js library
   - Build document from scratch
   - Export to .docx format

3. Editing workflow:
   - Unpack existing document
   - Modify XML directly
   - Validate after each change
   - Repack when complete
```

If workflows become large or complicated with many steps, consider pushing them into separate files.

---

## Skills + MCP Workflow Patterns

MCP gives Claude the tools (*what* Claude can do); a skill gives the recipe (*how* Claude should do it). Without a skill, users connect a server and don't know what to do next, prompt differently every time, and blame the connector for inconsistent results ([PDF][pdf-guide], "Skills + Connectors"). The PDF's five patterns are examples, not templates:

| Pattern | Use when | Key techniques |
|---|---|---|
| 1. Sequential workflow orchestration | Steps must run in a set order | Explicit ordering; data passed between steps (`customer_id` from step 1); validation at each stage; rollback instructions |
| 2. Multi-MCP coordination | The workflow spans services (Figma → Drive → Linear → Slack) | Clear phases; data hand-off between servers; validate before the next phase; central error handling |
| 3. Iterative refinement | Quality improves with passes | Draft → run `scripts/check_*.py` → fix → re-validate; an explicit quality bar and stop condition |
| 4. Context-aware tool selection | Same goal, different tool by context | Decision tree (size, type, collaboration); fallbacks; tell the user why that tool |
| 5. Domain-specific intelligence | The skill adds rules beyond tool access (compliance) | Check before acting; record each decision; audit trail |

Pattern 1, as a skill body:

```markdown
## Workflow: Onboard a new customer
### Step 1: Create the account
Call `create_customer` with name, email, company.
### Step 2: Set up payment
Call `setup_payment_method`; wait for verification before continuing.
### Step 3: Create the subscription
Call `create_subscription` with plan_id and the customer_id from Step 1.
If a step fails, stop and report the step and the error. Do not retry blindly.
```

Checklist for MCP-backed skills:

- [ ] Tool names exactly as the server exposes them (case-sensitive), fully qualified as `Server:tool` ([MCP Tool References](#mcp-tool-references)).
- [ ] The workflow works when you call the MCP tools directly without the skill; this separates server problems from skill problems.
- [ ] Auth failure, a disconnected server and rate limits each have a documented "what to do".
- [ ] The dependency is recorded, e.g. `metadata: {mcp-server: projecthub}` (PDF suggestion; `metadata` is free-form).
- [ ] The server's docs link to the skill and explain using both together ([PDF][pdf-guide], Distribution).

---

## Anti-Patterns to Avoid

### Don't Offer Too Many Options

Don't present multiple approaches unless necessary:

````markdown
**Bad example: Too many choices** (confusing):
"You can use pypdf, or pdfplumber, or PyMuPDF, or pdf2image, or..."

**Good example: Provide a default** (with escape hatch):
"Use pdfplumber for text extraction:
```python
import pdfplumber
```

For scanned PDFs requiring OCR, use pdf2image with pytesseract instead."
````

### Don't Assume Tools are Installed

Don't assume packages are available:

````markdown
**Bad example: Assumes installation**:
"Use the pdf library to process the file."

**Good example: Explicit about dependencies**:
"Install required package: `pip install pypdf`

Then use it:
```python
from pypdf import PdfReader
reader = PdfReader("file.pdf")
```"
````

### Don't Use Windows-Style Paths

Always use forward slashes:

- ✓ **Good**: `scripts/helper.py`, `reference/guide.md`
- ✗ **Avoid**: `scripts\helper.py`, `reference\guide.md`

---

## Advanced: Skills with Executable Code

### Solve, Don't Punt

When writing scripts for Skills, handle error conditions rather than punting to Claude.

**Good example: Handle errors explicitly**:

```python
def process_file(path):
    """Process a file, creating it if it doesn't exist."""
    try:
        with open(path) as f:
            return f.read()
    except FileNotFoundError:
        # Create file with default content instead of failing
        print(f"File {path} not found, creating default")
        with open(path, 'w') as f:
            f.write('')
        return ''
    except PermissionError:
        # Provide alternative instead of failing
        print(f"Cannot access {path}, using default")
        return ''
```

**Bad example: Punt to Claude**:

```python
def process_file(path):
    # Just fail and let Claude figure it out
    return open(path).read()
```

### No "Voodoo Constants"

Configuration parameters should be justified and documented.

**Good example: Self-documenting**:

```python
# HTTP requests typically complete within 30 seconds
# Longer timeout accounts for slow connections
REQUEST_TIMEOUT = 30

# Three retries balances reliability vs speed
# Most intermittent failures resolve by the second retry
MAX_RETRIES = 3
```

**Bad example: Magic numbers**:

```python
TIMEOUT = 47  # Why 47?
RETRIES = 5   # Why 5?
```

### Provide Utility Scripts

Even if Claude could write a script, pre-made scripts offer advantages:

**Benefits of utility scripts**:
- More reliable than generated code
- Save tokens (no need to include code in context)
- Save time (no code generation required)
- Ensure consistency across uses

**Make execution intent clear**:
- "Run `analyze_form.py` to extract fields" (execute)
- "See `analyze_form.py` for the extraction algorithm" (read as reference)

**Example**:

````markdown
## Utility scripts

**analyze_form.py**: Extract all form fields from PDF

```bash
python scripts/analyze_form.py input.pdf > fields.json
```

Output format:
```json
{
  "field_name": {"type": "text", "x": 100, "y": 200},
  "signature": {"type": "sig", "x": 150, "y": 500}
}
```

**validate_boxes.py**: Check for overlapping bounding boxes

```bash
python scripts/validate_boxes.py fields.json
# Returns: "OK" or lists conflicts
```

**fill_form.py**: Apply field values to PDF

```bash
python scripts/fill_form.py input.pdf fields.json output.pdf
```
````

### Use Visual Analysis

When inputs can be rendered as images, have Claude analyze them:

````markdown
## Form layout analysis

1. Convert PDF to images:
   ```bash
   python scripts/pdf_to_images.py form.pdf
   ```

2. Analyze each page image to identify form fields
3. Claude can see field locations and types visually
````

Claude's vision capabilities help understand layouts and structures.

### Create Verifiable Intermediate Outputs

When Claude performs complex, open-ended tasks, use the "plan-validate-execute" pattern.

**Example**: Asking Claude to update 50 form fields in a PDF based on a spreadsheet.

**Solution**: Use the workflow pattern, but add an intermediate `changes.json` file that gets validated before applying changes. The workflow becomes: analyze → **create plan file** → **validate plan** → execute → verify.

**Why this pattern works:**
- **Catches errors early**: Validation finds problems before changes are applied
- **Machine-verifiable**: Scripts provide objective verification
- **Reversible planning**: Claude can iterate on the plan without touching originals
- **Clear debugging**: Error messages point to specific problems

**When to use**: Batch operations, destructive changes, complex validation rules, high-stakes operations.

**Implementation tip**: Make validation scripts verbose with specific error messages like "Field 'signature_date' not found. Available fields: customer_name, order_total, signature_date_signed"

### Package Dependencies

Skills run in the code execution environment with platform-specific limitations:

- **claude.ai**: Can install packages from npm and PyPI and pull from GitHub repositories
- **Anthropic API**: Has no network access and no runtime package installation

List required packages in your SKILL.md and verify they're available in the code execution tool documentation.

### MCP Tool References

If your Skill uses MCP (Model Context Protocol) tools, always use fully qualified tool names.

**Format**: `ServerName:tool_name`

**Example**:

```markdown
Use the BigQuery:bigquery_schema tool to retrieve table schemas.
Use the GitHub:create_issue tool to create issues.
```

Where:
- `BigQuery` and `GitHub` are MCP server names
- `bigquery_schema` and `create_issue` are the tool names within those servers

### Extended Thinking in Skills

To enable extended thinking (thinking mode) in a skill, include the word "ultrathink" anywhere in your skill content. This activates Claude's extended thinking capabilities for more complex reasoning tasks.

---

## Code for Facts, Claude for Judgment

How to split a skill between deterministic code and model judgment. The official sources state the principle; the field lessons show what it takes when other people act on the output.

**What the official sources say**

- "Certain operations are better suited for traditional code execution … many applications require the deterministic reliability that only code can provide." A bundled script runs without its code or its input entering context; only the output does ([eng-post]; [overview], Level 3).
- Instructions for flexible guidance, **code for reliability**, resources for factual lookup ([overview]).
- "For critical validations, consider bundling a script that performs the checks programmatically rather than relying on language instructions. Code is deterministic; language interpretation isn't" ([PDF][pdf-guide], Troubleshooting).
- Match specificity to fragility: low freedom (an exact script, few parameters) for fragile, consistency-critical steps; high freedom (prose) when many approaches are valid ([Degrees of Freedom](#2-set-appropriate-degrees-of-freedom)).
- If every test run has Claude writing the same helper (`create_docx.py`, `build_chart.py`), bundle that script once in `scripts/` and tell the skill to use it ([skill-creator], "Look for repeated work").
- Make clear whether Claude should **run** a script or **read** it as reference ([eng-post]; [Provide Utility Scripts](#provide-utility-scripts)).

**Decision rule**

| Put it in code (`scripts/`) | Leave it to Claude (instructions) |
|---|---|
| Counting, summing, thresholds, sorting, ranking, selection cut-offs | Interpreting free text, weighing context, choosing among valid options |
| Anything someone may later ask "why was X flagged / not flagged?" about | Explaining a finding, writing the report, talking to the user |
| Parsing and checking the input's shape; format conversion | Deciding what to tell the user after the code refuses |
| Checks that must give the same answer on every run | Tasks where variation is acceptable or wanted |

**Field lessons** (from shipping an audit skill to non-technical reviewers; they extend the official guidance and don't contradict it)

1. **Two layers plus a validator.** Layer 1, a deterministic, config-driven engine, turns the input into `findings.json`. Layer 2, Claude following a procedure file, triages and writes the report. A validator script then checks Claude's output against `findings.json` and exits non-zero on any failure. A renderer turns the JSON into CSV/PDF and **copies, never computes**.

   ```text
   input ─► scripts/engine.py ─► findings.json ─► scripts/render.py ─► CSV / PDF
                                      │
                                      ▼
                     Claude follows reference/PROCEDURE.md ─► triage.json + report
                                      │
                                      ▼
                     scripts/validate.py ─► pass / fail (Claude checked against engine)
   ```

   Skip Layer 2 when there's no judgment. Skip the validator only if nobody acts on Claude's output.
2. **Claude's output is checked, not trusted.** Judgment isn't reproducible; a validator makes it *checked*: every selected item addressed, nothing added or dropped, every quoted evidence string literally present in the source (a quote it can't find counts as fabricated), dispositions only from a fixed vocabulary, every skipped check disclosed.
3. **Refuse rather than guess.** Unknown columns, an implausible derived population or ambiguous semantics stop the run with a clear message that has a matching troubleshooting entry; a wrong answer that looks normal is the worst outcome. Map columns by name from a list of accepted spellings, assert the shape you assume, put plausibility ranges on anything inferred, and detect silent truncation.
4. **Say what didn't run.** A check that didn't run looks the same as one that found nothing. Emit a `data_gaps` list; the renderer and the report show it.
5. **Every threshold in a versioned config.** `config.json` holds limits, windows and capacity. Stamp `criteria_version`, the config hash and the input hash on every output so a past result replays. Disabled checks stay in the config with their reason.
6. **Selection belongs to the engine.** If reviewers can handle N items, the engine scores, ranks and cuts at N, and Claude works exactly that set. "Why wasn't X reviewed?" is then answered by a rank, a score and a cutoff that replay.
7. **Label provenance.** Mark each item `rule:<id>`, `ai:<kind>` or `human:<name>` in the report itself, so readers can tell what a rule found from what the model concluded. The model never closes an item or signs as a human.
8. **Name the forbidden workaround.** Claude's helpful instinct is to route around a failure ("I'll build the CSV myself"). Forbid it by name in SKILL.md.
9. **Text encoding is part of determinism.** Pass `encoding="utf-8"` on every read and write and set `PYTHONUTF8=1` for child scripts. Locale defaults differ (cp1252 on Windows), and a mis-decoded lookup silently matches nothing.

**Sources differ** on enforcing rules: skill-creator warns against ALL-CAPS MUST/NEVER and prefers explaining the why; the PDF suggests `CRITICAL:` headers and repetition for instructions that get skipped. Reconcile them: keep hard rules few (3–5), give each a one-line reason, and move anything that truly must hold into code, where wording no longer matters ([Writing Style](#writing-style-explain-the-why)).

---

## Using Skills Across Platforms

### Where Skills Work

Skills are available across Claude's agent products:

- **Claude API**: Pre-built Skills (pptx, xlsx, docx, pdf) and custom Skills via `/v1/skills` endpoints
- **Claude.ai and Cowork**: Pre-built Skills (automatic) and custom Skills (upload via Settings)
- **Claude Code**: Custom Skills (filesystem-based), plus bundled skills
- **Claude Agent SDK**: Custom Skills via filesystem configuration
- **Claude Managed Agents**: Skills attached in the agent's `skills` array, or loaded from a GitHub repository mounted on the session ([overview])

### Claude API

The Claude API supports both pre-built Agent Skills and custom Skills.

**Prerequisites**: Include the code execution tool (`code_execution_20250825`); Skills run in its container. The Skills API is **out of beta and needs no beta header**. Requests that still send `skills-2025-10-02` keep working and keep the old response shapes (`display_title`, epoch-string `latest_version`); without the header you get `display_name`, `latest_version_id` (`skver_…`), and `DELETE /v1/skills/{id}` removes every version ([skills guide § Migrate][skills-guide]). *Unverified here:* whether downloading generated files still needs a Files API beta header; check the Files API page.

**Quick example** (Python):

```python
import anthropic

client = anthropic.Anthropic()

# Create a message with the PowerPoint Skill
response = client.messages.create(
    model="claude-opus-5-5",
    max_tokens=4096,
    container={
        "skills": [
            {
                "type": "anthropic",
                "skill_id": "pptx",
                "version": "latest"
            }
        ]
    },
    messages=[{
        "role": "user",
        "content": "Create a presentation about renewable energy with 5 slides"
    }],
    tools=[{
        "type": "code_execution_20250825",
        "name": "code_execution"
    }]
)
```

**Pre-built Skills available**:
- **PowerPoint (pptx)**: Create presentations, edit slides, analyze content
- **Excel (xlsx)**: Create spreadsheets, analyze data, generate reports with charts
- **Word (docx)**: Create documents, edit content, format text
- **PDF (pdf)**: Generate formatted PDF documents and reports

**Custom Skills**: Upload via `/v1/skills` endpoints. Shared workspace-wide. Limits: at most 20 skills per request and 30 MB uncompressed per skill; `name` and `description` rules as in the [frontmatter reference](#yaml-frontmatter-reference) ([skills-guide]). Reference a custom skill with `{"type": "custom", "skill_id": "…", "version": "<version id>|latest"}`, and pin the version in production.

### Claude.ai

**Pre-built Agent Skills**: Working behind the scenes when you create documents. No setup required.

**Custom Skills**: Upload as zip files in Settings (the [PDF][pdf-guide] gives *Settings › Capabilities › Skills*; the menu has moved before). Available on Pro, Max, Ultra, Team and Enterprise plans with code execution enabled ([overview]).

**Note**: A skill you upload is yours alone. Organization admins can provision skills org-wide (the PDF dates this to 2025-12-18), and Claude Enterprise can require [skill content scanning](#vetting-a-skill-enterprise-review).

### Claude Code

**Custom Skills only**. Create Skills as directories with SKILL.md files. Claude discovers and uses them automatically. Users can also invoke skills directly via `/skill-name`.

**Skill Locations and Priority**:

Where you store a skill determines who can use it. When skills share the same name across levels, higher-priority locations win:

| Location | Path | Applies to | Priority |
|----------|------|------------|----------|
| Enterprise | Via managed settings | All users in your organization | Highest |
| Personal | `~/.claude/skills/<skill-name>/SKILL.md` | All your projects | High |
| Project | `.claude/skills/<skill-name>/SKILL.md` | This project only | Normal |
| Plugin | `<plugin>/skills/<skill-name>/SKILL.md` | Where plugin is enabled | Namespaced |

Plugin skills use a `plugin-name:skill-name` namespace, so they cannot conflict with other levels. Skills synced from your claude.ai account load from `~/.claude/skills/synced/` under the `anthropic-skills:` namespace — see [Skills Synced from claude.ai](#skills-synced-from-claudeai). Full collision rules: [Command Names, Collisions and Reserved Names](#command-names-collisions-and-reserved-names).

#### Enterprise Skills

Deployed organization-wide through managed settings. Highest priority. See Claude Code managed settings documentation.

#### Personal Skills

**Location**: `~/.claude/skills/`

```bash
mkdir -p ~/.claude/skills/my-skill-name
```

Use for:
- Individual workflows and preferences
- Experimental Skills you're developing
- Personal productivity tools

#### Project Skills

**Location**: `.claude/skills/` (within your project)

```bash
mkdir -p .claude/skills/my-skill-name
```

Use for:
- Team workflows and conventions
- Project-specific expertise
- Shared utilities and scripts

Project Skills are checked into git and automatically available to team members.

#### Plugin Skills

Skills can also come from Claude Code plugins. Plugins may bundle Skills that are automatically available when the plugin is installed. Plugin skills are namespaced as `plugin-name:skill-name`.

#### Live Change Detection

Claude Code watches skill directories for file changes. **Adding, editing, or removing** a skill under `~/.claude/skills/`, the project `.claude/skills/`, or an `--add-dir`'d `.claude/skills/` takes effect **within the current session without restarting**.

Exception: a **top-level skills directory** created after the session started isn't watched — run `/reload-skills` to pick it up (and again after each later change there). Live detection covers `SKILL.md` text only; for a skill folder that is also a plugin, changes to `hooks/`, `.mcp.json`, `agents/` or `output-styles/` need `/reload-plugins`. Bare mode doesn't watch at all.

#### Skills Synced from claude.ai

When you sign in to Claude Code with a claude.ai account (v2.1.273+ in the terminal), it loads the skills enabled on that account — ones you created or turned on, your organization's, and Anthropic's built-ins (`pdf`, `xlsx`, `docx`, `pptx`, `skill-creator`, …).

- **Where**: downloaded into `~/.claude/skills/synced/<id>/` in the background at startup, then re-checked about every 10 minutes; adds/edits/removals apply without a restart. Startup is never delayed — a skill downloads when first invoked. For `-p` runs that must see them, set `CLAUDE_CODE_SYNC_SKILLS=1`.
- **Download only**: editing files under `synced/` is not saved to claude.ai and a later sync can overwrite it. Change the skill on claude.ai. These files are sync output — **don't commit them** if you track `~/.claude` in git (the `.bucket-*` and `.last-complete-round` markers churn on their own).
- **Not synced** when: authenticated by API key / `ANTHROPIC_AUTH_TOKEN` / `CLAUDE_CODE_OAUTH_TOKEN` / `apiKeyHelper`; on Bedrock or with `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`; in bare or `--safe-mode`; when managed settings lock skills to plugins; or with `--setting-sources` lacking `user`.
- **Turn off**: `syncClaudeAiSkills: false` in user settings (already-synced skills move to `~/.claude/skills/.trash/`). Remove one skill by turning it off on claude.ai — deleting the folder just gets it re-downloaded.
- **Restrictions on your machine** (v2.1.228+): `!` commands are not run, `@` file references aren't attached, and `${CLAUDE_PROJECT_DIR}`/`${CLAUDE_SESSION_ID}` aren't substituted — all reach Claude as literal text. Descriptions are sanitized (control chars removed, angle brackets escaped). `allowed-tools` goes through the normal permission flow. In cloud sessions the body behaves like a local skill.
- **List them**: `/skills` shows them under `claude.ai sync`.

#### Skills in Cowork, Cloud Sessions and Routines

Cowork and cloud sessions (including **routines**) **don't read `~/.claude/skills/`** on your machine. They load the skills enabled on your claude.ai account; cloud sessions also load project skills committed to the repo's `.claude/skills/`. A routine invoking a personal-only skill reports "skill not found" — enable it on claude.ai or commit it to the repo. Desktop scheduled tasks run locally, so they do see `~/.claude/skills/`.

#### Removing a Skill

| Source | How |
|---|---|
| Personal / project | Delete the skill directory (drops from `/skills` live) |
| Enterprise | Admin deletes it from the managed settings directory's `.claude/skills/` |
| Plugin | Disable/uninstall the plugin (`/plugin uninstall <plugin>@<marketplace>`) |
| Synced from claude.ai | Turn it off on claude.ai (deleting the folder re-downloads it) |
| Bundled | `disableBundledSkills: true`, or `"off"` in `skillOverrides` |

To keep a skill but stop Claude invoking it: `disable-model-invocation: true`, or `"user-invocable-only"` in `skillOverrides`.

#### Nested Directory Discovery (Monorepo Support)

When you work with files in subdirectories, Claude Code automatically discovers skills from nested `.claude/skills/` directories. For example, editing `packages/frontend/foo.ts` also pulls in skills from `packages/frontend/.claude/skills/`. Supports monorepo setups where packages have their own skills.

#### Skills from Additional Directories (`--add-dir`)

`--add-dir` grants **file access**, not configuration discovery. **Skills are an exception**: `.claude/skills/` within an added directory is loaded automatically and benefits from live change detection.

Other `.claude/` configuration (subagents, commands, output styles) is **not** loaded from `--add-dir` directories. CLAUDE.md files from added directories are also not loaded by default — set `CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1` to opt in.

### Claude Agent SDK

The Claude Agent SDK supports custom Skills through filesystem-based configuration.

Create Skills as directories with SKILL.md files in `.claude/skills/`; there is no programmatic API for registering them ([sdk-skills]).

- **Discovery** follows the filesystem setting sources (`setting_sources` in Python, `settingSources` in TypeScript). With default `query()` options that means `~/.claude/skills/`, `<cwd>/.claude/skills/`, and `.claude/skills/` in any parent directory up to the repository root.
- **Scope** with the `skills` option: omitted = all discovered skills enabled; `"all"`; a list of names (`ClaudeAgentOptions(skills=["pdf", "docx"])`); or `[]` for none. When `skills` is set the SDK adds them to `allowedTools` itself; if you also pass an explicit `tools` list, include `"Skill"`.
- **User invocation:** send `/<name>` in the prompt.

### Cross-Surface Availability

**Custom Skills do not sync across surfaces**. Skills uploaded to one surface are not automatically available on others:

- Skills uploaded to Claude.ai must be separately uploaded to the API
- Skills uploaded via the API are not available on Claude.ai
- Claude Code Skills are filesystem-based and separate from both

### Sharing Scope

- **Claude.ai**: Personal uploads are individual (each member uploads separately); admins can provision org-wide skills
- **Claude Models on Google Cloud (Anthropic managed)**: each skill belongs to one workspace, but IAM roles apply to every workspace in the project, so use separate projects for separate access ([overview])
- **Claude API**: Workspace-wide; all workspace members can access uploaded Skills
- **Claude Code**: Personal (`~/.claude/skills/`) or project-based (`.claude/skills/`)

### Runtime Environment Constraints

**Claude.ai**:
- **Varying network access**: Depending on user/admin settings, Skills may have full, partial, or no network access

**Claude API**:
- **No network access**: Skills cannot make external API calls or access the internet
- **No runtime package installation**: Only pre-installed packages are available
- **Pre-configured dependencies only**: Check the code execution tool documentation for available packages

**Claude Code**:
- **Full network access**: Skills have the same network access as any other program on the user's computer
- **Global package installation discouraged**: Skills should only install packages locally

---

## Distribution, Versioning and Shipping

Custom skills don't sync across surfaces, so each one is installed separately ([Cross-Surface Availability](#cross-surface-availability)).

| Audience | Channel | Notes |
|---|---|---|
| You | `~/.claude/skills/` or the project's `.claude/skills/` | Live-reloaded in Claude Code |
| A team on Claude Code | A plugin in a marketplace: `claude plugin marketplace add <path-or-repo>`, then `claude plugin install <plugin>@<marketplace>` | The install is a **cached snapshot**, not a live link (*field lesson*) |
| claude.ai / Cowork users | Upload a zip in Settings (the PDF's path: *Settings › Capabilities › Skills*) | Only the six spec frontmatter fields; per user unless an admin provisions it |
| A whole claude.ai organization | Admin-provisioned skills (the PDF: shipped 2025-12-18, with automatic updates and central management) | Enterprise orgs can require security scanning ([Security](#vetting-a-skill-enterprise-review)) |
| Apps and agents you build | Skills API `/v1/skills`, then `container.skills` in Messages requests; Managed Agents' `skills` array | Workspace-wide; pin versions in production |
| The public | A GitHub repo with a repo-level README for humans, plus release zips | If the skill wraps your MCP server, link it from the server's docs |

**Packaging rules**

- The file MUST be named exactly `SKILL.md` (case-sensitive). The folder is kebab-case and matches `name` ([PDF][pdf-guide]).
- **No `README.md` inside the skill folder.** Instructions go in `SKILL.md` or `references/`; a README for humans lives at the repo root ([PDF][pdf-guide]). *Field lesson:* keep the human README next to the canonical source, not in the packaged copy.
- skill-creator's `python -m scripts.package_skill <skill-dir>` builds a `<name>.skill` zip, leaving out `__pycache__/`, `node_modules/`, `*.pyc`, `.DS_Store` and a root-level `evals/` ([skill-creator]). When updating an installed skill, keep its original `name` and directory (no `-v2`), and copy it somewhere writable (e.g. `/tmp/<name>/`) before editing, since installed paths may be read-only.
- Skills API limits: at most 30 MB uncompressed per skill, at most 20 skills per Messages request ([skills-guide]).

**Versioning** (*field lessons*, consistent with [enterprise])

- One version source: `plugin.json` `version`. `SKILL.md` `metadata.version` must match, and the build script enforces it. Name the zip with the version, and add a CHANGELOG entry per bump.
- Version the rules separately from releases (e.g. a `criteria_version` in config that changes whenever a threshold does).
- **Pin versions in production on the API.** Without `version`, a new upload by anyone in the workspace changes what production runs. Keep the previous version for rollback, checksum reviewed skills and verify the checksum at deploy, and use signed commits for provenance ([enterprise]).
- Keep a registry entry per skill: purpose, owner, version, dependencies (MCP servers, packages, services), last evaluation date and result ([enterprise]).

**A build script is the only way to produce the package** (*field lesson*):

1. Read the version from `plugin.json`; fail if `SKILL.md` disagrees.
2. Copy scripts and config from the canonical source. Never hand-edit generated copies, and mark which files are hand-written.
3. Patch path assumptions for the packaged layout.
4. Smoke-test the **packaged** scripts end to end.
5. Run `claude plugin validate` on the plugin and marketplace manifests. It checks the schema, **not** that referenced files exist.
6. Zip, and fail if the zip contains any data file (`.csv`, `.xlsx`, fixtures, samples).
7. After installing: uninstall and reinstall (the same version number won't re-copy), then `diff -rq` the plugin cache under `~/.claude/plugins/cache/` against the build.

Marketplace gotchas (*field lesson*): each `marketplace.json` `plugins[].name` MUST equal that plugin's `plugin.json` `name`, or install fails; relative `source` paths are resolved from the marketplace root and can't contain `..`.

### Skills for External Users

*Field lessons* from a skill used by people who attach a file, type three words and expect a defensible result:

- **No-input path.** If the required input isn't attached, run nothing. Ask for it by the name the user knows it by, with its file type, and say in one or two sentences what will happen. **Ship no sample data and never invent data to demo on**: demo output reads like a real result.
- **Section order that worked in SKILL.md:** the default path when a file is attached → what to ask when nothing is → exact commands → the files every run returns → output keys in reading order (what did *not* run first) → 3–5 numbered rules, each with its reason → a pointer to the procedure file → a "They say → You do" table → how to change thresholds → what the skill cannot do → where outputs may go.
- **`reference/TROUBLESHOOTING.md`:** one entry per refusal, headed by the exact message text, with *What happened / Why it matters / What to say* (a quoted sentence) */ What to do*. Add sections for "runs but looks wrong" and "looks alarming but is fine".
- **Levels of verification.** Each level catches what the one before can't:

  | Level | What | Catches |
  |---|---|---|
  | 0. Manifest | `claude plugin validate` | Schema and name mismatches, not missing files |
  | 1. Unit | Tests on a script-generated synthetic fixture | Logic you thought of |
  | 2. Real data | Per-rule counts before and after each change, on real input | Rules that explode or vanish |
  | 3. Mutation | Break each new behavior on purpose; a test must fail | Tests passing for the wrong reason |
  | 4. Clone-and-run | Fresh `git clone`, build, run the packaged scripts | Untracked files the package needs |
  | 5. Installed copy | Reinstall; `diff -rq` the cache against the build | A stale cached install |
  | 6. Independent review | Separate code-quality and security reviews | Blind spots the author and tests share |

  A check that shares an assumption with the fix is not evidence; verify by a different route. Don't claim it works unless it ran on something real. Keep a "do not fix these back" list of deliberate design choices in the project's `CLAUDE.md`.

**Positioning.** Describe outcomes, not mechanics: "sets up a complete project workspace in seconds", not "a folder with YAML frontmatter that calls our MCP tools". MCP vendors should tell the "the server gives access, the skill gives the workflow" story ([PDF][pdf-guide]).

---

## Bundled Skills (Claude Code)

Bundled skills ship with Claude Code and are available in every session. Unlike built-in commands (like `/help`, `/compact`), which execute fixed logic directly, bundled skills are **prompt-based**: they give Claude a detailed playbook and let it orchestrate the work using its tools. This means bundled skills can spawn parallel agents, read files, and adapt to your codebase.

You invoke bundled skills the same way as any other skill: type `/` followed by the skill name. Some run only when you invoke them (e.g. `/verify`), others Claude may invoke when relevant. Turn them all off with `disableBundledSkills`; hide one with `skillOverrides`. Since v2.1.205, `/doctor` is a bundled skill too. The [commands reference](https://code.claude.com/docs/en/commands) marks bundled skills as **Skill**.

### `/run`, `/verify`, `/run-skill-generator`

Launch the app and confirm a change against the running app, not just tests:
- `/run` — launch and drive the app to see a change working.
- `/verify` — build and run the app to confirm a change does what it should. When it has to work out the build itself, it records the recipe to `.claude/skills/verify/SKILL.md` (repo root or the touched package), which then **replaces the bundled `/verify`** for that repo (v2.1.200+). Since v2.1.205 it edits that file only when a step steered a run wrong, so it's safe to commit.
- `/run-skill-generator` — records a clean-environment launch recipe as `.claude/skills/run-<name>/` so `/run`, `/verify` and other agents reuse it. Re-run when the build changes.

### Skills Named `verify` or `simplify` Run Before Each Commit

From v2.1.286, if a session starts with a skill named **`verify`** or **`simplify`** that Claude can invoke, the built-in commit instructions tell Claude to run it right before each commit (except docs/test-only changes). It must come from an enterprise, personal, project or `--add-dir` location (or a `.claude/commands/` file); the bundled versions, plugin skills and claude.ai-synced skills don't count. Turning off `includeGitInstructions` removes the behavior. **Naming a skill `verify` is therefore a behavior choice, not just a name.**

### `/simplify`

Reviews your recently changed files for code reuse, quality, and efficiency issues, then fixes them. Run it after implementing a feature or bug fix to clean up your work. It spawns three review agents in parallel (code reuse, code quality, efficiency), aggregates their findings, and applies fixes. Pass optional text to focus on specific concerns:

```
/simplify focus on memory efficiency
```

### `/batch <instruction>`

Orchestrates large-scale changes across a codebase in parallel. Provide a description of the change and `/batch` researches the codebase, decomposes the work into 5 to 30 independent units, and presents a plan for your approval. Once approved, it spawns one background agent per unit, each in an isolated git worktree. Each agent implements its unit, runs tests, and opens a pull request. Requires a git repository.

```
/batch migrate src/ from Solid to React
```

### `/debug [description]`

Troubleshoots your current Claude Code session by reading the session debug log. Optionally describe the issue to focus the analysis.

```
/debug why did the last tool call fail?
```

### `/loop <interval> <prompt>`

Run a prompt or slash command on a recurring interval (e.g. `/loop 5m /check-deploys`). Omit the interval to let the model self-pace. Useful for polling, status checks, or repeated tasks.

### `/claude-api`

Build, debug, and optimize Claude API / Anthropic SDK and Managed Agents applications. Auto-activates when code imports `anthropic` or `@anthropic-ai/sdk`. Subcommands: `migrate` (move code to a newer model), `upgrade` (SDK major version, v2.1.236+), `managed-agents-onboard`, `prompt-audit` (flag instructions written for older models in prompts, **skills** and tool descriptions; v2.1.221+), `cost-optimize` (v2.1.247+), `build-eval` and `hillclimb` (v2.1.259+), `preserved-thinking-migration` (v2.1.282+).

### Built-In Commands Also Reachable Via Skill Tool

A few built-in commands are exposed through the Skill tool and respond to `Skill(name)` permission rules, including **`/init`** and **`/security-review`**. Others like `/compact` are not. (`/review` is now an alias of the bundled `/code-review` skill.)

> **Note**: Claude Code also includes a bundled developer platform skill that activates automatically when your code imports the Anthropic SDK. You don't need to invoke it manually.

---

## Skill Permission Control (Claude Code)

By default, Claude can invoke any skill that doesn't have `disable-model-invocation: true` set. Skills that define `allowed-tools` grant those tools without per-use approval **during the invoking turn only** (the grant clears on the next user message). Your permission settings still govern baseline approval behavior for all other tools.

### Three Ways to Control Skill Access

**1. Disable all skills** by denying the Skill tool in `/permissions`:

```
# Add to deny rules:
Skill
```

**2. Allow or deny specific skills** using permission rules:

```
# Allow only specific skills
Skill(commit)
Skill(review-pr *)

# Deny specific skills
Skill(deploy *)
```

Permission syntax: `Skill(name)` for exact match, `Skill(name *)` for prefix match with any arguments.

**What a `deny` rule also blocks** (v2.1.260+ for nested names):

| Rule names | Example | Also blocks |
|---|---|---|
| An alias | `Skill(review)` | the bundled `/code-review` |
| An unqualified name | `Skill(deploy)` | a nested skill listed as `apps/web:deploy` |
| A synced skill | `Skill(anthropic-skills:deploy)` | that skill when Claude Desktop delivers it as a plugin |
| Parameter form | `Skill(skill:deploy)` | the skill under any of its names |

**`allow` rules match only the skill's own name.** To pre-approve synced skills use their namespace: `Skill(anthropic-skills:pdf)` or `Skill(anthropic-skills *)` — `Skill(anthropic *)` does **not** match them.

**3. Hide individual skills** by adding `disable-model-invocation: true` to their frontmatter. This removes the skill from Claude's context entirely.

> **Note**: The `user-invocable` field only controls menu visibility, not Skill tool access. Use `disable-model-invocation: true` to block programmatic invocation.

### Skill Visibility Overrides (`skillOverrides`)

The `skillOverrides` setting controls skill visibility **from settings instead of the skill's own frontmatter**. Useful for skills you don't want to (or can't) edit — shared repo skills, MCP-server-provided skills. Set interactively via the `/skills` menu (`Space` cycles state, `Esc` saves to `.claude/settings.local.json`; the menu labels `"user-invocable-only"` as `user-only`).

Four states per skill:

| Value | Listed to Claude | In `/` menu |
|-------|------------------|-------------|
| `"on"` *(default if absent)* | Name and description | Yes |
| `"name-only"` | Name only (description hidden — frees budget) | Yes |
| `"user-invocable-only"` | Hidden | Yes |
| `"off"` | Hidden | Hidden |

```json
{
  "skillOverrides": {
    "legacy-context": "name-only",
    "deploy": "off"
  }
}
```

Plugin skills are not affected by `skillOverrides` — manage those through `/plugin`.

- `"off"` also hides the skill from Remote Control clients and Agent SDK command lists; invoking it by full name returns a `skillOverrides` error.
- Entries under a bundled skill's **alias** (e.g. `checkup` for `/doctor`) apply only in managed settings or a `--settings` file, and can only restrict. In user/project/local settings, entries match skill names only.

### When Only Managed Permission Rules Apply

If the organization sets `allowManagedPermissionRulesOnly`, Claude Code **ignores `allowed-tools` in project and personal skills** (v2.1.282+); the listed tools go through managed rules and normal prompts. `/status` lists skills whose `allowed-tools` were ignored.

### Find Unused Skills (`/skill-doctor`)

Every listed skill costs context on every turn. `/skill-doctor` (v2.1.252+) reports each skill's context cost and usage, flags never-invoked skills and says where to turn them off — start with the costliest. It opens in the `/plugin` manager's **Stats** tab (text with `-p`); not available over Remote Control or without feature-flag fetching. It excludes bundled and enterprise skills and also lists unused plugins.

---

## Evaluation and Iteration

### Measure Triggering and Output Separately (Baseline Comparison)

A skill triggering only proves Claude found it. Measure two things: **does Claude invoke it on the prompts it should**, and **is the output right when it does**. The method is a baseline comparison — run a few realistic prompts each in a **fresh session** with the skill on and again with it off, and compare. Fresh sessions matter: leftover authoring context masks gaps in the written instructions.

- Turn a personal/project skill off for the baseline with `"off"` in `skillOverrides`.
- Plugin skills ignore `skillOverrides` — use `claude plugin eval`, which repeats each run with no plugin loaded.

**Two tools automate this** (their eval formats are **not** interchangeable):

| Tool | For | What it does |
|---|---|---|
| `claude plugin eval` | Skills shipped in a plugin | Runs each prompt in an isolated session with/without the plugin, scores with graders you define (or it writes), exits non-zero below a threshold so CI can gate on it. Trigger rate: a `tool_used: Skill` grader. |
| `skill-creator` plugin | Iterating on one skill inside a conversation | Stores cases in `evals/evals.json` in the skill dir; one subagent per case (clean context, tokens and time recorded); writes `grading.json` (pass/fail with evidence) and `benchmark.json` (pass rate, time, tokens with vs without the skill); blind A/B between two skill versions; **description tuning** from generated should-trigger / should-not-trigger prompts; an HTML review viewer whose feedback feeds the next iteration. |

Install skill-creator: `/plugin install skill-creator@claude-plugins-official` (if the marketplace is missing: `/plugin marketplace add anthropics/claude-plugins-official`), then ask e.g. *"evaluate my summarize-changes skill with skill-creator"*. It is also one of the Anthropic skills synced from claude.ai. Eval file format and workflow: [Evaluating skill output quality](https://agentskills.io/skill-creation/evaluating-skills).

### What to Test

From the [PDF][pdf-guide] (first three rows) and the [enterprise] approval dimensions (last two):

| Test | Goal | Cases |
|---|---|---|
| Triggering | Loads at the right times | Obvious asks, paraphrases, near-miss should-not queries |
| Functional | Correct output | Valid outputs; API/MCP calls succeed; error handling; edge cases, written as Given / When / Then |
| Performance vs. baseline | Proves the skill helps | The same task with and without it: messages, failed calls, tokens |
| Isolation | Works on its own | Every file it references exists in its own directory |
| Coexistence | Doesn't steal triggers from, or degrade, other skills | Run with your real skill set loaded |

- **Match rigor to the audience:** manual runs on claude.ai → scripted runs in Claude Code → programmatic suites through the Skills API ([PDF][pdf-guide]).
- **Enterprise bar:** each skill ships with 3–5 representative queries (should, should-not, ambiguous), tested on every model you deploy (Haiku, Sonnet, Opus); authors don't review their own skills; evals re-run periodically to catch drift; a skill that keeps failing is deprecated ([enterprise]).
- **Recall drops as skills pile up.** Measure recall as you add skills and stop when it degrades; start narrow and consolidate only when evals show the merged skill does as well ([enterprise]). The PDF flags trouble above roughly 20–50 skills enabled at once.

### The skill-creator Eval Loop

Pinned to [`claude-plugins-official@a2e251d`][skill-creator]: draft → run test prompts with and without the skill → review → improve → repeat, then widen the test set.

1. **Test prompts.** 2–3 realistic prompts (what a user would actually type) in `evals/evals.json`; add assertions later:
   ```json
   {"skill_name": "example-skill",
    "evals": [{"id": 1, "prompt": "…", "expected_output": "…", "files": []}]}
   ```
2. **Spawn every run in the same turn**: for each prompt, one subagent **with** the skill and one **baseline**. For a new skill the baseline has no skill; when improving one, snapshot the old version first (`cp -r <skill> <workspace>/skill-snapshot/`). Outputs go to `<skill-name>-workspace/iteration-N/<eval-name>/{with_skill|without_skill|old_skill}/outputs/`, with an `eval_metadata.json` per eval.
3. **Draft assertions while the runs execute.** Make them objectively checkable and descriptively named. Don't force assertions onto subjective output (style, design); review that by eye.
4. **Record `total_tokens` and `duration_ms`** from each subagent's completion notice into `timing.json` right away; they aren't stored anywhere else.
5. **Grade** with `agents/grader.md` into `grading.json`. Expectations MUST use the fields `text`, `passed`, `evidence` (the viewer depends on those names). A pass needs real evidence, not surface compliance: the file exists **and** its content is right. The burden of proof is on the assertion. Script any assertion code can check.
6. **Aggregate:** `python -m scripts.aggregate_benchmark <workspace>/iteration-N --skill-name <name>` writes `benchmark.json` and `benchmark.md` (pass rate, time and tokens as mean ± stddev, plus the delta).
7. **Analyst pass** (`agents/analyzer.md`): flag assertions that pass in both configurations (they don't discriminate), fail in both (broken), high-variance evals (flaky), and time/token trade-offs.
8. **Review:** `python eval-viewer/generate_review.py <workspace>/iteration-N --skill-name <name> --benchmark <workspace>/iteration-N/benchmark.json`. Add `--previous-workspace` from iteration 2 on, and use `--static <file.html>` when there's no display (e.g. Cowork). Feedback lands in `feedback.json`; empty feedback means the output was fine.
9. **Improve.** Generalize from the feedback instead of overfitting to the test prompts; cut instructions that waste steps (read transcripts, not only outputs); explain the why; bundle scripts every run rewrote. Re-run into `iteration-N+1/`, baselines included. Stop when the user is happy, the feedback is empty, or progress stalls.
10. **Optional blind A/B** between two versions with `agents/comparator.md` and `agents/analyzer.md`.

On claude.ai (no subagents), run the prompts one at a time yourself, skip baselines, benchmarks and blind comparison, and show results inline. Description optimization needs `claude -p`, so it runs only in Claude Code.

**Sources differ:** the PDF (January 2026) says skill-creator "does not execute automated test suites or produce quantitative evaluation results"; the pinned plugin does (subagent runs, `benchmark.json`, `run_eval.py`). Go by the plugin version you have installed.

### Description Optimization Loop

skill-creator's trigger tuner (Claude Code only; it shells out to `claude -p`):

1. **Write about 20 queries:** 8–10 should-trigger (formal and casual phrasings, the skill not named, uncommon uses, cases where it competes with another skill and should win) and 8–10 should-not-trigger **near misses** (shared keywords, adjacent domains). Make them realistic and detailed: file names, column names, backstory, lowercase and typos. "Write a fibonacci function" as a negative for a PDF skill tests nothing.
   ```json
   [{"query": "ok so my boss sent me 'Q4 sales final FINAL v2.xlsx' and wants a profit margin column…", "should_trigger": true},
    {"query": "…", "should_trigger": false}]
   ```
2. **Have the user review the set** (`assets/eval_review.html`); bad queries produce bad descriptions.
3. **Run:**
   ```bash
   python -m scripts.run_loop --eval-set trigger-evals.json --skill-path <skill> \
     --model <model-id-of-this-session> --max-iterations 5 --verbose
   ```
   Defaults: 40% held out for testing (`--holdout 0.4`), 3 runs per query, trigger threshold 0.5, up to 5 iterations. It proposes new descriptions from the failures and returns `best_description`, chosen by **held-out** score to avoid overfitting.
4. **Apply `best_description`**, and show the before/after with scores. The 1,024-character limit still applies.

### Build Evaluations First

**Create evaluations BEFORE writing extensive documentation.** This ensures your Skill solves real problems.

**Evaluation-driven development:**

1. **Identify gaps**: Run Claude on representative tasks without a Skill. Document specific failures or missing context
2. **Create evaluations**: Build three scenarios that test these gaps
3. **Establish baseline**: Measure Claude's performance without the Skill
4. **Write minimal instructions**: Create just enough content to address the gaps and pass evaluations
5. **Iterate**: Execute evaluations, compare against baseline, and refine

**Evaluation structure**:

```json
{
  "skills": ["pdf-processing"],
  "query": "Extract all text from this PDF file and save it to output.txt",
  "files": ["test-files/document.pdf"],
  "expected_behavior": [
    "Successfully reads the PDF file using an appropriate PDF processing library or command-line tool",
    "Extracts text content from all pages in the document without missing any pages",
    "Saves the extracted text to a file named output.txt in a clear, readable format"
  ]
}
```

### Develop Skills Iteratively with Claude

Work with one instance of Claude ("Claude A") to create a Skill that will be used by other instances ("Claude B").

**Creating a new Skill:**

1. **Complete a task without a Skill**: Work through a problem with Claude A using normal prompting
2. **Identify the reusable pattern**: After completing the task, identify what context you provided that would be useful for similar future tasks
3. **Ask Claude A to create a Skill**: "Create a Skill that captures this BigQuery analysis pattern we just used"
4. **Review for conciseness**: Check that Claude A hasn't added unnecessary explanations
5. **Improve information architecture**: Ask Claude A to organize content more effectively
6. **Test on similar tasks**: Use the Skill with Claude B (a fresh instance with the Skill loaded) on related use cases
7. **Iterate based on observation**: If Claude B struggles, return to Claude A with specifics

**Iterating on existing Skills:**

1. **Use the Skill in real workflows**: Give Claude B (with the Skill loaded) actual tasks, not test scenarios
2. **Observe Claude B's behavior**: Note where it struggles, succeeds, or makes unexpected choices
3. **Return to Claude A for improvements**: Share the current SKILL.md and describe what you observed
4. **Review Claude A's suggestions**: Claude A might suggest reorganizing, using stronger language, or restructuring
5. **Apply and test changes**: Update the Skill with Claude A's refinements, then test again with Claude B
6. **Repeat based on usage**: Continue this observe-refine-test cycle as you encounter new scenarios

**Why this approach works**: Claude A understands agent needs, you provide domain expertise, Claude B reveals gaps through real usage, and iterative refinement improves Skills based on observed behavior.

### Observe How Claude Navigates Skills

As you iterate on Skills, pay attention to how Claude actually uses them:

- **Unexpected exploration paths**: Does Claude read files in an order you didn't anticipate?
- **Missed connections**: Does Claude fail to follow references to important files?
- **Overreliance on certain sections**: If Claude repeatedly reads the same file, consider whether that content should be in the main SKILL.md
- **Ignored content**: If Claude never accesses a bundled file, it might be unnecessary or poorly signaled

---

## Security Considerations

We strongly recommend using Skills only from trusted sources: those you created yourself or obtained from Anthropic.

Skills provide Claude with new capabilities through instructions and code. A malicious Skill can direct Claude to invoke tools or execute code in ways that don't match the Skill's stated purpose.

### Key Security Considerations

**Audit thoroughly**: Review all files bundled in the Skill: SKILL.md, scripts, images, and other resources. Look for unusual patterns like unexpected network calls, file access patterns, or operations that don't match the Skill's stated purpose.

**External sources are risky**: Skills that fetch data from external URLs pose particular risk, as fetched content may contain malicious instructions. Even trustworthy Skills can be compromised if their external dependencies change over time.

**Tool misuse**: Malicious Skills can invoke tools (file operations, bash commands, code execution) in harmful ways.

**Data exposure**: Skills with access to sensitive data could be designed to leak information to external systems.

**Repository skills grant themselves tools before trust** *(Claude Code)*: a project skill's `allowed-tools` applies even in a `-p` run in a folder you never trusted, and `` !`cmd` `` injection runs as the skill renders. Read `.claude/skills/*/SKILL.md` frontmatter and injected commands in any repo before running Claude Code there. Org-wide controls: `allowManagedPermissionRulesOnly` (ignore skill `allowed-tools`), `disableSkillShellExecution` (block injection), `Skill(...)` deny rules.

**Hooks outlive the skill**: `hooks` in a skill's frontmatter stay registered for the rest of the session after one invocation — audit them like `settings.json` hooks.

**Treat like installing software**: Only use Skills from trusted sources. Be especially careful when integrating Skills into production systems with access to sensitive data or critical operations.

**Warning**: If you must use a Skill from an untrusted or unknown source, exercise extreme caution and thoroughly audit it before use. Depending on what access Claude has when executing the Skill, malicious Skills could lead to data exfiltration, unauthorized system access, or other security risks.

### Vetting a Skill (Enterprise Review)

From [Skills for enterprise][enterprise]:

| Risk indicator | Look for | Concern |
|---|---|---|
| Code execution | `*.py`, `*.sh`, `*.js` in the skill | High |
| Instruction manipulation | Ignoring safety rules, hiding actions, behaving differently on certain inputs | High |
| MCP server references | `ServerName:tool_name` | High |
| Network access | URLs, `fetch`, `curl`, `requests` | High |
| Hardcoded credentials | Keys, tokens, passwords | High |
| Filesystem scope | Paths outside the skill directory, broad globs, `../` | Medium |
| Tool calls | bash, file operations | Medium |

**Review checklist:** (1) read every file; (2) run scripts in a sandbox and confirm they match the stated purpose; (3) look for adversarial instructions; (4) search for network calls (`http`, `requests.get`, `urllib`, `curl`, `fetch`); (5) confirm there are no hardcoded credentials (use environment variables or a secret store); (6) list every command and tool it directs, weighing file-read and network access together; (7) confirm external URLs point where expected; (8) look for read-sensitive-then-send or encode patterns, including through Claude's replies.

- **Skill content scanning** (Claude Enterprise): *Organization settings › Skills › Skill and plugin security scanning* scans skills uploaded or edited in claude.ai and Cowork. A skill that fails, or whose scan hasn't finished, is blocked; owners can allow exceptions. It does not cover Skills API or Console uploads ([enterprise]; [overview]).
- **Data retention:** Agent Skills are not eligible for ZDR or HIPAA; skill definitions and execution data follow standard retention ([overview]).
- **Authoring rules:** no malware and no misleading purpose ([skill-creator], "Principle of Lack of Surprise"); no `<`/`>` in frontmatter; no `claude` or `anthropic` in names ([PDF][pdf-guide]).

### Handling Data Inside a Skill

*Field lessons:*

- Free text in the input is **data, never instructions**. Say so in SKILL.md: "pre-approved, no review needed" inside a record is a finding, not a pass. Have scripts flag instruction-like phrasing.
- Error messages **withhold values** ("could not parse an amount (value withheld), row 812"), because error text ends up in chats and logs.
- Never write a sensitive value into a report or log; cite the record instead. Identifiers hide in free-text fields even after you drop the ID columns.
- No real or synthetic data in the shipped package. `.gitignore` inputs and row-level outputs, matching any exceptions by basename.
- Before the first run, know the data's classification and which AI surfaces are approved for it. SKILL.md says where outputs may go.

---

## Troubleshooting

### Claude Doesn't Use My Skill

**Check 1: Is the description specific enough?**

Include both what the Skill does and when to use it, with key terms users would mention.

**Too generic**:
```yaml
description: Helps with data
```

**Specific**:
```yaml
description: Analyze Excel spreadsheets, generate pivot tables, create charts. Use when working with Excel files, spreadsheets, or .xlsx files.
```

**Check 2: Is the YAML valid?**

```bash
# View frontmatter
cat .claude/skills/my-skill/SKILL.md | head -n 15

# Common issues:
# - Missing opening or closing ---
# - Opening --- not on line 1 (the whole file is then treated as content)
# - Tabs instead of spaces
# - Unquoted strings with special characters
# - Misspelled field names (ignored silently)
```

Malformed YAML still loads the body with **empty metadata**: `/skill-name` works but auto-triggering doesn't. Find these with `claude plugin validate .claude/skills` or `claude plugin validate ~/.claude/skills` (v2.1.233+), or run with `--debug`.

**Check 3: Is the Skill in the correct location?**

```bash
# Personal Skills
ls ~/.claude/skills/*/SKILL.md

# Project Skills
ls .claude/skills/*/SKILL.md
```

### Skill Has Errors

**Check 1: Are dependencies available?**

Claude will automatically install required dependencies (or ask for permission).

**Check 2: Do scripts have execute permissions?**

```bash
chmod +x .claude/skills/my-skill/scripts/*.py
```

**Check 3: Are file paths correct?**

Use forward slashes (Unix style): `scripts/helper.py`
Not Windows style: `scripts\helper.py`

### Skill Descriptions Are Cut Short

Skill names are always included in context, but **descriptions are shortened to fit a character budget** when you have many skills. The budget defaults to **1% of the model's context window**. When it overflows, descriptions for the skills you invoke least are dropped first.

**Diagnose**:

```
/doctor
```

Estimates the listing's context cost and its biggest contributors. `/skill-doctor` finds skills worth turning off; an overflow also logs a warning visible with `--debug`. The **Skills** row in `/context` shows the post-budget size (accurate since v2.1.196).

**Tune the budget**:

- `skillListingBudgetFraction` setting — e.g. `0.02` for 2%
- `SLASH_COMMAND_TOOL_CHAR_BUDGET` env var — fixed char count
- `skillListingMaxDescChars` setting — per-entry cap (default 1,536)

**Free budget for high-priority skills**:

- Set low-priority entries to `"name-only"` in `skillOverrides` (description hidden, slot freed)
- Front-load the key use case in each `description` (each entry is capped regardless of budget)
- Trim `when_to_use` text at the source

### Personal Skills Disappeared

Look in `~/.claude/skills/.trash/`. Sync never moves your own folders, but before v2.1.280 a stray `manifest.json` in `~/.claude/skills/` caused the folders it listed to be moved there. Move them back before the retention sweep deletes trash (30 days by default).

### Multiple Skills Conflict

Be specific in descriptions. Use distinct trigger terms.

**Instead of**:
```yaml
# Skill 1
description: For data analysis

# Skill 2
description: For analyzing data
```

**Use**:
```yaml
# Skill 1
description: Analyze sales data in Excel files and CRM exports. Use for sales reports, pipeline analysis, and revenue tracking.

# Skill 2
description: Analyze log files and system metrics data. Use for performance monitoring, debugging, and system diagnostics.
```

### Upload Fails (claude.ai, API)

| Error | Cause | Fix |
|---|---|---|
| "Could not find SKILL.md in uploaded folder" | The file isn't named exactly `SKILL.md` | Rename it (case-sensitive); confirm with `ls -la` |
| "Invalid frontmatter" | Missing `---` delimiters, an unclosed quote | Fix the YAML; the opening `---` goes on line 1 |
| "Invalid skill name" | Spaces or capitals | kebab-case: `my-cool-skill` |
| "Unexpected key(s) in SKILL.md frontmatter" | A Claude Code-only field | Keep to the six spec fields ([Portability](#frontmatter-outside-claude-code-portability)) |
| Description rejected | Over 1,024 characters, or contains `<` / `>` | Shorten it; remove angle brackets |

Sources: [PDF][pdf-guide] ch. 5; skill-creator `quick_validate.py`.

### Skill Loads but Instructions Aren't Followed

1. **Too verbose:** use bullets and numbered steps; move detail to `references/`.
2. **Buried:** put critical steps at the top under a clear heading.
3. **Ambiguous:** replace "validate properly" with the exact checks.
4. **Skipped steps ("laziness"):** enforce the step with a script that fails loudly. Encouragement text works better in the user prompt than in SKILL.md ([PDF][pdf-guide]).
5. **Claude works around a failure:** forbid that workaround by name and give the sentence to say instead (*field lesson*).

### Skill Loads but MCP Calls Fail

1. The server is connected (claude.ai, per the PDF: *Settings › Extensions › your service* shows "Connected").
2. Auth is valid: keys not expired, scopes granted, OAuth tokens refreshed.
3. Call the tool directly without the skill. If that fails too, the problem is the server, not the skill.
4. Tool names in the skill match the server's exactly (case-sensitive, fully qualified).

### Responses Slow or Degraded (Too Much Context)

- **SKILL.md too large:** move detail to `references/` and link it instead of inlining. Keep the body under 500 lines (the PDF says under 5,000 words).
- **Too many skills enabled:** the PDF flags trouble above roughly 20–50 at once. Enable selectively and use role-based bundles ([enterprise]).
- **Everything loaded up front:** use progressive disclosure, with references one level deep.

---

## Complete Examples

### Example 1: Simple Skill (Single File)

**Structure**:
```
commit-helper/
└── SKILL.md
```

**SKILL.md**:
```yaml
---
name: generating-commit-messages
description: Generates clear commit messages from git diffs. Use when writing commit messages or reviewing staged changes.
---

# Generating Commit Messages

## Instructions

1. Run `git diff --staged` to see changes
2. I'll suggest a commit message with:
   - Summary under 50 characters
   - Detailed description
   - Affected components

## Best practices

- Use present tense
- Explain what and why, not how
```

### Example 2: Skill with Tool Permissions

**Structure**:
```
code-reviewer/
└── SKILL.md
```

**SKILL.md**:
```yaml
---
name: code-reviewer
description: Review code for best practices and potential issues. Use when reviewing code, checking PRs, or analyzing code quality.
allowed-tools: Read, Grep, Glob
---

# Code Reviewer

## Review checklist

1. Code organization and structure
2. Error handling
3. Performance considerations
4. Security concerns
5. Test coverage

## Instructions

1. Read the target files using Read tool
2. Search for patterns using Grep
3. Find related files using Glob
4. Provide detailed feedback on code quality
```

### Example 3: Multi-File Skill

**Structure**:
```
pdf-processing/
├── SKILL.md
├── FORMS.md
├── REFERENCE.md
└── scripts/
    ├── fill_form.py
    └── validate.py
```

**SKILL.md**:
````yaml
---
name: pdf-processing
description: Extract text, fill forms, merge PDFs. Use when working with PDF files, forms, or document extraction. Requires pypdf and pdfplumber packages.
---

# PDF Processing

## Quick start

Extract text:
```python
import pdfplumber
with pdfplumber.open("doc.pdf") as pdf:
    text = pdf.pages[0].extract_text()
```

For form filling, see [FORMS.md](FORMS.md).
For detailed API reference, see [REFERENCE.md](REFERENCE.md).

## Requirements

Packages must be installed in your environment:
```bash
pip install pypdf pdfplumber
```
````

### Example 4: BigQuery Data Analysis Skill

**Structure**:
```
bigquery-skill/
├── SKILL.md
└── reference/
    ├── finance.md
    ├── sales.md
    ├── product.md
    └── marketing.md
```

**SKILL.md**:
````markdown
---
name: bigquery-data-analysis
description: Query and analyze BigQuery data across finance, sales, product, and marketing datasets. Use when analyzing company metrics, generating reports, or querying BigQuery tables.
---

# BigQuery Data Analysis

## Available datasets

**Finance**: Revenue, ARR, billing → See [reference/finance.md](reference/finance.md)
**Sales**: Opportunities, pipeline, accounts → See [reference/sales.md](reference/sales.md)
**Product**: API usage, features, adoption → See [reference/product.md](reference/product.md)
**Marketing**: Campaigns, attribution, email → See [reference/marketing.md](reference/marketing.md)

## Quick search

Find specific metrics using grep:

```bash
grep -i "revenue" reference/finance.md
grep -i "pipeline" reference/sales.md
grep -i "api usage" reference/product.md
```

## Common queries

When the user asks for revenue, always:
1. Filter by `account_type != 'test'`
2. Use UTC timestamps for date filtering
3. Include both MRR and ARR in the results
````

---

## Checklist for Effective Skills

Before sharing a Skill, verify:

### Core Quality

- [ ] Description is specific and includes key terms
- [ ] Description includes both what the Skill does and when to use it
- [ ] Description front-loads the key use case (1,536-char Claude Code cap; 1,024 standard cap)
- [ ] SKILL.md body is under 500 lines
- [ ] Additional details are in separate files (if needed)
- [ ] No time-sensitive information (or in "old patterns" section)
- [ ] Consistent terminology throughout
- [ ] Examples are concrete, not abstract
- [ ] File references are one level deep
- [ ] Progressive disclosure used appropriately
- [ ] Workflows have clear steps
- [ ] Standing instructions written for skill content lifecycle (persists across turns; survives compaction with caveats)
- [ ] Uses `${CLAUDE_SKILL_DIR}` for any bundled script paths

### Code and Scripts

- [ ] Scripts solve problems rather than punt to Claude
- [ ] Error handling is explicit and helpful
- [ ] No "voodoo constants" (all values justified)
- [ ] Required packages listed in instructions and verified as available
- [ ] Scripts have clear documentation
- [ ] No Windows-style paths (all forward slashes)
- [ ] Validation/verification steps for critical operations
- [ ] Feedback loops included for quality-critical tasks

### Testing

- [ ] At least three evaluations created
- [ ] Tested with Haiku, Sonnet, and Opus (if using multiple models)
- [ ] Tested with real usage scenarios
- [ ] Team feedback incorporated (if applicable)

### Documentation Quality

- [ ] Name follows naming conventions (gerund form recommended)
- [ ] YAML frontmatter is valid and complete
- [ ] Description is written in third person
- [ ] File paths use forward slashes
- [ ] Longer reference files include table of contents
- [ ] MCP tools use fully qualified names (if applicable)

### Planning and Triggering

- [ ] 2–3 concrete use cases written, each with trigger phrases, steps and result
- [ ] Success criteria set (trigger rate, tool calls and tokens vs. baseline, failed calls)
- [ ] Description uses the user's vocabulary, has no `<` / `>`, and is ≤ 1,024 characters
- [ ] Trigger-tested on obvious, paraphrased and near-miss should-not queries
- [ ] Coexistence-tested alongside the other skills it will run with

### Determinism and Data Handling

- [ ] Every number, threshold, ranking and validation someone may question is computed by a script, not by Claude
- [ ] Thresholds live in a versioned config, and outputs carry the config version
- [ ] Scripts refuse unknown input shapes instead of guessing, and each refusal has a troubleshooting entry
- [ ] Checks that didn't run are reported, not silent
- [ ] A validator checks Claude's structured output before anything is handed over
- [ ] Free-text input is treated as data; error messages withhold values
- [ ] Every text read and write sets UTF-8 explicitly

### Shipping

- [ ] Folder is kebab-case and equals `name`; the file is exactly `SKILL.md`; no `README.md` inside the skill
- [ ] Only the six spec frontmatter fields if it will go to claude.ai or the API
- [ ] No sample or real data in the package; with no input, it asks and runs nothing
- [ ] Version kept in one place (`plugin.json` = `metadata.version`), with a CHANGELOG entry
- [ ] Clone-and-run passes, and the installed copy diffs clean against the build
- [ ] Security review against the risk-tier table done by someone other than the author
- [ ] Production API use pins the skill version

---

## Agent Skills Open Standard (agentskills.io)

Agent Skills is a formal **open standard** for extending AI agent capabilities with portable, version-controlled skill folders. Originally developed by Anthropic, released openly, and adopted by 35+ tools as of 2026: **Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenAI Codex, Goose, Kiro, OpenHands, Letta, Amp, Junie, Databricks Genie Code, Snowflake Cortex Code, Spring AI, Laravel Boost, Factory, OpenCode, Roo Code, TRAE, Mistral Vibe, Workshop, Emdash, Ona, Mux, Autohand Code CLI, Firebender, Piebald, Command Code, fast-agent, nanobot, Google AI Edge Gallery, Qodo, VT Code, pi, Agentman**.

> Spec home: <https://agentskills.io> · Source/discussion: <https://github.com/agentskills/agentskills>

### Standard Frontmatter Fields

Per the spec at <https://agentskills.io/specification>:

| Field | Required | Constraints |
|-------|----------|-------------|
| `name` | **Yes** | 1–64 chars, lowercase `a-z` + digits + hyphens. No leading/trailing hyphen, no `--`. Must match parent directory name. |
| `description` | **Yes** | 1–1024 chars. What it does + when to use it. |
| `license` | No | License name or reference to a bundled license file. |
| `compatibility` | No | Max 500 chars. Intended product, required system packages, network access, etc. |
| `metadata` | No | Arbitrary string→string map for non-spec metadata. |
| `allowed-tools` | No | Space-separated pre-approved tools. **Experimental** — support varies between agents. |

### Claude Code Extensions to the Standard

Claude Code implements a **superset**. Fields beyond the standard:

`when_to_use` · `argument-hint` · `arguments` · `disable-model-invocation` · `user-invocable` · `disallowed-tools` · `model` · `effort` · `context` · `agent` · `background` · `hooks` · `paths` · `shell`

Plus settings-level controls: `skillOverrides`, `disableSkillShellExecution`, `disableBundledSkills`, `skillListingBudgetFraction`, `skillListingMaxDescChars`, `syncClaudeAiSkills`, `allowManagedPermissionRulesOnly`. **Using any extension field makes a claude.ai/API upload fail** — see [Frontmatter Outside Claude Code](#frontmatter-outside-claude-code-portability).

### Standard Directory Layout

```
my-skill/
├── SKILL.md          # Required: metadata + instructions
├── scripts/          # Optional: executable code
├── references/       # Optional: documentation
├── assets/           # Optional: templates, resources
└── ...               # Any additional files
```

> The standard uses `references/` (plural); Claude Code's examples often use flat reference files at the skill root. Both work in Claude Code.

### Validation

Use the reference library to validate against the standard:

```bash
skills-ref validate ./my-skill
```

Checks frontmatter validity and naming conventions. See <https://github.com/agentskills/agentskills/tree/main/skills-ref>.

### Cross-Tool Portability

A skill written to the standard works in any compatible agent. Tool-specific extensions (Claude Code's `context: fork`, `paths`, etc.) are ignored by other agents. Keep portable skills minimal; opt into extensions when you need them.

---

## Resources

### Official Documentation

- [Agent Skills Open Standard](https://agentskills.io) — agentskills.io home
- [Agent Skills Specification](https://agentskills.io/specification) — formal SKILL.md spec
- [Use Skills in Claude Code](https://code.claude.com/docs/en/skills) — canonical Claude Code reference
- [Agent Skills Overview (Claude platform)](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview)
- [Agent Skills Quickstart](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/quickstart)
- [Best Practices Guide](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices)
- [Use Skills with the Claude API](https://docs.claude.com/en/docs/build-with-claude/skills-guide)
- [Agent Skills in the SDK](https://docs.claude.com/en/docs/agent-sdk/skills) — current page: [code.claude.com/docs/en/agent-sdk/skills][sdk-skills]
- [Agent Skills overview (current URL)][overview] · [Best practices][best-practices] · [Skills for enterprise][enterprise] · [Skills API guide][skills-guide]
- [The Complete Guide to Building Skills for Claude][pdf-guide] (PDF, January 2026)

### GitHub Resources

- [agentskills.io Repo & Discussion](https://github.com/agentskills/agentskills)
- [skills-ref Validator](https://github.com/agentskills/agentskills/tree/main/skills-ref)
- [Agent Skills Cookbook](https://github.com/anthropics/claude-cookbooks/tree/main/skills)
- [Example Skills Repository](https://github.com/anthropics/skills)
- [skill-creator plugin, pinned @ a2e251d][skill-creator] — `SKILL.md`, `agents/` (grader, comparator, analyzer), `scripts/` (`quick_validate`, `package_skill`, `run_eval`, `run_loop`, `aggregate_benchmark`), `references/schemas.md`

### Blog Posts

- [Equipping agents for the real world with Agent Skills](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills) (also at [/research/…][eng-post])

### Help Center (Claude.ai)

- [What are Skills?](https://support.claude.com/en/articles/12512176-what-are-skills)
- [Using Skills in Claude](https://support.claude.com/en/articles/12512180-using-skills-in-claude)
- [How to create custom Skills](https://support.claude.com/en/articles/12512198-creating-custom-skills)
- [Teach Claude your way of working using Skills](https://support.claude.com/en/articles/12580051-teach-claude-your-way-of-working-using-skills)

---

## Quick Reference Commands

```bash
# Create personal skill
mkdir -p ~/.claude/skills/my-skill-name

# Create project skill
mkdir -p .claude/skills/my-skill-name

# List personal skills
ls ~/.claude/skills/

# List project skills
ls .claude/skills/

# View skill content
cat ~/.claude/skills/my-skill/SKILL.md

# View a specific skill's frontmatter
cat .claude/skills/my-skill/SKILL.md | head -n 15

# Check for valid SKILL.md files
ls ~/.claude/skills/*/SKILL.md
ls .claude/skills/*/SKILL.md
```

---

## YAML Frontmatter Template

```yaml
---
name: skill-name                             # Required by standard; matches dir name
description: What this skill does and when to use it (front-load key use case)
when_to_use: Extra trigger phrases           # Claude Code: appended to description
argument-hint: [optional-args-hint]          # Shown during autocomplete
arguments: [issue, branch]                   # Claude Code: named positional args
disable-model-invocation: false              # true = only user can invoke
user-invocable: true                         # false = hidden from / menu
allowed-tools: Read Write Bash               # Pre-approved for the invoking turn only
disallowed-tools: AskUserQuestion            # Claude Code: removed from the tool pool
model: inherit                               # Claude Code: model override or 'inherit'
effort: medium                               # Claude Code: low|medium|high|xhigh|max
context: fork                                # Claude Code: run in subagent
agent: Explore                               # Claude Code: subagent type (with context: fork)
background: true                             # Claude Code: false = wait for the fork's result
paths: "src/**/*.ts, tests/**/*.ts"          # Claude Code: limit auto-activation
shell: bash                                  # Claude Code: bash (default) or powershell
license: MIT                                 # Standard: license name or file
compatibility: Requires git, jq              # Standard: env requirements (max 500 chars)
metadata:                                    # Standard: arbitrary string→string map
  author: example-org
  version: "1.0"
---
```

---

**Document Created**: November 12, 2025
**Document Updated**: November 21, 2026
**Document Version**: 6.0
**Sources**: agentskills.io home + specification, code.claude.com/docs/en/skills, Official Anthropic documentation (overview.md, quickstart.md, best-practices.md), Engineering blog post, GitHub cookbooks; *The Complete Guide to Building Skills for Claude* (PDF); the skill-creator plugin @ `a2e251d`; platform enterprise and Skills API pages; code.claude.com Agent SDK skills page

**v6.0 changes** (2026-11-21, against the PDF guide, skill-creator @ `a2e251d`, and the live platform overview, enterprise, Skills API and Agent SDK pages): **added** — Start Here task router; planning (use cases, three categories, problem- vs tool-first, success criteria); triggering in practice (under-triggering, "pushy" descriptions, negative triggers, simple tasks don't trigger); writing style (explain the why); Skills + MCP patterns; *Code for Facts, Claude for Judgment* with field lessons from shipping an audit skill; distribution, versioning and shipping (packaging, build script, verification levels, external users); what to test; the skill-creator eval loop and description optimization loop; enterprise vetting (risk tiers, review checklist, content scanning, ZDR); new troubleshooting entries; checklist sections. **Corrected** — the Skills API needs no beta header (example updated to `client.messages.create`); claude.ai plans include Ultra and org-wide provisioning exists; Agent SDK uses the `skills` option and setting sources; Managed Agents and Google Cloud sharing noted. **Sources differ** notes: body-size limits, description voice, MUST-style vs explain-why, the PDF's claim that skill-creator doesn't run quantitative evals.

**v5.0 changes** (checked against the live code.claude.com/docs/en/skills and platform best-practices pages, 2026-10-03): **corrections** — `allowed-tools` is a per-turn grant and is *not* gated by workspace trust; the per-entry cap setting is `skillListingMaxDescChars` (not `maxSkillDescriptionChars`); description fallback is the first non-empty line; new top-level skills dirs need `/reload-skills`, not a restart; `/review` is now an alias of `/code-review`; `skillOverrides` menu saves with `Esc`; reserved words `anthropic`/`claude` apply to API/claude.ai uploads. **Additions** — `disallowed-tools`, `background` (forks run in the background by default since v2.1.218), frontmatter parsing rules, portability table and the exact upload error, command names/collisions/reserved `anthropic-skills` namespace, `${CLAUDE_PROJECT_DIR}`/`${CLAUDE_PLUGIN_ROOT}`/`${CLAUDE_PLUGIN_DATA}` and substitution in `allowed-tools`, argument edge cases and escaping, skill stacking, injected-command execution/failure/permission rules (exit-code-1 carve-out), skills synced from claude.ai, Cowork/cloud/routines availability, removing skills, `/run`/`/verify`/`/run-skill-generator`, `verify`/`simplify` auto-run before commits, `/claude-api` subcommands, deny/allow rule details for skills, `allowManagedPermissionRulesOnly`, `/skill-doctor`, baseline eval method with `claude plugin eval` and the skill-creator plugin, `claude plugin validate`, `.trash` recovery.

**v4.0 changes**: agentskills.io open standard now formally documented; new frontmatter fields (`when_to_use`, `arguments`, `effort`, `paths`, `shell`); new substitutions (`$name`, `${CLAUDE_EFFORT}`, `${CLAUDE_SKILL_DIR}`); skill content lifecycle (persistence + auto-compaction handling); `skillOverrides` settings; skill listing budget controls; multi-line shell injection; `disableSkillShellExecution`; Reference vs Task content distinction; expanded bundled skills (`/loop`, `/claude-api`, `/init`/`/review`/`/security-review` via Skill tool); `--add-dir` skills-only exception; name validation corrected (no consecutive hyphens, must match dir name, no reserved-word rule); description cap clarified (1,536 Claude Code combined vs 1,024 standard).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.