Agent Skills is an open standard for instructions, scripts, and references that agents load on demand. This reference covers layout, frontmatter, writing patterns, and discovery.

Getting started

Introduction

Agent Skills is an open standard for instructions, scripts, and references that agents load on demand. This reference covers layout, frontmatter, writing patterns, and discovery.

Anatomy

skill-name/
├── SKILL.md
├── scripts/
├── references/
└── assets/

SKILL.md is required; the rest are optional. Scripts execute without loading into context, references load on demand, and assets land in output.

See: Skill structure

Sample skill

---
name: summarize-changes
description: >
  Summarizes uncommitted changes. Use when asked what changed.
---

Run `git diff HEAD`, then list the risks.

Frontmatter first, then plain instructions. The body loads only when the skill activates.

See: SKILL.md format

Locations

HarnessProjectUser
Claude Code.claude/skills/~/.claude/skills/
Codex.agents/skills/~/.agents/skills/
Gemini CLI.gemini/skills/~/.gemini/skills/
Cursor.cursor/skills/~/.cursor/skills/
Copilot.github/skills/~/.copilot/skills/

Codex and Claude Code also scan parent directories; most harnesses read .agents/skills/. Review allowed-tools and scripts before trusting a repo skill.

See: Claude Code skills, Codex skill locations

Frontmatter

Fields

FieldRequiredRules
nameyes1–64 chars, lowercase, matches folder
descriptionyes1–1024 chars, what and when
licensenoname or bundled file
compatibilitynoenvironment needs, 500 chars
metadatanostring map for client data
allowed-toolsnopre-approved tools (experimental)

Names use lowercase letters, numbers, and single hyphens. PDF-Processing, -pdf, and pdf--processing are invalid.

See: Frontmatter fields

Claude Code

# Use one invocation flag, not both
disable-model-invocation: true   # only /name runs it
# user-invocable: false          # only the model runs it
paths: "src/**/*.ts"             # activate on matching files
context: fork                    # run in a subagent

These extras work in Claude Code, but claude.ai uploads and the Skills API accept only the six spec fields.

See: Frontmatter reference

Codex

# agents/openai.yaml
interface:
  display_name: "Release notes"
policy:
  allow_implicit_invocation: false

Codex keeps UI metadata and invocation policy in agents/openai.yaml.

See: Optional metadata

Writing

Descriptions

description: >
  Extracts text and tables from PDFs, fills forms, and merges files.
  Use when the user mentions PDFs, forms, or document extraction.

Lead with the capability, then words a user would type. Third person: the description is injected into the system prompt. Helps with documents never triggers.

See: Optimizing descriptions

Progressive disclosure

StageLoadsBudget
Discoveryevery skill's name and description~100 tokens
Activationthe full SKILL.mdunder 5k tokens
Executionscripts/, references/none until read

Keep SKILL.md under 500 lines, keep references one level deep, and say when to read each file.

See: Progressive disclosure

Gotchas

## Gotchas

- `users` uses soft deletes: filter `WHERE deleted_at IS NULL`.
- `user_id` (db), `uid` (auth), `accountId` (billing) are one value.
- `/health` returns 200 with the database down; use `/ready`.

Usually the highest-value section: add a line every time an agent gets something wrong it could not have guessed.

See: Gotchas sections

Workflows

Loops

- [ ] Analyze the form: `scripts/analyze.py input.pdf`
- [ ] Map fields into `fields.json`
- [ ] Validate the mapping
- [ ] Fill and verify the output

Validation is the gate: a script checks the plan against the source of truth before anything is written. Fix and re-run until it passes.

See: Plan, validate, execute

Scripts

python scripts/analyze.py input.pdf > fields.json

Non-interactive only: flags, env vars, or stdin. Data to stdout, diagnostics to stderr, --help works, and say whether to run or read it.

See: Using scripts

Testing

Trigger evals

[
  { "query": "extract tables from this PDF", "should_trigger": true },
  { "query": "rename this branch", "should_trigger": false }
]

Write about 20 queries (8–10 positive, 8–10 negative), run each three times, and keep a 60/40 train/validation split.

See: Optimizing descriptions

Output evals

{
  "id": 1,
  "prompt": "Extract text from document.pdf",
  "files": ["evals/files/document.pdf"],
  "expected_output": "Every page read; text saved to output.txt"
}

Cases live in evals/evals.json. Run each with and without the skill, grade the assertions, and read the traces; wasted exploration means vague instructions.

See: Evaluating skills

References

0 Comments for this cheatsheet. Write yours!