ForestForest

Mastering Claude Code Skills: A Practical Guide to Using and Creating Them

7 min read

Skills are Claude Code's answer to a fundamental problem: how do you teach an AI assistant to do something complex reliably? Not just once, but every time, across different sessions and contexts.

I've spent considerable time both using community skills and building my own. What I've learned is that skills aren't just documentation—they're executable workflows that turn Claude from a general assistant into a specialized tool. Done right, they're transformative. Done poorly, they're ignored.

This guide covers both sides: how to get the most from existing skills, and how to create ones that actually work.


Understanding the Skill Ecosystem

Skills live in a layered hierarchy. Understanding this hierarchy explains why Claude might use one skill over another.

The three layers:

LayerLocationScopePriority
User~/.claude/skills/All your projectsLower
Project.claude/skills/Current project onlyHigher
PluginInstalled pluginsDepends on pluginVaries

Claude Skills Ecosystem - Three-layer architecture showing user, project, and plugin skill locations

Project-level skills override user-level ones with the same name. This lets teams enforce consistent workflows while allowing personal customization elsewhere.

Why this matters: If you create a commit skill in your project, it takes precedence over any commit skill in your user directory. Teams can standardize workflows without fighting individual preferences.


Using Skills Effectively

Most Claude Code users underutilize skills. They might know /commit exists but never explore what else is available.

Discovering skills:

The skill list appears in Claude's system prompt and in reminder messages. But the real power is understanding when skills activate.

Every skill has a description field that defines its triggers:

description: Use when implementing any feature or bugfix, before writing implementation code

This isn't just documentation—Claude uses these descriptions to decide which skills to load. Write /help or ask "what skills do you have?" to see what's available.

Invocation patterns:

PatternWhen to UseExample
Slash commandDirect invocation/commit, /review-pr
Natural languageLet Claude choose"Research the latest AI news"
Explicit requestForce specific skill"Use the article-illustrator skill"

The 1% rule: If there's even a 1% chance a skill might help, Claude should check it. This means well-described skills get invoked more reliably than vague ones.


Creating Your First Skill

A skill is fundamentally a SKILL.md file with YAML frontmatter. Everything else is optional.

Minimal viable skill:

---
name: quick-test
description: Use when running project tests with coverage reporting
---
 
# Quick Test
 
Run tests with coverage:
 
```bash
npm test -- --coverage
```
 
Report summary of passing/failing tests and coverage percentage.

That's it. Save this to ~/.claude/skills/quick-test/SKILL.md and it's immediately available.

SKILL.md Anatomy - Breakdown of frontmatter and content sections

The two critical frontmatter fields:

FieldMax LengthPurpose
nameN/ASkill identifier (letters, numbers, hyphens only)
description~500 charsTriggers—when should this skill activate?

The description is everything. Claude reads it to decide relevance. Get it wrong and your skill never gets used.


Writing Effective Descriptions

This is where most skill authors fail. They describe what the skill does instead of when to use it.

Bad description:

description: A skill that helps with code review by checking for bugs, security issues, and style problems

Good description:

description: Use when reviewing code changes before committing, when asked to check a PR, or when code quality concerns are raised

The difference is subtle but critical. The first describes capability. The second describes triggers—the situations where Claude should reach for this skill.

Description patterns that work:

  • "Use when [specific situation]..."
  • "Use for [task type] when [condition]..."
  • "Triggers on requests like [examples]..."

Avoid in descriptions:

  • Workflow summaries (Claude might follow the summary instead of reading the full skill)
  • Implementation details
  • Marketing language

Designing Skill Workflows

Complex skills need structure. Here's the pattern I use for multi-step workflows:

## Workflow
 
Copy this checklist and track progress:
 
```
 
Progress:
 
- [ ] Step 1: Gather context
- [ ] Step 2: Analyze
- [ ] Step 3: Execute
- [ ] Step 4: Verify
 
---
 
### Step 1: Gather Context
 
[Detailed instructions for step 1]
 
---
 
### Step 2: Analyze
 
[Detailed instructions for step 2]
```

The explicit checklist serves two purposes:

  1. Claude can track where it is in the workflow
  2. Users can see progress and intervene if needed

Skill Workflow Design - Flowchart showing step progression with checkpoints

Interactive skills with AskUserQuestion:

For skills that need user input mid-workflow, use structured questions:

**Use AskUserQuestion** to confirm approach:
 
- Option 1: [Choice A] (Recommended)
- Option 2: [Choice B]
- Option 3: [Choice C]

This creates a consistent interaction pattern. Users know what to expect, and Claude knows exactly when to pause for input.


Skill Composition: Invoking Other Skills

Skills can reference other skills. This is powerful but requires care.

Reference pattern:

### Step 4: Generate Illustrations
 
**Invoke skill:** `article-illustrator`
 
Follow article-illustrator workflow to:
 
1. Analyze content for illustration positions
2. Generate appropriate images
3. Insert image references

Notice the explicit "Invoke skill:" marker. This tells Claude to actually load and follow another skill, not just reference its concepts.

When to compose vs. embed:

  • Compose when the other skill is complex and maintained separately
  • Embed when you need tight control over the sub-workflow

Supporting Files and References

Not everything belongs in SKILL.md. Here's when to split:

Keep InlineMove to Separate File
Core workflow (under 200 lines)Heavy API reference (100+ lines)
Code examples (under 50 lines)Reusable scripts/tools
Decision flowchartsLarge templates
Key principlesDetailed specifications

File organization:

my-skill/
├── SKILL.md              # Required: main skill file
├── references/           # Optional: supporting docs
│   ├── api-reference.md
│   └── examples.md
└── scripts/              # Optional: executable tools
    └── helper.ts

Reference files with relative paths: [See API Reference](references/api-reference.md)


Testing Skills Before Deployment

Untested skills have issues. Always.

The testing approach depends on skill type:

For procedural skills (step-by-step guides):

  1. Run through the workflow manually
  2. Check for ambiguous instructions
  3. Verify all referenced tools/paths exist

For decision-making skills (when to do X vs Y):

  1. Present edge cases to Claude
  2. Verify correct skill activation
  3. Check that guidance handles exceptions

Quick validation:

You: "I want to [describe situation that should trigger skill]"
Claude: [Should mention or invoke the skill]

If Claude doesn't reach for your skill when it should, the description needs work.


Common Patterns Worth Stealing

After reviewing dozens of skills, these patterns consistently work well:

1. The Research-Then-Act Pattern

## Step 1: Research
 
[Gather information, present options]
 
## Step 2: Confirm Direction
 
**Use AskUserQuestion** to confirm approach
 
## Step 3: Execute
 
[Do the work based on confirmed direction]

Never skip the confirmation step for significant actions.

2. The Quality Gate Pattern

### Final Checklist
 
Before completing, verify:
 
- [ ] Requirement A met
- [ ] Requirement B met
- [ ] No regressions introduced
- [ ] Output matches expected format

Explicit checklists catch issues Claude might otherwise overlook.

3. The Fallback Pattern

If [primary approach] fails:
 
1. Try [fallback approach A]
2. If still failing, [fallback approach B]
3. If all fail, **ask user** for guidance

Plan for failure. Skills that handle edge cases gracefully get trusted more.


Wrapping Up

Skills transform Claude from a capable generalist into a reliable specialist. The investment in creating good skills pays off every time you invoke them.

Start simple. A three-line skill that runs your tests correctly is more valuable than an elaborate workflow that's never quite right. Iterate based on actual usage, not theoretical completeness.

The skills I use most aren't the fanciest—they're the ones that handle the tasks I do repeatedly with zero friction. That's the goal.


Resources:

Share this article

Comments

0/2000