Handmade by Devvrat. All rights reserved.
A skill is a folder. The folder holds SKILL.md. The file tells the agent how to do one task.
Anthropic made the format. Anthropic then released the format as an open standard. You write the skill once. You'll run it in Cursor, Claude Code, Codex, GitHub Copilot, VS Code, and Gemini CLI.
At the start, the agent reads the name and the description. The agent reads the steps only when the task matches.
code-review/
├── SKILL.md
├── scripts/
├── references/
└── assets/SKILL.md is required. The other three directories are optional.
scripts/ holds code the agent can run.references/ holds docs the agent reads on demand.assets/ holds templates, images, and data files.You can add other files. The three names above are the common ones.
SKILL.md starts with YAML frontmatter. The markdown body comes after the frontmatter.
nameThe name value has five rules.
code-review and pdf-processing pass the rules. Code-Review, -pdf, and pdf--processing break the rules.
descriptionThe description value has a hard limit of 1024 characters. The description says what the skill does. The description says when to use the skill. Put the user's words in the description.
This description is too thin:
description: Review code.This description names the checks and the trigger:
description: >
Review a diff for SQL injection, missing auth checks, and
errors with leaked internals. Use this skill when the user
asks for a review of a pull request, a branch, or a patch,
even when they don't say "security".Write the description as a command. Start with Use this skill when. Name the user goal. Name a near miss, so the agent skips the adjacent task.
| Field | Required | Limit |
|---|---|---|
| name | Yes | 64 characters. Must match the directory. |
| description | Yes | 1024 characters. Task plus trigger. |
| license | No | License name, or a bundled license file. |
| compatibility | No | 500 characters. Packages, product, or network. |
| metadata | No | Map of string keys to string values. |
| allowed-tools | No | Experimental. A space-separated tool list. |
Add compatibility when the skill needs a package, a product, or network access.
allowed-tools is experimental. Support for the field differs by agent.
The load has three stages. The spec calls this progressive disclosure.
name and description only. The catalog costs approximately 100 tokens for each skill.SKILL.md.A one-step task often skips the skill. Read this PDF is one step. The agent can read the file with basic tools. A skill earns the load on a team workflow, an unfamiliar API, or an uncommon format.
Keep the main file small.
SKILL.md under 500 lines.Move the long detail to references/. Tell the agent when to open the file.
If the API status is not 200, read references/api-errors.md.Use a path from the skill root. Keep each reference one level under SKILL.md. Do not chain a reference through more files.
Put a project skill in .agents/skills/. Put a personal skill in ~/.agents/skills/.
A project skill with the same name overrides the personal skill.
Put in SKILL.md only the facts the agent will miss. Skip the definition of a pull request. Skip the definition of SQL. The agent knows both.
Give one default. State the defect in the next sentence.
Use parameterized queries for every database call.
If the code builds SQL with string concatenation, flag the line.Put a gotcha in SKILL.md. The agent reads the gotcha before the mistake.
## Gotcha
The users table uses a soft delete. Each query needs `deleted_at IS NULL`.When the output shape matters, give a template. The agent matches a template more reliably than a prose description of the shape.
If the agent builds the same script on every run, put the script in scripts/. Point at the script from SKILL.md.
Run scripts/validate.py on the diff.A script for an agent takes flags, environment variables, or stdin. The script prints JSON on stdout. The script prints errors on stderr. The script won't take a typed answer. A prompt on the terminal hangs the run.
.agents/skills/code-review.SKILL.md in the new directory.name to code-review.The validator checks the frontmatter and the name rules. The tool is skills-ref in the Agent Skills repository.
The description carries the whole trigger. A thin description misses the task. A wide description loads on the wrong task.
Do not paste a failed prompt into the description. Name the category of the task. A keyword from one prompt fits one prompt and misses the next prompt.
Model output varies between runs. Three runs is the minimum for a trigger rate.
After the trigger is stable, grade the skill output on real tasks. Read the trace and the final file. A vague step makes the agent try several paths. The agent still follows a step for a different task.
A large set of skills gets expensive. Build better agent skills shows how to keep the set small.
The description decides if the skill runs. The folder holds the steps.
name to the directory.SKILL.md under 500 lines.