SKILL.md in Practice: Reusable Workflows for Coding Agents
In short
- A skill is a folder with a
SKILL.mdfile that teaches an agent a procedure: how to cut a release, review a migration, write a report. Agent Skills is the open standard for that folder, and Claude Code, Codex, GitHub Copilot, Gemini CLI and OpenCode all read it. - Skills load in stages. Only the name and description sit in context every session, a median of about 500 characters across the 106 published skills I measured; the body, a median of about 11,700 characters, loads only when the skill is used.
- The description decides whether a skill is ever used, and it competes for a small budget: Claude Code keeps the whole listing within a budget that scales at 1 per cent of the context window and drops descriptions when it overflows.
- Of the 106 published skills, 65 pass the official validator. Most failures are Claude Code fields the open standard does not define, so a skill can work in one agent and fail the portable format.
- Early research agrees on one point: focused, curated skills help, and the benefit shrinks when an agent must pick from many similar ones. The post ends with a validated example skill and a tested script.
A project's CLAUDE.md tells an agent what is true about the code: the commands, the boundaries, the facts it cannot read off the files. It is a poor place for procedures. A release takes several steps, a script and a style guide; writing that into a file that loads every session costs context on every task that is not a release. A skill packages the procedure instead, and the agent loads it only when a task calls for it.
This post covers how skills load, how an agent decides to use one, and what goes wrong. It draws on the specification, Anthropic's documentation, five early studies, and measurements of 106 published skills checked with the official validator. It ends with a small skill built and tested for this post.
Three names for one thing
| Name | What it is |
|---|---|
| Agent Skills | The open standard, published at agentskills.io, for packaging a procedure so an agent can find and use it |
| A skill | A folder: one SKILL.md, plus optional scripts/, references/ and assets/ |
SKILL.md | The one required file: YAML front matter with a name and a description, then Markdown instructions |
SKILLS.md | Not part of the standard or of Claude Code; a few community pages use it for a project index |
Anthropic's announcement describes skills as "folders that include instructions, scripts, and resources that Claude can load when needed." The format is now maintained as an open specification, and Claude Code's documentation says its skills "follow the Agent Skills open standard, which works across multiple AI tools."
How a skill loads
Anthropic's engineering post calls the loading scheme "the core design principle that makes Agent Skills flexible and scalable": progressive disclosure. There are three levels. At startup, the agent "pre-loads the name and description of every installed skill into its system prompt." The body of SKILL.md loads when the skill is used. Files the body points to load only if the task needs them.
The middle number is the point of the design. A body of almost 12,000 characters would cost the same in every session if it lived in CLAUDE.md. As a skill it costs about 500 characters of listing until it is used. The Claude Code docs put it the same way: "a skill's body loads only when it's used, so long reference material costs almost nothing until you need it."
The third level goes further for scripts. A bundled script is run, not read: "Claude can run this script without loading either the script or the PDF into context." Only its output enters the conversation. That makes scripts the right home for anything that must be exact, such as gathering facts from git, validating a file, or rendering a template.
The description decides
At level one the agent sees only names and descriptions, so the description is the whole case for using a skill. In the Claude Code docs' words: "Claude uses this to decide when to apply the skill." Anthropic's best-practices page adds the scale it has to work at, a description that helps Claude "choose the right Skill from potentially 100+ available Skills", and a rule about voice: "Always write in third person," because the description is injected into the system prompt.
Anthropic's own skill-creator names the usual failure: "currently Claude has a tendency to 'undertrigger' skills", and advises making descriptions "a little bit 'pushy'". That is an observation, not a published measurement, and it has a cost: a broader description also fires on requests it should not. The spec shows the shape of a good description with two contrasting examples:
| Weak description | Stronger | Why |
|---|---|---|
| Helps with PDFs. | 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. | The spec's own poor and good examples: what, when, and the words users use |
| I can help you write release notes. | Drafts release notes from the git history since the last tag. Use when asked for release notes or what changed since the last release. | Third person, as Anthropic advises; names the input it works from |
| Database utilities. | Plans and runs schema migrations with a rollback step. Use for schema changes, new columns or tables, and migration failures. | Names the task and its triggers, not a category |
| Use this skill for anything about the cloud. | Moves a service from Heroku to AWS: inventory, mapping, cut-over plan. Use when migrating from Heroku. | Narrow scope avoids collisions with similar skills |
Descriptions also compete for space. "Every skill in the skill listing adds to your context on every turn, whether or not Claude ever uses it." Claude Code fits the listing to a budget: "The budget scales at 1% of the model's context window. When the listing overflows, Claude Code drops descriptions starting with the skills you invoke least." Each description, together with the optional when_to_use text, is also cut at 1,536 characters. A skill whose description has been dropped keeps its name and can still be run by hand, but Claude loses the words it would match against.
The figure is an estimate, not a measurement of Claude Code: I used the listing that the reference library generates, about 889 characters per skill, and assumed four characters per token. The direction does not depend on those details: with a 200,000-token window, a few plugins with long descriptions are enough to push some descriptions out. The ones dropped first are the skills you rarely call, which are also the ones Claude can find only through their description. Claude Code reports the listing's cost with /doctor and per-skill use with /skill-doctor, and lets you set rarely used skills to name only.
What 106 published skills look like
To see how skills are written in practice, I measured every skill in five public sources: Anthropic's skills repository, the plugins in Claude Code's official plugin directory, an AWS plugin from that directory listed separately because its skills are unusually long, the skills in the TabArena benchmark's repository, and the skills that the OpenSpec tool generates. A skill shipped in two places was counted once, which left 106. In the table, description length is in characters and "Pass validator" counts skills accepted by the reference validator described below.
| Source | Skills | Median description | Median lines | Over 500 lines | Pass validator |
|---|---|---|---|---|---|
| Anthropic skills repository | 19 | 324 | 148 | 1 | 18 of 19 |
| Official plugin directory | 56 | 453 | 235 | 6 | 22 of 56 |
| AWS plugin | 19 | 954 | 216 | 3 | 19 of 19 |
| TabArena | 6 | 1,108 | 522 | 3 | 0 of 6 |
| OpenSpec (generated) | 6 | 191 | 189 | 0 | 6 of 6 |
The spec recommends keeping the main file under 500 lines and the body under 5,000 tokens, and Anthropic's best-practices page repeats the line limit: "Keep the SKILL.md body under 500 lines." Ninety-three of the 106 follow it. Length is not simply a missing references/ folder: the longest, at 1,569 lines, already bundles 59 files.
I also ran the official reference validator, skills-ref 0.1.1, on all 106:
The failures are mostly not mistakes. Claude Code accepts many more front-matter fields than the standard, and it is lenient about the rest: "Claude Code ignores a field it doesn't recognize without reporting an error." The reference validator is strict and allows six fields only. So a skill can work well in Claude Code and fail the portable format. The other failures are real. Four descriptions pass 1,024 characters (the validator flags three; it could not parse the fourth skill's front matter), one name does not match its folder, and two files have front matter the validator cannot parse: one has a description with an unquoted colon, which no YAML parser accepts, and the other writes allowed-tools as a bracketed list, valid YAML that the validator's stricter parser refuses. Claude Code still loads a skill with broken YAML, but with empty metadata, so its description cannot be matched.
| Field | Open standard | Claude Code |
|---|---|---|
name | Required; up to 64 characters, lowercase letters, digits and hyphens, matching the folder name | Optional; defaults to the folder name |
description | Required; up to 1,024 characters; what the skill does and when to use it | How Claude decides to use the skill; cut at 1,536 characters in the listing |
license, compatibility, metadata | Optional | Accepted; Claude Code does not act on them |
allowed-tools | Optional, marked experimental | Tools the skill may use without asking, for that turn |
when_to_use, argument-hint, arguments | Not defined | Extra trigger text, autocomplete hint, named arguments |
disable-model-, user-invocable | Not defined | Who may start the skill: only you, or only Claude |
context: fork, agent | Not defined | Run the skill as a subagent in its own context |
paths, hooks, model, effort | Not defined | File globs that activate it, hooks while it runs, model and effort for the turn |
The practical rule: write the six standard fields for any skill you want to share across agents, and add Claude Code fields only where you need them, knowing they tie the skill to Claude Code.
Last, I compared the descriptions with each other. For each skill I found the most similar description elsewhere in the corpus, using word-frequency (TF-IDF) similarity. It is a crude measure of wording, not of meaning, but it finds the pairs a reader would also call close. The median is 0.25, and 14 of the 106 skills have a neighbour at 0.40 or more.
The closest pairs are siblings: azure-to-aws and gcp-to-aws, build-mcp-server and mcp-integration, plugin-settings and plugin-structure. Siblings are where a wrong choice is most likely, because their descriptions share many of the same words. The fix is to state the difference in each description: what input it starts from, and when to use the other one instead.
What the research says
The studies below are 2025 and 2026 preprints, and they define a skill in different ways, so compare their conclusions rather than their numbers.
| Study | Setting | Finding |
|---|---|---|
| SkillsBench (Li et al., 2026) | 87 tasks in 8 domains | Curated skills raised the average pass rate from 33.9 to 50.5 per cent; focused skills with at most three modules beat large bundles |
| Liu et al., 2026 | 34,000 real-world skills to retrieve from | Gains shrink as the setting gets more realistic, approaching the no-skill baseline in the hardest one |
| Li, 2026 | Growing skill libraries | Selection stays accurate up to a size, then drops sharply; similar skills, not size alone, drive the drop |
| SkillRouter (Zheng et al., 2026) | About 80,000 candidate skills | Hiding the skill body cost 37 to 44 points of routing accuracy |
| RAG-MCP (Gan and Sun, 2025) | Tool selection with many MCP tools | Retrieving tools instead of listing all of them tripled selection accuracy, 43.13 against 13.62 per cent |
Curated, focused skills help: SkillsBench measured a rise from 33.9 to 50.5 per cent in average pass rate, and found that "Focused Skills with at most three modules outperform larger or exhaustive bundles." The benefit shrinks when the agent has to find the right skill among many: Liu and colleagues saw gains fall towards the no-skill baseline in the most realistic setting, and Li found that "semantic confusability among similar skills, rather than library size alone, plays a central role" in the drop. SkillRouter adds a caution for progressive disclosure, which shows only names and descriptions until a skill is chosen: in its retrieval system, hiding the skill body cost 37 to 44 points of routing accuracy. Its setting had about 80,000 candidates, far from a personal setup with a few dozen, so the size of the effect there is unknown. The practical advice holds either way: fewer, distinct skills with precise descriptions.
A worked example
Here is a small skill written for this post: it drafts release notes from git history. The facts come from a script; the model writes the prose.
release-notes/
โโโ SKILL.md # front matter and the procedure
โโโ scripts/
โ โโโ release_facts.py # gathers the facts from git, prints JSON
โโโ references/
โ โโโ style.md # loaded only when the notes are written
โโโ evals/
โโโ triggers.csv # prompts that should and should not use the skill
---
name: release-notes
description: Drafts release notes for this repository from the git history since the last tag. Use when the user asks for release notes, a changelog entry, or what changed since the last release.
license: Apache-2.0
metadata:
version: "1.0"
---
# Release notes
1. Run this skill's `scripts/release_facts.py` with the repository root as the working
directory (in Claude Code: `python3 "${CLAUDE_SKILL_DIR}/scripts/release_facts.py"`).
It prints JSON: the last tag, the commits since it, and the files they touched.
Use only these facts.
2. Group the commits under Added, Changed, Fixed and Removed, following
`references/style.md`. Skip merge commits and commits that only touch tests or CI.
3. Write one line per user-visible change, in the past tense, with the PR number if the
subject has one. Do not invent changes that are not in the commit list.
4. Show the draft and ask before writing it to `CHANGELOG.md`.
If there is no tag yet, say so and use the whole history.
The body is 20 lines. It names the script that produces the facts, the reference that defines the style, and the one action that needs permission. The style guide stays out of context until step 2:
# Release note style
- Headings, in this order and only when non-empty: Added, Changed, Fixed, Removed.
- One line per change, starting with a verb in the past tense: "Added", "Fixed", "Removed".
- Name the user-visible effect, not the implementation: "Fixed a crash when the input is empty",
not "Refactored the parser".
- Keep the PR number at the end in brackets: "(#123)".
The script does the part that must be exact. Run with a repository as the working directory, it prints the last tag, the commits since it and the files they touched:
"""Print the facts a release note needs, as JSON: the last tag, and the commits and files since it.
Deterministic on purpose: the model writes the prose, this script decides what changed.
"""
import json
import subprocess
def git(*args: str) -> str:
return subprocess.run(["git", *args], capture_output=True, text=True, check=False).stdout.strip()
def main() -> None:
tag = git("describe", "--tags", "--abbrev=0") or None
rng = f"{tag}..HEAD" if tag else "HEAD"
commits = [dict(zip(("sha", "subject"), line.split("\t", 1)))
for line in git("log", "--no-merges", "--format=%h\t%s", rng).splitlines() if line]
files = sorted(set(git("diff", "--name-only", f"{tag}", "HEAD").splitlines())) if tag else []
print(json.dumps({"last_tag": tag, "commits": commits, "files": files}, indent=2))
if __name__ == "__main__":
main()
I tested it on two throwaway repositories. With a tag v1.0 and two commits after it, it returned both commits and the two changed files; with no tag, it returned "last_tag": null and the whole history. The official validator accepts the skill:
Valid skill: release-notes
exit 0
This is the entry the reference library generates for the agent's listing, which is all the agent sees until it decides to use the skill:
<available_skills>
<skill>
<name>
release-notes
</name>
<description>
Drafts release notes for this repository from the git history since the last tag. Use when the user asks for release notes, a changelog entry, or what changed since the last release.
</description>
<location>
release-notes/SKILL.md
</location>
</skill>
</available_skills>
A skill that changes things, such as cutting a release or deploying, should not start on its own. The docs say to use disable-model-invocation: true "for workflows with side effects or that you want to control timing, like /commit, /deploy, or /send-slack-message. You don't want Claude deciding to deploy because your code looks ready." Adding that field and an argument-hint to this skill makes it fail the portable validator, which is the trade made explicit:
Validation failed for cc-variant:
- Unexpected fields in frontmatter: argument-hint, disable-model-invocation. Only ['allowed-tools', 'compatibility', 'description', 'license', 'metadata', 'name'] are allowed.
exit 1
Arguments and shell code
Claude Code substitutes arguments into a skill's text before Claude reads it: $ARGUMENTS for all of them, and $0, $1 and so on for each one. That is convenient, and it has a sharp edge. When an argument is passed, a shell snippet inside SKILL.md that uses its own $1 gets the skill's argument instead. A team I worked with fixed exactly this bug, in a commit titled "stop skill arguments overwriting shell positional parameters". The simplest rule: keep shell code in a script under scripts/ and call it from the skill. Substitution applies to the skill's content, so a script file it runs is left alone.
Testing whether it triggers
A skill that never loads still costs listing space and does nothing. The first test is whether it fires on the right requests and stays quiet on the wrong ones. The example ships six prompts for that:
prompt,should_trigger
"Write the release notes for the next version",true
"What changed since v1.4?",true
"Add a changelog entry for this release",true
"Fix the failing test in parser.py",false
"Explain what a git tag is",false
"Summarise this pull request for a reviewer",false
This is the method both Anthropic and OpenAI describe. Anthropic's best-practices page: "Create evaluations BEFORE writing extensive documentation." Its skill-creator generates should-trigger and should-not-trigger prompts, measures the hit rate and proposes description edits, and claude plugin eval can grade whether the skill was used. OpenAI's post on evaluating skills uses the same idea: a small prompt set with a should_trigger flag, including negative controls, run repeatedly. I did not run these prompts against a live model for this post; that costs money, and the result would hold only for one model and one set of installed skills. The file is there to be run in your own setup.
Where skills live across agents
The format is shared; the folders are not quite. Each agent reads its own path, and several read others' paths too:
| Agent | Project skill folders it reads |
|---|---|
| Claude Code | .claude/skills/, and nested .claude/skills/ folders below the start directory |
| OpenAI Codex | .agents/skills/, from the working directory up to the repository root |
| GitHub Copilot | .github/skills/, .claude/skills/ or .agents/skills/ |
| Gemini CLI | .gemini/skills/ or .agents/skills/ |
| OpenCode | .opencode/skills/, plus .claude/skills/ and .agents/skills/ |
.agents/skills/ is the closest thing to a shared location, and Copilot and OpenCode also read .claude/skills/. Gemini CLI's documentation notes that for unpaid and Google One users it was replaced by Antigravity CLI in June 2026, so check the current tool before relying on a path. Personal skills live in each tool's home folder, such as ~/.claude/skills/ for Claude Code.
When a skill is the wrong tool
Skills sit among several mechanisms, and choosing the right one keeps each small:
| Put it in | When |
|---|---|
| CLAUDE.md | Claude needs it in every session: commands, boundaries, facts the code hides |
| A path-scoped rule | It applies only to some files or one language |
| A skill | It is a procedure with steps, scripts or reference material, needed only for some tasks |
| A forked skill or subagent | The work should run apart from the conversation and return a summary (context: fork) |
| A hook or permission rule | It must happen, or never happen, every time |
Two Claude Code details blur the lines. "Custom commands have been merged into skills", so a file in .claude/commands/ still works and a skill is now the way to write one. And a skill with context: fork runs as a subagent, which "doesn't see your conversation history, so the skill's instructions have to stand on their own."
Lessons from a team's skills
A team repository I worked in grew a dozen skills over several months, most written by two colleagues. Their commit history shows what changed as the skills were used:
- Documents became skills. A document describing a coding pattern was converted into a skill, so it loads only when that pattern is in play.
- Facts came from scripts. The skill that wrote interface stories shipped a shell script that gathered the facts it needed, so each story started from facts about the code rather than from the model's guesses.
- Output rules belong in the skill. Fixes such as "always produce the story and wireframe in French" and "ask for a destination" were added to the skill itself, where they could not be forgotten between sessions.
- Modes beat copies. The release-notes skill gained a hotfix mode rather than a second, near-identical skill.
- Guidance became enforcement. An architecture skill described the rules; later, tests enforced some of them. The skill explains the rule; the test makes sure it holds.
- Skills move between repositories. One skill was migrated from another repository together with its backlog.
Security
A skill is instructions plus code that an agent will follow and run, so it deserves the trust you would give a dependency. Anthropic: "We recommend installing skills only from trusted sources." The Claude Code docs are specific about why. "A skill can grant itself broad tool access", through allowed-tools, so review that field in any skill checked into a repository before working there. Shell commands embedded in a skill run while it renders: "Injected commands never prompt for permission while the skill renders." The disableSkillShellExecution setting turns that off. Hosted catalogues that run skills on their own servers have appeared too; the same rule applies to what they receive and send back.
A checklist
- Does the description say what the skill does and when to use it, in the third person, with the words users actually type?
- Does it state how it differs from its closest sibling skill?
- Is
SKILL.mdunder 500 lines, with detail inreferences/one level deep? - Is everything that must be exact done by a script, not by instructions?
- Does
skills-ref validatepass, or do you know which Claude Code fields make it fail? - Does a skill with side effects set
disable-model-invocation: true? - Is shell code in script files rather than inline, away from argument substitution?
- Is there a trigger test with negative controls, run after every description change?
- Have you read the
allowed-toolsof every skill you did not write?
Limits of this post
The corpus is 106 skills from five sources, weighted towards Anthropic's own and its plugin directory, so it shows how skills are written by people who build the tools more than by everyone else. The similarity measure compares words, not meaning. The budget figure is an estimate built on the reference library's listing and an assumed four characters per token. I did not measure triggering against a live model. The research cited is preprints with small or synthetic settings. The documentation is a living document, read on 2 December 2026.
Sources and further reading
All pages read on 2 December 2026. The documentation changes often; check the current version before relying on a limit.
The standard
- Agent Skills specification: fields, limits, folder layout and the three loading levels.
- Optimizing skill descriptions and Evaluating skill output quality, the specification site's own guides.
- skills-ref, the reference library and validator (on PyPI, Apache-2.0); version 0.1.1 was used here.
Anthropic documentation and articles
- Claude Code, Extend Claude with skills: front-matter fields, loading, the listing budget, arguments and security.
- Agent Skills overview and Skill authoring best practices: descriptions, length, degrees of freedom, evaluation.
- Barry Zhang, Keith Lazuka and Mahesh Murag, Equipping agents for the real world with Agent Skills, Anthropic Engineering, 16 October 2025: progressive disclosure.
- Introducing Agent Skills, Anthropic, 16 October 2025.
Other agents
- Codex, GitHub Copilot, VS Code, Gemini CLI and OpenCode: where each looks for skills.
- OpenAI, Testing Agent Skills Systematically with Evals: trigger tests with negative controls.
Research (preprints)
- Xiangyi Li et al., SkillsBench, 2026, version 4: curated against no skills, on 87 tasks.
- Yujian Liu et al., How Well Do Agentic Skills Work in the Wild: Benchmarking LLM Skill Usage in Realistic Settings, 2026.
- Xiaoxiao Li, When Single-Agent with Skills Replace Multi-Agent Systems and When They Fail, 2026.
- YanZhao Zheng et al., SkillRouter: Skill Routing for LLM Agents at Scale, 2026.
- Tiantian Gan and Qiyao Sun, RAG-MCP: Mitigating Prompt Bloat in LLM Tool Selection via Retrieval-Augmented Generation, 2025.
The skills measured, and others worth reading
- anthropics/skills (Apache-2.0 for many skills, per its README), including skill-creator, which writes and tests skills.
- anthropics/claude-plugins-official (Apache-2.0), the official plugin directory, including the AWS plugin.
- autogluon/tabarena (Apache-2.0) and Fission-AI/OpenSpec (MIT), whose generated skills were measured.
- obra/superpowers (MIT): development workflows such as planning, test-driven development and debugging, written as skills.
- microsoft/skills and github/awesome-copilot (both MIT).
- The earlier post on CLAUDE.md in practice, for what belongs in project instructions rather than in a skill, and AGENTS.md.