This skill will be invoked when you want to create or improve a Claude Code skill. You may skip sections if you don't consider them necessary.
Process
When building a new skill, work through these steps with the user:
Gather requirements — ask the user:
- What task or domain does the skill cover?
- What specific use cases should it handle?
- Does it need executable scripts, or just instructions?
- Any reference materials to include?
Draft the skill — create:
SKILL.md with concise instructions
- Additional reference files if content would exceed 500 lines (see Performance Best Practices)
- Utility scripts if deterministic operations are needed (see Write Effective Skill Content)
Review with the user — present the draft and ask:
- Does this cover your use cases?
- Anything missing or unclear?
- Should any section be more or less detailed?
Then validate against the Checklist for Good Skills below before finalizing.
Skill File Structure
Every skill needs a SKILL.md file with two parts:
- YAML frontmatter (between
--- markers) — tells Claude when/how to use the skill
- Markdown content — instructions Claude follows when the skill runs
Skills live in directories: .claude/skills/<skill-name>/SKILL.md
Required and Recommended Frontmatter
---
name: my-skill
description: What this skill does. Include key use case first — Claude uses this to decide when to apply the skill.
---
Critical fields:
name (optional) — Skill identifier. Lowercase letters, numbers, hyphens only. Max 64 chars. Defaults to directory name.
description (recommended) — What it does + when to use it. Claude uses this to decide whether to load the skill. Combined with when_to_use, capped at 1,536 characters. Put key use case FIRST.
Control Who Invokes the Skill
disable-model-invocation: true — Only you can invoke it (use for workflows with side effects: /commit, /deploy, /send-slack-message)
user-invocable: false — Only Claude can invoke it (use for background knowledge users shouldn't run directly)
---
name: deploy
description: Deploy the application to production
disable-model-invocation: true
---
Advanced Frontmatter Fields
Execution context:
context: fork — Run in isolated subagent (forked context, doesn't access conversation history)
agent: Explore — Which subagent type (Explore, Plan, general-purpose, or custom)
allowed-tools: Bash(git *) Read — Pre-approve tools for this skill without permission prompts
Model and performance:
model: claude-opus-4-7 — Override model for this skill
effort: high — Override effort level (low, medium, high, xhigh, max)
Content and arguments:
when_to_use: "Additional trigger phrases or examples" — Appended to description (counts toward 1,536 char cap)
argument-hint: "[issue-number]" — Hint for autocomplete
arguments: [issue, branch] — Named arguments for $name substitution in content
Conditional activation:
paths: "src/**/*.ts,*.js" — Glob patterns. Skill only auto-loads when working with matching files.
Shell and hooks:
shell: bash — bash (default) or powershell
hooks: {...} — Lifecycle hooks scoped to this skill
Write Effective Skill Content
Keep it concise — skill content stays in context across turns, so every line is a token cost.
Types of content:
Reference content (runs inline) — Conventions, patterns, domain knowledge
---
name: api-conventions
description: API design patterns for this codebase
---
When writing API endpoints:
- Use RESTful naming conventions
- Return consistent error formats
Task content (explicit instructions) — Steps for a specific action. Often paired with disable-model-invocation: true
---
name: commit
description: Stage and commit the current changes
disable-model-invocation: true
---
1. Stage all modified files
2. Write a conventional commit message
3. Verify the commit
Performance Best Practices
Description optimization:
- Put key use case FIRST — combined description +
when_to_use capped at 1,536 chars
- Claude uses descriptions to decide when to load skills
- Real-world testing: 20% activation baseline → 50% with optimized description → 90% with examples
Character budget:
- Skill descriptions consume 1% of context window dynamically (fallback: 8,000 chars)
- Set
SLASH_COMMAND_TOOL_CHAR_BUDGET environment variable to raise limit
- Use
skillOverrides in settings to mark low-priority skills as "name-only" to free budget
File structure:
Advanced Patterns
Dynamic context injection — Run shell commands before Claude sees the prompt:
---
name: pr-summary
description: Summarize a pull request
context: fork
agent: Explore
allowed-tools: Bash(gh *)
---
## PR Context
- Diff: !`gh pr diff`
- Comments: !`gh pr view --comments`
The !`<command>` executes immediately, output replaces the placeholder.
String substitutions in skill content:
$ARGUMENTS — All arguments passed to the skill
$0, $1, etc. or $ARGUMENTS[0] — Specific argument by position
$name — Named argument (declared in arguments field)
${CLAUDE_SESSION_ID} — Current session ID
${CLAUDE_SKILL_DIR} — Directory containing SKILL.md
Example:
---
name: fix-issue
description: Fix a GitHub issue
disable-model-invocation: true
---
Fix GitHub issue $ARGUMENTS following our coding standards.
Running /fix-issue 123 renders as "Fix GitHub issue 123..."
Skill Lifecycle
- When invoked,
SKILL.md content enters conversation as a message and stays for the session
- Claude Code doesn't re-read the skill file on later turns — write standing instructions
- During auto-compaction, skills are re-attached (first 5,000 tokens of each)
- If skill stops influencing behavior after first response, strengthen the description/instructions
Checklist for Good Skills
- ✅ Description is specific and includes use case (key phrase first)
- ✅ Frontmatter declares whether Claude or you invokes it
- ✅ Content is concise (under 500 lines in SKILL.md)
- ✅ Reference material in separate files with links
- ✅ Arguments documented with examples if applicable
- ✅ For task skills:
disable-model-invocation: true if user-controlled
- ✅ For knowledge skills:
user-invocable: false if Claude-only
- ✅ Supporting files organized (templates, examples, scripts)
- ✅ Shell commands injected with
!`command` when live data needed
Resources
1---2name: skill-m3description: Create well-structured Claude Code skills following official best practices. Use when building new skills, improving existing ones, or understanding skill architecture. Covers frontmatter, invocation control, and performance optimization.4---56This skill will be invoked when you want to create or improve a Claude Code skill. You may skip sections if you don't consider them necessary.78## Process910When building a new skill, work through these steps with the user:11121. **Gather requirements** — ask the user:13 - What task or domain does the skill cover?14 - What specific use cases should it handle?15 - Does it need executable scripts, or just instructions?16 - Any reference materials to include?17182. **Draft the skill** — create:19 - `SKILL.md` with concise instructions20 - Additional reference files if content would exceed 500 lines (see *Performance Best Practices*)21 - Utility scripts if deterministic operations are needed (see *Write Effective Skill Content*)22233. **Review with the user** — present the draft and ask:24 - Does this cover your use cases?25 - Anything missing or unclear?26 - Should any section be more or less detailed?2728 Then validate against the *Checklist for Good Skills* below before finalizing.2930## Skill File Structure3132Every skill needs a `SKILL.md` file with two parts:331. **YAML frontmatter** (between `---` markers) — tells Claude when/how to use the skill342. **Markdown content** — instructions Claude follows when the skill runs3536Skills live in directories: `.claude/skills/<skill-name>/SKILL.md`3738## Required and Recommended Frontmatter3940```yaml41---42name: my-skill43description: What this skill does. Include key use case first — Claude uses this to decide when to apply the skill.44---45```4647**Critical fields:**48- `name` (optional) — Skill identifier. Lowercase letters, numbers, hyphens only. Max 64 chars. Defaults to directory name.49- `description` (recommended) — What it does + when to use it. Claude uses this to decide whether to load the skill. Combined with `when_to_use`, capped at 1,536 characters. Put key use case FIRST.5051## Control Who Invokes the Skill5253- `disable-model-invocation: true` — Only you can invoke it (use for workflows with side effects: `/commit`, `/deploy`, `/send-slack-message`)54- `user-invocable: false` — Only Claude can invoke it (use for background knowledge users shouldn't run directly)5556```yaml57---58name: deploy59description: Deploy the application to production60disable-model-invocation: true61---62```6364## Advanced Frontmatter Fields6566**Execution context:**67- `context: fork` — Run in isolated subagent (forked context, doesn't access conversation history)68- `agent: Explore` — Which subagent type (Explore, Plan, general-purpose, or custom)69- `allowed-tools: Bash(git *) Read` — Pre-approve tools for this skill without permission prompts7071**Model and performance:**72- `model: claude-opus-4-7` — Override model for this skill73- `effort: high` — Override effort level (low, medium, high, xhigh, max)7475**Content and arguments:**76- `when_to_use: "Additional trigger phrases or examples"` — Appended to description (counts toward 1,536 char cap)77- `argument-hint: "[issue-number]"` — Hint for autocomplete78- `arguments: [issue, branch]` — Named arguments for `$name` substitution in content7980**Conditional activation:**81- `paths: "src/**/*.ts,*.js"` — Glob patterns. Skill only auto-loads when working with matching files.8283**Shell and hooks:**84- `shell: bash` — bash (default) or powershell85- `hooks: {...}` — Lifecycle hooks scoped to this skill8687## Write Effective Skill Content8889Keep it concise — skill content stays in context across turns, so every line is a token cost.9091**Types of content:**92931. **Reference content** (runs inline) — Conventions, patterns, domain knowledge94 ```yaml95 ---96 name: api-conventions97 description: API design patterns for this codebase98 ---99 100 When writing API endpoints:101 - Use RESTful naming conventions102 - Return consistent error formats103 ```1041052. **Task content** (explicit instructions) — Steps for a specific action. Often paired with `disable-model-invocation: true`106 ```yaml107 ---108 name: commit109 description: Stage and commit the current changes110 disable-model-invocation: true111 ---112 113 1. Stage all modified files114 2. Write a conventional commit message115 3. Verify the commit116 ```117118## Performance Best Practices119120**Description optimization:**121- Put key use case FIRST — combined description + `when_to_use` capped at 1,536 chars122- Claude uses descriptions to decide when to load skills123- Real-world testing: 20% activation baseline → 50% with optimized description → 90% with examples124125**Character budget:**126- Skill descriptions consume 1% of context window dynamically (fallback: 8,000 chars)127- Set `SLASH_COMMAND_TOOL_CHAR_BUDGET` environment variable to raise limit128- Use `skillOverrides` in settings to mark low-priority skills as `"name-only"` to free budget129130**File structure:**131- Keep `SKILL.md` under 500 lines132- Move detailed reference material to separate files and reference them:133 ```markdown134 For complete API details, see [reference.md](reference.md)135 For usage examples, see [examples.md](examples.md)136 ```137138## Advanced Patterns139140**Dynamic context injection** — Run shell commands before Claude sees the prompt:141```yaml142---143name: pr-summary144description: Summarize a pull request145context: fork146agent: Explore147allowed-tools: Bash(gh *)148---149150## PR Context151- Diff: !`gh pr diff`152- Comments: !`gh pr view --comments`153```154155The `` !`<command>` `` executes immediately, output replaces the placeholder.156157**String substitutions** in skill content:158- `$ARGUMENTS` — All arguments passed to the skill159- `$0`, `$1`, etc. or `$ARGUMENTS[0]` — Specific argument by position160- `$name` — Named argument (declared in `arguments` field)161- `${CLAUDE_SESSION_ID}` — Current session ID162- `${CLAUDE_SKILL_DIR}` — Directory containing SKILL.md163164Example:165```yaml166---167name: fix-issue168description: Fix a GitHub issue169disable-model-invocation: true170---171172Fix GitHub issue $ARGUMENTS following our coding standards.173```174175Running `/fix-issue 123` renders as "Fix GitHub issue 123..."176177## Skill Lifecycle178179- When invoked, `SKILL.md` content enters conversation as a message and stays for the session180- Claude Code doesn't re-read the skill file on later turns — write standing instructions181- During [auto-compaction](https://code.claude.com/docs/en/how-claude-code-works#when-context-fills-up), skills are re-attached (first 5,000 tokens of each)182- If skill stops influencing behavior after first response, strengthen the description/instructions183184## Checklist for Good Skills185186- ✅ Description is specific and includes use case (key phrase first)187- ✅ Frontmatter declares whether Claude or you invokes it188- ✅ Content is concise (under 500 lines in SKILL.md)189- ✅ Reference material in separate files with links190- ✅ Arguments documented with examples if applicable191- ✅ For task skills: `disable-model-invocation: true` if user-controlled192- ✅ For knowledge skills: `user-invocable: false` if Claude-only193- ✅ Supporting files organized (templates, examples, scripts)194- ✅ Shell commands injected with `` !`command` `` when live data needed195196## Resources197198- [Official Claude Code Skills Docs](https://code.claude.com/docs/en/skills)199- [Agent Skills Overview](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview)