The SKILL.md format: frontmatter fields and examples

A skill is a folder with a SKILL.md file: YAML frontmatter that says what the skill does and when to use it, then Markdown instructions. This page covers every field, the limits, and how to lay out a skill so agents load it reliably.

Updated · Skill Index docs

A minimal SKILL.md

The file must start with frontmatter between two --- lines, and the opening --- has to be the very first line. Everything after the closing --- is the body the agent follows:

---
name: release-notes
description: Writes release notes from merged pull requests. Use when the user asks for release notes, a changelog, or "what shipped".
---

# Release notes

1. List the pull requests merged since the last tag.
2. Group them into Features, Fixes, and Internal.
3. Write one plain-language line per change.

The folder name and name match (release-notes/SKILL.md). That is all a working skill needs.

Required frontmatter fields

FieldRules (Agent Skills spec)
name1–64 characters; lowercase letters, numbers and hyphens only; no leading, trailing or double hyphens; must match the parent folder name.
description1–1,024 characters. Says what the skill does and when to use it, with the words a user would actually type.

PDF-Processing, -pdf and pdf--processing are all invalid names; pdf-processing is fine.

Optional fields

---
name: pdf-processing
description: Extracts text and tables from PDF files, fills PDF forms, and merges PDFs. Use when working with PDF documents or when the user mentions PDFs, forms, or document extraction.
license: Apache-2.0
compatibility: Requires Python 3 and the pypdf package
metadata:
  author: example-org
  version: "1.0"
---
FieldWhat it is for
licenseLicense name, or a reference to a bundled license file.
compatibilityUp to 500 characters on environment needs (product, system packages, network access). Most skills don't need it.
metadataA map of string keys to string values for anything else, such as author or version.
allowed-toolsSpace-separated tools the skill may use without asking, e.g. Bash(git:*) Read. Marked experimental; support varies by agent.

Extra fields Claude Code understands

Claude Code accepts the spec fields plus its own. Other agents ignore fields they don't know, so these are safe to add but only take effect in Claude Code:

FieldEffect in Claude Code
when_to_useExtra trigger context appended to the description. Description + when_to_use are capped at 1,536 characters in the skill listing.
disable-model-invocationtrue = only you can run it with /skill-name; Claude won't load it on its own.
user-invocablefalse = hidden from the / menu; only Claude invokes it.
argument-hint, argumentsAutocomplete hint and named arguments for /skill-name.
model, effortModel or effort level for the turn that runs the skill.
context: fork, agentRun the skill in a forked subagent, optionally of a given type.
pathsGlob patterns; the skill auto-activates only for matching files.
hooksHooks registered while the skill is active.

Field names must match exactly: Claude Code silently ignores a misspelled field rather than reporting an error.

Writing a description that triggers

Agents read only the name and description of every installed skill up front and decide from that alone whether to load the rest. A vague description is the most common reason a skill never fires.

  • Weak: description: Helps with PDFs.
  • Strong: description: Extracts text and tables from PDF files, fills PDF forms, and merges multiple PDFs. Use when working with PDF documents or when the user mentions PDFs, forms, or document extraction.

Put the main use case first: if many skills are installed, long descriptions are the first thing to get cut.

Folder layout and progressive disclosure

pdf-processing/
├── SKILL.md          # required: frontmatter + instructions
├── scripts/          # optional: code the agent can run
│   └── extract.py
├── references/       # optional: docs loaded only when needed
│   └── FORMS.md
└── assets/           # optional: templates, schemas, images
    └── invoice-template.pdf

Agents load a skill in three steps, which is why the layout matters:

  1. Metadata (about 100 tokens): name and description, loaded at startup for every skill.
  2. Instructions (under ~5,000 tokens recommended): the SKILL.md body, loaded when the skill activates.
  3. Resources: files in scripts/, references/ and assets/, opened only when needed.

Keep SKILL.md under 500 lines, link to supporting files with relative paths (references/FORMS.md), and keep those references one level deep. In Claude Code, ${CLAUDE_SKILL_DIR}resolves to the skill's folder wherever it is installed.

Create and validate a skill

Scaffold a new skill folder with the skills CLI:

$ npx skills init my-skill

Check the frontmatter against the specification with the reference validator:

$ skills-ref validate ./my-skill

Or find SKILL.md files whose frontmatter doesn't parse, with Claude Code v2.1.233 or later:

$ claude plugin validate ~/.claude/skills

To have Claude write and test the skill with you, install Anthropic's skill-creator skill; obra's writing-skills covers the same job test-first.

Real SKILL.md examples

Every skill page on this site shows the full SKILL.md when its license allows. A few worth reading for structure:

  • frontend-design — a long, opinionated instruction set in one file.
  • mcp-builder — a multi-phase workflow that points to reference files.
  • brainstorming — a process skill with a tight trigger description.
  • grill-me — proof that a skill can be a few lines long.

Once it's written, put it in the right folder: see where skills are stored, and what to check if it doesn't show up.

Advertisement

FAQ

Is the name field required in SKILL.md?
The Agent Skills specification requires it, and it must match the folder name. Claude Code itself falls back to the folder name when name is missing, but set it anyway so the skill also loads in Codex, Cursor and other agents that follow the spec.
How long can a SKILL.md file be?
There is no hard limit on the body, but the specification recommends keeping SKILL.md under 500 lines (roughly under 5,000 tokens) and moving detailed material into separate reference files that the agent opens only when it needs them.
Can a skill run scripts?
Yes. Put them in a scripts/ folder and tell the agent in SKILL.md when to run them. The agent executes them with its normal tools and permissions, which is why you should read a third-party skill before installing it.
What is the difference between SKILL.md and AGENTS.md or CLAUDE.md?
AGENTS.md and CLAUDE.md are loaded at the start of every session as standing project instructions. A SKILL.md is loaded only when its description matches the task (or you invoke it), so it suits procedures you need sometimes, not rules you need always.

Sources