[CC]
All guides

How to Create Claude Code Skills

Build custom slash commands that route to agents and run multi-step workflows.

What is a skill?

A skill is a reusable workflow triggered by a slash command. When you type /plan-feature Add dark mode, Claude loads the skill file, routes it to the assigned agent, and injects your input via the $ARGUMENTS placeholder.

Skills live in .claude/skills/<name>/SKILL.md. The file must be named exactly SKILL.md (case-sensitive).

Basic skill structure

---
name: plan-feature
description: Break features into prioritized tasks
context: fork
agent: product-manager
allowed-tools:
  - Read
  - Grep
  - Glob
  - Task
---

# Plan Feature

Break down a feature request into prioritized tasks.

**Feature:** $ARGUMENTS

## Instructions

1. Read CLAUDE.md for project conventions
2. Search existing code for related patterns
3. Break the feature into tasks with RICE scores
4. Assign each task to the right agent
5. Define acceptance criteria for each task

## Output Format

| # | Task | Agent | Priority | Acceptance Criteria |
|---|------|-------|----------|-------------------|
| 1 | ... | developer | P0 | ... |

Frontmatter fields

FieldDescription
nameKebab-case identifier. Defaults to parent directory name if omitted
user-invocableDefault: true (shows as slash command). Set to false to hide from the / menu
agentWhich agent runs this skill (must match agent's name field)
contextfork runs in isolated subagent context (recommended for pipelines)
allowed-toolsTools available without permission prompts when active
argument-hintAutocomplete hint shown in the CLI

Using $ARGUMENTS

The $ARGUMENTS placeholder captures everything after the slash command:

User types:  /plan-feature Add user authentication
$ARGUMENTS:  "Add user authentication"

User types:  /bug-fix Login page crashes on Safari
$ARGUMENTS:  "Login page crashes on Safari"

Place it where the user's input should appear in the skill instructions, usually under a heading or as part of the task description.

Context forking

Adding context: fork runs the skill in an isolated subagent context. This means:

  • The skill's tool calls don't pollute your main conversation
  • The agent gets a clean context focused on the task
  • Only the final output is returned to the main conversation

Use context: fork for pipeline skills that run many steps (build, lint, test). Omit it for simple skills where you want the agent to see the full conversation history.

Pipeline skills

Skills can define multi-step pipelines where stages run sequentially and failures trigger auto-fix loops:

# Ship — Pre-Ship Verification Pipeline

## Pipeline

### Stage 1: Build
Run `npm run build`. If fails -> /auto-fix -> rebuild.

### Stage 2: Type Check
Run `npx tsc --noEmit`. If fails -> /auto-fix -> recheck.

### Stage 3: Lint
Run `npm run lint`. If fails -> /auto-fix -> relint.

### Stage 4: UX Check
Delegate to ux-designer agent.

### Stage 5: Security Audit
Delegate to security-reviewer agent.

### Stage 6: Final Report
Summarize all stages with PASS/FAIL status.

This pattern chains multiple agents through a single entry point. The tester agent runs the pipeline and delegates specialist stages to other agents via the Task tool.

Skill design tips

  • One skill, one job. A /plan-feature skill should plan, not plan and implement.
  • Define output format. Include an output template so the agent produces consistent, structured results.
  • Add completion criteria. Explicitly state what "done" looks like so the agent knows when to stop.
  • Use allowed-tools sparingly. Only grant tools the skill actually needs. A review skill doesn't need Write or Edit.

Skip the setup

Pre-built skills with tested agent routing, output formats, and pipeline patterns: