// Guide for creating new Claude Code skills. Use when you need to create a new skill to package expertise or workflow into a reusable capability that Claude can automatically invoke.
| name | create-skill |
| description | Guide for creating new Claude Code skills. Use when you need to create a new skill to package expertise or workflow into a reusable capability that Claude can automatically invoke. |
Use this skill when creating new Claude Code skills that package expertise, workflows, or domain knowledge into reusable capabilities.
Skills are autonomous capabilities that Claude Code can invoke automatically based on the user's request. Each skill consists of a SKILL.md file with YAML frontmatter and markdown instructions, plus optional supporting files.
.claude/skills/
└── your-skill-name/
├── SKILL.md # Required: Main skill definition
├── reference.md # Optional: Additional documentation
├── examples.md # Optional: Example usage
├── templates/ # Optional: Template files
│ └── template.txt
└── scripts/ # Optional: Helper scripts
└── helper.py
Every SKILL.md file must have:
---
name: skill-name
description: Brief description of what the skill does and when to use it (max 1024 chars)
---
Requirements:
name: lowercase letters, numbers, and hyphens only (max 64 characters)description: Clear description for Claude to understand when to invoke this skill
Structure your skill instructions clearly:
# Skill Name
Brief introduction of when to use this skill.
## Overview
High-level explanation of what this skill does.
## Workflow
### Step 1: First step
- Details
- Instructions
### Step 2: Second step
- More details
## Key concepts
Important concepts the user needs to understand.
## Examples
Concrete examples showing how to use the skill.
## Checklist
- [ ] Verification steps
- [ ] Required actions
Create a skill when:
Plan your skill by answering:
YAML frontmatter:
name (kebab-case)description that helps Claude understand when to use itContent structure:
If your skill needs:
templates/ directoryscripts/ directoryreference.mdexamples.mdTest that Claude invokes your skill by:
Iterate on the description if Claude doesn't invoke it at the right times.
✅ Good descriptions:
❌ Bad descriptions:
sql-translation, create-skill, review-security, deploy-productionMost skills should be designed for automatic invocation.
---
name: format-code
description: Format code using air format. Use after writing or modifying R code files.
---
# Format Code
Run `air format .` to format all R code in the project.
## Checklist
- [ ] Run `air format .`
- [ ] Verify no formatting errors
---
name: add-test
description: Add tests for new R functions. Use when creating new functions in R/ directory.
---
# Add Test
Add tests for new R functions following dbplyr conventions.
## Workflow
### 1. Identify test file
- Tests for `R/{name}.R` go in `tests/testthat/test-{name}.R`
### 2. Write tests
- Place new tests next to similar existing tests
- Keep tests minimal with few comments
- Use `expect_snapshot()` for SQL translation tests
### 3. Run tests
```bash
Rscript -e "devtools::test(filter = '{name}', reporter = 'llm')"
## Common patterns
### Research workflows
For skills that require research before implementation:
1. Specify search steps with WebSearch
2. Require documentation with citations
3. Only implement after research is complete
See `sql-translation` skill for an example.
### Multi-step processes
For complex workflows:
1. Break into numbered steps
2. Use subsections for each step
3. Include verification at each stage
4. Provide a final checklist
### Domain expertise
For packaging specialized knowledge:
1. Explain key concepts upfront
2. Provide reference information
3. Include decision trees or flowcharts
4. Link to external documentation
## Troubleshooting
**Skill not being invoked:**
- Check description clarity
- Make description more specific
- Verify YAML syntax
**Skill invoked at wrong times:**
- Description too broad
- Add specifics about when NOT to use it
**Instructions unclear:**
- Add more concrete examples
- Break down complex steps
- Reference actual files from the codebase
## Checklist
Before completing a new skill:
- [ ] Created `.claude/skills/{skill-name}/` directory
- [ ] Created `SKILL.md` with YAML frontmatter
- [ ] `name` field uses kebab-case (lowercase, hyphens only)
- [ ] `description` clearly explains what and when (max 1024 chars)
- [ ] Content has clear structure with sections
- [ ] Workflow broken into numbered steps
- [ ] Examples included where helpful
- [ ] Checklist provided for verification
- [ ] Tested that Claude invokes the skill correctly
- [ ] Supporting files added if needed