write-a-skill — Create Custom Skills
- Trigger:
/write-a-skillor keywords "create skill", "write a skill", "new skill" - Best for: Creating custom Skills, encapsulating team workflows
- Not for: Modifying existing Skills (edit files directly)
Overview
write-a-skill helps you create new Claude Code Skills with complete guidance: structure design, Frontmatter configuration, prompt writing, and resource bundling.
Trigger Conditions
write-a-skill auto-triggers when you:
- Mention "create a skill", "write a skill"
- Want to encapsulate a repetitive workflow
- Use the
/write-a-skillcommand
Examples
Example 1: Simple Skill
/write-a-skill Create a skill that auto-generates docstrings for Python functionsClaude generates:
my-docstring-skill/
├── SKILL.md # Skill entry (frontmatter + prompt)
└── resources/
└── examples.md # Reference examplesSKILL.md example:
markdown
---
name: python-docstring
description: Generate Google-style docstrings for Python functions
triggers:
- "add docstring"
- "generate docs for this function"
---
When activated, generate a Google-style Python docstring covering:
- Args (type + description)
- Returns (type + description)
- Raises (if applicable)
- Example usage
Follow PEP 257. Keep descriptions concise.Example 2: Skill with Tools
/write-a-skill Create a DB migration skill that connects to PostgreSQL and validates migration safetyExample 3: Team Convention Skill
/write-a-skill Create a code review skill that checks against our team's 5 coding standardsExample 4: i18n Translation Skill
/write-a-skill Create an i18n skill for translating Chinese JSON translation files to English and JapaneseExample 5: CI/CD Skill
/write-a-skill Create a skill that checks if a PR meets our CI configuration requirementsSkill File Structure
skill-name/
├── SKILL.md # Required: Skill entry file
└── resources/ # Optional: Additional resources
├── examples.md
├── templates/
└── docs/Notes
- Use
kebab-casefor skill names - The
descriptionin frontmatter should be concise and distinct — it's key to trigger matching - Don't over-engineer — one Skill, one job
- When testing, check both trigger precision and false positive rate
- Resource files are for reference — they aren't fully loaded into context
Related Skills
- update-config — Configure Skill permissions and hooks
- init — Initialize project CLAUDE.md
- simplify — Simplify verbose Skill prompts