What is a skill?
A skill is a Markdown reference guide — aSKILL.md file with YAML frontmatter — that agents discover and load at runtime. Skills encode proven techniques, patterns, and workflows so that future agent instances can apply them without being told explicitly.
Skills are: reusable techniques, patterns, tools, and reference guides.
Skills are not: narratives about how you solved a problem once, project-specific conventions (put those in CLAUDE.md), or mechanical constraints better enforced by automation.
Where to put skills
Skills can live in three locations depending on their intended scope:| Location | Purpose |
|---|---|
~/.config/opencode/skills/<skill-name>/SKILL.md | Personal skills — available across all your projects |
.opencode/skills/<skill-name>/SKILL.md | Project skills — checked into the repo, shared with the team |
skills/<skill-name>/SKILL.md in the Superpowers repo | Published skills — contributed back for everyone |
Claude Code uses
~/.claude/skills/ and Codex uses ~/.agents/skills/. Each platform has its own personal skill directory — check your platform’s documentation.YAML frontmatter
EverySKILL.md starts with YAML frontmatter containing two required fields:
name — matches the directory name. Use letters, numbers, and hyphens only. No parentheses or special characters. 64-character maximum.
description — the most important field. Agents read descriptions from all available skills to decide which ones to load. 1024-character maximum.
Writing effective descriptions
The description determines when your skill fires automatically. Get this wrong and the skill never triggers — or triggers at the wrong time. The format: Start with “Use when…” and describe only triggering conditions. Never summarize the skill’s process or workflow.- Write in third person (it’s injected into the system prompt)
- Use concrete triggers, symptoms, and situations
- Describe the problem, not language-specific symptoms
- Keep technology-agnostic unless the skill itself is technology-specific
Skill types
Understanding which type of skill you’re writing shapes how you structure it. Rigid skills (liketest-driven-development) must be followed exactly. The agent does not adapt or abbreviate the process. Use authority language: “YOU MUST”, “Never”, “No exceptions.”
Flexible skills (like brainstorming) provide principles and patterns the agent adapts to context. Use guidance language that leaves room for judgment.
The skill itself should tell the agent which type it is.
Minimal skill template
Key writing principles
Be concise — context window is shared
At startup, only thename and description from all skills are pre-loaded. The SKILL.md body is read on demand. But once loaded, every token competes with conversation history.
Target word counts:
- Skills loaded at session start: fewer than 150 words
- Frequently-referenced skills: fewer than 200 words total
- Other skills: fewer than 500 words
One excellent example beats many mediocre ones
Choose the most relevant language for the skill’s domain. A complete, well-commented example from a real scenario is more useful than five variations of the same pattern.Use reference files for heavy content
KeepSKILL.md as a focused overview. Move long reference docs (100+ lines) into subdirectory files and link to them from the main skill.
advanced.md which links to details.md. Claude may only partially read nested references.
Keyword coverage for discovery
Use words an agent would search for:- Error messages verbatim: “Hook timed out”, “ENOTEMPTY”
- Symptoms: “flaky”, “hanging”, “zombie”, “pollution”
- Synonyms: “timeout/hang/freeze”, “cleanup/teardown”
- Actual tool and library names
Use checklists for multi-step processes
For workflows with multiple steps that must all complete, provide a checklist. Agents can copy it into their response and track progress.Close every loophole explicitly
Discipline-enforcing skills need to resist rationalization. Don’t just state the rule — forbid specific workarounds:Instruction priority
Skills override default agent behavior, but user instructions always take precedence:- User’s explicit instructions (
CLAUDE.md,AGENTS.md, direct requests) — highest priority - Superpowers skills — override default system behavior where they conflict
- Default system prompt — lowest priority
The Iron Law
Skill creation checklist
RED phase — establish baseline:- Create pressure scenarios with 3+ combined pressures
- Run scenarios WITHOUT the skill — document failures verbatim
- Identify patterns in rationalizations
- Name uses only letters, numbers, hyphens
- YAML frontmatter with
nameanddescription(max 1024 chars total) - Description starts with “Use when…” — triggering conditions only, no workflow summary
- Description written in third person
- Keywords throughout for discovery
- Clear overview with core principle
- Addresses the specific baseline failures from RED phase
- Identify new rationalizations from testing
- Add explicit counters for discipline skills
- Build rationalization table from test iterations
- Re-test until bulletproof
Skill Anatomy
Understand the structure of a SKILL.md file in depth
Testing Skills
Verify your skill works before deploying it