Agent Skills Explained: Packaging Know-How for AI Agents
An agent skill is a folder with a SKILL.md file: a short name and description, followed by instructions, with optional scripts and reference files alongside. The agent keeps only the name and description in context, reads the full instructions when a task matches, and opens the other files only if needed. Skills package how to do something. They do not connect the agent to anything.
Skills answer a practical problem. Agents are capable, but they do not know how your team writes a release note, checks an invoice or structures a client report. You can paste that guidance into every conversation, or load all of it into a system prompt and pay for it on every call. A skill is the third option: written once, stored as files, loaded on demand. This post explains the format using the open specification and Anthropic's documentation, as of late 2026.
What is an agent skill?
An agent skill is a directory that contains, at minimum, a SKILL.md file with YAML frontmatter and Markdown instructions. The Agent Skills site describes the format as "a lightweight, open format for extending AI agent capabilities with specialized knowledge and workflows". It was originally developed by Anthropic, released as an open standard, and has since been adopted by other agent products.
The specification defines the layout:
SKILL.md: required. Metadata plus instructions.scripts/: optional. Executable code the agent can run.references/: optional. Extra documentation the agent reads when needed.assets/: optional. Templates, images and data files.
Only two frontmatter fields are required. The name is at most 64 characters, in lowercase letters, numbers and hyphens, and must match the folder name. The description is at most 1,024 characters and should say both what the skill does and when to use it. Optional fields cover a licence, compatibility notes, free-form metadata and an experimental list of pre-approved tools.
The body is ordinary Markdown with no required structure. The specification suggests step-by-step instructions, examples of inputs and outputs, and common edge cases.
How does progressive disclosure work?
Progressive disclosure means the agent loads a skill in stages, so that unused detail costs nothing. The specification describes three stages, and Anthropic's documentation gives the same three levels with their context cost:
- Metadata, always loaded. The name and description of every installed skill, about 100 tokens per skill.
- Instructions, loaded when triggered. The body of
SKILL.md, recommended to stay under 5,000 tokens. - Resources, loaded as needed. Reference files enter context only when read. Scripts are executed, and only their output enters context.
The third level is the clever part. Anthropic's documentation explains that when the agent runs a bundled script, the script's code never enters the context window, only its output. A skill can therefore carry a long validation script, a large schema or dozens of reference documents, and the agent pays tokens only for the one it opens. A deterministic script is also more reliable than asking the model to write equivalent code each time.
The whole mechanism depends on the description. It is the only part the agent sees when deciding whether a skill applies. The specification contrasts a poor description, "Helps with PDFs.", with a good one that names the operations and the situations that should trigger it.
How are skills different from MCP and system prompts?
Skills, MCP servers and system prompts solve three different problems: skills teach procedure, MCP provides access, and system prompts set standing rules. Mixing them up leads to bloated prompts or to tools nobody told the agent how to use.
| System prompt or project file | Agent skill | MCP server | |
|---|---|---|---|
| What it holds | Rules that apply to every request | A procedure, with optional scripts and references | Tools, resources and prompts exposed by a service |
| When it loads | Always, in full | Metadata always, the rest on demand | Tool definitions when connected, data when called |
| What it adds | Behaviour and constraints | Know-how | Reach into external systems |
| Runs code | No | Yes, bundled scripts in the agent's environment | Yes, on the server |
| Typical example | "Reply in British English, never promise refunds" | "How we prepare a monthly board report" | "Query the CRM, create a ticket" |
A useful test: if the agent lacks access to something, that is an MCP or tool calling problem. If it has access but does the job the wrong way, that is a skill. If the guidance must apply to every single request, it belongs in the system prompt or a project file such as the one I describe in how to write a CLAUDE.md.
The three combine well. A skill can tell the agent which MCP tools to call and in what order. Anthropic's authoring best practices recommend that a skill refer to MCP tools by their fully qualified name, server name then tool name, so the agent can find the right one when several servers are connected. If MCP itself is new to you, start with what MCP is.
When should you write a skill?
Write a skill when you have explained the same procedure to an agent more than twice and the explanation is longer than a few lines. Good candidates share three traits: the task recurs, there is a known right way to do it, and the model would not guess that way unaided.
Signs that a skill fits:
- A multi-step workflow with a fixed order, such as a release checklist or a document review.
- House conventions the model cannot know: naming rules, report layouts, tone for a specific audience.
- A fragile operation that should run through a tested script instead of freshly written code.
- A large body of reference material where each task needs only a small part.
Signs that it does not:
- The need is live data or an action in another system. That calls for a tool or an MCP server.
- The rule applies to every request. Put it in the system prompt.
- The task is a one-off. A good prompt is enough.
Anthropic's guidance on writing skills is worth following closely. It asks authors to be concise and to assume the model is already capable, adding only context the model does not have. It suggests matching the level of prescription to the risk: loose guidance where many approaches work, an exact script where one wrong step breaks something. And it recommends building evaluations before writing much: run the agent on representative tasks without the skill, note where it fails, write three test scenarios, then write the minimum instructions that pass them.
That last point matches how I approach any agent work: decide how you will check the result before you write the instructions. The specification also recommends keeping SKILL.md under 500 lines and moving detail into reference files one level deep.
Where do skills run, and what are the limits?
Skills run wherever an agent has a filesystem and a way to execute code, and the limits depend on that environment. Anthropic's documentation lists the differences across its own products as of late 2026:
- Claude API: skills run in the code execution container, with no network access and no installing packages at run time. Custom skills are uploaded through a Skills API and shared across the workspace.
- Claude Code: skills are plain folders in a personal or project directory, with the same network access as any other program on the machine.
- claude.ai: custom skills are uploaded as zip files, and network access depends on user and administrator settings.
Custom skills do not sync between those surfaces. A skill uploaded in one place has to be added separately in the others. Because the format is an open standard, the same folder can also be used by other compatible agents, though support for optional fields such as pre-approved tools varies between implementations.
What are the security risks of skills?
The main security risk is that a skill is instructions plus code, executed with whatever access the agent has. Anthropic's documentation is direct: use skills only from trusted sources, meaning ones you wrote or obtained from Anthropic, because a malicious skill can direct the agent to call tools or run code in ways that do not match its stated purpose.
Before installing a skill someone else wrote, I treat it like a dependency:
- Read every file, including scripts and anything in the assets folder.
- Look for network calls, file access outside the task and instructions that do not fit the stated purpose.
- Be wary of skills that fetch content from external URLs, since that content can change after your review.
- Keep skills in version control so changes are visible in a diff.
- Run the agent with the least access the task needs, so a bad skill has little to work with.
The specification's reference library includes a skills-ref validate command that checks frontmatter and naming. It confirms a skill is well formed. It does not tell you the skill is safe.
Work with me
I build agents and the skills, tools and MCP servers around them, including turning a team's written procedures into skills with tests. See AI agent development and MCP server development, or browse my work and book a scoping call.
Frequently asked
Are agent skills only for Claude?
No. The format began at Anthropic but is published as an open standard at agentskills.io, which says it has been adopted by a growing number of agent products. A skill is a folder of Markdown and scripts, so nothing in the format itself is tied to one vendor.
Do skills replace MCP servers?
No. A skill carries knowledge and procedure, while an MCP server gives the agent access to a system. An agent that must read your CRM still needs a tool or MCP server for that. A skill can then teach it how your team wants CRM records handled.
How long should a SKILL.md be?
Short. The specification recommends keeping the body under 5,000 tokens and the file under 500 lines, with detailed material moved to separate reference files. Once a skill is triggered, the whole body is loaded, so every extra paragraph competes with the conversation for context.
Why is my skill not being used?
Usually the description. The agent sees only the name and description when deciding, so a vague one will not match the request. State what the skill does and the situations that should trigger it, using the words a user would use.
Sources
Related services
Building something like this?
Naman Gundaniya takes on full-stack and AI projects: fixed quote after a free 30-minute scoping call, replies within 24 hours.
Get in touch