SKILL.md Format

A SKILL.md is Markdown with a YAML frontmatter block. The frontmatter tells the agent when to use the skill; the body tells it how. Get the frontmatter wrong and the best instructions in the world never load.

Minimal valid file

---
name: og-image
description: Create 1200x630 social preview images from a title and optional screenshot. Use when the user asks for an OG image, social card, or link preview.
---

# OG Image

1. Read the title and the page URL.
2. Pick a layout from `references/layouts.md`.
3. Render at 1200x630 with 80px safe margins.
4. Export PNG under 300 KB.

Two fields are required. That's a valid skill.

Field reference

FieldRequiredRules
nameYesMax 64 chars; lowercase letters, numbers, hyphens; no leading/trailing hyphen
descriptionYesMax 1024 chars; non-empty; says what it does and when to use it
licenseNoLicense name or a reference to a bundled file
compatibilityNoMax 500 chars; environment requirements
metadataNoArbitrary key-value pairs (version, author)
allowed-toolsNoRestrict which tools the skill may use

The description is the product

Everything else can be mediocre and the skill still works; a bad description makes it invisible. Write it as: capability + trigger phrases.

Weak:

Helps with images.

Strong:

Create 1200×630 social preview images from a title and optional screenshot. Use when the user asks for an OG image, social card, or link preview.

Body structure that works

  1. One sentence: what this produces
  2. Inputs required
  3. Numbered steps
  4. Output format and constraints
  5. Failure cases ("if no screenshot, use the type-only layout")

Keep it under ~500 lines. If it's longer, move reference material into references/ and load it only when needed.

Optional directories

FolderHoldsLoaded
scripts/Executable helpersOn demand
references/Long docs, checklistsOn demand
assets/Fonts, templates, imagesOn demand

This is progressive disclosure: the agent reads the map first, then opens the drawer it needs.

Validation checklist

  • [ ] Frontmatter parses as YAML
  • [ ] name matches the folder name
  • [ ] description includes at least three phrases a user would actually type
  • [ ] Steps are imperative and ordered
  • [ ] Every referenced file exists
  • [ ] Output format is explicit (size, file type, naming)

FAQ

Can I add custom fields? Yes, under metadata. Unknown top-level fields may be ignored.

Does the filename have to be SKILL.md? Yes, in every implementation I've checked.

Can one skill call another? It can instruct the agent to use another skill, but don't build deep chains — behaviour becomes hard to predict.

Related

Install skills · Skill not loading · What are Agent Skills