Authoring Agent Skills
Overview
An Agent Skill is a folder containing a SKILL.md file that packages instructions, metadata, and optional resources (scripts, reference docs, templates) that an agent loads automatically when a task is relevant. Skills turn a general-purpose agent into a specialist without bloating the system prompt, because only lightweight metadata is loaded up front. Read this when you need to create a new skill, fix one that is not being discovered, or review a skill's structure against the spec.
Official sources
Core concepts
- A skill is a directory. At minimum it holds a top-level
SKILL.md; optional scripts/, references/, and assets/ subfolders carry code and reference material (per the open spec at agentskills.io).
SKILL.md = YAML frontmatter + Markdown body. The frontmatter is metadata for discovery; the body is the procedural instructions the agent follows once the skill activates.
- Two required frontmatter fields:
name (max 64 chars, lowercase letters/numbers/hyphens, no reserved words anthropic/claude) and description (non-empty, max 1024 chars). Both must avoid XML tags.
- Three loading levels (progressive disclosure). Level 1 metadata (name + description, ~100 tokens) is always loaded at startup; Level 2 is the
SKILL.md body, loaded only when the skill is triggered; Level 3 is bundled files/scripts, read or executed on demand without consuming context until accessed.
- Discovery is description-driven. At startup only each skill's
name and description enter the system prompt, so the agent decides whether to read the full SKILL.md based almost entirely on the description.
- Scripts run, not read. Utility scripts in
scripts/ are executed via bash; only their output enters context, making them more reliable and cheaper than asking the agent to regenerate code.
Best practices
- Write the
description in third person and state both what the skill does and when to use it, including concrete trigger keywords — it is the single most important field for discovery (best-practices guide).
- Keep the
SKILL.md body under 500 lines; split deeper material into separate reference files that the body links to (best-practices guide, "Progressive disclosure patterns").
- Use gerund-form names where it reads naturally (
processing-pdfs, analyzing-spreadsheets); avoid vague names like helper, utils, or tools (best-practices guide, "Naming conventions").
- Assume the agent is already capable: only add context it does not already have, and challenge each sentence for its token cost (best-practices guide, "Concise is key").
- Match degrees of freedom to task fragility: high-freedom prose for open-ended work, exact low-freedom commands for fragile/destructive steps (best-practices guide, "Set appropriate degrees of freedom").
Common pitfalls
- Vague descriptions like "Helps with documents" → write specific descriptions with what + when + keywords so the agent can pick the right skill among many.
- Windows-style backslash paths in references → always use forward slashes (
scripts/helper.py); backslashes break on Unix (best-practices guide, "Anti-patterns to avoid").
- Deeply nested reference chains (
SKILL.md → a.md → b.md) → keep all references one level deep from SKILL.md so the agent reads complete files instead of partial previews.
- Using a skill from an untrusted source without auditing it → review every bundled file; a malicious skill can direct the agent to misuse tools or exfiltrate data (overview, "Security considerations").
Examples
---
name: processing-pdfs
description: Extract text and tables from PDF files, fill forms, and merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
---
# PDF Processing
## Quick start
Use pdfplumber to extract text:
import pdfplumber
with pdfplumber.open("file.pdf") as pdf:
text = pdf.pages[0].extract_text()
## Advanced features
- Form filling: see references/FORMS.md
- API reference: see references/REFERENCE.md
Further reading
Related skills
- ../progressive-disclosure — how to keep SKILL.md short and push depth into on-demand files
- ../skill-frontmatter-spec — the exact YAML frontmatter fields and their constraints
1---2name: authoring-agent-skills3description: How to author an Agent Skill — a folder + SKILL.md with YAML frontmatter, loaded on demand. Consult when creating or reviewing a skill.4domain: meta5category: meta6tags: [agent-skills, skill-md, frontmatter, claude, authoring]7official_sources:8 - https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview9 - https://github.com/anthropics/skills10verified: 2026-06-1611metadata:12 source: https://skillmd.com/skills/gabriel7silva/authoring-agent-skills13---1415# Authoring Agent Skills1617## Overview18An Agent Skill is a folder containing a `SKILL.md` file that packages instructions, metadata, and optional resources (scripts, reference docs, templates) that an agent loads automatically when a task is relevant. Skills turn a general-purpose agent into a specialist without bloating the system prompt, because only lightweight metadata is loaded up front. Read this when you need to create a new skill, fix one that is not being discovered, or review a skill's structure against the spec.1920## Official sources21- Docs (overview): https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview22- Docs (authoring best practices): https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices23- Repo (official examples + template + spec): https://github.com/anthropics/skills24- Open spec: https://agentskills.io/specification2526## Core concepts27- **A skill is a directory.** At minimum it holds a top-level `SKILL.md`; optional `scripts/`, `references/`, and `assets/` subfolders carry code and reference material (per the open spec at agentskills.io).28- **`SKILL.md` = YAML frontmatter + Markdown body.** The frontmatter is metadata for discovery; the body is the procedural instructions the agent follows once the skill activates.29- **Two required frontmatter fields:** `name` (max 64 chars, lowercase letters/numbers/hyphens, no reserved words `anthropic`/`claude`) and `description` (non-empty, max 1024 chars). Both must avoid XML tags.30- **Three loading levels (progressive disclosure).** Level 1 metadata (name + description, ~100 tokens) is always loaded at startup; Level 2 is the `SKILL.md` body, loaded only when the skill is triggered; Level 3 is bundled files/scripts, read or executed on demand without consuming context until accessed.31- **Discovery is description-driven.** At startup only each skill's `name` and `description` enter the system prompt, so the agent decides whether to read the full `SKILL.md` based almost entirely on the description.32- **Scripts run, not read.** Utility scripts in `scripts/` are executed via bash; only their output enters context, making them more reliable and cheaper than asking the agent to regenerate code.3334## Best practices35- Write the `description` in third person and state both *what the skill does* and *when to use it*, including concrete trigger keywords — it is the single most important field for discovery (best-practices guide).36- Keep the `SKILL.md` body under 500 lines; split deeper material into separate reference files that the body links to (best-practices guide, "Progressive disclosure patterns").37- Use gerund-form names where it reads naturally (`processing-pdfs`, `analyzing-spreadsheets`); avoid vague names like `helper`, `utils`, or `tools` (best-practices guide, "Naming conventions").38- Assume the agent is already capable: only add context it does not already have, and challenge each sentence for its token cost (best-practices guide, "Concise is key").39- Match degrees of freedom to task fragility: high-freedom prose for open-ended work, exact low-freedom commands for fragile/destructive steps (best-practices guide, "Set appropriate degrees of freedom").4041## Common pitfalls42- Vague descriptions like "Helps with documents" → write specific descriptions with what + when + keywords so the agent can pick the right skill among many.43- Windows-style backslash paths in references → always use forward slashes (`scripts/helper.py`); backslashes break on Unix (best-practices guide, "Anti-patterns to avoid").44- Deeply nested reference chains (`SKILL.md` → `a.md` → `b.md`) → keep all references one level deep from `SKILL.md` so the agent reads complete files instead of partial previews.45- Using a skill from an untrusted source without auditing it → review every bundled file; a malicious skill can direct the agent to misuse tools or exfiltrate data (overview, "Security considerations").4647## Examples48```markdown49---50name: processing-pdfs51description: Extract text and tables from PDF files, fill forms, and merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.52---5354# PDF Processing5556## Quick start57Use pdfplumber to extract text:5859 import pdfplumber60 with pdfplumber.open("file.pdf") as pdf:61 text = pdf.pages[0].extract_text()6263## Advanced features64- Form filling: see references/FORMS.md65- API reference: see references/REFERENCE.md66```6768## Further reading69- Best-practices guide (full authoring checklist): https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices70- Agent Skills open specification: https://agentskills.io/specification71- Official template + example skills: https://github.com/anthropics/skills7273## Related skills74- ../progressive-disclosure — how to keep SKILL.md short and push depth into on-demand files75- ../skill-frontmatter-spec — the exact YAML frontmatter fields and their constraints