skills/writing-skills/SKILL.md · view on GitHub (opens in a new tab)
A skill is a directory containing a SKILL.md file. Claude loads it automatically when the request matches its description, or the user invokes it directly with /<skill-name>. Use this guide whenever creating or revising a skill.
This SKILL.md is the workflow and the rules you need every time. Load the reference files only when a step points you there:
Create a skill when:
Do not create a skill for a one-off task, a single fact (use CLAUDE.md or memory), or something Claude already does well unprompted. The default assumption is that Claude is already smart — only add what it does not already have.
Work through these steps in order. Each links to detail only when you need it.
Before writing, run the task without a skill and watch where Claude struggles or where you repeatedly supply the same context. That gap — not an imagined requirement — is what the skill must close. Note 2-3 concrete scenarios you want it to handle; they are your test cases for step 7.
| Type | Content | Invocation |
|---|---|---|
| Knowledge / reference | Conventions, patterns, domain facts Claude applies to current work | Usually model-invoked; runs inline. |
| Workflow / task | Step-by-step actions (deploy, commit, generate) | Often user-only via /name; add disable-model-invocation: true so Claude never fires it on its own. |
Two independent toggles control invocation (see frontmatter reference for the table):
disable-model-invocation: true → only the user can invoke it (use for anything with side effects — deploy, commit, send message).user-invocable: false → only Claude can invoke it (use for background knowledge that is not a meaningful user command).If the skill should run in isolation with its own context, consider context: fork — but only for skills that contain an actual task, not pure guidelines.
| Location | Path | Scope |
|---|---|---|
| Personal | ~/.claude/skills/<name>/SKILL.md | All your projects |
| Project | .claude/skills/<name>/SKILL.md | This repo (commit it to share) |
| Plugin | <plugin>/skills/<name>/SKILL.md | Where the plugin is enabled |
The directory name becomes the command (~/.claude/skills/deploy-staging/ → /deploy-staging). The frontmatter name is only the display label — it does not change what the user types (except for a plugin-root SKILL.md). Keep the directory name and name in sync to avoid confusion.
Naming rules: lowercase letters, numbers, hyphens only; max 64 chars; no XML tags; may not contain the reserved words “anthropic” or “claude”. Prefer gerund form (processing-pdfs, writing-documentation) or a clear action (deploy, fix-issue). Avoid vague names (helper, utils, tools).
description is the highest-leverage lineOnly description is recommended; everything else is optional. The description is loaded into the system prompt at startup and is how Claude (and the user) decide when to use the skill, so it must earn its place.
Rules for a good description:
# Good
description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDFs or when the user mentions forms or document extraction.
# Bad — vague, no triggers, wrong person
description: Helps with documents
description: I can process your PDFs for youFor the complete field list (allowed-tools, argument-hint, arguments, model, effort, paths, context, agent, when_to_use, …), see reference/frontmatter.md.
The body loads when the skill is invoked and then stays in context for the rest of the session (Claude does not re-read the file). Every line is a recurring token cost, so treat the context window as a public good.
@imports — they do not work in SKILL.md. Point to other files in prose: “See reference/foo.md for…”.Keep SKILL.md under 500 lines. When it grows past that — or covers multiple independent domains — move detail into sibling files that Claude reads only when needed.
reference/finance.md, reference/sales.md).scripts/validate.py is more reliable and cheaper than regenerated code; its source never enters context, only its output. Make execution intent explicit: “Run scripts/x.py” vs “See scripts/x.py for the algorithm.” Use ${CLAUDE_SKILL_DIR}/scripts/... so paths resolve at any install location. Use forward slashes always.api passthrough for the rest. See reference/api-wrappers.md for how to structure the script and describe its surface to Claude./<name>.SKILL.md under a watched directory take effect within the session.disable-model-invocation: true.description is third-person, specific, and states what + when with real trigger words.name matches; lowercase/hyphens, no “anthropic”/“claude”.@imports, no Windows-style paths.disable-model-invocation / user-invocable) matches intent; side-effecting workflows are user-only.The full annotated version of this checklist, with examples for each item, is in reference/best-practices.md.