Agent Skills guide
SKILL.md format reference
Every SKILL.md frontmatter field in the Agent Skills spec, the extra fields each agent adds, size budgets, folder layout and the mistakes that stop loading.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkOn this page
SKILL.md is the one required file in an Agent Skill: YAML frontmatter with a name (1 to 64 lowercase characters, matching the folder) and a description (up to 1,024 characters), then Markdown instructions. The open spec allows four more optional fields. Agents read the frontmatter up front and the body only when the skill is used.
For a copy-ready file, see the SKILL.md template and frontmatter cheat sheet. If you are new to skills, what Agent Skills are covers the idea first.
This page summarises the open specification at agentskills.io/specification and the client documentation for Claude Code, the Claude apps and API, Codex, Cursor, GitHub Copilot and Antigravity, as checked on 19 November 2026. When the spec and a client disagree, both are noted.
SKILL.md file and folder layout
A skill is a directory containing a file named exactly SKILL.md. The reference validator also accepts lowercase skill.md, but GitHub’s docs require the uppercase name, so use that.
skill-name/
├── SKILL.md # required
├── scripts/ # optional: executable code
├── references/ # optional: documentation loaded on demand
├── assets/ # optional: templates, images, data files
└── ... # anything else the skill needs
SKILL.md must start with YAML frontmatter between two --- lines, followed by Markdown. Paths inside the skill are written relative to the skill root with forward slashes, for example scripts/extract.py.
SKILL.md frontmatter fields in the spec
The open specification defines six top-level fields.
| Field | Required | Rules |
|---|---|---|
name |
Yes | 1 to 64 characters: lowercase letters, digits and hyphens. No leading or trailing hyphen, no --. Must match the folder name. |
description |
Yes | 1 to 1,024 characters. Say what the skill does and when to use it. See skill description best practices. |
license |
No | A licence name, or a pointer to a licence file in the folder. |
compatibility |
No | 1 to 500 characters describing environment needs, such as “Requires Python 3.12+ and uv” or “Needs network access”. Most skills leave it out. |
metadata |
No | A map of string keys to string values for anything else, such as author or version. |
allowed-tools |
No | A space-separated string of pre-approved tools, for example Bash(git:*) Read. Marked experimental; support varies by client. |
A complete example using every spec field:
---
name: release-notes
description: Drafts release notes from merged pull requests since the last tag. Use when the user asks for release notes, a changelog entry or a summary of what shipped.
license: MIT
compatibility: Requires git and the GitHub CLI (gh), authenticated.
metadata:
author: platform-team
version: "1.2"
allowed-tools: Bash(git log:*) Bash(gh pr list:*) Read
---
Two details trip people up. Metadata values must be strings, so version: 1.2 without quotes is a number in YAML and fails strict validation. And a description containing a colon followed by a space (Use when: ...) is invalid YAML unless you quote it or use a block scalar.
Fields added by individual agents
The spec is deliberately small, so clients add their own fields. Most agents ignore keys they do not recognise, which means a skill using another client’s fields still loads. The exception is Anthropic’s hosted surfaces, covered below.
Claude Code
Claude Code accepts every spec field and adds these. In Claude Code name is optional and defaults to the folder name.
| Field | What it does |
|---|---|
when_to_use |
Extra trigger context appended to the description. |
argument-hint, arguments |
Autocomplete hint and named arguments for /skill-name arg invocations. |
disable-model-invocation |
true means only you can start it, with /skill-name. |
user-invocable |
false hides it from the / menu so only Claude can use it. |
disallowed-tools |
Removes tools while the skill is active. |
model, effort |
Overrides for the rest of the current turn. |
context, agent, background |
context: fork runs the skill in a subagent. |
hooks |
Hooks registered when the skill runs. |
paths |
Glob patterns that limit when the skill activates automatically. |
shell |
Shell used for !`command` blocks: bash or powershell. |
The body can use $ARGUMENTS (or $0, $1 and so on) for arguments, ${CLAUDE_SKILL_DIR} for the skill’s own folder, and !`command` to inject a command’s output before the model sees the text. Claude Code truncates the combined description and when_to_use at 1,536 characters in its skill listing.
Cursor
Cursor reads name (which must match the folder), description, paths, disable-model-invocation, icon, color and metadata. The older globs field still works.
Codex
Codex reads name and description from SKILL.md. Everything else goes in an optional agents/openai.yaml file inside the skill: an interface block for display name, icons and a default prompt, a policy block with allow_implicit_invocation, and dependencies.tools, for example an MCP server the skill needs. Several non-OpenAI skills now ship this file too.
GitHub Copilot
Copilot documents name, description, license and allowed-tools, and warns against pre-approving shell or bash for skills you have not reviewed. When you install with gh skill install, the CLI writes the source repository, ref and tree SHA into the installed file’s frontmatter so gh skill update can detect changes.
Antigravity
Antigravity makes name optional, defaulting to the folder name. Only description is required.
Extra rules on claude.ai and the Claude API
Uploading to claude.ai, the Claude desktop app or the Skills API adds constraints on top of the spec:
- Only the six spec fields are allowed. Any other key, including Claude Code’s own
disable-model-invocation, is an upload error. namemust not contain XML tags or the reserved wordsanthropicorclaude.descriptionmust not contain XML tags. On claude.ai it is also limited to 200 characters, according to the Claude Help Center article on creating custom skills (checked on 21 November 2026), well under the spec’s 1,024.- The upload must have
SKILL.mdat the root of the archive or inside one top-level folder, and API uploads must be under 30 MB uncompressed.
So a skill that works in Claude Code can still be refused by claude.ai. In our directory, grill-me (uses disable-model-invocation) and vercel-react-best-practices (name does not match its folder) both need editing before upload.
The SKILL.md body
The body has no required structure. In practice the skills that work well share a shape:
- A one-paragraph statement of what the skill is for.
- Numbered steps or a checklist for the main workflow.
- Exact commands where the order matters, and looser guidance where judgement matters.
- Examples of input and output when format matters.
- Pointers to reference files, each with a sentence on when to read it.
Size budgets
| Item | Guideline |
|---|---|
| Catalogue entry (name and description) | Roughly 50 to 100 tokens per installed skill |
SKILL.md body |
Under 500 lines and about 5,000 tokens |
| Reference files | Loaded only when read; add a table of contents if over 100 lines |
| Reference depth | One level from SKILL.md; do not chain references to references |
These are guidelines, not hard limits. Anthropic’s own claude-api skill is over 600 lines. But clients do cap the catalogue: Codex limits the initial skills list to a share of the context window and shortens descriptions first when there are many skills.
Scripts
Scripts run; they are not read into context, so they are cheaper and more reliable than asking the model to write the same code every time. Make them non-interactive (agents cannot answer prompts), give them a --help, print structured output to stdout and errors to stderr, and pin dependencies, for example with an inline PEP 723 block run by uv run. Say in SKILL.md whether the agent should run a script or read it. Bundling scripts in skills covers this in depth.
In the Claude API’s code execution container there is no network access and no package installation at runtime, so scripts there can only use what is preinstalled.
Validate a SKILL.md before you share it
The reference library in the spec repository includes a validator. It is for demonstration rather than production use, but it catches the common errors:
git clone https://github.com/agentskills/agentskills.git
cd agentskills/skills-ref
python -m venv .venv && source .venv/bin/activate
pip install -e .
skills-ref validate path/to/your-skill
It is stricter than most clients: it rejects any top-level key outside the six spec fields. Treat those errors as portability warnings if you are targeting Claude Code only. Our SKILL.md validator runs similar checks in the browser with a profile per agent.
Check your understanding
SKILL.md format reference quiz
Spec fields and their rules, client-specific fields, claude.ai upload limits, size budgets and validation.
7 questions · pass mark 70%
Review
Related
- SKILL.md
The required file in an Agent Skill: YAML frontmatter with at least a name and description, followed by the Markdown instructions.
- Progressive disclosure
Loading only skill names and descriptions up front, and the full instructions or bundled files only when a task needs them.
- How to create a Claude skill (Agent Skill) from scratch
Create a Claude skill in ~/.claude/skills: write a SKILL.md with a description that triggers, add a script, test it, then make it work in other agents too.