Skip to main content

Overview

Skills provide Claude with domain-specific knowledge and workflows. This guide covers everything you need to know to create high-quality skills.

Frontmatter Requirements

Every SKILL.md file must start with YAML frontmatter:

Name Requirements

  • Format: kebab-case only
  • Length: Maximum 64 characters
  • Preferred form: Gerund (verb + -ing)
    • Good: analyzing-contracts, processing-pdfs
    • Avoid: contract-analyzer, pdf-processor
  • Avoid vague names: helper, utils, tools, misc
  • Avoid reserved words: anthropic, claude

Description Requirements

Your description must trigger correctly since skills compete with 100+ others:
The description is critical for skill discovery. Claude uses it to decide when to invoke your skill.
Best practices:
  • Third-person voice: “Analyzes X” not “I help with X”
  • Include triggers: “Use when auditing Solidity” not just “Smart contract tool”
  • Be specific: “Detects reentrancy vulnerabilities” not “Helps with security”
Examples:

Allowed Tools (Optional)

Restrict the skill to only the tools it needs:
Available tools include: Read, Write, Edit, Bash, Grep, Glob, Task, and others.

Required Sections

Every SKILL.md must include these sections:

When to Use

Specify concrete scenarios where the skill applies:
Make triggers concrete and specific. Think about what keywords or patterns should activate your skill.

When NOT to Use

Specify scenarios where another approach is better:
This helps Claude avoid false positive skill invocations.

Security Skills: Rationalizations to Reject

For audit/security skills, also include:
This section helps Claude maintain rigor and avoid common shortcuts that lead to missed findings.

Content Organization

1

Keep SKILL.md under 500 lines

If your skill grows beyond 500 lines, split it into supporting files:
  • references/ - Detailed documentation
  • workflows/ - Step-by-step guides
  • scripts/ - Utility scripts
2

Use progressive disclosure

Start with quick start, then link to details:
3

Keep references one level deep

SKILL.md can link to files, but those files shouldn’t chain to more files:
  • ✅ Good: SKILL.md → file1.md (one level)
  • ❌ Bad: SKILL.md → file1.md → file2.md (chained references)
Directory depth is fine (references/guides/topic.md). The restriction is on reference chains, not nested folders.

Path Handling

Never hardcode absolute paths. Always use {baseDir} for portability.
Good:
Bad:
Rules:
  • Use {baseDir} for paths relative to the skill directory
  • Use forward slashes (/) even on Windows
  • Claude will automatically replace {baseDir} with the actual path at runtime

Python Scripts

When skills include Python scripts with dependencies:
1

Use PEP 723 inline metadata

Declare dependencies in the script header:
2

Use uv run for execution

This enables automatic dependency resolution:
No need for separate pip install or virtual environment setup!
3

Include pyproject.toml

Keep in scripts/ for development tooling (ruff, pytest, etc.):
1

Document system dependencies

List non-Python dependencies in workflows with platform-specific install commands for macOS (brew), Ubuntu (apt-get), and other platforms.

Writing Effective Workflows

Workflows should provide step-by-step guidance for complex tasks:

Scope Boundaries

Match prescriptiveness to task risk:
  • Strict for fragile tasks: Security audits, crypto implementations, compliance checks need rigid step-by-step enforcement
  • Flexible for variable tasks: Code exploration, documentation, refactoring can offer options and judgment calls

Workflow Format

Value-Add: Behavioral Guidance Over Reference Dumps

Skills should provide guidance Claude doesn’t already have:
Don’t paste entire specs. Teach when and how to look things up.
Behavioral guidance over reference dumps:
  • Don’t paste entire specs; teach when and how to look things up
  • Explain WHY, not just WHAT
  • Include trade-offs, decision criteria, judgment calls
  • Document anti-patterns WITH explanations
Example: The DWARF skill doesn’t include the full DWARF spec. Instead, it teaches Claude:
  • How to use dwarfdump, readelf, and pyelftools to look up what it needs
  • Judgment about when each tool is appropriate
  • What patterns indicate problems vs normal behavior

Examples and Concreteness

Make examples concrete with actual input → output:

Decision Criteria and Trade-offs

Help Claude make judgment calls:

Testing Your Skill

Before submitting:
  1. Test triggering: Does the description cause the skill to load at the right times?
  2. Test workflows: Do the step-by-step instructions work as expected?
  3. Test scripts: Do all scripts run successfully with uv run?
  4. Test references: Do all referenced files exist and load correctly?
  5. Test paths: Does {baseDir} resolve correctly across different systems?

Next Steps

Best Practices

Learn Trail of Bits quality standards

Plugin Structure

Understand required directory layout

Examples

See real-world skill examples

Getting Started

Start creating your first skill