Files

375 lines
7.7 KiB
Markdown
Raw Permalink Normal View History

2025-10-17 10:32:29 -05:00
---
name: Skill Creator
2025-10-28 12:48:17 -05:00
description: Guide for creating effective Claude Agent Skills with best practices, structure guidelines, and progressive disclosure principles. Use PROACTIVELY BEFORE starting skill creation to review best practices, DURING skill structuring to optimize content organization, AFTER completing a skill draft to validate triggers and structure, or when users mention "create a skill", "skill not working", or "skill.md". NOT for using existing skills.
2025-10-17 10:32:29 -05:00
---
# Skill Creation Best Practices
## When to Use This Skill
Use this skill when:
- Creating a new Agent Skill from scratch
- Improving or refactoring an existing skill
2025-10-28 12:48:17 -05:00
- Debugging why a skill isn't triggering
2025-10-17 10:32:29 -05:00
- Optimizing skill structure for token efficiency
2025-10-28 12:48:17 -05:00
- Before, during, and after skill creation
2025-10-17 10:32:29 -05:00
## Core Principle: Progressive Disclosure
2025-10-28 12:48:17 -05:00
**The fundamental design pattern for Agent Skills.**
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
### Three Layers
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
1. **Metadata** (Always Loaded ~100 tokens)
- YAML frontmatter: `name` and `description`
- Triggers skill activation
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
2. **Instructions** (Triggered ~800-1000 tokens)
- Main SKILL.md content
- Workflows and guidance
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
3. **Resources** (On-Demand)
- Additional files loaded when needed
- Examples, reference docs, scripts
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
## Skill Structure Requirements
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
### Mandatory: SKILL.md
2025-10-17 10:32:29 -05:00
```yaml
---
2025-10-28 12:48:17 -05:00
name: Your Skill Name # Max 64 chars
description: What it does and when to use it # Max 1024 chars
2025-10-17 10:32:29 -05:00
---
```
2025-10-28 12:48:17 -05:00
**Critical**: The description determines when Claude triggers the skill.
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
### Optional: Additional Files
2025-10-17 10:32:29 -05:00
```
my-skill/
2025-10-28 12:48:17 -05:00
├── SKILL.md # Required entry point
├── examples.md # Working code samples
├── reference.md # Deep API docs
└── workflows/
├── beginner.md
└── advanced.md
2025-10-17 10:32:29 -05:00
```
## Writing Effective Descriptions
2025-10-28 12:48:17 -05:00
The `description` is your trigger mechanism.
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
### Template
```
[Action] [domain/task] [with capabilities].
Use when [trigger scenario]. PROACTIVELY when [context].
```
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
### Examples
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
**✓ Good**:
```yaml
description: Create and analyze Excel spreadsheets with formulas, formatting, and pivot tables. Use when building reports or data analysis.
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
description: Debug Swift applications using LLDB for crashes, memory issues, and runtime errors. Use PROACTIVELY when encountering Swift bugs.
2025-10-17 10:32:29 -05:00
```
2025-10-28 12:48:17 -05:00
**✗ Poor**:
```yaml
description: Helps with coding
description: Python utilities
description: Security checker
```
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
## Essential SKILL.md Structure
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
### 1. When to Use This Skill
2025-10-17 10:32:29 -05:00
```markdown
## When to Use This Skill
Use this skill when:
- [Primary scenario]
- [Secondary scenario]
Do NOT use this skill for:
2025-10-28 12:48:17 -05:00
- [Common confusion]
- [Different tool]
2025-10-17 10:32:29 -05:00
```
2025-10-28 12:48:17 -05:00
### 2. Quick Start
2025-10-17 10:32:29 -05:00
```markdown
## Quick Start
2025-10-28 12:48:17 -05:00
Minimal working example:
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
```[language]
[code]
2025-10-17 10:32:29 -05:00
```
2025-10-28 12:48:17 -05:00
**Result**: [What this achieves]
```
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
### 3. Core Workflows
2025-10-17 10:32:29 -05:00
```markdown
2025-10-28 12:48:17 -05:00
## Core Workflows
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
### Workflow 1: [Name]
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
1. [Step]
2. [Step]
3. [Step]
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
**Example**:
```[language]
[code]
```
2025-10-17 10:32:29 -05:00
```
2025-10-28 12:48:17 -05:00
### 4. Additional Resources
2025-10-17 10:32:29 -05:00
```markdown
2025-10-28 12:48:17 -05:00
## Additional Resources
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
**Need more?**
- [Examples](examples.md) - Working code samples
- [Reference](reference.md) - API documentation
- [Advanced Workflows](workflows/advanced.md)
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
💡 **Tip**: These load only when referenced.
2025-10-17 10:32:29 -05:00
```
2025-10-28 12:48:17 -05:00
## Token Optimization
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
### Target Sizes
- SKILL.md: 800-1000 tokens (~200-250 lines)
- Supplementary files: As needed
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
### When to Split
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
**Keep in SKILL.md**:
- Needed 80%+ of time
- Under 1000 tokens
- Sequential steps
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
**Move to separate file**:
- Mutually exclusive content
- Reference material
- Advanced/edge cases
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
### Compression Techniques
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
1. **Bullet points > Paragraphs** (50% more efficient)
2. **Code examples > Prose** (show don't tell)
3. **References > Embedding** (load on-demand)
4. **Concrete > Abstract** (examples beat theory)
2025-10-17 10:32:29 -05:00
## Development Workflow
2025-10-28 12:48:17 -05:00
### 1. Identify Need
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
Don't guess - observe:
2025-10-17 10:32:29 -05:00
1. Run Claude on representative tasks
2025-10-28 12:48:17 -05:00
2. Find repeated questions or struggles
3. Capture successful patterns
4. Codify into skill
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
### 2. Start Minimal
```yaml
---
name: My Skill
description: [Specific, clear trigger description]
---
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
## When to Use This Skill
[Clear scenarios]
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
## Quick Start
[One minimal example]
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
## Core Workflow
[3-5 essential steps]
```
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
### 3. Test Triggering
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
**Positive tests** (should activate):
- "Create X using Y"
- "[Domain-specific request]"
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
**Negative tests** (should NOT activate):
- "[Related but different domain]"
- "[Different tool's purpose]"
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
### 4. Grow Organically
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
Add only when needed:
- More examples from actual usage
- Advanced workflows when requested
- Reference docs when API is complex
- Scripts for repeated commands
2025-10-17 10:32:29 -05:00
## Common Patterns by Domain
### Code Development Skills
```markdown
---
2025-10-28 12:48:17 -05:00
name: [Framework] [Pattern] Guide
description: [Action] [framework] applications following [pattern]. Use when building [type] with [requirements].
2025-10-17 10:32:29 -05:00
---
## When to Use This Skill
2025-10-28 12:48:17 -05:00
[Specific project types]
2025-10-17 10:32:29 -05:00
## Project Structure
2025-10-28 12:48:17 -05:00
[Standard layout]
2025-10-17 10:32:29 -05:00
## Core Workflows
2025-10-28 12:48:17 -05:00
### Create [Component]
[Steps]
2025-10-17 10:32:29 -05:00
## Testing Strategy
2025-10-28 12:48:17 -05:00
[How to test]
2025-10-17 10:32:29 -05:00
```
2025-10-28 12:48:17 -05:00
### Workflow Skills
2025-10-17 10:32:29 -05:00
```markdown
---
name: [Task] Workflow
description: [Action] for [domain] following [methodology]. Use when [scenario].
---
## Prerequisites
2025-10-28 12:48:17 -05:00
[What's needed]
2025-10-17 10:32:29 -05:00
## Step-by-Step Process
### Phase 1: [Name]
2025-10-28 12:48:17 -05:00
[Steps]
2025-10-17 10:32:29 -05:00
## Quality Checklist
2025-10-28 12:48:17 -05:00
- [ ] [Verification]
2025-10-17 10:32:29 -05:00
```
2025-10-28 12:48:17 -05:00
## Debugging Skills
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
### Skill Doesn't Trigger
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
**Fix description**:
```yaml
# ❌ Too vague
description: Python development helpers
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
# ✓ Specific with triggers
description: Create Python projects using Hatch and Hatchling for dependency management. Use when initializing new Python packages or configuring build systems.
2025-10-17 10:32:29 -05:00
```
2025-10-28 12:48:17 -05:00
### Skill Triggers Too Often
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
**Add negatives**:
```markdown
## When to Use This Skill
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
Use when:
- [Specific scenario]
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
Do NOT use for:
- [Broader scenario that should use different skill]
```
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
### Content Doesn't Load
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
**Check references**:
- Verify file paths are correct
- Ensure .md files exist in skill directory
- Use relative paths from skill root
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
## Skill Checklist
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
Before finalizing:
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
- [ ] Name under 64 characters
- [ ] Description under 1024 characters, includes triggers
- [ ] SKILL.md has YAML frontmatter
- [ ] "When to Use This Skill" section present
- [ ] At least one concrete example
- [ ] No sensitive information
- [ ] File references work
- [ ] Tested positive trigger scenarios
- [ ] Tested negative scenarios (doesn't over-trigger)
- [ ] Size under 1000 tokens for SKILL.md
2025-10-17 10:32:29 -05:00
## Quick Start Template
```markdown
---
2025-10-28 12:48:17 -05:00
name: [Skill Name]
description: [Action] [domain] [with capabilities]. Use when [scenario]. PROACTIVELY when [context].
2025-10-17 10:32:29 -05:00
---
# [Skill Name]
## When to Use This Skill
Use this skill when:
2025-10-28 12:48:17 -05:00
- [Primary scenario]
- [Secondary scenario]
2025-10-17 10:32:29 -05:00
Do NOT use this skill for:
2025-10-28 12:48:17 -05:00
- [Common confusion]
2025-10-17 10:32:29 -05:00
## Quick Start
[Minimal working example]
## Core Workflows
### Workflow 1: [Name]
2025-10-28 12:48:17 -05:00
1. [Step]
2. [Step]
3. [Step]
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
**Example**:
2025-10-17 10:32:29 -05:00
```
2025-10-28 12:48:17 -05:00
[code]
2025-10-17 10:32:29 -05:00
```
2025-10-28 12:48:17 -05:00
**Result**: [What this achieves]
2025-10-17 10:32:29 -05:00
## Common Pitfalls
### Issue: [Problem]
2025-10-28 12:48:17 -05:00
**Solution**: [Fix]
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
## Additional Resources
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
**Need more?**
- [Examples](examples.md) - Working samples
- [Reference](reference.md) - API docs
- [Advanced](workflows/advanced.md) - Complex patterns
2025-10-17 10:32:29 -05:00
2025-10-28 12:48:17 -05:00
💡 **Tip**: [Key insight]
2025-10-17 10:32:29 -05:00
```
2025-10-28 12:48:17 -05:00
## Additional Resources
**Need more?**
- [Skill Examples](examples.md) - Complete working skills
- [Best Practices Guide](best-practices.md) - Comprehensive guidelines
- [Templates](templates.md) - Ready-to-use templates
- [Checklist](checklist.md) - Validation checklist
- [Official Docs](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview)
💡 **Tip**: Best skills emerge from real usage. Start simple, iterate based on actual needs, prioritize clarity over comprehensiveness.
2025-10-17 10:32:29 -05:00
---
2025-10-28 12:48:17 -05:00
**Remember**: Specific descriptions trigger correctly. Progressive disclosure saves tokens. Test thoroughly. Start minimal and grow organically.