Create Agent Skill
When to Use This Skill
Use this skill when:
- •User wants to create a new agent skill
- •User wants to package knowledge or workflows for AI agents
- •User mentions "skill", "agent capability", or "reusable instructions"
- •User wants to extend agent capabilities with domain expertise
Directory Structure
Every skill requires this minimum structure:
skill-name/ └── SKILL.md # Required: instructions + metadata
Optional directories for complex skills:
skill-name/ ├── SKILL.md # Required ├── scripts/ # Optional: executable code (Python, Bash, JS) ├── references/ # Optional: additional documentation └── assets/ # Optional: templates, images, data files
Important: Place skills in .github/skills/ for repository-level skills.
SKILL.md Format
Required Frontmatter
--- name: skill-name description: A description of what this skill does and when to use it. ---
Frontmatter Field Rules
| Field | Required | Rules |
|---|---|---|
name | Yes | 1-64 chars, lowercase alphanumeric + hyphens only, no leading/trailing/consecutive hyphens, must match directory name |
description | Yes | 1-1024 chars, describe WHAT it does AND WHEN to use it, include keywords for discovery |
license | No | License name or reference to LICENSE file |
compatibility | No | 1-500 chars, environment requirements if any |
metadata | No | Key-value pairs for author, version, etc. |
allowed-tools | No | Space-delimited list of pre-approved tools (experimental) |
Name Validation
✅ Valid names:
- •
pdf-processing - •
code-review - •
data-analysis
❌ Invalid names:
- •
PDF-Processing(uppercase not allowed) - •
-pdf(cannot start with hyphen) - •
pdf-(cannot end with hyphen) - •
pdf--processing(consecutive hyphens not allowed)
Writing Good Descriptions
✅ Good description:
description: Extracts text and tables from PDF files, fills PDF forms, and merges multiple PDFs. Use when working with PDF documents or when the user mentions PDFs, forms, or document extraction.
❌ Poor description:
description: Helps with PDFs.
The description should:
- •State what the skill DOES (capabilities)
- •State WHEN to use it (trigger conditions)
- •Include keywords agents will match against
Body Content Best Practices
After frontmatter, write Markdown instructions. Recommended sections:
- •When to use this skill - Clear trigger conditions
- •Step-by-step instructions - How to perform the task
- •Examples - Inputs and expected outputs
- •Edge cases - Common issues and how to handle them
- •File references - Links to scripts or references if needed
Progressive Disclosure
Structure content for efficient context use:
| Level | Token Budget | Content |
|---|---|---|
| Metadata | ~100 tokens | name + description (loaded at startup for ALL skills) |
| Instructions | <5000 tokens | Full SKILL.md body (loaded when skill activates) |
| Resources | As needed | scripts/, references/, assets/ (loaded on demand) |
Keep SKILL.md under 500 lines. Move detailed reference material to separate files.
Step-by-Step: Creating a New Skill
- •Choose a name - lowercase, hyphens only, descriptive
- •Create directory -
.github/skills/{skill-name}/ - •Write SKILL.md with:
- •Valid frontmatter (name + description minimum)
- •Clear instructions in the body
- •Examples where helpful
- •Add optional directories if needed:
- •
scripts/for executable code - •
references/for detailed documentation - •
assets/for templates and resources
- •
- •Validate the skill structure
Template
Use this template for new skills:
---
name: {skill-name}
description: {What it does}. Use when {trigger conditions}.
metadata:
author: {your-org}
version: "1.0"
---
# {Skill Title}
## When to Use This Skill
Use this skill when:
- {Condition 1}
- {Condition 2}
## Instructions
{Step-by-step instructions for the agent}
## Examples
### Example 1: {Scenario}
**Input:** {What the user asks}
**Output:** {What the agent produces}
## Edge Cases
- {Edge case 1}: {How to handle}
- {Edge case 2}: {How to handle}
File References
When referencing other files, use relative paths from skill root:
See [the reference guide](references/REFERENCE.md) for details. Run the extraction script: scripts/extract.py
Keep references one level deep. Avoid deeply nested chains.
Validation
After creating a skill, verify:
- •Directory name matches
namefield exactly - •
namefollows naming rules (lowercase, hyphens, no consecutive) - •
descriptionis non-empty and under 1024 characters - •SKILL.md has valid YAML frontmatter
- •Body content is clear and actionable
Reference
- •Specification: https://agentskills.io/specification
- •Examples: https://github.com/anthropics/skills
- •Validation tool: https://github.com/agentskills/agentskills/tree/main/skills-ref