Official Guide Anthropic Docs

Write Skills
Claude Actually Uses

Most Skills fail not because they lack content, but because they lack clarity. This guide covers the rules that separate Skills Claude discovers and runs correctly from ones it ignores or misuses.

3 core principles 8 sections 21 checklist items

5 rules that matter most

01 Be concise

Every token in SKILL.md competes with conversation context. Claude is already very smart — only add what it doesn't have.

02 Description = discovery

Claude picks Skills from the description alone. If it's vague, the Skill never runs. Write what + when, in third person.

03 One level deep

Keep all file references one level from SKILL.md. Nested references cause Claude to read files only partially.

04 Add feedback loops

Run validator → fix errors → repeat. This catches mistakes automatically instead of relying on Claude to notice.

05 Test all models

A Skill that works on Opus may fail on Haiku. Test across every model you plan to deploy.

Critical

Core Principles

Concise is key

The context window is a public good. SKILL.md shares it with everything else Claude needs — system prompt, conversation history, other Skills' metadata, and the user's request.

At startup, only the metadata (name and description) from all Skills is pre-loaded. Claude reads SKILL.md only when the Skill becomes relevant. But once loaded, every token competes with conversation context.

Default assumption: Claude is already very smart. Only add context Claude doesn't already have. Challenge each piece: "Does Claude really need this?" · "Can I assume Claude knows this?" · "Does this paragraph justify its token cost?"
Good — ~50 tokens
## Extract PDF text

Use pdfplumber:

```python
import pdfplumber
with pdfplumber.open("file.pdf") as pdf:
    text = pdf.pages[0].extract_text()
```
Bad — ~150 tokens
## Extract PDF text

PDF (Portable Document Format) files
are a common file format that contains
text, images, and other content. To
extract text you'll need a library.
There are many options but pdfplumber
is recommended because it's easy to
use and handles most cases well.
First, install it using pip...

Set appropriate degrees of freedom

Match specificity to the task's fragility and variability. Think of Claude as a robot on a path: a narrow bridge with cliffs needs exact guardrails; an open field just needs a general direction.

High freedom Multiple approaches valid, context-driven
## Code review process
1. Analyze structure and organization
2. Check for bugs and edge cases
3. Suggest readability improvements
4. Verify project conventions
Medium freedom Preferred pattern, some variation OK
## Generate report
Use this template and customize as needed:

```python
def generate_report(data, format="markdown", include_charts=True):
    # Process data
    # Generate output in specified format
```
Low freedom Fragile operations, exact sequence required
## Database migration
Run exactly this script:

```bash
python scripts/migrate.py --verify --backup
```

Do not modify the command or add flags.

Test with all models you plan to use

Skills act as additions to models — effectiveness depends on the underlying model. A Skill that over-explains wastes tokens on Opus; one that under-explains fails on Haiku.

Claude Haiku

Fast, economical. Does the Skill provide enough guidance?

Claude Sonnet

Balanced. Is the Skill clear and efficient?

Claude Opus

Powerful. Does the Skill avoid over-explaining?

Critical

Skill Structure

YAML Frontmatter requirements
  • name — max 64 chars, lowercase letters/numbers/hyphens only. No XML tags. No reserved words ("anthropic", "claude").
  • description — non-empty, max 1024 chars, no XML tags. Describes what the Skill does and when to use it.

Naming conventions

Use gerund form (verb + -ing) for Skill names — this clearly describes the activity the Skill provides.

✓ Good (gerund)

  • processing-pdfs
  • analyzing-spreadsheets
  • managing-databases
  • testing-code
  • writing-documentation

✗ Avoid

  • helper — too vague
  • utils — too generic
  • documents — not descriptive
  • anthropic-helper — reserved word
  • claude-tools — reserved word

Writing effective descriptions

Always write in third person. The description is injected into the system prompt — inconsistent POV causes discovery problems.
  • ✓ "Processes Excel files and generates reports"
  • ✗ "I can help you process Excel files"
  • ✗ "You can use this to process Excel files"

Include what the Skill does and when to use it. Claude uses the description to choose from potentially 100+ available Skills.

PDF Processing

description: Extract text and tables from PDF files, fill forms,
merge documents. Use when working with PDF files or when the
user mentions PDFs, forms, or document extraction.

Excel Analysis

description: Analyze Excel spreadsheets, create pivot tables,
generate charts. Use when analyzing Excel files, spreadsheets,
tabular data, or .xlsx files.

Git Commit Helper

description: Generate descriptive commit messages by analyzing
git diffs. Use when the user asks for help writing commit
messages or reviewing staged changes.
Avoid vague descriptions like "Helps with documents", "Processes data", or "Does stuff with files." These won't trigger the Skill reliably.
Best Practice

Progressive Disclosure

SKILL.md is a table of contents that points Claude to detailed materials as needed. Keep SKILL.md body under 500 lines. Split content into separate files when approaching this limit.

# Skill directory structure

pdf/

├── SKILL.md # Main instructions (loaded when triggered)

├── FORMS.md # Form-filling guide (loaded as needed)

├── reference.md # API reference (loaded as needed)

├── examples.md # Usage examples (loaded as needed)

└── scripts/

├── analyze_form.py # Executed, not loaded into context

└── fill_form.py

Pattern: High-level guide with references

## Advanced features
- **Form filling**: See [FORMS.md](FORMS.md) for complete guide
- **API reference**: See [REFERENCE.md](REFERENCE.md)
- **Examples**: See [EXAMPLES.md](EXAMPLES.md)

Claude loads FORMS.md or REFERENCE.md only when needed — zero token cost otherwise.

Pattern: Domain-specific organization

For Skills with multiple domains, organize by domain so Claude only loads what's relevant to the current task.

bigquery-skill/
├── SKILL.md
└── reference/
    ├── finance.md   # revenue, billing metrics
    ├── sales.md     # opportunities, pipeline
    └── product.md   # API usage, features
Keep all references one level deep from SKILL.md. Nested references (SKILL.md → advanced.md → details.md) cause Claude to partially read files using head -100, resulting in incomplete information.

Table of contents for long reference files

For reference files longer than 100 lines, add a TOC at the top so Claude can see the full scope even when previewing.

# API Reference

## Contents
- Authentication and setup
- Core methods (create, read, update, delete)
- Error handling patterns

## Authentication and setup
...
Best Practice

Workflows & Feedback Loops

Use checklists for complex tasks

For complex operations, provide a checklist Claude can copy into its response and check off as it progresses.

Example: Research synthesis

## Research synthesis workflow

Copy this checklist and track progress:

```
Research Progress:
- [ ] Step 1: Read all source documents
- [ ] Step 2: Identify key themes
- [ ] Step 3: Cross-reference claims
- [ ] Step 4: Create structured summary
- [ ] Step 5: Verify citations
```

Example: PDF form filling

## PDF form filling workflow

Task Progress:
- [ ] Step 1: Analyze form (run analyze_form.py)
- [ ] Step 2: Create field mapping (edit fields.json)
- [ ] Step 3: Validate mapping (run validate_fields.py)
- [ ] Step 4: Fill the form (run fill_form.py)
- [ ] Step 5: Verify output (run verify_output.py)

Implement feedback loops

The run validator → fix errors → repeat pattern greatly improves output quality for document editing, code generation, or any structured output.

## Document editing process

1. Make your edits to `word/document.xml`
2. **Validate immediately**: `python ooxml/scripts/validate.py unpacked_dir/`
3. If validation fails:
   - Review the error message carefully
   - Fix issues in the XML
   - Run validation again
4. **Only proceed when validation passes**
5. Rebuild: `python ooxml/scripts/pack.py unpacked_dir/ output.docx`
Best Practice

Content Guidelines

Avoid time-sensitive information

✗ Will become wrong

If before August 2025, use old API.
After August 2025, use new API.

✓ Use "old patterns"

## Current method
Use v2: `api.example.com/v2/messages`

## Old patterns
<details>
<summary>Legacy v1 (deprecated)</summary>
...
</details>

Use consistent terminology

✓ Consistent

  • Always "API endpoint"
  • Always "field"
  • Always "extract"

✗ Inconsistent

  • "API endpoint" / "URL" / "route" / "path"
  • "field" / "box" / "element" / "control"
  • "extract" / "pull" / "get" / "retrieve"
Best Practice

Common Patterns

Template pattern

Provide templates for output format. Match strictness level to requirements.

## Report structure

ALWAYS use this exact template:

```markdown
# [Analysis Title]

## Executive summary
[One-paragraph overview of key findings]

## Key findings
- Finding 1 with supporting data

## Recommendations
1. Specific actionable recommendation
```

Examples pattern

For Skills where output quality depends on seeing examples, provide input/output pairs — just like prompting.

## Commit message format

**Example 1:**
Input: Added user authentication with JWT tokens
Output:
```
feat(auth): implement JWT-based authentication

Add login endpoint and token validation middleware
```

**Example 2:**
Input: Fixed bug where dates displayed incorrectly
Output:
```
fix(reports): correct date formatting in timezone conversion
```

Conditional workflow pattern

## Document modification workflow

1. Determine the modification type:

   **Creating new content?** → Follow "Creation workflow"
   **Editing existing content?** → Follow "Editing workflow"

2. Creation workflow:
   - Use docx-js library
   - Build document from scratch

3. Editing workflow:
   - Unpack existing document
   - Modify XML directly
   - Validate after each change
If workflows become large, push them into separate files and tell Claude to read the appropriate file based on the task type.
Best Practice

Evaluation & Iteration

Build evaluations first

Create evaluations before writing extensive documentation. This ensures your Skill solves real problems rather than documenting imagined ones.

1

Identify gaps

Run Claude on representative tasks without a Skill. Document specific failures or missing context.

2

Create evaluations

Build 3 scenarios that test these gaps.

3

Establish baseline

Measure Claude's performance without the Skill.

4

Write minimal instructions

Create just enough content to address the gaps and pass evaluations.

5

Iterate

Execute evaluations, compare against baseline, and refine.

Develop Skills iteratively with Claude

Use Claude A to create and refine the Skill, and Claude B (fresh instance) to test it in real tasks.

Claude models understand the Skill format natively. Simply ask Claude to create a Skill and it generates properly structured SKILL.md content.

Claude A — The Expert

  • Helps design and refine the Skill
  • Identifies what to include / remove
  • Organizes information architecture
  • Reviews for conciseness

Claude B — The Tester

  • Fresh instance with Skill loaded
  • Performs real tasks using the Skill
  • Reveals gaps through actual usage
  • Confirms what's working
Avoid These

Anti-patterns

✗ Windows-style paths

Always use forward slashes — Unix-style paths work across all platforms.

✓ Good

scripts/helper.py
reference/guide.md

✗ Avoid

scripts\helper.py
reference\guide.md

✗ Too many options

Don't present multiple approaches unless necessary. Provide a default with an escape hatch.

✗ Confusing

"You can use pypdf, or pdfplumber, or PyMuPDF, or pdf2image, or..."

✓ Clear default

"Use pdfplumber. For scanned PDFs requiring OCR, use pdf2image + pytesseract instead."

✗ Assuming tools are installed

# Bad
"Use the pdf library to process the file."

# Good
"Install required package: `pip install pypdf`

Then use it:
```python
from pypdf import PdfReader
reader = PdfReader("file.pdf")
```"
Advanced

Skills with Executable Code

Solve, don't punt

Handle error conditions in scripts rather than letting Claude figure them out.

✓ Handle errors explicitly

def process_file(path):
    try:
        with open(path) as f:
            return f.read()
    except FileNotFoundError:
        with open(path, "w") as f:
            f.write("")
        return ""

✗ Punt to Claude

def process_file(path):
    # Just fail and let
    # Claude figure it out
    return open(path).read()

No magic numbers

✓ Self-documenting

# HTTP requests typically
# complete in 30 seconds
REQUEST_TIMEOUT = 30

# Three retries balances
# reliability vs speed
MAX_RETRIES = 3

✗ Magic numbers

TIMEOUT = 47  # Why 47?
RETRIES = 5   # Why 5?

Document utility scripts clearly

Make clear whether Claude should execute or read the script. Pre-made scripts are more reliable than generated code.

## Utility scripts

**analyze_form.py** — Extract all form fields from PDF
```bash
python scripts/analyze_form.py input.pdf > fields.json
```

**validate_boxes.py** — Check for overlapping bounding boxes
```bash
python scripts/validate_boxes.py fields.json
# Returns: "OK" or lists conflicts
```

MCP tool references

Always use fully qualified tool names to avoid "tool not found" errors.

Format: ServerName:tool_name

Use BigQuery:bigquery_schema to retrieve table schemas.
Use GitHub:create_issue to create issues.

Package dependencies

claude.ai

Can install from npm, PyPI, and GitHub repos

Claude API

No network access, no runtime package installation

List required packages in SKILL.md and verify they're available in the code execution tool documentation.

Critical

Checklist

Before sharing a Skill, verify all of the following:

Core quality

  • Description is specific and includes key terms
  • Description includes what and when
  • Written in third person
  • SKILL.md body is under 500 lines
  • Additional details in separate files
  • No time-sensitive information
  • Consistent terminology throughout
  • File references are one level deep
  • Progressive disclosure used appropriately
  • Workflows have clear steps

Code & scripts

  • Scripts solve problems, don't punt to Claude
  • Error handling is explicit and helpful
  • No magic numbers (all values justified)
  • Required packages listed and verified
  • No Windows-style paths (forward slashes only)
  • Validation steps for critical operations
  • Feedback loops for quality-critical tasks

Testing

  • At least 3 evaluations created
  • Tested with Haiku, Sonnet, and Opus
  • Tested with real usage scenarios
  • Team feedback incorporated

Ready to build your first Skill?

Browse the 169 skills in this collection as reference, or install them to your agent and start prompting.