How to Create a Skill in Claude Code
How to Create a Skill in Claude Code
Create custom Skills to standardize your development workflows in Claude Code.
This tutorial covers the complete process: planning your Skill, writing the SKILL.md file, testing it, and sharing it with your team.
What Makes a Good Claude Code Skill?
Effective Skills are focused, clear, and actionable.
Good Skill characteristics:
- Single responsibility — One Skill per task type or pattern
- Clear instructions — Specific rules, not vague suggestions
- Concrete examples — Show code patterns, not just descriptions
- Consistency rules — Enforce team standards
- Context awareness — Account for common edge cases
Bad Skill characteristics:
- Too broad ("How to write good code")
- Contradictory rules
- Vague guidance ("Make it clean")
- Missing examples
- Ignores project context
Before creating a Skill, ask:
- What specific task does this Skill address?
- What patterns or rules should Claude follow?
- Can I provide 2-3 concrete examples?
- Does this Skill conflict with existing Skills?
SKILL.md Structure and Common Sections
Every Skill is defined by a SKILL.md file.
Common structure:
# Skill Name
Brief description of what this Skill does.
## Purpose
Explain when and why to use this Skill.
## Instructions
Detailed guidance for Claude:
- Specific rules to follow
- Patterns to apply
- Anti-patterns to avoid
## Examples
### Example 1: [Description]
\`\`\`typescript
// Show actual code following the Skill
\`\`\`
### Example 2: [Description]
\`\`\`typescript
// Another example demonstrating the pattern
\`\`\`
## Constraints
- List any hard requirements
- Note language or framework specifics
- Specify required dependencies
Frequently used sections:
- Skill Name — Short, descriptive title
- Purpose — When to use this Skill (1-2 sentences)
- Instructions — The core guidance for Claude
- Examples — Real code demonstrating correct patterns
- Constraints — Technical requirements or limitations
Many teams also add sections for anti-patterns, related skills, or changelog information.
Writing Effective Skill Instructions
Instructions should be specific and actionable.
Weak instruction:
> "Write good TypeScript code."
Strong instruction:
> "Use TypeScript strict mode. Define explicit return types for all functions. Use readonly for immutable properties. Prefer type over interface for unions."
Instruction writing tips:
- Use imperative language
- ✓ "Define types before using them"
- ✗ "Types should probably be defined first"
- Provide rationale when needed
- "Use const assertions for literal types (prevents accidental widening)"
- List rules as bullets
## Component Structure
- Place imports in this order: React, third-party, local
- Define types before component
- Use named exports, not default
- Include PropTypes for runtime checking
- Include negative rules (what NOT to do)
## Avoid
- Don't use `any` type
- Don't mutate props
- Don't inline complex logic in JSX
- Reference official style guides when applicable
Follow the Airbnb React Style Guide with these additions:
- [specific team rules]
Testing Your Claude Code Skill
Test Skills before sharing with your team.
Step 1: Create a test skill
Skills are typically organized as folders containing a SKILL.md file. The current Claude Code docs use ~/.claude/skills/<skill-name>/SKILL.md for personal skills and .claude/skills/<skill-name>/SKILL.md for project skills, documented in Claude Code's skills guide.
Step 2: Write your SKILL.md file
Use your text editor to create the Skill following the structure above.
Step 3: Reference the Skill in Claude Code
Start Claude Code and try:
/test-skill
Create a function that validates email addresses.
Step 4: Evaluate Claude's output
Check if Claude followed your Skill instructions:
- Are specified patterns applied?
- Do examples match your Skill's style?
- Are constraints respected?
Step 5: Iterate on instructions
If Claude didn't follow your Skill correctly:
- Add more specific rules
- Provide additional examples
- Clarify ambiguous instructions
- Test again
Common issues and fixes:
| Issue | Fix |
|---|---|
| Claude ignores a rule | Make the rule more explicit and add an example |
| Output is inconsistent | Add constraints or specify default behavior |
| Too much boilerplate | Add "keep it concise" instruction |
| Wrong style applied | Check for conflicting Skills being loaded |
Test across multiple scenarios:
Don't just test once. Try:
- Simple cases
- Edge cases
- Integration with other code
- Different file types or contexts
Creating a Claude Code Skill in Practice
Creating a skill is easiest to understand when you see it as a reusable workflow layer inside a real coding project.
What this shows: This screenshot uses the Claude Code repository as a practical anchor for how teams define repeatable instructions and evolve them with version control.
Why this scenario matters: It reinforces that creating a skill is a real project workflow decision, not just a writing exercise, because teams maintain and improve these patterns in source control.
Typical assistant task: Define a reusable workflow pattern, store it near the repo, and reuse it across recurring coding tasks.
Source: Claude Code Repository
When to Pick How to Create a Skill in Claude Code vs Cursor Rules
This comparison is most useful when both options look plausible on paper but differ in operating model, team fit, and day-to-day workflow cost.
| Decision Lens | This Page's MCP Path | Competitor |
|---|---|---|
| Best For | Teams packaging recurring Claude Code workflows into reusable, named capabilities. | Teams that only need lightweight instruction layers rather than packaged capabilities. |
| Where MCP Wins | Skill creation wins when the goal is to operationalize a repeatable workflow instead of just adding guidance. | |
| Tradeoff to Watch | It is more structured than a simple rules file, which may be overkill for basic behavioral preferences. | |
| Choose This Path When | Choose a Claude Code skill when you want workflow reuse; choose Cursor Rules when you only need lighter guidance. | |
| Sources | ||
Frequently Asked Questions
Where should I store my SKILL.md files?
~/.claude/skills/<skill-name>/SKILL.md for personal skills and .claude/skills/<skill-name>/SKILL.md for project skills, documented in Claude Code's skills guide.Can I have multiple SKILL.md files in one directory?
How do I share Skills with my team?
Can I reference other Skills within a Skill?
What if my Skill instructions are too long?
Do Skills work with all programming languages?
Can I use Markdown formatting in SKILL.md?
Create Skills in Verdent
Verdent provides a Skill builder interface for creating and testing Skills without manual file management.
Define Skill instructions, test them in an isolated environment, and deploy across all projects from the Verdent dashboard.