Creating high-quality agent skills following Claude's official best practices...
Guide for creating agent skills that follow Claude's official best practices.
Concise is Key: The context window is shared. Only add what Claude doesn't already know. Default assumption: Claude is already very smart.
Progressive Disclosure: Skills load in three levels:
Keep SKILL.md small: Target ~200 lines, maximum 500 lines. Move detailed content to reference files aggressively.
Single Responsibility: Each skill does one thing well.
Ask the user to clarify (adapt questions to context):
For clear requests (e.g., "format markdown tables"):
For ambiguous requests (e.g., "handle data", "help with files"):
Red flags requiring extra clarification:
Get clear sense of: purpose, usage examples, triggers, AND scope boundaries.
Before proceeding, verify the skill follows Single Responsibility:
Check naming:
handling-data - too broad, what data? what handling?data-helper - generic, unclear purposetransforming-csv-data - specific operation + data typevalidating-json-schemas - clear single purposeCheck boundaries:
If scope is too broad:
Do NOT proceed to file creation until scope is validated.
Freedom level controls how much latitude Claude has when following the skill:
Unless clearly LOW freedom: Read references/degrees-of-freedom.md and apply the decision framework. Cite the factors (fragility, context-dependency, consistency, error impact) in your justification.
If uncertain after reading the reference, ask the user.
Identify what to include:
Scripts (scripts/): Executable code for deterministic operations
References (references/): Documentation loaded as needed
Assets (assets/): Files used in output (templates, images, fonts)
skill-name/
āāā SKILL.md (required - AI agent instructions)
āāā README.md (optional - human-facing installation and usage guide)
āāā references/ (optional)
āāā tests/
ā āāā scenarios.md (optional - self-evaluation scenarios)
āāā scripts/ (optional)
āāā assets/ (optional)
README.md vs SKILL.md:
README.md, if present, should include:
tests/scenarios.md purpose)Avoid creating: INSTALLATION_GUIDE.md, CHANGELOG.md, or other redundant docs. Use README.md for human-facing documentation.
---
name: skill-name
description: What the skill does and when to use it
---
Naming (use gerund form):
processing-pdfs, analyzing-spreadsheets, managing-databaseshelper, utils, tools, anthropic-*, claude-*Description (third person, include WHAT and WHEN):
Be specific and include key terms. Description is the primary triggering mechanism.
Use imperative form. Keep small (target ~200 lines, max 500). Include only:
For complex multi-step processes, see references/workflows-and-validation.md.
Example pattern:
## Quick start
[Basic usage]
## Advanced features
**Feature A**: See [references/feature-a.md](references/feature-a.md)
**Feature B**: See [references/feature-b.md](references/feature-b.md)
Keep references one level deep. See references/progressive-disclosure.md for patterns.
For files >100 lines, include table of contents at top.
Organize by domain when appropriate:
skill/
āāā SKILL.md
āāā references/
āāā domain_a.md
āāā domain_b.md
Avoid: deeply nested references, duplicate information, generic file names.
Ask the user: "Would you like to create test scenarios for this skill? Test scenarios enable automated evaluation with /evaluating-skills-with-models to measure skill quality across different models (sonnet, opus, haiku)."
If the user agrees, create tests/scenarios.md for self-evaluation:
## Scenario: [Name]
**Difficulty:** Easy | Medium | Hard | Edge-case
**Query:** User request that triggers this skill
**Expected behaviors:**
1. [Action description]
- **Minimum:** What counts as "did it"
- **Quality criteria:** What "did it well" looks like
- **Haiku pitfall:** Common failure mode for smaller models
- **Weight:** 1-5 (importance)
**Output validation:** (optional)
- Pattern: `regex`
- Line count: `< N`
Why this format: Binary pass/fail doesn't differentiate models. Quality-based scoring reveals capability differences.
After completing SKILL.md and references, identify which tools the skill uses:
Bash(git status:*), WebSearch, Skill(other-skill))allowed-tools field to frontmatter if needed---
name: skill-name
description: ...
allowed-tools: "Bash(git status:*) Bash(git diff:*) WebSearch"
---
This field is experimental but helps agents pre-approve tool access.
Important considerations:
Read, Glob are already allowed by default - do not includeEdit, Write are destructive - do not pre-approveBash(git status:*) Bash(git diff:*) Bash(git log:*)Bash(git:*) (too broad, includes destructive operations like git push --force)ā Windows-style paths (scripts\file.py)
ā Too many options without a default
ā Time-sensitive information
ā Inconsistent terminology
ā Deeply nested references
ā Vague instructions
Progressive Disclosure: references/progressive-disclosure.md - Detailed patterns and examples
Degrees of Freedom: references/degrees-of-freedom.md - Guidance on appropriate freedom levels
Workflows and Validation: references/workflows-and-validation.md - Creating workflows with validation and feedback loops