Creating Skills
Overview
Skills are reference guides for proven techniques, patterns, or tools. Write them to help future Claude instances quickly find and apply effective approaches.
Skills must be discoverable (Claude can find them), scannable (quick to evaluate), and actionable (clear examples).
Core principle: Default assumption is Claude is already very smart. Only add context Claude doesn't already have.
When to Use
Create a skill when:
- Technique wasn't intuitively obvious
- Pattern applies broadly across projects
- You'd reference this again
- Others would benefit
Don't create for:
- One-off solutions specific to single project
- Standard practices well-documented elsewhere
- Project conventions (put those in
.claude/CLAUDE.md)
Required Structure
Frontmatter (YAML)
yaml
1---
2name: skill-name-with-hyphens
3description: Use when [triggers/symptoms] - [what it does and how it helps]
4tags: relevant-tags
5---
Rules:
- Only
name and description fields supported (max 1024 chars total)
- Name: letters, numbers, hyphens only (max 64 chars). Use gerund form (verb + -ing)
- Avoid reserved words: "anthropic", "claude" in names
- Description: Third person, starts with "Use when..." (max 1024 chars)
- Include BOTH triggering conditions AND what skill does
- Match specificity to task complexity (degrees of freedom)
Document Structure
markdown
1# Skill Name
2
3## Overview
4Core principle in 1-2 sentences. What is this?
5
6## When to Use
7- Bullet list with symptoms and use cases
8- When NOT to use
9
10## Quick Reference
11Table or bullets for common operations
12
13## Implementation
14Inline code for simple patterns
15Link to separate file for heavy reference (100+ lines)
16
17## Common Mistakes
18What goes wrong + how to fix
19
20## Real-World Impact (optional)
21Concrete results from using this technique
Degrees of Freedom
Match specificity to task complexity:
Red flag: If skill tries to constrain Claude too much on creative tasks, reduce specificity. If skill is too vague on critical operations, add explicit steps.
Claude Search Optimization (CSO)
Critical: Future Claude reads the description to decide if skill is relevant. Optimize for discovery.
Description Best Practices
yaml
1# ❌ BAD - Too vague, doesn't mention when to use
2description: For async testing
3
4# ❌ BAD - First person (injected into system prompt)
5description: I help you with flaky tests
6
7# ✅ GOOD - Triggers + what it does
8description: Use when tests have race conditions or pass/fail inconsistently - replaces arbitrary timeouts with condition polling for reliable async tests
9
10# ✅ GOOD - Technology-specific with explicit trigger
11description: Use when using React Router and handling auth redirects - provides patterns for protected routes and auth state management
Keyword Coverage
Use words Claude would search for:
- Error messages: "ENOENT", "Cannot read property", "Timeout"
- Symptoms: "flaky", "hanging", "race condition", "memory leak"
- Synonyms: "cleanup/teardown/afterEach", "timeout/hang/freeze"
- Tools: Actual command names, library names, file types
Naming Conventions
Use gerund form (verb + -ing):
- ✅
creating-skills not skill-creation
- ✅
testing-with-subagents not subagent-testing
- ✅
debugging-memory-leaks not memory-leak-debugging
- ✅
processing-pdfs not pdf-processor
- ✅
analyzing-spreadsheets not spreadsheet-analysis
Why gerunds work:
- Describes the action you're taking
- Active and clear
- Consistent with Anthropic conventions
Avoid:
- ❌ Vague names like "Helper" or "Utils"
- ❌ Passive voice constructions
Code Examples
One excellent example beats many mediocre ones.
Choose Language by Use Case
- Testing techniques → TypeScript/JavaScript
- System debugging → Shell/Python
- Data processing → Python
- API calls → TypeScript/JavaScript
Good Example Checklist
Example Template
typescript
1// ✅ GOOD - Clear, complete, ready to adapt
2interface RetryOptions {
3 maxAttempts: number;
4 delayMs: number;
5 backoff?: 'linear' | 'exponential';
6}
7
8async function retryOperation<T>(
9 operation: () => Promise<T>,
10 options: RetryOptions
11): Promise<T> {
12 const { maxAttempts, delayMs, backoff = 'linear' } = options;
13
14 for (let attempt = 1; attempt <= maxAttempts; attempt++) {
15 try {
16 return await operation();
17 } catch (error) {
18 if (attempt === maxAttempts) throw error;
19
20 const delay = backoff === 'exponential'
21 ? delayMs * Math.pow(2, attempt - 1)
22 : delayMs * attempt;
23
24 await new Promise(resolve => setTimeout(resolve, delay));
25 }
26 }
27
28 throw new Error('Unreachable');
29}
30
31// Usage
32const data = await retryOperation(
33 () => fetchUserData(userId),
34 { maxAttempts: 3, delayMs: 1000, backoff: 'exponential' }
35);
Don't
- ❌ Implement in 5+ languages (you're good at porting)
- ❌ Create fill-in-the-blank templates
- ❌ Write contrived examples
- ❌ Show only code without comments
File Organization
Self-Contained (Preferred)
typescript-type-safety/
SKILL.md # Everything inline
When: All content fits in ~500 words, no heavy reference needed
With Supporting Files
api-integration/
SKILL.md # Overview + patterns
retry-helpers.ts # Reusable code
examples/
auth-example.ts
pagination-example.ts
When: Reusable tools or multiple complete examples needed
With Heavy Reference
aws-sdk/
SKILL.md # Overview + workflows
s3-api.md # 600 lines API reference
lambda-api.md # 500 lines API reference
When: Reference material > 100 lines
Token Efficiency
Skills load into every conversation. Keep them concise.
Target Limits
- SKILL.md: Keep under 500 lines
- Getting-started workflows: <150 words
- Frequently-loaded skills: <200 words total
- Other skills: <500 words
- Files > 100 lines: Include table of contents
Challenge each piece of information: "Does Claude really need this explanation?"
Compression Techniques
markdown
1# ❌ BAD - Verbose (42 words)
2Your human partner asks: "How did we handle authentication errors in React Router before?"
3You should respond: "I'll search past conversations for React Router authentication patterns."
4Then dispatch a subagent with the search query: "React Router authentication error handling 401"
5
6# ✅ GOOD - Concise (20 words)
7Partner: "How did we handle auth errors in React Router?"
8You: Searching...
9[Dispatch subagent → synthesis]
Techniques:
- Reference tool
--help instead of documenting all flags
- Cross-reference other skills instead of repeating content
- Show minimal example of pattern
- Eliminate redundancy
- Use progressive disclosure (reference additional files as needed)
- Organize content by domain for focused context
Workflow Recommendations
For multi-step processes, include:
- Clear sequential steps: Break complex tasks into numbered operations
- Feedback loops: Build in verification/validation steps
- Error handling: What to check when things go wrong
- Checklists: For processes with many steps or easy-to-miss details
Example structure:
markdown
1## Workflow
2
31. **Preparation**
4 - Check prerequisites
5 - Validate environment
6
72. **Execution**
8 - Step 1: [action + expected result]
9 - Step 2: [action + expected result]
10
113. **Verification**
12 - [ ] Check 1 passes
13 - [ ] Check 2 passes
14
154. **Rollback** (if needed)
16 - Steps to undo changes
Common Mistakes
| Mistake | Why It Fails | Fix |
|---|
| Narrative example | "In session 2025-10-03..." | Focus on reusable pattern |
| Multi-language dilution | Same example in 5 languages | One excellent example |
| Code in flowcharts | step1 [label="import fs"] | Use markdown code blocks |
| Generic labels | helper1, helper2, step3 | Use semantic names |
| Missing description triggers | "For testing" | "Use when tests are flaky..." |
| First-person description | "I help you..." | "Use when... - provides..." |
| Deeply nested file references | Multiple @ symbols, complex paths | Keep references simple and direct |
| Windows-style file paths | C:\path\to\file | Use forward slashes |
| Offering too many options | 10 different approaches | Focus on one proven approach |
| Punting error handling | "Claude figures it out" | Include explicit error handling in scripts |
| Time-sensitive information | "As of 2025..." | Keep content evergreen |
| Inconsistent terminology | Mixing synonyms randomly | Use consistent terms throughout |
Flowchart Usage
Only use flowcharts for:
- Non-obvious decision points
- Process loops where you might stop too early
- "When to use A vs B" decisions
Never use for:
- Reference material → Use tables/lists
- Code examples → Use markdown blocks
- Linear instructions → Use numbered lists
Cross-Referencing Skills
markdown
1# ✅ GOOD - Name only with clear requirement
2**REQUIRED:** Use superpowers:test-driven-development before proceeding
3
4**RECOMMENDED:** See typescript-type-safety for proper type guards
5
6# ❌ BAD - Unclear if required
7See skills/testing/test-driven-development
8
9# ❌ BAD - Force-loads file, wastes context
10@skills/testing/test-driven-development/SKILL.md
Advanced Practices
Iterative Development
Best approach: Develop skills iteratively with Claude
- Start with minimal viable skill
- Test with real use cases
- Refine based on what works
- Remove what doesn't add value
Build Evaluations First
Before extensive documentation:
- Create test scenarios
- Identify what good looks like
- Document proven patterns
- Skip theoretical improvements
Utility Scripts
For reliability, provide:
- Scripts with explicit error handling (don't defer errors to Claude)
- Exit codes for success/failure
- Clear error messages
- Examples of usage
- List required dependencies explicitly
Example:
bash
1#!/bin/bash
2set -e # Exit on error
3
4if [ ! -f "config.json" ]; then
5 echo "Error: config.json not found" >&2
6 exit 1
7fi
8
9# Script logic here
10echo "Success"
11exit 0
For complex operations, create validation checkpoints:
- Have Claude produce a structured plan file
- Validate the plan with a script
- Execute only after validation passes
This catches errors before they compound.
Templates for Structured Output
When skills produce consistent formats:
markdown
1## Output Template
2
3\`\`\`typescript
4interface ExpectedOutput {
5 status: 'success' | 'error';
6 data: YourDataType;
7 errors?: string[];
8}
9\`\`\`
10
11**Usage**: Copy and adapt for your context
Skill Creation Checklist
Before writing:
Frontmatter:
Content:
Quality:
Testing:
Directory Structure
skills/
skill-name/
SKILL.md # Required
supporting-file.* # Optional
examples/ # Optional
example1.ts
scripts/ # Optional
helper.py
Flat namespace - all skills in one searchable directory
Real-World Impact
Good skills:
- Future Claude finds them quickly (CSO optimization)
- Can be scanned in seconds (quick reference)
- Provide clear actionable examples
- Prevent repeating same research
- Stay under 500 lines (token efficient)
- Match specificity to task needs (right degrees of freedom)
Bad skills:
- Get ignored (vague description)
- Take too long to evaluate (no quick reference)
- Leave gaps in understanding (no examples)
- Waste token budget (verbose explanations of obvious things)
- Over-constrain creative tasks or under-specify critical operations
- Include time-sensitive or obsolete information
Remember: Skills are for future Claude, not current you. Optimize for discovery, scanning, and action.
Golden rule: Default assumption is Claude is already very smart. Only add context Claude doesn't already have.