How to Create a Claude Code Skill (SKILL.md)
A Claude Code skill is just a folder with one Markdown file — a SKILL.md that teaches Claude how you like things done. In this guide you'll build one from scratch, learn exactly where it goes, and fix it when it doesn't trigger.
What is a Claude Code skill?
Imagine hiring a brilliant new teammate. They can code, write, and analyze anything — but they don't yet know how your team does things: your commit style, your report format, your naming rules. So you hand them a one-page onboarding doc.
A Claude Code skill is exactly that: a folder containing a file named SKILL.md — a short instruction sheet Claude reads only when the task calls for it. Nothing to compile, no code required. If you can write a Markdown file, you can write a skill.
SKILL.md → Claude → new capability. That's the whole mechanism.Claude Skills are Anthropic's implementation of the open Agent Skills standard, so the same SKILL.md format works in Claude Code, the Claude apps, and other agents like Codex and Gemini CLI. New to the idea? Start with what agent skills are.
Where do skills work?
This guide uses Claude Code, where skills are plain folders on your disk. In the Claude apps you upload the same folder as a ZIP under Customize → Skills — and skills you turn on there also sync into Claude Code when you sign in with the same account.
How Claude decides to use a skill
You might worry: "If I add 30 skills, won't Claude get slow and confused?" No — thanks to a design called progressive disclosure. Think of your skills as a bookshelf. Claude keeps only the spines in view: each skill's name and description. It pulls a book off the shelf — loads the full SKILL.md — only when your request matches a spine.
Level 1 · Always loaded
name + description — the “book spine”
Level 2 · Loaded when relevant
the full SKILL.md body — your instructions
Level 3 · Opened only if needed
extra files: reference.md, templates, scripts…
The practical consequence, which you'll use in every skill you write: the description field is how Claude finds your skill. It isn't documentation for humans — it's what Claude matches your request against.
Claude skill vs slash command, subagent, plugin, and MCP
These building blocks overlap, so it's worth knowing which one you're reaching for:
| What it adds | Who triggers it | Best for | |
|---|---|---|---|
| Skill | Know-how: instructions, plus optional scripts and reference files | Claude, when the task matches — or you, with /skill-name | Repeatable workflows |
| Slash command | A saved prompt you run by name | You | Now part of skills — .claude/commands/ files still work |
| Subagent | A separate agent with its own context window | Claude delegates to it | Big, self-contained side tasks |
| Plugin | A bundle of skills, agents, hooks, and MCP servers | You install it once | Sharing a toolkit across repos and teams |
| MCP server | Tools and data from outside systems | Claude calls its tools | Connecting APIs, databases, and apps |
The short version: MCP adds tools; a skill adds instructions. They're complementary — a skill can teach Claude how to use an MCP server well.
Where Claude skills live: ~/.claude/skills vs .claude/skills
This is where most beginners get stuck, so let's slow down. Claude Code looks for skills in two different places, for two different reasons:
- Personal skills live in
~/.claude/skills/, inside your home directory. They follow you: available in every project you open on this machine, invisible to teammates. - Project skills live in
.claude/skills/, inside a project's root folder next to itssrc/andpackage.json. They follow the repo: commit them to git and every teammate who clones the project gets them.
Same folder name, completely different address. The only visual difference is that little ~/ prefix — which is exactly why it trips people up.
Personal — follows you
✓ works in all your projects
✗ only on your machine
Project — follows the repo
✓ shared with the team via git
✗ only inside this project
New to ~ and the leading dot? Read this first
~(tilde) means "my home directory." Your terminal expands it for you: macOS →/Users/yourname, Linux →/home/yourname, Windows →C:\Users\yourname(PowerShell understands~too).- The leading dot makes
.claudea hidden folder. In Finder pressCmd+Shift+.; in Windows File Explorer turn on hidden items from the View menu; or runls -ain a terminal. - The folders may not exist yet — that's normal. Nothing creates
~/.claude/skills/in advance; you'll create it in the hands-on part below.
So… which one should I use?
Personal · ~/.claude/skills/ | Project · .claude/skills/ | |
|---|---|---|
| Who benefits? | Just you | Everyone who clones the repo |
| Scope | Every project on your machine | Only this project |
| Lives in git? | No — it's outside any repo | Yes — commit and review it like code |
| Perfect for | Your personal style: commit messages, note formats, favorite refactors | Team rules: API conventions, release checklists, PR templates |
Rule of thumb
Start personal. The moment a teammate says "I want that too," move the folder into the repo's .claude/skills/. That's the entire migration.
Anatomy of a SKILL.md file
A SKILL.md has two parts: a small frontmatter block between --- fences (machine-readable metadata), and below it a free-form Markdown body with your actual instructions. Here's a complete, working one you can copy:
---
name: commit-messages
description: Writes clear, conventional commit messages from staged changes or a diff. Use when the user asks to write, improve, or review a git commit message.
---
# Commit messages
Follow the Conventional Commits format:
type(scope): short summary in imperative mood
## Rules
- Allowed types: feat, fix, docs, refactor, test, chore
- Summary line: max 72 characters, no trailing period
- Explain the why in the body, not the what
- Breaking change? Add a "BREAKING CHANGE:" footer
## Example
feat(auth): add passwordless login via magic links
Reduces sign-up friction; password resets were 30% of support tickets.The two fields that matter
name— the skill's ID, and the/commandyou can type to run it. Use lowercase letters, numbers, and hyphens only (max 64 characters), and keep it identical to the folder name:commit-messages/↔name: commit-messages. Claude Code falls back to the folder name if you leave it out, but the open standard requires it — so set it and your skill stays portable.description— the "book spine" from above. It answers two questions: what the skill does and when Claude should reach for it. Lead with the key use case; the open standard caps it at 1,024 characters.
The golden rule
Write the description for Claude, not for humans. Include the words a user would actually type. Compare:
✗ "Git helper." — Claude has no idea when this applies.
✓ "Writes conventional commit messages… Use when the user asks to write, improve, or review a commit message." — now "improve this commit message" is an obvious match.
Common frontmatter mistakes
- Name the file exactly
SKILL.md— capital SKILL, lowercase.md. - The opening
---must be the very first line of the file; Claude Code ignores frontmatter that starts anywhere else. - YAML is picky: put a space after every colon (
name: value). If the YAML doesn't parse, the skill still loads — but with no description, so Claude can't match it. - Field names must match exactly, hyphens included. Claude Code silently ignores a field it doesn't recognize.
How to create a Claude Code skill step by step
We'll create the commit-messages skill as a personal skill, so it works in every project you open. Total time: about five minutes.
1. Create the folder
mkdir -p ~/.claude/skills/commit-messagesmkdir -Force ~\.claude\skills\commit-messagesBoth commands create every missing parent folder in one go — remember, none of them may exist yet — and are safe to run twice.
2. Create SKILL.md inside it
Open the new folder in any editor and save the file from the anatomy section above as SKILL.md. Or let Claude do it — open Claude Code and paste:
Create ~/.claude/skills/commit-messages/SKILL.md with a skill that writes Conventional Commits messages. The description should say to use it whenever I ask to write, improve, or review a commit message.Yes — Claude is good at writing skills for Claude. Review what it generates and tweak the rules to taste.
3. Load it — no restart needed
Claude Code watches your skills folders, so a skill you add or edit is picked up in the current session. One exception catches almost every first-timer: if ~/.claude/skills/ didn't exist when the session started, Claude Code isn't watching it yet. Run /reload-skills (again after each edit there), or simply start a new session.
4. Trigger it — naturally
Don't announce the skill. Ask the way you normally would, and watch Claude reach for it on its own:
> write a commit message for these changes
● Skill(commit-messages)
feat(checkout): validate coupon codes server-side
Client-side checks were bypassable; this moves validation behind the API so expired coupons can't be applied.
>
You can also call it directly by typing /commit-messages — skills double as slash commands.
5. Check the shelf
Curious what Claude can see? Run /skills to list every skill Claude Code has loaded, or simply ask: "What skills are available?" Your new skill should be on the list. If it is — congratulations, you've shipped your first skill. 🎓
Claude skill not triggering? Troubleshooting
Most "my skill doesn't work" cases come down to one of these. Check them in order:
| Symptom | Likely cause and fix |
|---|---|
Missing from /skills | Wrong location. The path must be exactly ~/.claude/skills/<name>/SKILL.md (personal) or <project>/.claude/skills/<name>/SKILL.md (project). A file in .claude/skill/ (singular), or a SKILL.md dropped straight into skills/ without its own folder, won't be found. |
| Still missing after you fix the path | Folder not watched yet. If the skills/ folder was created after the session started, run /reload-skills or start a new session. |
/commit-messages works, but Claude never picks it on its own | Broken frontmatter. If the YAML doesn't parse, the skill loads with no description, so Claude has nothing to match. Check the --- fences and colons; claude --debug prints the parse error. |
| Listed, never used | Vague description. Add the phrases users actually type ("commit message", "changelog", "release notes"), then test with a request that contains one. |
| Works in one project, not another | It's a project skill. By design it exists only inside that repo (Fig. 3). Copy it to ~/.claude/skills/ to make it personal. |
| Fires when you don't want it | Description too broad. Make it more specific — or add disable-model-invocation: true so it runs only when you type /commit-messages. |
Debug like a pro
Ask Claude itself: "Why didn't you use my commit-messages skill for that request?" The answer usually points straight at a description that didn't match — and Claude can rewrite it on the spot. To check every skill's frontmatter at once, run claude plugin validate ~/.claude/skills in your shell.
How to install a ready-made Claude skill
You don't have to write every skill from scratch. Three ways to add an existing one, no coding required:
1. Plugin marketplace (Anthropic's official method). Claude Code registers Anthropic's official marketplace the first time you start it, so you can install straight away. The command opens the plugin's details, where you review it and pick a scope:
/plugin install skill-creator@claude-plugins-officialOther marketplaces need adding first — Anthropic's example skills, for instance:
/plugin marketplace add anthropics/skills
/plugin install example-skills@anthropic-agent-skillsSkills from a plugin show up namespaced, as /plugin-name:skill-name.
2. The skills CLI (community tool). Install a raw SKILL.md skill from any GitHub repo:
npx skills add owner/repo --skill <skill-name> -a claude-code -g-g installs globally to ~/.claude/skills; drop it to install into the current project (.claude/skills). This is the third-party skills.sh CLI, not an Anthropic command.
3. Manual. Copy any skill folder (the one containing SKILL.md) into ~/.claude/skills/ — Claude Code picks it up right away (run /reload-skills if that folder is brand new).
Or find one in the ProfessorGPT catalog and install it in one command.
Let Claude scaffold it: skill-creator
Anthropic publishes an official skill-creator plugin that writes skills for you: it drafts the SKILL.md, helps you add test cases, and tunes the description so the skill triggers reliably. Install it with the command above (/plugin install skill-creator@claude-plugins-official), then ask in plain language: "Create a skill that reviews my PRs." It picks up that request on its own — or run it from the / menu as /skill-creator:skill-creator. (In OpenAI Codex the same idea is a built-in $skill-creator command.)
Build a Claude skill without writing YAML
If you'd rather not hand-write frontmatter, the Skill Builder generates a clean, standard-compliant SKILL.md from a few inputs: pick a category, describe the job, then download or install the result. You can also browse ready-made skills and adapt one.
Level up from here
You now have the core loop: folder → SKILL.md → trigger → iterate. Everything advanced is a variation on it:
- Bundle resources. Drop a
reference.md, templates, or examples next toSKILL.mdand link to them from the body — Claude opens them only when needed (Level 3 in Fig. 2). - Add scripts. A skill can ship runnable helpers like
scripts/validate.pyand tell Claude to run them instead of improvising. - Control who triggers it.
disable-model-invocation: truemakes a skill manual-only — right for anything with side effects, like a deploy.allowed-toolspre-approves specific tools for the turn that runs the skill; it doesn't restrict the others. - Share it. Commit project skills to git, bundle a set into a plugin to reuse across repos, or publish one to the ProfessorGPT catalog.
The SKILL.md template adds the optional frontmatter fields, and the SKILL.md examples show finished skills to borrow from.
Before you ship a skill
- Path is exactly
…/skills/<skill-name>/SKILL.md— its own folder, exact filename - A deliberate choice: personal (
~/.claude/skills/) or project (.claude/skills/) name: lowercase letters, numbers, and hyphens, ≤ 64 characters, same as the folderdescription: says what and when, uses real trigger words, key use case first- Tested with a natural request — and Claude actually used it