Claude Skills Documentation: Official Reference & API Docs
SKILL.md File Format
Every skill requires a SKILL.md file. It has two parts: YAML frontmatter that tells Claude when to use the skill, and Markdown content with instructions Claude follows when invoked.
Frontmatter (Required)
The frontmatter sits between --- markers at the top of SKILL.md. Two fields are required:
--- name: my-skill-name description: A clear description of what this skill does and when to use it ---
Writing effective descriptions:
The description field is the most important part of frontmatter — it's the only content Claude sees before deciding whether to load the full skill. Include:
- What the skill does
- When Claude should use it
- Trigger phrases that users might say
--- name: explain-code description: Explains code with visual diagrams and analogies. Use when explaining how code works, teaching about a codebase, or when the user asks "how does this work?" ---
Source: Claude Code Docs — Extend Claude with skills; Skill authoring best practices — Claude API Docs
Markdown Content (Required)
After the frontmatter, write instructions in Markdown. This is the prompt Claude receives when the skill is invoked.
markdown
--- name: explain-code description: Explains code with visual diagrams and analogies. --- When explaining code, always include: 1. **Start with an analogy**: Compare the code to something from everyday life 2. **Draw a diagram**: Use ASCII art to show the flow, structure, or relationships 3. **Walk through the code**: Explain step-by-step what happens 4. **Highlight a gotcha**: What's a common mistake or misconception?
Content guidelines:
- Keep SKILL.md focused on core instructions — under 500 lines to minimize context bloat
- Move detailed content to separate files in references/ or scripts/
- Reference external files explicitly so Claude knows they exist and when to read them
- Include concrete examples, not abstract instructions
- Write for another Claude instance, not a human — include information that would be beneficial and non-obvious to Claude
Source: anthropics/skills GitHub — skill-creator/SKILL.md; Skill authoring best practices — Claude API Docs
Skill Directory Structure
A skill is a folder. The SKILL.md file is required; everything else is optional.
my-skill/ ├── SKILL.md # Required — instructions + YAML frontmatter ├── scripts/ # Optional — executable code (Python, Bash, etc.) │ ├── validate.py │ └── generate.sh ├── references/ # Optional — documentation loaded into context as needed │ ├── workflows.md │ └── style-guide.md ├── assets/ # Optional — files used in output (templates, icons, fonts) │ ├── template.html │ └── logo.png └── LICENSE.txt # Optional — license file
Three content types and their loading behavior
This three-level progressive disclosure system means:
- Installing many skills has near-zero context cost
- Only relevant content loads when needed
- Scripts execute efficiently without polluting the context window
Source: Agent Skills Overview — Claude API Docs; Anthropic Engineering Blog — Equipping agents for the real world
Claude API — Skills Endpoints
Skills are available via the Claude Messages API with the Code Execution Tool. Both pre-built and custom skills work identically.
Prerequisites
Using Skills via the API requires three beta headers:
code-execution-2025-05-22 # Code execution tool support extended-cache-ttl-2025-04-11 # Optional extended prompt cache TTL interleaved-thinking-2025-05-14 # Optional interleaved thinking
Using Pre-Built Skills
Reference a pre-built skill by its skill_id in the container parameter:
{ "model": "claude-sonnet-4-5-20250929", "max_tokens": 16384, "tools": [{ "type": "code_execution_20250522" }], "container": { "skill_ids": ["pptx"] }, "messages": [ { "role": "user", "content": "Create a 5-slide presentation about Q4 results" } ] }
Available pre-built skill_id values:
Using Custom Skills
Create custom skills via the /v1/skills endpoint, then reference them by skill_id:
{ "container": { "skill_ids": ["pptx", "your-custom-skill-id"] } }
The /v1/skills endpoint supports:
- Creating new custom skills
- Viewing existing skills
- Upgrading skill versions
- Programmatic skill management
Custom skills can also be managed via the Claude Console.
Source: Agent Skills Overview — Claude API Docs; Skills API Quickstart — Claude API Docs
Skills Across Platforms
Skills use the same format everywhere but install differently depending on the platform.
Claude.ai
Claude Code
Claude API
Agent Skills Open Standard
Source: Claude Help Center — What are Skills?; Claude Code Docs — Extend Claude with skills; Agent Skills Overview — Claude API Docs
Skill Authoring Best Practices
Guidance from Anthropic's official documentation and the skill-creator reference implementation.
Description Writing
SKILL.md Content
Progressive Disclosure
Testing
Source: Skill authoring best practices — Claude API Docs; anthropics/skills GitHub — skill-creator/SKILL.md
Official Documentation Links
A curated index of every official Anthropic resource related to Claude Skills.
| Field | Required | Purpose |
|---|---|---|
| name | ✅ Yes | Becomes the /slash-command in Claude Code. Used as the skill identifier |
| description | ✅ Yes | Tells Claude when to load this skill. Appears in the system prompt at session start. Keep it concise — this is what Claude reads to decide relevance |
| compatibility | ❌ Optional | Notes if the skill is designed for a specific platform's capabilities |
| context | ❌ Optional | Controls execution context. fork runs in a forked agent session |
| agent | ❌ Optional | Specifies which subagent to use (e.g., Explore, Plan, or custom) |
| Content Type | When Loaded | Context Cost |
|---|---|---|
| Frontmatter (name + description) | Always — at session startup | ~100 words per skill. Minimal cost, safe to install many skills |
| SKILL.md body + referenced files | On demand — when Claude determines the skill is relevant | Full content loaded into context window |
| Scripts | On execution — Claude runs via bash | Script code never enters context. Only output consumes tokens |
| skill_id | Skill |
|---|---|
| pptx | PowerPoint creation and editing |
| xlsx | Excel spreadsheet generation with formulas and charts |
| docx | Word document creation with formatting |
| PDF reading, form filling, merging, and creation |
| Feature | Details |
|---|---|
| Pre-built skills | Available automatically — Claude invokes when relevant |
| Custom skills | Upload via Settings → Skills |
| Quick-create | Describe what you want in natural language, Claude builds the skill |
| Skills Directory | Partner-built skills available through the directory |
| Admin management | Team and Enterprise admins can centrally provision and control skills |
| Plans | Available to Pro, Max, Team, and Enterprise users |
| Runtime | Code execution environment with filesystem access. No runtime package installation — only pre-installed packages. Varying network access based on settings |
| Feature | Details |
|---|---|
| Personal skills | ~/.claude/skills/ — available across all projects |
| Project skills | .claude/skills/ — shared via version control with your team |
| Plugin marketplace | Install from the anthropics/skills repo: /plugin install document-skills@anthropic-agent-skills |
| Slash commands | The name field becomes /skill-name for direct invocation |
| Auto-discovery | Claude Code scans skill directories and loads relevant skills automatically |
| Live editing | Skills in --add-dir directories support live change detection — edit during a session without restarting |
| Subagent integration | Skills can specify context: fork and agent: Explore to run in isolated subagent sessions |
| Runtime | Full filesystem access, full network access, can install packages |
| Feature | Details |
|---|---|
| Pre-built skills | Reference by skill_id in container parameter |
| Custom skills | Create and manage via /v1/skills endpoint |
| Versioning | Programmatic version management via Console or API |
| Requirements | Code Execution Tool beta headers required |
| Feature | Details |
|---|---|
| Specification | Published at agentskills.io |
| Reference SDK | Python SDK available for implementing support in other platforms |
| Adopters | a growing number of agent products and development tools |
| Portability | Skills created for Claude work on any platform adopting the standard |
| Do | Don't |
|---|---|
| Include what the skill does AND when to use it | Write a vague one-liner like "Helps with tasks" |
| Add trigger phrases: "Use when user asks to..." | Assume Claude will figure out when to activate |
| Keep under ~100 words | Write a full paragraph in the description |
| Do | Don't |
|---|---|
| Keep under 500 lines | Dump all information into one file |
| Move deep content to references/ files | Include setup docs, testing procedures, or user-facing docs |
| Reference external files explicitly with clear guidance on when to read them | Assume Claude will discover unreferenced files |
| Include concrete examples with expected inputs and outputs | Write abstract, theoretical instructions |
| Write for another Claude instance, not a human reader | Include obvious information Claude already knows |
| Do | Don't |
|---|---|
| Put core instructions in SKILL.md | Load everything into SKILL.md body |
| Split references by theme so Claude loads only what's needed | Create one massive reference file |
| Use scripts for computation — output enters context, code doesn't | Have Claude read and reason about script source code |
| Step | Purpose |
|---|---|
| Test with Claude B (fresh instance with skill loaded) | Verify the skill works for a Claude that didn't create it |
| Test with varied prompts | Ensure robustness across different phrasings |
| Review for conciseness | Remove unnecessary explanations Claude already knows |
| Test alongside other skills | Verify it composes well and doesn't conflict |
| Resource | URL | Description |
|---|---|---|
| Agent Skills Overview | platform.claude.com/docs/en/agents-and-tools/agent-skills/overview | Core API documentation — architecture, endpoints, usage |
| Skill Authoring Best Practices | platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices | Official writing and design guidelines |
| Claude Code: Extend with Skills | code.claude.com/docs/en/skills | Claude Code-specific installation and usage |
| Skills API Quickstart | platform.claude.com (Skills Cookbook) | Getting started with pre-built and custom skills via API |
| What are Skills? (Help Center) | support.claude.com/en/articles/12512176-what-are-skills | Non-technical overview for Claude.ai users |
| How to Create Custom Skills | support.claude.com | Step-by-step guide for custom skill creation |
| anthropics/skills GitHub | github.com/anthropics/skills | Public repository with example and reference skills |
| Agent Skills Open Standard | agentskills.io | Open specification and reference Python SDK |
| Engineering Blog: Agent Skills | anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills | Technical deep dive on architecture and design patterns |
| Announcement: Introducing Agent Skills | anthropic.com/news/skills | Official launch announcement (Oct 16, 2025) |