Agent Skills Specification: Portable SKILL.md Format for AI Agents

agent-skillsintermediate7 min readVerified Jul 26, 2026
Agent Skills Specification: Portable SKILL.md Format for AI Agents

The Agent Skills specification defines a portable, directory-based format for packaging AI agent capabilities. If you build or maintain agent skills that need to work across different agent products, this is the standard you follow. It covers the required SKILL.md file, optional directories for scripts and references, naming rules, and validation.

What it does

The specification gives you a single, predictable way to describe what a skill does, how an agent should use it, and what files it needs. An agent product reads the SKILL.md frontmatter at startup to learn which skills are available, then loads the full instructions only when a task activates the skill. This progressive loading keeps context usage low while still making detailed instructions accessible on demand.

Before you start

  • A skill is a directory. At minimum it must contain a SKILL.md file.
  • The name field in frontmatter must match the parent directory name exactly.
  • Names are restricted to lowercase letters, numbers, and hyphens. No consecutive hyphens, no leading or trailing hyphens.
  • The description field is required and must be 1-1024 characters.
  • For validation, install the skills-ref library.

Directory structure

A skill directory looks like this:

skill-name/
├── SKILL.md          # Required: metadata + instructions
├── scripts/          # Optional: executable code
├── references/       # Optional: documentation
├── assets/           # Optional: templates, resources
└── ...               # Any additional files or directories

You can add any other files or directories you need. The spec only mandates SKILL.md.

SKILL.md format

Diagram: SKILL.md format

The file starts with YAML frontmatter (between --- delimiters) followed by Markdown body content.

Frontmatter fields

FieldRequiredConstraints
nameYesMax 64 characters. Lowercase letters, numbers, and hyphens only. Must not start or end with a hyphen.
descriptionYesMax 1024 characters. Non-empty. Describes what the skill does and when to use it.
licenseNoLicense name or reference to a bundled license file.
compatibilityNoMax 500 characters. Indicates environment requirements (intended product, system packages, network access, etc.).
metadataNoArbitrary key-value mapping for additional metadata.
allowed-toolsNoSpace-separated string of pre-approved tools the skill may use. (Experimental)

Minimal example:

---
name: skill-name
description: A description of what this skill does and when to use it.
---

Example with optional fields:

---
name: pdf-processing
description: Extract PDF text, fill forms, merge files. Use when handling PDFs.
license: Apache-2.0
metadata:
  author: example-org
  version: "1.0"
---

name field

The required name field:

  • Must be 1-64 characters
  • May only contain unicode lowercase alphanumeric characters (a-z, 0-9) and hyphens (-)
  • Must not start or end with a hyphen (-)
  • Must not contain consecutive hyphens (--)
  • Must match the parent directory name

Valid examples:

name: pdf-processing
name: data-analysis
name: code-review

Invalid examples:

name: PDF-Processing  # uppercase not allowed
name: -pdf  # cannot start with hyphen
name: pdf--processing  # consecutive hyphens not allowed

description field

The required description field:

  • Must be 1-1024 characters
  • Should describe both what the skill does and when to use it
  • Should include specific keywords that help agents identify relevant tasks

Good example:

description: Extracts text and tables from PDF files, fills PDF forms, and merges multiple PDFs. Use when working with PDF documents or when the user mentions PDFs, forms, or document extraction.

Poor example:

description: Helps with PDFs.

license field

The optional license field:

  • Specifies the license applied to the skill
  • We recommend keeping it short (either the name of a license or the name of a bundled license file)

Example:

license: Proprietary. LICENSE.txt has complete terms

compatibility field

The optional compatibility field:

  • Must be 1-500 characters if provided
  • Should only be included if your skill has specific environment requirements
  • Can indicate intended product, required system packages, network access needs, etc.

Examples:

compatibility: Designed for Claude Code (or similar products)
compatibility: Requires git, docker, jq, and access to the internet
compatibility: Requires Python 3.14+ and uv

Most skills do not need the compatibility field.

metadata field

The optional metadata field:

  • A map from string keys to string values
  • Clients can use this to store additional properties not defined by the Agent Skills spec
  • We recommend making your key names reasonably unique to avoid accidental conflicts

Example:

metadata:
  author: example-org
  version: "1.0"

allowed-tools field

The optional allowed-tools field:

  • A space-separated string of tools that are pre-approved to run
  • Experimental. Support for this field may vary between agent implementations

Example:

allowed-tools: Bash(git:*) Bash(jq:*) Read

Body content

The Markdown body after the frontmatter contains the skill instructions. There are no format restrictions. Write whatever helps agents perform the task effectively.

Recommended sections:

  • Step-by-step instructions
  • Examples of inputs and outputs
  • Common edge cases

Note that the agent will load this entire file once it's decided to activate a skill. Consider splitting longer SKILL.md content into referenced files.

Optional directories

scripts/

Contains executable code that agents can run. Scripts should:

  • Be self-contained or clearly document dependencies
  • Include helpful error messages
  • Handle edge cases gracefully

Supported languages depend on the agent implementation. Common options include Python, Bash, and JavaScript.

references/

Contains additional documentation that agents can read when needed:

  • REFERENCE.md - Detailed technical reference
  • FORMS.md - Form templates or structured data formats
  • Domain-specific files (finance.md, legal.md, etc.)

Keep individual reference files focused. Agents load these on demand, so smaller files mean less use of context.

assets/

Contains static resources:

  • Templates (document templates, configuration templates)
  • Images (diagrams, examples)
  • Data files (lookup tables, schemas)

Progressive disclosure

Agents load skills progressively, pulling in more detail only as a task calls for it. Skills should be structured to take advantage of this:

  1. Metadata (~100 tokens): The name and description fields are loaded at startup for all skills
  2. Instructions (< 5000 tokens recommended): The full SKILL.md body is loaded when the skill is activated
  3. Resources (as needed): Files (e.g. those in scripts/, references/, or assets/) are loaded only when required

Keep your main SKILL.md under 500 lines. Move detailed reference material to separate files.

File references

When referencing other files in your skill, use relative paths from the skill root:

See [the reference guide](references/REFERENCE.md) for details.

Run the extraction script:
scripts/extract.py

Keep file references one level deep from SKILL.md. Avoid deeply nested reference chains.

Validation

Use the skills-ref reference library to validate your skills:

skills-ref validate ./my-skill

This checks that your SKILL.md frontmatter is valid and follows all naming conventions.

When not to use it

If your agent product does not support the Agent Skills format, or if you are building a one-off script that will never be shared or reused, this specification adds unnecessary structure. The spec is designed for portable, multi-product skills.

Limits and gotchas

  • The name field must match the parent directory name. Renaming one without the other breaks the skill.
  • Consecutive hyphens in the name are forbidden, even though they look similar to valid single hyphens.
  • The allowed-tools field is experimental. Not all agent implementations will honour it, and behaviour may change.
  • The compatibility field is optional and most skills do not need it. Only add it when your skill has specific environment requirements.
  • Keep SKILL.md under 500 lines. Longer files waste context and defeat the purpose of progressive loading.
  • File references should stay one level deep from SKILL.md. Deeply nested reference chains are discouraged.

Related resources

Newsletter

The #1 AI Newsletter

The most important ai updates, guides, and fixes — one weekly email.

No spam, unsubscribe anytime. Privacy policy

Related Guides