Skills
Skills are reusable prompt templates stored as SKILL.md files in .claude/skills/. Invoke them with /skill-name. They let you codify repeatable workflows — page creation, code review, deployments, content updates — so you get consistent results every time.
Explain Like I'm 12
Think of skills like recipe cards for Claude. Instead of explaining how to bake chocolate chip cookies from scratch every single time, you write the recipe once on a card. Next time you just say "use the cookie recipe" and Claude follows the exact same steps. Skills are those recipe cards — write them once, use them forever with /cookie-recipe.
How Skills Work
What Is a Skill?
A skill is a SKILL.md file that contains instructions for Claude. When you type /skill-name, Claude reads the file and follows the instructions as if you'd typed them yourself — but with much more detail and consistency than you'd write each time.
# Skill directory structure
.claude/skills/
├── new-page/
│ ├── SKILL.md # The instructions
│ └── references/
│ └── page-templates.md # Supporting files
├── commit/
│ └── SKILL.md
└── review-pr/
└── SKILL.md
.claude/skills/ at your project root. Each skill gets its own directory with a SKILL.md file and an optional references/ folder for templates and examples.Anatomy of SKILL.md
A SKILL.md has two parts: frontmatter (metadata) and the instruction body.
---
name: new-page
description: Create a new content page with all required elements
---
# New Page Creator
## Arguments
- `{topic}` — the topic name (e.g., "docker")
- `{level}` — page level: 1 (overview), 2 (core-concepts), 3 (deep-dive)
## Steps
1. Read the page template from `references/page-templates.md`
2. Create the HTML file at `domains/{domain}/{topic}/{page}.html`
3. Fill in all placeholders with topic-specific content
4. Add entry to `js/site-data.js` PAGES array
5. Add URL to `sitemap.xml`
## Rules
- Every page MUST have a TL;DR box
- Include at least 5 Test Yourself questions
- Related Topics must link to real pages, never placeholders
description in frontmatter helps Claude decide when to suggest the skill. Make it specific — "Create a new content page" is better than "Page helper."Passing Arguments
Skills can accept arguments passed after the slash command:
# Invoke with arguments
/new-page docker overview
# Claude receives:
# Arguments: docker overview
# Then parses them according to the SKILL.md instructions
Arguments are passed as a single string. The skill's instructions define how to parse them. Common patterns:
- Positional:
/new-page {topic} {level} - Named:
/deploy --env production --tag v2.1 - Free-form:
/explain How does the auth middleware work?
Reference Files
Complex skills need supporting files — templates, examples, checklists. Put them in a references/ subdirectory:
.claude/skills/new-page/
├── SKILL.md
└── references/
├── page-templates.md # HTML skeletons for each page level
├── seo-checklist.md # SEO requirements
└── example-page.html # A completed example for reference
In your SKILL.md, reference them with relative paths:
## Step 1: Read Templates
Read `references/page-templates.md` for the HTML skeleton.
Use the Level 3 template for deep-dive pages.
Real-World Skill Examples
| Skill | Trigger | What It Does |
|---|---|---|
| new-page | /new-page docker overview | Creates a content page with full SEO, TL;DR, ELI12, diagrams, tests |
| new-topic | /new-topic devops docker | Creates an entire topic: overview + core-concepts + deep-dives + interview |
| update-content | /update-content | Updates versioned content: checks changelogs, updates code, bumps version |
| commit | /commit | Stages changes, generates a commit message, creates the commit |
| review-pr | /review-pr 123 | Reads PR diff, checks for bugs, suggests improvements |
| excalidraw-diagram | /excalidraw-diagram | Creates an Excalidraw JSON diagram following design methodology |
Creating Your Own Skill
Walk-through: create a /changelog skill that generates release notes.
# 1. Create the directory
mkdir -p .claude/skills/changelog
# 2. Write .claude/skills/changelog/SKILL.md
---
name: changelog
description: Generate release notes from recent git commits
---
# Changelog Generator
## Steps
1. Run `git log --oneline` since the last tag
2. Group commits by type (feat, fix, docs, refactor)
3. Write a CHANGELOG.md entry with the version and date
4. Include breaking changes in a separate section
## Output Format
```
## [1.2.0] - 2026-04-04
### Added
- Feature description (#PR)
### Fixed
- Bug fix description (#PR)
### Breaking Changes
- Description of what changed and migration steps
```
# 3. Use it
/changelog
Best Practices
- One skill, one job — a skill should do one thing well. Don't combine "create page" and "deploy site" in one skill.
- Include examples — show Claude what good output looks like. A concrete example beats a page of rules.
- Version control your skills — commit
.claude/skills/to git so the team shares the same workflows. - Test iteratively — run the skill, see what's wrong, fix the SKILL.md, repeat. Skills improve over time.
- Document arguments — list expected arguments clearly in the SKILL.md so users know what to pass.
- Keep instructions actionable — "Create the file at X with Y content" beats "The file should be good."
Test Yourself
What is a skill and where does it live?
A skill is a SKILL.md file containing reusable instructions for Claude. It lives in .claude/skills/{skill-name}/SKILL.md. You invoke it with /skill-name.
What goes in the references/ directory?
Supporting files the skill needs: templates (HTML skeletons, boilerplate), examples (completed output for reference), checklists (validation rules). The SKILL.md references these with relative paths.
How do you pass arguments to a skill?
Type them after the slash command: /new-page docker overview. Arguments are passed as a string. The SKILL.md defines how to parse them (positional, named, or free-form).
What's the difference between a skill and a CLAUDE.md instruction?
CLAUDE.md instructions are always active — Claude follows them every conversation. Skills are on-demand — only activated when you invoke /skill-name. Use CLAUDE.md for always-on rules, skills for specific workflows.
When should you NOT create a skill?
When the task is one-time (not repeatable), too simple (a single command), or too variable (every invocation needs completely different instructions). Skills are for repeatable workflows with consistent structure.
Interview Questions
How would you design a reusable automation system for an AI coding assistant?
Key design: (1) File-based templates (Markdown) for human readability and version control. (2) Trigger mechanism (slash commands) for easy invocation. (3) Argument passing for parameterization. (4) Reference files for supporting templates/examples. (5) Namespace isolation — each skill in its own directory. (6) Composability — skills can reference other skills or shared references.
What's the trade-off between detailed skill instructions and flexibility?
More detailed instructions = more consistent output but less adaptability to edge cases. Too rigid skills break when requirements vary. Too loose skills produce inconsistent results. The sweet spot: define the structure and rules strictly, but leave content decisions to Claude's judgment. Include examples of good output rather than prescribing every detail.
How do skills compare to CI/CD pipeline templates or GitHub Actions reusable workflows?
Similar concept, different scope. CI/CD templates automate build/deploy processes with deterministic steps. Skills automate creative/cognitive tasks (writing code, creating content, reviewing PRs) with AI judgment. Both use: template files, parameterization, composability, and version control. Skills are more flexible because the AI can adapt to context, while CI/CD must be fully deterministic.