Module 1.3
Skills
What Skills Are
Skills extend what Claude can do by giving it custom instructions it can follow on demand. You write a SKILL.md file, and Claude adds it to its toolkit.
Two ways they activate:
- You invoke it - type
/skill-nameand Claude immediately follows the skill's instructions - Claude invokes it automatically - if your request matches the skill's description, Claude loads and applies it on its own
Custom slash commands (
.claude/commands/) have been merged into skills. They're the same thing. Skills add more features on top.
File Structure
Each skill is a directory with SKILL.md as the required entrypoint:
my-skill/
├── SKILL.md ← main instructions (required)
├── template.md ← template for Claude to fill in
├── examples/
│ └── sample.md ← example output showing expected format
└── scripts/
└── validate.sh ← script Claude can execute
Keep SKILL.md under 500 lines. Move large docs to separate files.
Where Skills Live
| Location | Path | Applies to |
|---|---|---|
| Personal | ~/.claude/skills/<name>/SKILL.md | All your projects |
| Project | .claude/skills/<name>/SKILL.md | This project only |
| Plugin | <plugin>/skills/<name>/SKILL.md | Where plugin is enabled |
| Enterprise | Managed settings | All org users |
When skills share the same name, priority is: enterprise > personal > project.
Anatomy of a SKILL.md
---
name: explain-code
description: Explains code with visual diagrams and analogies. Use when explaining how code works or when the user asks "how does this work?"
---
When explaining code, always include:
1. **Start with an analogy** - compare to something from everyday life
2. **Draw a diagram** - use ASCII art to show flow or structure
3. **Walk through the code** - explain step by step
4. **Highlight a gotcha** - what's a common mistake?Two parts:
- YAML frontmatter (between
---) - tells Claude when and how to use it - Markdown body - the actual instructions Claude follows
All Frontmatter Fields
| Field | Required | Description |
|---|---|---|
name | No | Becomes the /slash-command. Uses directory name if omitted. |
description | Recommended | What it does and when to use it. Claude uses this to decide when to auto-load it. |
argument-hint | No | Hint shown in autocomplete. E.g. [issue-number] |
disable-model-invocation | No | true = only YOU can invoke it. Claude won't auto-trigger it. |
user-invocable | No | false = hidden from / menu. Only Claude can invoke it. |
allowed-tools | No | Tools Claude can use without asking permission when this skill is active. |
model | No | Override the model used when this skill runs. |
context | No | Set to "fork" to run in an isolated subagent. |
agent | No | Which subagent type to use when context: fork is set. |
hooks | No | Hooks scoped to this skill's lifetime only. |
Controlling Who Invokes a Skill
| Frontmatter | You can invoke | Claude auto-invokes |
|---|---|---|
| (default) | ✓ | ✓ |
disable-model-invocation: true | ✓ | ✗ |
user-invocable: false | ✗ | ✓ |
disable-model-invocation: true - use for skills with side effects you control: /deploy, /commit, /send-slack-message.
user-invocable: false - use for background knowledge Claude applies automatically but that isn't meaningful as a slash command.
Passing Arguments
---
name: fix-issue
disable-model-invocation: true
---
Fix GitHub issue $ARGUMENTS following our coding standards./fix-issue 123 → Claude receives "Fix GitHub issue 123 following our coding standards..."
Positional arguments:
Migrate the $0 component from $1 to $2./migrate-component SearchBar React Vue → $0=SearchBar, $1=React, $2=Vue
Dynamic Context Injection
The !`command` syntax runs a shell command before Claude sees anything. Output gets injected into the skill content.
---
name: pr-summary
context: fork
agent: Explore
allowed-tools: Bash(gh *)
---
## Pull request context
- PR diff: !`gh pr diff`
- PR comments: !`gh pr view --comments`
## Your task
Summarize this pull request clearly and concisely.Claude only sees the rendered result with actual PR data - not the commands themselves.
Running Skills in a Subagent
Add context: fork to run in isolation - no access to conversation history, only the skill content as its task.
---
name: deep-research
description: Research a topic thoroughly using codebase exploration
context: fork
agent: Explore
---
Research $ARGUMENTS thoroughly:
1. Find relevant files using Glob and Grep
2. Read and analyze the code
3. Summarize findings with specific file referencesagent options: Explore, Plan, general-purpose, or any custom subagent. Defaults to general-purpose.
Real Examples
/commit - structured git commit
---
name: commit
description: Create a structured git commit message
disable-model-invocation: true
allowed-tools: Bash(git *)
---
Review staged changes and create a commit:
1. Run `git diff --staged`
2. Write message: imperative verb, under 50 chars, explain the why in the body
3. Run `git commit -m "..."`/standup - daily standup from git history
---
name: standup
disable-model-invocation: true
allowed-tools: Bash(git *)
---
Yesterday: !`git log --oneline --since="2 days ago" --until="yesterday" --author="$(git config user.name)"`
Today's staged: !`git diff --staged --stat`
Format as: Yesterday / Today / Blockers/explain - explain code simply
---
name: explain
description: Explain code or a concept simply. Use when user asks "what does this do?"
---
Explain $ARGUMENTS as if to someone who doesn't code:
1. One sentence summary
2. A real-world analogy
3. What problem it solves
4. What would break if it didn't existString Substitutions
| Variable | Description |
|---|---|
$ARGUMENTS | Everything passed after the skill name |
$ARGUMENTS[N] | Specific argument by 0-based index |
$N | Shorthand for $ARGUMENTS[N] |
${CLAUDE_SESSION_ID} | Current session ID |
Power User Tips
/context- check if skills are hitting the context budget limit (descriptions always load; full content loads only on invocation)- Monorepo support -
packages/frontend/.claude/skills/is auto-discovered when working in that package - Restrict skill access - deny
Skillin/permissions, or useSkill(deploy *)to block specific ones ultrathinkin skill content - enables extended thinking mode for that skill
Sources
- Claude Code Skills Documentation (official docs)