Agent Skills and SKILL.md: How to Create a Skill for Any AI Agent
Agent skills are an open way to give any AI agent reusable know-how through a single SKILL.md file. This guide covers the format, how agents load it, how to write one skill that works in Claude, Codex, and Gemini, and how to keep it safe.
What are Agent Skills? (the open standard)
Agent Skills are reusable capabilities you give an AI agent as a small folder containing a SKILL.md file. The agent reads each skill's name and description up front and loads the full instructions only when a task matches — so one agent can carry many skills without bloating its context.
It's an open standard, not one vendor's feature. Anthropic originally developed the format and released it as an open standard on December 18, 2025; today the same SKILL.md runs in Claude Code, OpenAI Codex, Gemini CLI and Antigravity, GitHub Copilot, VS Code, Cursor, and dozens of other agents.
my-skill/
- SKILL.mdmetadata + instructionsrequired
- scripts/code the agent can runoptional
- references/docs read only when neededoptional
- assets/templates, images, dataoptional
SKILL.md
Frontmatter · always visible
---
name: my-skill
description: What it does + when to use it
---
Body · read when the skill fires
# Instructions
1. …
2. …
Anatomy of a SKILL.md file
A SKILL.md starts with YAML frontmatter between --- lines, followed by a Markdown body with the instructions. The open standard defines these frontmatter fields:
| Field | Required? | Rules |
|---|---|---|
name | Yes | 1–64 characters: lowercase letters, numbers, and hyphens; no leading, trailing, or double hyphens; matches the folder name |
description | Yes | 1–1,024 characters: what the skill does and when to use it, with the keywords a user would type |
license | No | A license name or a bundled license file |
compatibility | No | Up to 500 characters on what the skill needs, such as tools or network access |
metadata | No | Free-form key–value pairs, like author or version |
allowed-tools | No | Experimental: tools the skill may use without asking. A pre-approval, not a restriction |
Individual agents add their own extras on top — Claude Code can make a skill manual-only, and Codex reads an optional agents/openai.yaml for display names and invocation policy. Agents ignore fields they don't use, so the core stays portable.
The body has no required format, but the standard recommends step-by-step instructions, examples of inputs and outputs, and common edge cases — kept under about 500 lines, with longer material moved into references/.
How progressive disclosure works
Skills stay cheap because the agent reveals them to itself in three stages: discovery, activation, execution.
Level 1 · Always loaded
name + description — the “book spine”
Level 2 · Loaded when relevant
the full SKILL.md body — your instructions
Level 3 · Opened only if needed
extra files: reference.md, templates, scripts…
At startup the agent loads only names and descriptions. When your request matches one, it reads that skill's full SKILL.md. Bundled scripts and references are opened only if the instructions need them. Each agent also caps how much context the skill list may use — Claude Code budgets about 1% of the context window for it, Codex about 2% — so short, specific descriptions matter more as your library grows.
How to create a SKILL.md file (tool-agnostic)
These steps work in any compatible agent; only the folder in step 1 changes per tool.
1. Create a folder named after the skill
Use lowercase letters and hyphens, for example pr-review/, inside your agent's skills folder (see the table in the next section).
2. Write the frontmatter
Add SKILL.md with a name identical to the folder and a description that answers two questions: what does it do, and when should the agent use it?
3. Write the instructions
Below the frontmatter, write short imperative steps. Say what to check first, what the output should look like, and what to avoid. Here's a complete, portable example:
---
name: pr-review
description: Reviews a pull request for bugs, security issues, and style. Use when the user asks to review code, a diff, or a PR.
---
# PR review
1. Read the full diff before commenting.
2. Flag correctness bugs first, then security, then style.
3. Give concrete feedback with file:line references.
4. End with approve or request-changes and a one-line summary.4. Test the trigger
Ask for the job the way you normally would — "review this PR" — and check that the agent picks the skill. If it doesn't, the description is almost always the thing to fix.
One SKILL.md across Claude, Codex, and Gemini / Antigravity
The file is identical everywhere; only the install folder differs.
- Claude Code~/.claude/skills/<name>/
- Codex~/.agents/skills/<name>/
- Gemini CLI~/.gemini/skills/<name>/
…and other agents that read the open standard, such as GitHub Copilot, Cursor, and VS Code.
| Agent | Personal folder | Project folder |
|---|---|---|
| Claude Code | ~/.claude/skills/<name>/ | .claude/skills/<name>/ |
| OpenAI Codex | ~/.agents/skills/<name>/ | .agents/skills/<name>/ |
| Gemini CLI | ~/.gemini/skills/<name>/ | .gemini/skills/ or .agents/skills/ |
| Antigravity CLI | ~/.gemini/antigravity-cli/skills/<name>/ | .agents/skills/<name>/ |
One folder for three agents
A repo's .agents/skills/ folder is read by Codex, Gemini CLI, and Antigravity. Keep your team's skills there, and copy them into .claude/skills/ for Claude Code.
SKILL.md is not an Azure AI Search skillset or a Gemini Gem
Two frequent mix-ups:
- Azure AI Search "skillsets" are enrichment pipelines for search indexing — unrelated to agent
SKILL.mdfiles. - Gemini "Gems" are no-code custom chatbots at gemini.google.com, not
SKILL.mdfiles. Google is converting Gems into skills in the Gemini app from November 2026, and the app can already import aSKILL.mdon the web and the Mac app.
If you're here to build an agent capability as a file, agent skills / SKILL.md is what you want.
Are agent skills safe?
A skill is instructions your agent follows with the access it already has — so it's exactly as safe as the file you install. Read the whole SKILL.md, open every bundled script, and prefer sources you can verify. The full checklist is in are agent skills safe?
Install skills like you install software
A SKILL.md from an unknown source can tell your agent to run commands or send data somewhere. Treat each install — and each update — as code you're about to run.
Create your skill by tool
Pick your agent for a step-by-step guide:
Or get the fundamentals in what are agent skills, compare the always-on files in SKILL.md vs CLAUDE.md vs AGENTS.md, and grab a SKILL.md template.
Build your first agent skill now
Skip the boilerplate with the free Skill Builder, or browse ready-made skills to install one in seconds.
A skill that works everywhere
- Folder and
namematch: lowercase letters, numbers, hyphens descriptionsays what and when, in a user's words- Instructions are short, concrete steps; body under ~500 lines
- Long material lives in
references/, code inscripts/ - Tested in each agent you plan to use