← All posts

SKILL.md in Practice: Reusable Workflows for Coding Agents

In short

  • A skill is a folder with a SKILL.md file 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

NameWhat it is
Agent SkillsThe open standard, published at agentskills.io, for packaging a procedure so an agent can find and use it
A skillA folder: one SKILL.md, plus optional scripts/, references/ and assets/
SKILL.mdThe one required file: YAML front matter with a name and a description, then Markdown instructions
SKILLS.mdNot 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.

Three stacked boxes. Level 1, the name and description, loads every session for every installed skill: about 504 characters, roughly 126 tokens, at the median. Level 2, the SKILL.md body, loads when the skill is used: about 11,677 characters, roughly 2,919 tokens. Level 3, scripts, references and assets, is read or run when needed; 73 of 106 skills bundle files, with a median of 37 KB. A note says a script that runs puts only its output in context. What a skill costs at each level (medians over 106 published skills) Level 1: name and description every session, for every installed skill: about 504 characters, roughly 126 tokens Level 2: the SKILL.md body when the skill is used: about 11,677 characters, roughly 2,919 tokens Level 3: scripts, references, assets read or run when needed: 73 of 106 skills bundle files, median 37 KB A script that runs puts only its output in context, not its code.
Figure 1. Each level is paid for only when it is needed. Medians over 106 published skills.

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 descriptionStrongerWhy
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.

A line rising with the number of installed skills, at 889 characters per skill, the measured mean of the listing that the reference library generates. Two dashed lines mark 1 per cent of a 200,000-token window, about 8,000 characters or 9 skills, and of a 1,000,000-token window, about 40,000 characters or 45 skills. Listing size as skills are added, at 889 characters per skill (measured mean) 0k 25k 50k 75k 100k 0 20 40 60 80 100 120 1% of a 200k-token window: about 8,000 characters, 9 skills 1% of a 1M-token window: about 40,000 characters, 45 skills installed skills (assumes 4 characters per token; Claude Code's own format differs)
Figure 2. An estimate of how quickly the listing fills its budget. Claude Code's own listing format and its counting of the budget differ in detail.

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.

SourceSkillsMedian descriptionMedian linesOver 500 linesPass validator
Anthropic skills repository19324148118 of 19
Official plugin directory56453235622 of 56
AWS plugin19954216319 of 19
TabArena61,10852230 of 6
OpenSpec (generated)619118906 of 6
A dot plot of description lengths for each source, with vertical lines at the spec's 1,024-character limit and Claude Code's 1,536-character listing cap. Most descriptions sit between 150 and 1,000 characters; the AWS plugin's cluster just under 1,024; four skills pass 1,024 and one passes 2,400. Description length in characters, one dot per skill Anthropic repo (19) Plugin directory (56) AWS plugin (19) TabArena (6) OpenSpec (6) spec limit 1,024 Claude Code listing cap 1,536 0 500 1,000 1,500 2,000 2,500
Figure 3. Description length by source. Four of 106 exceed the spec's limit.
A dot plot of SKILL.md length in lines for each source, with a vertical line at 500. Most skills are between 100 and 400 lines; 13 pass 500, the longest at 1,569. SKILL.md length in lines, one dot per skill Anthropic repo (19) Plugin directory (56) AWS plugin (19) TabArena (6) OpenSpec (6) guideline: under 500 0 250 500 750 1,000 1,250 1,500
Figure 4. SKILL.md length by source. Thirteen of 106 pass the 500-line guideline.

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:

Horizontal bars of passing and failing skills per source. Anthropic's repository: 18 of 19 pass. The plugin directory: 22 of 56. The AWS plugin: 19 of 19. TabArena: 0 of 6. OpenSpec: 6 of 6. A note lists the most common unexpected fields: argument-hint 14, version 13, user-invocable 8, disallowed-tools 6, disable-model-invocation 5. skills-ref validate: pass and fail by source Anthropic repo 18 of 19 pass Plugin directory 22 of 56 pass AWS plugin 19 of 19 pass TabArena 0 of 6 pass OpenSpec 6 of 6 pass Most failures are Claude Code fields the open spec does not define: argument-hint (14), version (13), user-invocable (8), disallowed-tools (6), disable-model-invocation (5).
Figure 5. Pass and fail by source. Most failures are fields that Claude Code accepts and the open standard does not define.

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.

FieldOpen standardClaude Code
nameRequired; up to 64 characters, lowercase letters, digits and hyphens, matching the folder nameOptional; defaults to the folder name
descriptionRequired; up to 1,024 characters; what the skill does and when to use itHow Claude decides to use the skill; cut at 1,536 characters in the listing
license, compatibility, metadataOptionalAccepted; Claude Code does not act on them
allowed-toolsOptional, marked experimentalTools the skill may use without asking, for that turn
when_to_use, argument-hint, argumentsNot definedExtra trigger text, autocomplete hint, named arguments
disable-model-invocation, user-invocableNot definedWho may start the skill: only you, or only Claude
context: fork, agentNot definedRun the skill as a subagent in its own context
paths, hooks, model, effortNot definedFile 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.

A histogram of each skill's highest similarity to any other description. The median is 0.25; half of the skills fall between 0.15 and 0.35, and 14 reach 0.40 or more, up to 0.51. The closest pair is azure-to-aws and gcp-to-aws at 0.51. Each skill's most similar description elsewhere in the corpus (TF-IDF cosine) 5 24 12 11 10 20 10 5 7 2 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 Closest pair: azure-to-aws and gcp-to-aws (0.51). Highlighted: 0.40 and above.
Figure 6. Most descriptions are far apart; the closest pairs are siblings from the same plugin.

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.

StudySettingFinding
SkillsBench (Li et al., 2026)87 tasks in 8 domainsCurated 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., 202634,000 real-world skills to retrieve fromGains shrink as the setting gets more realistic, approaching the no-skill baseline in the hardest one
Li, 2026Growing skill librariesSelection 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 skillsHiding the skill body cost 37 to 44 points of routing accuracy
RAG-MCP (Gan and Sun, 2025)Tool selection with many MCP toolsRetrieving 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:

AgentProject 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 inWhen
CLAUDE.mdClaude needs it in every session: commands, boundaries, facts the code hides
A path-scoped ruleIt applies only to some files or one language
A skillIt is a procedure with steps, scripts or reference material, needed only for some tasks
A forked skill or subagentThe work should run apart from the conversation and return a summary (context: fork)
A hook or permission ruleIt 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.md under 500 lines, with detail in references/ one level deep?
  • Is everything that must be exact done by a script, not by instructions?
  • Does skills-ref validate pass, 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-tools of 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

Anthropic documentation and articles

Other agents

Research (preprints)

The skills measured, and others worth reading