SKILL.md file is the core component of any agent skill. It consists of YAML frontmatter followed by Markdown instructions that guide the agent’s behavior.
File Structure
A SKILL.md file has two main parts:- YAML Frontmatter - Structured metadata enclosed in
---delimiters - Markdown Body - Instructions, examples, and guidance for the agent
Basic Example
Frontmatter Fields
The frontmatter section supports the following fields according to the Agent Skills specification:Required Fields
Skill identifier in lowercase-hyphen format. Must match the parent directory name.Constraints:
- Maximum 64 characters
- Lowercase letters, numbers, and hyphens only
- Cannot start or end with a hyphen
- No consecutive hyphens (
--)
creating-reports, data-analysis, api-clientBrief explanation of what the skill does and when to use it.Constraints:
- Maximum 1024 characters
- Should not be empty or whitespace-only
- Should include activation phrases like “Use when…”, “Designed for…”
"Creates detailed reports from data when the user asks for report generation or data summaries."Optional Fields
Runtime requirements and prerequisites for this skill.Constraints:
- Maximum 500 characters if provided
- Cannot be empty if present
"Requires Node.js 18+ and Python 3.9+"License identifier for the skill.Example:
"MIT", "Apache-2.0"Custom key-value pairs for additional metadata.Constraints:
- Must be a string-to-string mapping
- Both keys and values must be strings
Space-delimited list of allowed tools (experimental).Constraints:
- Must be a string, not a YAML list
- Use space-delimited format
"bash read write edit"Custom fields should be placed in the
metadata map rather than as top-level frontmatter fields to maintain spec compliance.Markdown Body
The body section provides instructions and context for the agent. This is where you explain how the skill works, when to use it, and provide examples.Body Guidelines
| Constraint | Value | Severity |
|---|---|---|
| Token budget | ≤5,000 tokens | Warning |
| Line budget | ≤500 lines | Warning |
| Minimum content | ≥50 characters | Warning |
Token estimates are calculated using a simplified tokenizer that approximates Claude’s tokenization. The actual token count may vary slightly.
Best Practices
- Include Code Examples - Use fenced code blocks (
```) or<example>tags to show how the skill works - Add Activation Context - Explain when and why the agent should use this skill
- Reference Scripts - If your skill includes scripts in the
/scriptsfolder, mention them in the body - Keep It Concise - Aim for clarity and brevity to stay within token budgets