Authoring Claude Code Skills
Guides the creation of Claude Code agent skills (SKILL.md files) that teach Claude reusable task-specific methods. Use when a user wants to create a skill, decide between a skill, CLAUDE.md, or slash command, choose where a skill should live, or turn repeated instructions into a reusable skill.
Create a skill by making a folder containing a SKILL.md file with frontmatter and instructions:
Bashmkdir -p ~/.claude/skills/pr-review
Markdown--- name: pr-review description: Reviews pull requests for code quality. Use when reviewing PRs or checking code changes. --- # PR Review 1. Check that the change matches the PR description 2. Flag missing tests, unclear naming, and risky logic 3. Structure feedback as: Summary, Blocking issues, Suggestions
Next time you ask Claude to "review this PR," it matches your request to the description and loads the skill automatically.
A skill is a folder of instructions (and optional resources) that Claude Code discovers and applies to handle a specific task accurately. The core file is SKILL.md:
- Frontmatter (
name,description): always visible to Claude. The description is how Claude decides whether to activate the skill. - Body: the actual instructions (checklists, formats, standards). Loaded only when the skill matches the request.
Skills load on demand. Only name and description sit in context initially, so skills don't bloat the context window.
Progress:
- [ ] Step 1: Identify a repeated instruction worth capturing
- [ ] Step 2: Decide whether a skill is the right tool
- [ ] Step 3: Choose scope (personal vs. project)
- [ ] Step 4: Write the description (what + when)
- [ ] Step 5: Write the instructions body
- [ ] Step 6: Test with a realistic request
- [ ] Step 7: Refine the description if it doesn't trigger
Step 1: Identify the repetition
The rule of thumb: if you find yourself explaining the same thing to Claude repeatedly, that's a skill waiting to be written. Review recent sessions for instructions you re-typed (review format, commit style, doc templates, debugging steps).
Step 2: Choose the right tool
| Feature | Loads | Use for |
|---|---|---|
| CLAUDE.md | Every conversation, always | Universal rules (e.g., "always use TypeScript strict mode") |
| Skill | Automatically, when the request matches the description | Task-specific expertise (PR review checklist, brand guidelines) |
| Slash command | Only when you explicitly type it | Actions you want to trigger deliberately |
Decision shortcut:
- Needed in every conversation? → CLAUDE.md
- Needed only for a specific kind of task, and should apply automatically? → Skill
- Should only run when you invoke it? → Slash command
Step 3: Choose scope
| Scope | Location | Use for |
|---|---|---|
| Personal | ~/.claude/skills/<skill-name>/SKILL.md | Your own preferences across all projects (commit style, explanation style) |
| Project | <repo-root>/.claude/skills/<skill-name>/SKILL.md | Team standards, committed to version control; anyone who clones the repo gets them |
On Windows, personal skills live in C:/Users/<your-user>/.claude/skills.
Step 4: Write the description
The description drives matching. It must state what the skill does and when to use it, with trigger phrases a user would naturally say.
Step 5: Write the body
Put the real content below the frontmatter: checklists, output formats, templates, examples. Be concise and specific; Claude doesn't need basics explained.
Step 6: Test
Ask Claude something that should trigger the skill, using natural phrasing (not the skill's name). Confirm you see the skill load in the terminal and that the output follows your instructions.
Example 1: Choosing the tool Input: "I want Claude to always use strict mode in TypeScript, and also follow our PR review checklist." Output: Strict mode → CLAUDE.md (applies to every conversation). PR review checklist → skill (only relevant when reviewing; loads on demand, so it doesn't consume context during unrelated work).
Example 2: Choosing scope
Input: "I want Claude to follow my personal commit message style everywhere, and our company brand colors on the web projects."
Output: Commit style → personal skill at ~/.claude/skills/commit-style/. Brand colors → project skill at .claude/skills/brand-guidelines/, committed so the whole team shares it.
Example 3: Weak vs. strong description
Input: Description written as Helps with PRs
Output: Rewrite as Reviews pull requests for code quality and consistency. Use when reviewing PRs, checking code changes, or asked for feedback on a diff.
Example 4: Good skill candidates
- Code review standards your team follows
- Commit message formats you prefer
- Brand guidelines for your organization
- Documentation templates for specific doc types
- Debugging checklists for particular frameworks
- Write descriptions in third person with both function and trigger phrases; this is the single biggest factor in whether the skill activates.
- One skill, one task. Narrow skills match more reliably than broad ones.
- Use kebab-case names that describe the activity (
reviewing-prs,writing-commit-messages). - Commit project skills to version control so standards travel with the repo.
- Keep the body lean. Claude is capable; give specifics (formats, checklists, examples), not background explanations.
- Start from real repetition. Write skills for instructions you've actually had to repeat, not hypothetical ones.
- Vague descriptions. "Helps with code" won't match anything reliably. Include concrete triggers.
- Putting universal rules in a skill. If it must apply to every conversation, it belongs in CLAUDE.md; skills only load when matched.
- Putting task-specific detail in CLAUDE.md. It loads every time and wastes context.
- Expecting skills to behave like slash commands. Skills are automatic; don't rely on typing a command to fire them.
- Storing team standards in
~/.claude/skills. Teammates won't get them. Use the project.claude/skillsdirectory. - Skipping testing. Always try a natural-language request to verify the skill triggers.
Related topics that merit their own files as skills grow: multi-file skills with supporting resources, configuration options, sharing skills across teams, and troubleshooting skills that don't trigger.