Skill v1.0.0
currentAutomated scan100/100version: "1.0.0" name: create-skill description: "Create Claude Code Skills (SKILL.md files). Use when authoring a new skill, when the user asks about SKILL.md structure or skill frontmatter, when packaging reusable workflows or domain knowledge into a forked-context capability. Skills differ from rules (always-loaded) and hooks (event-triggered) by being on-demand." context: fork model: sonnet allowed-tools: Read, Write, Edit, Glob, Grep
Creating Claude Code Skills
Skills are markdown files that teach the agent how to perform specific tasks: code reviews, commit message generation, database querying, doc generation, or any specialized workflow. They live in ~/.claude/skills/<name>/SKILL.md (user-global) or .claude/skills/<name>/SKILL.md (project).
Unlike rules (always loaded) and hooks (event-triggered), skills are invoked on demand — either by the user via the Skill tool, by name in a system prompt, or automatically based on the description's trigger terms.
Before You Begin: Gather Requirements
Determine:
- Purpose: What specific task or workflow does this skill help with?
- Trigger scenarios: When should the agent automatically apply this skill?
- Scope: Personal (
~/.claude/skills/) or project (.claude/skills/)? - Context mode: Forked (isolated context) or main?
- Domain knowledge: What specialized info does the agent need that it doesn't already have?
- Output format: Templates, formats, styles required?
If the user gave verbatim instructions or example output, preserve it word-for-word.
Storage Locations
| Type | Path | Scope | |
|---|---|---|---|
| Personal | ~/.claude/skills/skill-name/ | Available across all your projects | |
| Project | .claude/skills/skill-name/ | Shared with collaborators via version control |
Directory Layout
Skills are stored as directories containing a SKILL.md file:
skill-name/├── SKILL.md # Required - main instructions├── reference.md # Optional - detailed documentation├── examples.md # Optional - usage examples└── scripts/ # Optional - utility scripts├── validate.py└── helper.sh
SKILL.md Frontmatter
Every skill requires YAML frontmatter:
---name: your-skill-namedescription: "Specific description with both WHAT it does and WHEN to use it. Include trigger terms users might say."context: forkmodel: haikuallowed-tools: Read, Write, Edit, Glob, Grep, Bash---
Field Reference
| Field | Required | Values | Purpose | |
|---|---|---|---|---|
name | yes | lowercase-hyphens, ≤64 chars | Unique identifier | |
description | yes | non-empty, ≤1024 chars | Triggers automatic invocation; critical for discovery | |
context | recommended | fork or main | fork = isolated context (most skills); main = inline in main context (rare) | |
model | recommended | haiku, sonnet, opus | Preferred model for the task | |
allowed-tools | recommended | comma-separated tool names | Restricts what the skill can do |
Choosing the Model
| Task Type | Model | |
|---|---|---|
| Classification, fetching, lookup | haiku | |
| Writing, reasoning, code edits | sonnet | |
| Multi-step planning, framework reasoning | opus |
Default to haiku unless the task genuinely needs more capability — token costs add up across invocations.
Choosing the Tools
List only the tools the skill actually needs. Each unused tool in the allow-list is a security and behavior surface area.
Common combinations:
- Read-only research:
WebFetch, WebSearch, Read, Grep, Glob - Documentation writing:
Read, Write, Edit, Glob, Grep - Build validation:
Bash, Read, Glob - Git operations:
Bash, Read, Grep, Glob
Writing Effective Descriptions
The description is critical for auto-invocation. The agent uses it to decide when to apply the skill.
Best Practices
- Write in third person (description is injected into system prompt):
- ✅ "Processes Excel files and generates pivot tables"
- ❌ "I can help you process Excel files"
- Be specific, include trigger terms:
- ✅ "Extract text and tables from PDF files. Use when working with PDFs, forms, or document extraction tasks."
- ❌ "Helps with documents"
- Include WHAT and WHEN:
- WHAT: capabilities offered
- WHEN: specific scenarios that trigger invocation
Description Examples
# PDF extractiondescription: "Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDFs or when the user mentions PDFs, forms, or document extraction."# Commit messagesdescription: "Generate conventional-commit-format messages by analyzing git diffs. Use when the user asks for help writing commit messages or reviewing staged changes."# Code reviewdescription: "Review code for quality, security, and team standards. Use when reviewing PRs, examining code changes, or when the user asks for a code review."
Core Authoring Principles
1. Concise is Key
The context window is shared with conversation history, other skills, and active tasks. Every token competes for space.
Default assumption: The agent is already smart. Only add context it doesn't already have.
Challenge each piece:
- "Does the agent really need this explanation?"
- "Can I assume the agent knows this?"
- "Does this paragraph justify its token cost?"
2. Keep SKILL.md Under 500 Lines
For optimal performance, the main SKILL.md should be concise. Use progressive disclosure for detail.
3. Progressive Disclosure
Put essentials in SKILL.md; detailed reference in separate files the agent reads only when needed.
# PDF Processing## Quick start[Essential instructions]## Additional resources-For complete API details, see [reference.md](reference.md)-For usage examples, see [examples.md](examples.md)
Keep references one level deep — link directly from SKILL.md to reference files.
4. Match Specificity to Task Fragility
| Freedom | When | Example | |
|---|---|---|---|
| High (text instructions) | Multiple valid approaches | Code review guidelines | |
| Medium (templates/pseudocode) | Preferred pattern + variation OK | Report generation | |
| Low (specific scripts) | Fragile, consistency critical | DB migrations |
Common Patterns
Template Pattern
## Report structureUse this template:\`\`\`markdown# [Analysis Title]## Executive Summary[One-paragraph overview]## Key Findings-Finding 1 with supporting data-Finding 2 with supporting data## Recommendations1.Actionable recommendation2.Actionable recommendation\`\`\`
Workflow Pattern
## Process1.**Analyze** — Read input, identify shape2.**Plan** — Decide which output template fits3.**Execute** — Generate output per template4.**Validate** — Re-read output, check against checklist
Conditional Workflow
## Decision tree**New content?** → Follow "Creation workflow" below**Editing existing?** → Follow "Edit workflow" below### Creation workflow1.[steps]### Edit workflow1.[steps]
Feedback Loop
For quality-critical tasks:
## Output validation1.Generate output2.**Validate immediately**: run `scripts/validate.py output.md`3.If validation fails:-Review error-Fix issue-Re-validate4.**Only proceed when validation passes**
Utility Scripts
Pre-made scripts > generated code when:
- Operations are fragile (must be exact)
- Consistency matters across invocations
- Save tokens by not regenerating
## Utility scripts**scripts/analyze.py**: Extract metadata from input\`\`\`bashpython scripts/analyze.py input.json > meta.json\`\`\`**scripts/validate.py**: Check for errors\`\`\`bashpython scripts/validate.py output/# Exits 0 on OK, non-zero with error message on failure\`\`\`
Mark scripts as executable (most common) or read-as-reference (rare).
Anti-Patterns
❌ Too Many Options
"You can use pypdf, or pdfplumber, or PyMuPDF..."
→ Pick a default. Mention alternatives only with clear "use when X" criteria.
❌ Time-Sensitive Info
"Before August 2025, use the old API."
→ Will rot. Use "current pattern" + "deprecated pattern" sections.
❌ Inconsistent Terminology
Pick one term per concept and use it consistently.
❌ Vague Skill Names
- ✅
processing-pdfs,code-review - ❌
helper,utils,tools
❌ Windows-Style Paths
- ✅
scripts/helper.py - ❌
scripts\helper.py
Workflow
Phase 1: Discovery
- Skill purpose + use case
- Scope (personal vs. project)
- Trigger scenarios
- Specific requirements
- Existing examples / patterns
Phase 2: Design
- Skill name (lowercase, hyphens, ≤64 chars)
- Description (specific, third-person, WHAT + WHEN)
- Pick
context(usuallyfork) - Pick
model(haiku unless complexity demands more) - List
allowed-tools(minimal) - Outline main sections
- Identify supporting files / scripts
Phase 3: Implementation
- Create directory:
mkdir -p ~/.claude/skills/<name>/ - Write
SKILL.mdwith frontmatter + body - Create reference files if needed (one level deep)
- Create utility scripts if needed (
chmod +xif executable)
Phase 4: Verification
- [ ]
SKILL.mdunder 500 lines - [ ] Description specific with trigger terms
- [ ] Consistent terminology
- [ ] All file references one level deep
- [ ] Skill discoverable in next session
Complete Example
code-review/├── SKILL.md├── STANDARDS.md└── examples.md
SKILL.md:
---name: code-reviewdescription: "Review code for quality, security, and maintainability per team standards. Use when reviewing pull requests or when the user asks for a code review."context: forkmodel: sonnetallowed-tools: Read, Grep, Glob, Bash---# Code Review## Quick StartWhen reviewing code:1.Run `git diff` to see recent changes2.Check correctness + edge cases3.Verify security best practices4.Assess readability + maintainability5.Confirm test coverage## Review Checklist-[ ] Logic handles edge cases-[ ] No security vulnerabilities-[ ] Follows project style-[ ] Functions appropriately sized-[ ] Error handling comprehensive-[ ] Tests cover changes## Feedback FormatOrganize by priority:-🔴 **Critical**: Must fix before merge-🟡 **Suggestion**: Consider improving-🟢 **Nice to have**: Optional## Additional Resources-For detailed standards: [STANDARDS.md](STANDARDS.md)-For example reviews: [examples.md](examples.md)
Related Skills
[[create-hook]]— for event-triggered automation[[create-rule]]— for always-loaded guidance[[create-subagent]]— for delegating specialized work to an agent[[migrate-to-skills]]— for converting old rules/commands to skill format