SKILL.md file is the core of every skill. It contains YAML frontmatter with metadata and a markdown body with instructions that the AI agent will follow when the skill is active.
File Structure
A SKILL.md file has two parts:- YAML Frontmatter - Metadata enclosed in
---delimiters - Markdown Body - Instructions, examples, and guidelines
YAML Frontmatter
Required Fields
string
required
Unique identifier for the skill. Use lowercase letters, numbers, and hyphens. No spaces.
string
required
Complete description of what the skill does and when to use it. This is the primary triggering mechanism - include both capabilities and specific contexts for when to use the skill.The description should be “pushy” to combat Claude’s tendency to under-trigger skills. Include:
- What the skill does
- When to use it (specific contexts, keywords, scenarios)
- What it enables
Optional Fields
string | array
Required tools, dependencies, or platform requirements. Rarely needed.
string
License information or reference to a LICENSE.txt file in the skill folder.
Markdown Body
The markdown body contains the instructions the AI agent will follow. This is where you teach the agent how to accomplish the skill’s task.Structure Guidelines
Keep it Under 500 Lines
Keep it Under 500 Lines
The SKILL.md body should ideally be under 500 lines. If approaching this limit:
- Move detailed documentation to reference files
- Add clear pointers about when to read each reference
- Use progressive disclosure to load details on demand
Explain the Why, Not Just the What
Explain the Why, Not Just the What
Modern AI agents benefit from understanding why things are important, not just what to do.Good:Less effective:
Use Imperative Form
Use Imperative Form
Prefer imperative instructions for clarity:
Include Examples
Include Examples
Examples help agents understand expected input/output formats:
Reference Bundled Resources Clearly
Reference Bundled Resources Clearly
When referencing bundled resources, be explicit about when and how to use them:
Common Patterns
Defining Output Formats
Conditional Instructions
Error Handling
Writing Style
Theory of Mind
Write instructions with an understanding of how AI agents think and work:- Agents benefit from context and reasoning
- Agents can generalize from principles
- Agents work better with “why” than rigid “always/never” rules
- Agents can compose solutions from flexible guidelines
Generality vs. Specificity
Balance general principles with specific examples:Avoiding Over-Specification
If you find yourself writing ALWAYS or NEVER in all caps frequently, consider whether you can explain the reasoning instead. Rigid structures work less well than flexible guidelines grounded in understanding.
Complete Example
Here’s a complete SKILL.md example:Next Steps
Metadata Schema
Detailed schema reference for YAML frontmatter
Loading System
How the progressive disclosure system works