Creator Contest. Win $100. Enter →

    Guides
    skill.md
    reference
    specification

    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.

    March 19, 20266 min read
    Share:

    Quick Answer: A SKILL.md is YAML frontmatter (only name and description are required) followed by markdown instructions. Optional fields include when_to_use, allowed-tools, disable-model-invocation, argument-hint, arguments, paths, model, and effort. 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.

    FieldRequiredDescription
    nameyesLowercase-hyphenated identifier. Must match the folder name.
    descriptionyesOne-sentence summary. Claude uses this to decide when to invoke the skill. Be specific.
    when_to_usenoConcrete trigger conditions. Helps Claude pattern-match user requests.
    argument-hintnoPlaceholder text shown to the user when invoking via a slash command.
    argumentsnoStructured argument schema for skills invoked as slash commands.
    disable-model-invocationnoWhen true, skill only runs via explicit user invocation, not auto-detection.
    user-invocablenoWhen true, skill appears as a slash command in Claude Code.
    allowed-toolsnoWhitelist of tools the skill may invoke (e.g., Bash(git:*), Read, Write).
    modelnoOverride the default Claude model for this skill.
    effortnoEffort level hint (low, medium, high) for extended thinking.
    contextnoAdditional context files to include when the skill runs.
    agentnoSpecific agent subtype to use.
    hooksnoShell commands to run before/after the skill executes.
    pathsnoGlob patterns of files this skill operates on.
    shellnoDefault 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?

    Frequently Asked Questions

    Find the right skill for your workflow

    Browse our marketplace of AI agent skills, ready to install in seconds.

    Browse Skills

    Related Articles