Skills
Model-invoked capabilities loaded contextually when relevant.
Skills are specialized knowledge modules that the agent loads automatically when they're relevant to the current task. Unlike slash commands (user-invoked), skills are model-invoked based on context.
How It Works
Skills provide progressive disclosure of capabilities:
- The agent analyzes the current task
- It identifies which skills are relevant
- Relevant skills are loaded into context
- The agent applies the skill's knowledge and uses its recommended tools
This keeps the agent's context lean while ensuring specialized knowledge is available when needed.
File Location
Skills are stored in subdirectories of .claude/skills/:
.claude/
└── skills/
├── code-review/
│ └── SKILL.md
├── testing-patterns/
│ └── SKILL.md
└── api-design/
└── SKILL.mdEach skill lives in its own directory with a SKILL.md file.
Skill Structure
A skill file contains instructions, recommended tools, and reference materials:
1# Code Review Skill
2
3## When to Use
4Apply this skill when reviewing code for quality, security, or performance.
5
6## Instructions
7
8### Quality Checks
91. Verify consistent naming conventions
102. Check for code duplication
113. Assess function complexity (cyclomatic)
124. Review error handling patterns
13
14### Security Review
151. Check for injection vulnerabilities
162. Verify input validation
173. Review authentication/authorization
184. Check for sensitive data exposure
19
20### Performance Review
211. Identify N+1 queries
222. Check for unnecessary computations
233. Review memory allocation patterns
244. Assess caching opportunities
25
26## Recommended Tools
27- read-file: Examine source code
28- find-files: Locate related files
29- search-files: Find patterns across codebase
30
31## Output Format
32Provide findings as:
33- **Critical**: Must fix before merge
34- **Warning**: Should address soon
35- **Suggestion**: Nice to have improvementsSkill Components
When to Use
Describes the conditions that trigger this skill. Helps the model decide when the skill is relevant.
Instructions
Detailed guidance on how to apply the skill. Include checklists, procedures, and domain knowledge.
Recommended Tools
Which tools to use when applying this skill. Helps the agent choose the right tools for the task.
Output Format
How to structure the skill's output. Ensures consistent, useful results.
Built-in Skill Templates
code-review
Code quality, security, and performance review patterns.
- Tools: read-file, find-files, search-files
- Focus: Quality, security, performance
testing-patterns
Unit, integration, and end-to-end testing best practices.
- Tools: read-file, write-file, run-command
- Focus: Test structure, assertions, mocking
api-design
RESTful API design patterns and conventions.
- Tools: read-file, write-file, web-search
- Focus: Endpoints, validation, documentation
Creating Custom Skills
Example: Database Optimization Skill
1# Database Optimization Skill
2
3## When to Use
4Apply when analyzing or improving database queries and schema.
5
6## Instructions
7
8### Query Analysis
91. Identify slow queries (EXPLAIN ANALYZE)
102. Check for missing indexes
113. Review join patterns
124. Assess query complexity
13
14### Schema Review
151. Verify normalization level
162. Check foreign key constraints
173. Review index coverage
184. Assess data types appropriateness
19
20### Optimization Strategies
211. Add covering indexes
222. Rewrite subqueries as joins
233. Implement query caching
244. Consider denormalization for read-heavy tables
25
26## Recommended Tools
27- database-query: Execute analysis queries
28- read-file: Review migration files
29- write-file: Create optimization scripts
30
31## Output Format
32- Current state: Query/schema analysis
33- Issues found: With severity ratings
34- Recommendations: Prioritized action items
35- Implementation: SQL scripts for fixesSkills vs. Memory
Use Memory for always-relevant context (project structure, standards). Use Skills for task-specific expertise that should only load when needed.
Configuration in Agent Workshop
In the Levers Configuration step, the Skills tab lets you:
- Add from templates - Use pre-built skill templates
- Create custom - Write your own skills
- Configure tools - Specify recommended tools per skill
- Add references - Link to documentation or code
- Enable/disable - Toggle individual skills
Best Practices
Be Specific About Triggers
The "When to Use" section is crucial. Vague triggers lead to skills being loaded unnecessarily or not at all.
Include Actionable Steps
Instructions should be concrete and actionable, not abstract principles.
Match Tools to Tasks
Only list tools that are actually useful for the skill. Don't include tools just because they're available.
Keep Skills Focused
Each skill should cover one domain. Don't create a "do everything" skill.