Create new Claude Code skill with proper YAML frontmatter, directory structure, and activation triggers. Interactive wizard for skill creation with validation and best practices.
Interactive wizard that creates Claude Code skills with proper YAML frontmatter, directory structure, and validation. Guides you through naming, triggers, and best practices for production-ready skills.
/plugin marketplace add anton-abyzov/specweave/plugin install anton-abyzov-specweave-plugin-dev-plugins-specweave-plugin-dev@anton-abyzov/specweaveCreate new Claude Code skill with proper YAML frontmatter, directory structure, and activation triggers. Interactive wizard for skill creation with validation and best practices.
Interactive Wizard: From concept to production-ready skill with proper structure and validation.
You are helping the user create a new Claude Code skill following best practices and the required structure.
MANDATORY format:
~/.claude/skills/ ← Personal skills
└── your-skill-name/ ← MUST be in subdirectory!
└── SKILL.md ← Must be named exactly SKILL.md
.claude/skills/ ← Project skills (in project root)
└── your-skill-name/ ← MUST be in subdirectory!
└── SKILL.md ← Must be named exactly SKILL.md
Common mistake: Putting SKILL.md directly in ~/.claude/skills/ ❌
---
name: your-skill-name
description: What it does AND when to use it. Include trigger keywords users might say.
---
# Your Skill Title
Rest of your markdown content here...
Critical rules:
--- MUST be on line 1name field: lowercase, hyphens only, max 64 charsdescription field: max 1024 chars, MUST include activation triggers--- before any markdown contentAsk the user for the following information (use AskUserQuestion if appropriate):
Skill Name:
python-data-science, kubernetes-expert, react-hooksSkill Purpose:
Activation Triggers:
Skill Location:
~/.claude/skills/.claude/skills/ (in project root)Optional Tool Restrictions:
Validation rules:
# Check format (lowercase, hyphens only)
if [[ ! "$skill_name" =~ ^[a-z0-9-]+$ ]]; then
echo "❌ Invalid name: must be lowercase with hyphens only"
exit 1
fi
# Check length (max 64 chars)
if [ ${#skill_name} -gt 64 ]; then
echo "❌ Invalid name: must be 64 characters or less"
exit 1
fi
# Check no consecutive hyphens
if [[ "$skill_name" =~ -- ]]; then
echo "❌ Invalid name: no consecutive hyphens allowed"
exit 1
fi
# Check doesn't start/end with hyphen
if [[ "$skill_name" =~ ^- ]] || [[ "$skill_name" =~ -$ ]]; then
echo "❌ Invalid name: cannot start or end with hyphen"
exit 1
fi
Requirements:
Template:
[What the skill does]. [When to use it]. Activates for: [keyword1], [keyword2], [keyword3], [phrase1], [phrase2].
Examples:
# Command-based skill
description: Kubernetes expert. Explains kubectl commands, pod management, deployments. Activates for: kubectl, k8s, kubernetes, pods, deployments, services, namespaces.
# Framework skill
description: React expert for hooks, components, state management. Activates for: React, useState, useEffect, components, JSX, props, virtual DOM, React hooks.
# Project-specific skill
description: MyCompany API documentation. Explains endpoints, authentication, rate limits. Activates for: MyCompany API, /api/v1, authentication token, rate limit, API key.
Recommended sections:
---
name: your-skill-name
description: [Generated description with triggers]
---
# [Skill Title]
## What I Know
[Bullet list of expertise areas]
- Topic 1
- Topic 2
- Topic 3
## When to Use This Skill
Ask me about:
- "How do I [use case 1]..."
- "What's the best way to [use case 2]..."
- "[Topic] tips and best practices"
## Key Concepts
### [Concept 1]
[Explanation]
### [Concept 2]
[Explanation]
## Examples
### [Example 1: Common Task]
```[language]
[code example]
Explanation: [Why this works]
[code example]
Explanation: [When to use this pattern]
[Implementation details]
[Implementation details]
### Step 5: Handle Optional Tool Restrictions
**If user wants read-only skill**:
```yaml
---
name: documentation-helper
description: Documentation expert for project docs
allowed-tools: Read, Grep, Glob, WebSearch
---
Available tools:
Read - Read filesWrite - Create/overwrite filesEdit - Edit existing filesGrep - Search file contentsGlob - Find files by patternBash - Execute bash commandsWebSearch - Search the webWebFetch - Fetch web contentTodoWrite - Manage todosAskUserQuestion - Ask user questionsTool restriction patterns:
# Read-only (no modifications)
allowed-tools: Read, Grep, Glob, WebSearch
# Documentation expert (can create docs)
allowed-tools: Read, Grep, Glob, Write, Edit
# Analysis expert (no file modifications)
allowed-tools: Read, Grep, Glob, Bash
# Full access (no restrictions)
# (omit allowed-tools field)
Implementation:
# Determine full path
if [ "$location" = "personal" ]; then
skill_dir="$HOME/.claude/skills/$skill_name"
else
skill_dir="$PWD/.claude/skills/$skill_name"
fi
# Create directory
mkdir -p "$skill_dir"
# Create SKILL.md
cat > "$skill_dir/SKILL.md" <<'EOF'
---
name: $skill_name
description: $description
$allowed_tools_line
---
# $skill_title
$skill_content
EOF
echo "✅ Skill created at: $skill_dir/SKILL.md"
Validation checklist:
# 1. Check SKILL.md exists
if [ ! -f "$skill_dir/SKILL.md" ]; then
echo "❌ SKILL.md not found"
exit 1
fi
# 2. Check YAML frontmatter
if ! head -1 "$skill_dir/SKILL.md" | grep -q '^---$'; then
echo "❌ SKILL.md must start with '---'"
exit 1
fi
# 3. Check required fields
if ! grep -q '^name:' "$skill_dir/SKILL.md"; then
echo "❌ Missing 'name' field in YAML frontmatter"
exit 1
fi
if ! grep -q '^description:' "$skill_dir/SKILL.md"; then
echo "❌ Missing 'description' field in YAML frontmatter"
exit 1
fi
# 4. Check closing ---
if ! sed -n '2,10p' "$skill_dir/SKILL.md" | grep -q '^---$'; then
echo "❌ Missing closing '---' in YAML frontmatter"
exit 1
fi
# 5. Check description length
desc_length=$(grep '^description:' "$skill_dir/SKILL.md" | sed 's/^description: *//' | wc -c)
if [ "$desc_length" -gt 1024 ]; then
echo "⚠️ Warning: Description is ${desc_length} characters (max 1024)"
fi
echo "✅ Skill structure validated successfully"
User instructions:
✅ Skill created successfully!
📁 Location: $skill_dir/SKILL.md
📝 Next steps:
1. Review the skill content and customize as needed
2. Test the skill by asking a trigger question
3. Restart Claude Code to load the skill
4. Verify activation with a test question
🔄 To restart Claude Code:
- Close and reopen the application
- OR use /restart command (if available)
🧪 Test your skill:
Ask: "[example trigger question based on description]"
📚 Documentation:
- Skill format: ~/CLAUDE.md (your quick reference)
- Activation patterns: Description keywords determine when skill loads
- Tool restrictions: Optional 'allowed-tools' field limits capabilities
⚠️ Common issues:
- Skill doesn't activate → Check description has clear triggers
- YAML errors → Verify frontmatter format (opening/closing ---)
- File not found → Ensure SKILL.md is in subdirectory
Input:
python-data-scienceOutput (~/.claude/skills/python-data-science/SKILL.md):
---
name: python-data-science
description: Python best practices for data science projects. Explains pandas DataFrame operations, NumPy arrays, matplotlib visualizations, and Jupyter notebook workflows. Activates for: pandas, numpy, matplotlib, jupyter notebooks, Python data analysis, data science, scientific computing.
---
# Python Data Science Skill
## What I Know
- Pandas DataFrame operations and transformations
- NumPy array manipulation and vectorization
- Matplotlib and Seaborn visualizations
- Jupyter notebook best practices
- Data cleaning and preprocessing
- Statistical analysis and modeling
## When to Use This Skill
Ask me about:
- "How do I use pandas to..."
- "What's the best way to visualize..."
- "Python data analysis tips"
- "NumPy array operations"
- "Jupyter notebook shortcuts"
## Key Concepts
### Pandas DataFrames
DataFrames are the core data structure for tabular data in Python:
- Rows and columns with labels
- Rich indexing and selection capabilities
- Built-in aggregation and transformation methods
### NumPy Arrays
Efficient numerical computing with multi-dimensional arrays:
- Vectorized operations (avoid loops!)
- Broadcasting for element-wise operations
- Linear algebra and statistical functions
## Examples
### Example 1: Loading and Exploring Data
```python
import pandas as pd
# Load CSV file
df = pd.read_csv('data.csv')
# Quick exploration
print(df.head()) # First 5 rows
print(df.info()) # Column types and nulls
print(df.describe()) # Statistical summary
Explanation: Always start with exploration to understand your data structure, types, and missing values.
# Handle missing values
df_clean = df.dropna() # Drop rows with any nulls
df_filled = df.fillna(0) # Fill nulls with 0
df_ffill = df.fillna(method='ffill') # Forward fill
# Remove duplicates
df_unique = df.drop_duplicates()
Explanation: Choose the right strategy based on your data and analysis goals.
df.groupby('col').agg('mean').sort_values().copy() to avoid SettingWithCopyWarning.apply() or vectorization insteaddf.groupby('category').agg({
'sales': 'sum',
'quantity': 'mean',
'price': ['min', 'max']
})
df.set_index('date').resample('M').mean()
### Example 2: Read-Only Documentation Skill
**Input**:
- Name: `project-docs-helper`
- Purpose: "Project documentation expert"
- Triggers: "documentation, docs, readme, API reference"
- Location: Project (`.claude/skills/`)
- Tool restrictions: Read, Grep, Glob, WebSearch
**Output** (`.claude/skills/project-docs-helper/SKILL.md`):
```yaml
---
name: project-docs-helper
description: Project documentation expert. Helps find and explain documentation, API references, and README files. Read-only access for safe documentation browsing. Activates for: documentation, docs, readme, API reference, how to use, user guide.
allowed-tools: Read, Grep, Glob, WebSearch
---
# Project Documentation Helper
## What I Know
- Location of all project documentation
- API reference structure
- README and getting started guides
- Architecture documentation
- Contributing guidelines
## When to Use This Skill
Ask me about:
- "Where is the documentation for..."
- "How do I use [feature]..."
- "What APIs are available..."
- "Getting started with this project"
## Documentation Structure
This project follows standard documentation patterns:
- `/docs/` - Main documentation folder
- `README.md` - Getting started guide
- `API.md` - API reference
- `CONTRIBUTING.md` - Contribution guidelines
- `ARCHITECTURE.md` - System design
## How to Find Information
### Search by Topic
I can search through all documentation files to find information about specific topics.
### Navigate by Structure
I understand the documentation hierarchy and can guide you to the right files.
### Explain Concepts
I can read and explain complex documentation sections in simpler terms.
## Best Practices
1. ✅ **Check README first**: Start with README.md for project overview
2. ✅ **Use search**: Ask me to search docs instead of browsing manually
3. ✅ **Verify versions**: Documentation may be version-specific
4. ⚠️ **Read-only**: This skill cannot modify documentation
Run these checks after creation:
# 1. File exists in correct location
ls "$skill_dir/SKILL.md"
# 2. YAML frontmatter is valid
head -10 "$skill_dir/SKILL.md"
# Should see:
# ---
# name: your-skill-name
# description: ...
# ---
# 3. No syntax errors
node -e "
const fs = require('fs');
const yaml = require('js-yaml');
const content = fs.readFileSync('$skill_dir/SKILL.md', 'utf-8');
const match = content.match(/^---\\n([\\s\\S]*?)\\n---/);
if (!match) {
console.error('❌ No YAML frontmatter found');
process.exit(1);
}
try {
const data = yaml.load(match[1]);
console.log('✅ Valid YAML:', JSON.stringify(data, null, 2));
} catch (e) {
console.error('❌ YAML parsing error:', e.message);
process.exit(1);
}
"
Steps:
Test questions based on examples:
Possible causes:
Claude Code not restarted: Skills only load on startup
Missing trigger keywords: Description doesn't match user's question
YAML syntax errors: Frontmatter is invalid
Wrong file location: SKILL.md not in subdirectory
skills/skill-name/SKILL.mdName mismatch: YAML name doesn't match directory name
Common mistakes:
# ❌ WRONG: Missing closing ---
---
name: my-skill
description: My skill description
# ✅ CORRECT: Closing --- present
---
name: my-skill
description: My skill description
---
# ❌ WRONG: Invalid characters in name
---
name: My Skill Name
---
# ✅ CORRECT: Lowercase with hyphens
---
name: my-skill-name
---
# ❌ WRONG: Description too long (>1024 chars)
---
name: skill
description: [2000 character description]
---
# ✅ CORRECT: Concise description (<1024 chars)
---
name: skill
description: Focused description with key triggers
---
react-hooks not reactkubernetes-expert not k8s-helperpython-data-science not python-data-science-skillKey steps:
Remember: Restart Claude Code after creating or modifying skills!