Creating Skills
Skills are the building blocks of Superpowers. A skill is a reference guide for proven techniques, patterns, or tools that helps future Claude instances find and apply effective approaches.Creating skills IS Test-Driven Development applied to process documentation. You write test cases (pressure scenarios with subagents), watch them fail (baseline behavior), write the skill (documentation), watch tests pass (agents comply), and refactor (close loopholes).
What is a Skill?
Skills are:- Reusable techniques, patterns, tools, reference guides
- Documentation that helps agents discover and apply proven approaches
- Living documentation that evolves through testing and refinement
- Narratives about how you solved a problem once
- One-off solutions to specific problems
- Project-specific conventions (those belong in CLAUDE.md)
When to Create a Skill
Evaluate if a skill is needed
Create a skill when:
- The technique wasn’t intuitively obvious to you
- You’d reference this again across projects
- The pattern applies broadly (not project-specific)
- Others would benefit from this knowledge
- One-off solutions
- Standard practices well-documented elsewhere
- Project-specific conventions
- Mechanical constraints (if it’s enforceable with regex/validation, automate it—save documentation for judgment calls)
Understand the TDD mapping
Before creating a skill, understand that skill creation follows the RED-GREEN-REFACTOR cycle:
| TDD Concept | Skill Creation |
|---|---|
| Test case | Pressure scenario with subagent |
| Production code | Skill document (SKILL.md) |
| Test fails (RED) | Agent violates rule without skill (baseline) |
| Test passes (GREEN) | Agent complies with skill present |
| Refactor | Close loopholes while maintaining compliance |
Skill Types
Superpowers uses three main types of skills:Technique
Concrete method with steps to follow (e.g.,
condition-based-waiting, root-cause-tracing)Pattern
Way of thinking about problems (e.g.,
flatten-with-flags, test-invariants)Reference
API docs, syntax guides, tool documentation (e.g.,
office docs)Directory Structure
Skills use a flat namespace for easy discovery:- Heavy reference (100+ lines) - API docs, comprehensive syntax
- Reusable tools - Scripts, utilities, templates
- Principles and concepts
- Code patterns (< 50 lines)
- Everything else
SKILL.md Structure
Every skill follows a consistent structure:Frontmatter
- Only two fields:
nameanddescription - Max 1024 characters total
name: Letters, numbers, and hyphens only (no parentheses, special chars)description: Third-person, describes ONLY when to use (NOT what it does)
Content Sections
Claude Search Optimization (CSO)
CSO is critical for discovery - future Claude needs to FIND your skill.1. Rich Description Field
1. Rich Description Field
Purpose: Claude reads the description to decide which skills to load for a given task.CRITICAL: Description = When to Use, NOT What the Skill DoesThe description should ONLY describe triggering conditions. Do NOT summarize the skill’s process or workflow.Why this matters: Testing revealed that when a description summarizes the skill’s workflow, Claude may follow the description instead of reading the full skill content.Best practices:
- Start with “Use when…” to focus on triggering conditions
- Use concrete triggers, symptoms, and situations
- Describe the problem not language-specific symptoms
- Keep triggers technology-agnostic unless skill is technology-specific
- Write in third person (injected into system prompt)
- NEVER summarize the skill’s process or workflow
2. Keyword Coverage
2. Keyword Coverage
Use words Claude would search for:
- Error messages: “Hook timed out”, “ENOTEMPTY”, “race condition”
- Symptoms: “flaky”, “hanging”, “zombie”, “pollution”
- Synonyms: “timeout/hang/freeze”, “cleanup/teardown/afterEach”
- Tools: Actual commands, library names, file types
3. Descriptive Naming
3. Descriptive Naming
Use active voice, verb-first:
- ✅
creating-skillsnotskill-creation - ✅
condition-based-waitingnotasync-test-helpers
creating-skills,testing-skills,debugging-with-logs- Active, describes the action you’re taking
- ✅
flatten-with-flags>data-structure-refactoring - ✅
root-cause-tracing>debugging-techniques
4. Token Efficiency
4. Token Efficiency
Problem: Frequently-referenced skills load into EVERY conversation. Every token counts.Target word counts:Use cross-references:
- Getting-started workflows: under 150 words each
- Frequently-loaded skills: under 200 words total
- Other skills: under 500 words (still be concise)
Code Examples
Choose the most relevant language:- Testing techniques → TypeScript/JavaScript
- System debugging → Shell/Python
- Data processing → Python
- Is complete and runnable
- Has clear comments explaining WHY
- Comes from a real scenario
- Shows the pattern clearly
- Is ready to adapt (not a generic template)
- Implement in 5+ languages
- Create fill-in-the-blank templates
- Write contrived examples
File Organization Patterns
Self-Contained
With Reusable Tool
With Heavy Reference
Complete Example: Creating a Simple Skill
Let’s walk through creating a skill for condition-based waiting in tests.RED Phase - Establish Baseline
First, create a pressure scenario to test WITHOUT the skill:Scenario: “Write a test that waits for an async operation to complete”Run with a subagent WITHOUT the skill. Document what happens:
- Agent uses
setTimeoutwith arbitrary delays - Tests are flaky (pass/fail inconsistently)
- Agent doesn’t understand the race condition
- “100ms should be enough time”
- “Adding a longer timeout will fix it”
- “It works on my machine”
GREEN Phase - Write Minimal Skill
Create After (reliable):
Fix: Wait for conditionRun the same scenario WITH this skill. Agent should now use condition-based waiting.
skills/condition-based-waiting/SKILL.md:Quick Reference
| Framework | Helper |
|---|---|
| Jest | waitFor(() => condition) |
| Vitest | waitFor(() => condition) |
| Testing Library | waitFor(() => expect(...)) |
Common Mistakes
Mistake: Increasing timeout durationReal-World Skills to Study
Examine these skills from the Superpowers repository:test-driven-development
Excellent example of a discipline-enforcing skill with comprehensive rationalization table
brainstorming
Clean example of a process skill with clear flowchart
systematic-debugging
Pattern skill showing how to structure complex workflows
writing-plans
Technique skill with comprehensive reference material
Skill Creation Checklist
Use this checklist for every skill (see Testing Skills for testing details): RED Phase - Write Failing Test:- Create pressure scenarios (3+ combined pressures for discipline skills)
- Run scenarios WITHOUT skill - document baseline behavior verbatim
- Identify patterns in rationalizations/failures
- Name uses only letters, numbers, hyphens (no parentheses/special chars)
- YAML frontmatter with only name and description (max 1024 chars)
- Description starts with “Use when…” and includes specific triggers/symptoms
- Description written in third person
- Keywords throughout for search (errors, symptoms, tools)
- Clear overview with core principle
- Address specific baseline failures identified in RED
- Code inline OR link to separate file
- One excellent example (not multi-language)
- Run scenarios WITH skill - verify agents now comply
- Identify NEW rationalizations from testing
- Add explicit counters (if discipline skill)
- Build rationalization table from all test iterations
- Create red flags list
- Re-test until bulletproof
- Small flowchart only if decision non-obvious
- Quick reference table
- Common mistakes section
- No narrative storytelling
- Supporting files only for tools or heavy reference
- Commit skill to git and push to your fork (if configured)
- Consider contributing back via PR (if broadly useful)
Anti-Patterns to Avoid
Next Steps
Once you’ve created your skill:- Test it thoroughly - See Testing Skills
- Contribute it back - See Contributing
- Iterate based on feedback - Skills are living documentation
Additional Resources
- Full skill creation guide:
skills/writing-skills/SKILL.mdin the source repository - Anthropic’s official best practices:
anthropic-best-practices.md - Testing methodology: Testing Skills