Want to understand how skills work under the hood? This guide breaks down every part of a skill file.
skills/
βββ my-skill-name/
βββ SKILL.md β Required: The main skill definition
βββ examples/ β Optional: Example files
β βββ example1.js
β βββ example2.py
βββ scripts/ β Optional: Helper scripts
β βββ helper.sh
βββ templates/ β Optional: Code templates
β βββ template.tsx
βββ references/ β Optional: Reference documentation
β βββ api-docs.md
βββ README.md β Optional: Additional documentation
Key Rule: Only SKILL.md is required. Everything else is optional!
Every SKILL.md file has two main parts:
Let's break down each part:
The frontmatter is at the very top, wrapped in ---:
---
name: my-skill-name
description: "Brief description of what this skill does"
---- What it is: The skill's identifier
- Format: lowercase-with-hyphens
- Must match: The folder name exactly
- Example:
stripe-integration
- What it is: One-sentence summary
- Format: String in quotes
- Length: Keep it under 200 characters (validator enforces this)
- Example:
"Stripe payment integration patterns including checkout, subscriptions, and webhooks"
Some skills include additional metadata:
---
name: my-skill-name
description: "Brief description"
risk: "safe" # none | safe | critical | offensive (see QUALITY_BAR.md)
source: "community"
tags: ["react", "typescript"]
---After the frontmatter comes the actual skill content. Here's the recommended structure:
# Skill Title- Use a clear, descriptive title
- Usually matches or expands on the skill name
## Overview
A brief explanation of what this skill does and why it exists.
2-4 sentences is perfect.## When to Use This Skill
- Use when you need to [scenario 1]
- Use when working with [scenario 2]
- Use when the user asks about [scenario 3]Why this matters: Helps the AI know when to activate this skill
## How It Works
### Step 1: [Action]
Detailed instructions...
### Step 2: [Action]
More instructions...This is the heart of your skill - clear, actionable steps
## Examples
### Example 1: [Use Case]
\`\`\`javascript
// Example code
\`\`\`
### Example 2: [Another Use Case]
\`\`\`javascript
// More code
\`\`\`Why examples matter: They show the AI exactly what good output looks like
## Best Practices
- β
Do this
- β
Also do this
- β Don't do this
- β Avoid this## Common Pitfalls
- **Problem:** Description
**Solution:** How to fix it## Related Skills
- `@other-skill` - When to use this instead
- `@complementary-skill` - How this works togetherβ Bad:
You might want to consider possibly checking if the user has authentication.β Good:
Check if the user is authenticated before proceeding.β Bad:
The file should be created...β Good:
Create the file...β Bad:
Set up the database properly.β Good:
1. Create a PostgreSQL database
2. Run migrations: `npm run migrate`
3. Seed initial data: `npm run seed`If your skill needs helper scripts:
scripts/
βββ setup.sh β Setup automation
βββ validate.py β Validation tools
βββ generate.js β Code generators
Reference them in SKILL.md:
Run the setup script:
\`\`\`bash
bash scripts/setup.sh
\`\`\`Real-world examples that demonstrate the skill:
examples/
βββ basic-usage.js
βββ advanced-pattern.ts
βββ full-implementation/
βββ index.js
βββ config.json
Reusable code templates:
templates/
βββ component.tsx
βββ test.spec.ts
βββ config.json
Reference in SKILL.md:
Use this template as a starting point:
\`\`\`typescript
{{#include templates/component.tsx}}
\`\`\`External documentation or API references:
references/
βββ api-docs.md
βββ best-practices.md
βββ troubleshooting.md
- Frontmatter: name + description
- Content: 100-200 words
- Sections: Overview + Instructions
- Frontmatter: name + description
- Content: 300-800 words
- Sections: Overview + When to Use + Instructions + Examples
- Frontmatter: name + description + optional fields
- Content: 800-2000 words
- Sections: All recommended sections
- Extras: Scripts, examples, templates
Rule of thumb: Start small, expand based on feedback
Always specify the language:
\`\`\`javascript
const example = "code";
\`\`\`Use consistent formatting:
- Item 1
- Item 2
- Sub-item 2.1
- Sub-item 2.2- Bold for important terms:
**important** - Italic for emphasis:
*emphasis* Codefor commands/code:`code`
[Link text](https://example.com)Before finalizing your skill:
- Instructions are clear and actionable
- Examples are realistic and helpful
- No typos or grammar errors
- Technical accuracy verified
- Frontmatter is valid YAML
- Name matches folder name
- Sections are logically organized
- Headings follow hierarchy (H1 β H2 β H3)
- Overview explains the "why"
- Instructions explain the "how"
- Examples show the "what"
- Edge cases are addressed
- A beginner could follow this
- An expert would find it useful
- The AI can parse it correctly
- It solves a real problem
Let's analyze a real skill: brainstorming
---
name: brainstorming
description: "You MUST use this before any creative work..."
---Analysis:
- β Clear name
- β Strong description with urgency ("MUST use")
- β Explains when to use it
# Brainstorming Ideas Into Designs
## Overview
Help turn ideas into fully formed designs...Analysis:
- β Clear title
- β Concise overview
- β Explains the value proposition
## The Process
**Understanding the idea:**
- Check out the current project state first
- Ask questions one at a timeAnalysis:
- β Broken into clear phases
- β Specific, actionable steps
- β Easy to follow
## Instructions
If the user is working with React:
- Use functional components
- Prefer hooks over class components
If the user is working with Vue:
- Use Composition API
- Follow Vue 3 patterns## Basic Usage
[Simple instructions for common cases]
## Advanced Usage
[Complex patterns for power users]## Related Workflows
1. First, use `@brainstorming` to design
2. Then, use `@writing-plans` to plan
3. Finally, use `@test-driven-development` to implementHow to know if your skill is good:
- Can someone unfamiliar with the topic follow it?
- Are there any ambiguous instructions?
- Does it cover the happy path?
- Does it handle edge cases?
- Are error scenarios addressed?
- Does it solve a real problem?
- Would you use this yourself?
- Does it save time or improve quality?
For Beginners:
skills/brainstorming/SKILL.md- Clear structureskills/git-pushing/SKILL.md- Simple and focusedskills/copywriting/SKILL.md- Good examples
For Advanced:
skills/systematic-debugging/SKILL.md- Comprehensiveskills/react-best-practices/SKILL.md- Multiple filesskills/loki-mode/SKILL.md- Complex workflows
- Start with the "When to Use" section - This clarifies the skill's purpose
- Write examples first - They help you understand what you're teaching
- Test with an AI - See if it actually works before submitting
- Get feedback - Ask others to review your skill
- Iterate - Skills improve over time based on usage
## Instructions
Make the code better.β Fix:
## Instructions
1. Extract repeated logic into functions
2. Add error handling for edge cases
3. Write unit tests for core functionality## Instructions
[5000 words of dense technical jargon]β Fix: Break into multiple skills or use progressive disclosure
## Instructions
[Instructions without any code examples]β Fix: Add at least 2-3 realistic examples
Use React class components...β Fix: Keep skills updated with current best practices
- Read 3-5 existing skills to see different styles
- Try the skill template from CONTRIBUTING.md
- Create a simple skill for something you know well
- Test it with your AI assistant
- Share it via Pull Request
Remember: Every expert was once a beginner. Start simple, learn from feedback, and improve over time! π