SKILL.md Format Reference
The complete technical reference for the SKILL.md format. Every frontmatter field, the folder structure, progressive disclosure patterns, and best practices.
Quick Answer: A
SKILL.mdis YAML frontmatter (onlynameanddescriptionare required) followed by markdown instructions. Optional fields includewhen_to_use,allowed-tools,disable-model-invocation,argument-hint,arguments,paths,model, andeffort. Place the file inside a folder named after the skill at~/.claude/skills/SKILL_NAME/SKILL.md.
This is the canonical reference for the SKILL.md file format used by Claude Code, OpenClaw, Codex CLI, and Cursor. Bookmark it.
How should a skill folder be structured?
~/.claude/skills/
└── my-skill/ # Folder name = skill name
├── SKILL.md # Required — the skill definition
├── scripts/ # Optional — executable helpers
│ └── helper.sh
├── references/ # Optional — extra context files
│ └── style-guide.md
└── assets/ # Optional — images, templates
└── logo.png
Only SKILL.md is required. Everything else is loaded on demand by the skill's instructions.
What fields go in SKILL.md frontmatter?
The frontmatter sits between two --- lines at the top of SKILL.md. Required fields are name (or folder name as fallback) and description. All other fields are optional.
| Field | Required | Description |
|---|---|---|
name | yes | Lowercase-hyphenated identifier. Must match the folder name. |
description | yes | One-sentence summary. Claude uses this to decide when to invoke the skill. Be specific. |
when_to_use | no | Concrete trigger conditions. Helps Claude pattern-match user requests. |
argument-hint | no | Placeholder text shown to the user when invoking via a slash command. |
arguments | no | Structured argument schema for skills invoked as slash commands. |
disable-model-invocation | no | When true, skill only runs via explicit user invocation, not auto-detection. |
user-invocable | no | When true, skill appears as a slash command in Claude Code. |
allowed-tools | no | Whitelist of tools the skill may invoke (e.g., Bash(git:*), Read, Write). |
model | no | Override the default Claude model for this skill. |
effort | no | Effort level hint (low, medium, high) for extended thinking. |
context | no | Additional context files to include when the skill runs. |
agent | no | Specific agent subtype to use. |
hooks | no | Shell commands to run before/after the skill executes. |
paths | no | Glob patterns of files this skill operates on. |
shell | no | Default shell for inline commands (e.g., bash, zsh). |
What does a minimal SKILL.md template look like?
---
name: my-skill
description: One-sentence description of what this does and when Claude should use it.
---
# My Skill
Detailed instructions for Claude in markdown.
## When to use
Concrete trigger examples.
## How it works
Step-by-step procedure.
What does a standard SKILL.md template look like?
---
name: code-reviewer
description: Review staged git changes for security, logic, and style issues. Use when the user asks for a code review, PR review, or pre-commit check.
when_to_use:
- User explicitly requests a code review
- Before opening a pull request
- After staging significant changes
allowed-tools:
- Bash
- Read
- Grep
---
# Code Reviewer
Perform a structured review of staged changes.
## Procedure
1. Run `git diff --staged` to see the changes
2. Check for security issues (injection, secrets, auth bypasses)
3. Check for logic errors and missing edge cases
4. Suggest improvements organized by severity: Critical, Warning, Suggestion
## Output format
Group findings by file. For each finding, cite the line number and explain the impact.
What does a full SKILL.md template with optional fields look like?
---
name: env-doctor
description: Diagnose why a project fails to start by checking runtime versions, dependencies, env vars, ports, and build state.
when_to_use:
- "Project won't start"
- "Tests fail with environment errors"
- "Newly cloned repo onboarding"
allowed-tools:
- Bash
- Read
- Grep
paths:
- "package.json"
- "**/.env*"
- "**/Dockerfile"
shell: bash
---
# Env Doctor
Systematic environment diagnosis. Read `references/checklist.md` for the full step list.
What are common SKILL.md mistakes?
- Tabs in YAML. YAML requires spaces — tabs throw parse errors.
- Folder name ≠ name field. Claude Code treats the folder name as canonical; mismatched values cause silent load failures.
- Vague
description. "Helps with code" tells Claude nothing. "Reviews staged git changes for security and logic issues before commit" tells Claude exactly when to fire. - Missing the closing
---. The frontmatter block must be opened and closed with---on its own line. - Markdown headers above frontmatter. Frontmatter must be the very first content in the file.
How do I verify my SKILL.md?
# Check YAML parses
head -20 ~/.claude/skills/my-skill/SKILL.md
# In Claude Code:
# /skills → confirms the skill loaded
# Then ask Claude to invoke it by description
What should I do next?
- How to install skills in Claude Code
- What is SKILL.md? — conceptual overview
- How to add skills to Claude
Frequently Asked Questions
Find the right skill for your workflow
Browse our marketplace of AI agent skills, ready to install in seconds.
Browse SkillsRelated Articles
How to Update Claude Code Skills — Keep Skills Current
Update your SKILL.md skills in Claude Code — marketplace updates, GitHub pulls, and version management.
3 min read
Claude Code Skills Not Working? Troubleshooting Guide
Fix common issues with Claude Code skills — not loading, not triggering, wrong output, and frontmatter problems.
5 min read
How to Install Skills in Gemini CLI (2026 Guide)
Install SKILL.md skills in Gemini CLI. Directory locations, global vs project skills, and cross-agent compatibility with Claude Code and Codex CLI.
5 min read