Claude CodeSkillsAutomationDeveloper ToolsTutorial

Claude Code Skills: Teach Claude Your Workflow (2026 Guide)

Create custom Claude Code Skills to automate your workflow. SKILL.md files, progressive disclosure, and practical examples for PR reviews, commit messages, and more.

$ author: Viktor Bonino
$ date:
$ read: 8 min read

Every team has their own way of doing things. Your PR review checklist. Your commit message format. Your database query patterns. Your deployment procedures.

Claude Code Skills let you teach Claude your specific workflows. Instead of explaining the same thing every session, you write it once and Claude applies it automatically.

//What Are Skills?

A Skill is a markdown file that teaches Claude how to do something specific. When you ask Claude something that matches a Skill's purpose, Claude automatically applies it.

Think of Skills as specialized knowledge modules:

  • PR Review Skill — Reviews code using your team's standards
  • Commit Message Skill — Generates commits in your preferred format
  • Database Skill — Queries your schema using your conventions
  • Deployment Skill — Follows your deployment checklist

Skills are model-invoked. You don't call them explicitly. Claude reads the Skill descriptions and decides when to apply them based on your request.

//How Skills Work

When Claude starts, it loads only the name and description of each available Skill. This keeps startup fast while giving Claude enough context to match Skills to requests.

Discovery → Claude loads Skill names and descriptions at startup.

Activation → When your request matches a Skill's description, Claude asks to use it. You confirm, and the full SKILL.md is loaded.

Execution → Claude follows the Skill's instructions, loading referenced files or running bundled scripts as needed.

The key insight: descriptions matter. Claude matches requests against descriptions using semantic similarity. Write descriptions that include keywords users would naturally say.

//Where Skills Live

Where you store a Skill determines who can use it:

LocationPathWho can use it
Personal~/.claude/skills/You, across all projects
Project.claude/skills/Anyone working in the repo
PluginBundled with pluginsAnyone with the plugin
EnterpriseManaged settingsEveryone in your org

If two Skills have the same name, higher levels win: enterprise overrides personal, personal overrides project, project overrides plugin.

Personal Skills are great for your individual workflow preferences.

Project Skills are perfect for team standards that should be version-controlled with the codebase.

//Create Your First Skill

Let's create a Skill that teaches Claude to generate commit messages your way.

Step 1: Create the directory

code
mkdir -p ~/.claude/skills/commit-helper

Step 2: Write SKILL.md

Create ~/.claude/skills/commit-helper/SKILL.md:

code
---
name: commit-helper
description: Generates clear commit messages from git diffs. Use when writing commit messages 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 (imperative mood)
   - Blank line
   - Detailed description of what and why
   - List of affected components

## Format

```text
[type]: [summary]

[detailed description]

Affected: [components]

Types: feat, fix, docs, refactor, test, chore

//Best Practices

  • Use present tense ("Add feature" not "Added feature")
  • Explain what and why, not how
  • Reference issue numbers when applicable
code

**Step 3: Restart and test**

Restart Claude Code to load the new Skill. Then test it:

Generate a commit message for my staged changes

code

Claude should ask to use the `commit-helper` Skill, then follow your format exactly.

## SKILL.md Structure

Every Skill needs a `SKILL.md` file with two parts: YAML metadata and Markdown instructions.

```yaml
---
name: your-skill-name
description: What it does and when to use it
allowed-tools: Read, Grep, Glob  # Optional: restrict tools
model: claude-sonnet-4-20250514  # Optional: specific model
---

# Your Skill Name

## Instructions
Step-by-step guidance for Claude.

## Examples
Concrete examples showing the Skill in action.

Required fields:

FieldDescription
nameLowercase letters, numbers, hyphens only. Max 64 chars.
descriptionWhat the Skill does and when to use it. Max 1024 chars. Claude uses this to decide when to apply the Skill.

Optional fields:

FieldDescription
allowed-toolsRestrict which tools Claude can use when the Skill is active.
modelSpecific model to use (defaults to conversation's model).

//Progressive Disclosure

Skills share Claude's context window. To keep context focused, use progressive disclosure: essential info in SKILL.md, detailed reference in separate files.

code
my-skill/
ā”œā”€ā”€ SKILL.md          # Overview and navigation
ā”œā”€ā”€ reference.md      # Detailed API docs (loaded when needed)
ā”œā”€ā”€ examples.md       # Usage examples (loaded when needed)
└── scripts/
    └── helper.py     # Utility script (executed, not loaded)

In your SKILL.md, reference supporting files:

code
## Overview

[Essential instructions here]

## Additional Resources

- For complete API details, see [reference.md](reference.md)
- For usage examples, see [examples.md](examples.md)

## Utility Scripts

To validate input, run:
```bash
python scripts/helper.py input.txt
code

**Key insight:** Scripts in your Skill directory can be executed without loading their contents into context. Only the output consumes tokens. This is powerful for:

- Complex validation logic
- Data processing that's more reliable as code
- Operations that benefit from consistency

Keep `SKILL.md` under 500 lines. If you need more, split into separate files.

## Restrict Tool Access

Use `allowed-tools` to limit what Claude can do when a Skill is active:

```yaml
---
name: safe-reader
description: Read files without making changes. Use for read-only file access.
allowed-tools: Read, Grep, Glob
---

# Safe File Reader

This Skill provides read-only file access.

## Instructions
1. Use Read to view file contents
2. Use Grep to search within files
3. Use Glob to find files by pattern

When this Skill is active, Claude can only use Read, Grep, and Glob. Useful for:

  • Read-only Skills that shouldn't modify files
  • Security-sensitive workflows
  • Limited-scope operations

//Practical Examples

PR Review Skill

code
---
name: pr-review
description: Reviews pull requests for code quality, security, and best practices. Use when reviewing PRs or code changes.
---

# PR Review

## Checklist

1. **Correctness** — Does the code do what it's supposed to?
2. **Security** — Any vulnerabilities? Input validation? Auth checks?
3. **Performance** — Any obvious bottlenecks? N+1 queries?
4. **Maintainability** — Is the code readable? Well-structured?
5. **Tests** — Are there tests? Do they cover edge cases?

## Output Format

### Summary
[One paragraph overview]

### Issues Found
- šŸ”“ Critical: [blocking issues]
- 🟔 Suggestions: [improvements]
- 🟢 Nitpicks: [minor things]

### Verdict
[Approve / Request Changes / Comment]

Database Query Skill

code
---
name: db-queries
description: Write database queries following our patterns. Use when writing SQL or database operations.
allowed-tools: Read, Bash(psql:*)
---

# Database Queries

## Our Schema

See [schema.md](schema.md) for table definitions.

## Conventions

- Always use parameterized queries
- Include LIMIT on SELECT statements
- Use transactions for multi-step operations
- Log slow queries (>100ms)

## Common Patterns

### Pagination
```sql
SELECT * FROM users
ORDER BY created_at DESC
LIMIT $1 OFFSET $2

Soft Delete

code
UPDATE records
SET deleted_at = NOW()
WHERE id = $1
code

### Code Explainer Skill

```yaml
---
name: code-explainer
description: Explains code with visual diagrams and analogies. Use when explaining how code works or teaching about a codebase.
---

# Code Explainer

When explaining code, always include:

1. **Start with an analogy** — Compare to something from everyday life
2. **Draw a diagram** — Use ASCII art to show flow or structure
3. **Walk through step-by-step** — Explain what happens
4. **Highlight gotchas** — Common mistakes or misconceptions

Keep explanations conversational. For complex concepts, use multiple analogies.

//Skills vs Other Options

Claude Code has several customization options. Here's when to use each:

Use thisWhen you want to...When it runs
SkillsGive Claude specialized knowledgeClaude chooses when relevant
Slash commandsCreate reusable prompts (/deploy staging)You type /command
CLAUDE.mdSet project-wide instructionsEvery conversation
SubagentsDelegate to separate context with own toolsClaude delegates or you invoke
HooksRun scripts on events (lint on save)On specific tool events
MCP serversConnect to external tools and dataClaude calls as needed

Skills vs Subagents: Skills add knowledge to the current conversation. Subagents run in separate context with their own tools. Use Skills for guidance; use subagents when you need isolation.

Skills vs MCP: Skills tell Claude how to use tools. MCP provides the tools. An MCP server connects Claude to your database; a Skill teaches Claude your query patterns.

//Troubleshooting

Skill not triggering

The description is how Claude decides whether to use your Skill. Vague descriptions like "Helps with documents" don't work.

Good descriptions answer two questions:

  1. What does this Skill do? (specific capabilities)
  2. When should Claude use it? (trigger terms)
code
# Bad
description: Helps with documents

# Good
description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDFs or when the user mentions forms or document extraction.

Skill doesn't load

Check the file path. Skills must be in the correct directory with exact filename SKILL.md (case-sensitive):

code
~/.claude/skills/my-skill/SKILL.md     # Personal
.claude/skills/my-skill/SKILL.md        # Project

Check YAML syntax:

  • Frontmatter must start with --- on line 1 (no blank lines before)
  • End with --- before Markdown content
  • Use spaces, not tabs

Run claude --debug to see Skill loading errors.

Multiple Skills conflict

If Claude uses the wrong Skill, descriptions are too similar. Make each distinct with specific trigger terms.

Instead of two Skills with "data analysis" in both, differentiate: one for "sales data in Excel files and CRM exports" and another for "log files and system metrics."


Skills transform Claude from a generic assistant into a specialized team member that knows your workflows. Write them once, use them forever.

Start with one Skill for something you explain repeatedly. Iterate from there.

summonaikit

Ready to supercharge your Claude Code setup?

One command analyzes your codebase and generates CLAUDE.md, skills, and agents tailored to your exact stack.