Create Claude Code skills with proper structure, frontmatter, and best practices. Use when the user wants to create a new skill, write a SKILL.md file, or needs help structuring a Claude Code plugin.
This skill is limited to using the following tools:
Guide for creating well-structured Claude Code skills that are discoverable and effective.
Skills can be placed in three locations:
# Personal skills (available across all projects)
~/.claude/skills/skill-name/SKILL.md
# Project skills (shared via git with team)
.claude/skills/skill-name/SKILL.md
# Plugin skills (distributed via marketplace)
plugin-name/skills/skill-name/SKILL.md
Every skill requires a SKILL.md file with YAML frontmatter:
---
name: your-skill-name
description: Brief description of what this Skill does and when to use it
allowed-tools: Tool1, Tool2, Tool3 # Optional: restricts available tools
---
# Skill Title
## Instructions
Clear, step-by-step guidance for Claude.
## Examples
Concrete examples of using this skill.
| Field | Rules | Example |
|---|---|---|
name | Lowercase, numbers, hyphens only. Max 64 chars. | pdf-processor |
description | What it does AND when to use it. Max 1024 chars. | Extract text from PDFs. Use when working with PDF files or document extraction. |
| Field | Purpose | Example |
|---|---|---|
allowed-tools | Restrict which tools Claude can use | Read, Grep, Glob |
The description is critical for discoverability. Include:
description: Generate clear git commit messages from staged changes. Use when writing commits, reviewing diffs, or preparing code for push.
description: Analyze Excel spreadsheets, create pivot tables, and generate charts. Use when working with Excel files, .xlsx format, or tabular data analysis.
# Too vague - Claude won't know when to use it
description: Helps with documents
# Missing trigger context
description: Processes PDF files
Use allowed-tools to limit Claude's capabilities when the skill is active:
---
name: code-reviewer
description: Review code for best practices. Use when reviewing PRs or analyzing code quality.
allowed-tools: Read, Grep, Glob
---
Common tool combinations:
| Use Case | Recommended Tools |
|---|---|
| Read-only analysis | Read, Grep, Glob |
| File operations | Read, Write, Edit, Glob |
| Shell scripts | Bash, Read, Write |
| Web research | WebFetch, WebSearch, Read, Write |
| Full access | Omit allowed-tools entirely |
For complex skills, add supporting files:
my-skill/
├── SKILL.md # Required: main instructions
├── reference.md # Optional: detailed documentation
├── examples.md # Optional: usage examples
├── scripts/
│ └── helper.py # Optional: utility scripts
└── templates/
└── template.txt # Optional: templates
Reference files from SKILL.md:
For advanced usage, see [reference.md](reference.md).
Claude loads additional files only when needed (progressive disclosure).
For marketplace distribution, create this structure:
plugin-name/
├── .claude-plugin/
│ └── plugin.json
└── skills/
└── skill-name/
└── SKILL.md
{
"name": "plugin-name",
"description": "Brief plugin description",
"version": "1.0.0",
"author": {
"name": "Your Name"
}
}
When creating a skill:
---
name: commit-message-generator
description: Generate clear commit messages from git diffs. Use when writing commits or reviewing staged changes.
---
# Commit Message Generator
## Instructions
1. Run `git diff --staged` to see changes
2. Generate a commit message with:
- Summary under 50 characters
- Detailed description of what and why
- List affected components
## Format
- Use present tense ("Add feature" not "Added feature")
- First line is the subject, then blank line, then body
---
name: api-tester
description: Test REST API endpoints with curl. Use when testing APIs or debugging HTTP requests.
allowed-tools: Bash, Read, Write
---
# API Tester
## Usage
Test an endpoint:
```bash
./scripts/test-api.sh GET https://api.example.com/users
scripts/test-api.sh - Main testing scriptscripts/format-json.sh - Pretty print JSON responses
### Read-Only Analysis Skill
```yaml
---
name: security-scanner
description: Scan code for security vulnerabilities. Use when reviewing code security or checking for OWASP issues.
allowed-tools: Read, Grep, Glob
---
# Security Scanner
This skill provides read-only security analysis.
## Checks
1. Hardcoded credentials
2. SQL injection vulnerabilities
3. XSS attack vectors
4. Insecure dependencies
If Claude doesn't use your skill:
claude --debug shows loading errorsWhen creating skills for this marketplace:
.claude-plugin/plugin.jsonskills/skill-name/SKILL.mdmarketplace.json to register the plugin