An Agent Skill is a folder with a SKILL.md file in it: YAML frontmatter with a name and a description, then Markdown instructions the agent loads only when a task needs them. If you follow the Agent Skills specification, one skill folder works in Claude Code, OpenAI Codex, GitHub Copilot, Cursor, and the other agents that read the format. This guide covers the spec's rules, how each of those tools finds skills, and a complete example you can drop into a repository today.

What Agent Skills are (and what they are not)

The Agent Skills overview describes the format as "a lightweight, open format for extending AI agent capabilities with specialized knowledge and workflows." Anthropic originally developed it, then released it as an open standard that other agent products adopted. The spec and reference tooling live in the agentskills/agentskills repository.

A skill packages procedural knowledge: how your team cuts a release, how to fill a specific PDF form, how to migrate a database safely in your stack. Without skills, that knowledge goes in one of three places:

  • A giant always-loaded instructions file (CLAUDE.md, AGENTS.md, Copilot instructions), which costs context on every request whether it is relevant or not.
  • A prompt you paste by hand each time.
  • An MCP server, which is heavyweight when all you need is "read this checklist and run this script."

Skills fill the gap. They are files in a folder, version-controlled with your code, and loaded on demand.

Progressive disclosure: why skills are cheap

The key design idea is progressive disclosure. The spec defines three stages:

  1. Metadata (about 100 tokens). At startup the agent loads only name and description for every installed skill.
  2. Instructions (under 5,000 tokens recommended). When a task matches a description, the agent reads the full SKILL.md body.
  3. Resources (as needed). Files in scripts/, references/, or assets/ load only when the instructions point the agent at them.

That means you can install dozens of skills and pay roughly a sentence of context for each until one is actually used. It also means the description field does most of the work: if it is vague, the agent never activates the skill.

The SKILL.md specification, field by field

A skill is a directory containing at minimum a SKILL.md file. The recommended layout from the spec:

release-notes/
├── SKILL.md          # Required: metadata + instructions
├── scripts/          # Optional: executable code
├── references/       # Optional: documentation loaded on demand
└── assets/           # Optional: templates, schemas, images

SKILL.md must start with YAML frontmatter followed by Markdown. These are the fields the specification defines:

Field Required Constraints
name Yes 1–64 characters; lowercase a-z, 0-9 and hyphens only; no leading, trailing, or consecutive hyphens; must match the parent directory name
description Yes 1–1,024 characters; should say what the skill does and when to use it
license No License name or a reference to a bundled license file
compatibility No 1–500 characters; environment requirements such as system packages or network access
metadata No Map of string keys to string values for client-specific data
allowed-tools No Space-separated list of pre-approved tools; marked experimental, support varies by agent

The name rules trip people up

The name must match the folder. release-notes/SKILL.md needs name: release-notes. These are invalid:

name: Release-Notes   # uppercase not allowed
name: -release        # cannot start with a hyphen
name: release--notes  # consecutive hyphens not allowed

Writing a description that actually triggers

The spec's own example of a poor description is Helps with PDFs. Its good example names concrete actions and the words a user is likely to say. Apply the same pattern:

# Weak: the agent cannot tell when this applies
description: Release helper.

# Strong: actions + trigger phrases
description: Drafts release notes and a CHANGELOG entry from git history since the last tag. Use when the user asks for release notes, a changelog, "what shipped", or is preparing a version bump or GitHub release.

Two practical notes. First, front-load the use case: Claude Code's docs say the combined description and when_to_use text is truncated at 1,536 characters in its skill listing. Second, write in the third person about the task rather than about the user; the description is read by a model deciding relevance, not by a human.

Body content and size

The spec puts no format restrictions on the body, but recommends step-by-step instructions, input/output examples, and edge cases. Two limits matter:

  • Keep SKILL.md under 500 lines and move detail into references/.
  • Keep file references one level deep from SKILL.md, using relative paths such as references/STYLE.md. Avoid chains where one reference file sends the agent to another.

Scripts, references, and assets

  • scripts/ holds executable code. The spec asks that scripts be self-contained or document their dependencies, print helpful errors, and handle edge cases. Language support depends on the agent; Python, Bash, and JavaScript are the common choices.
  • references/ holds documentation the agent reads on demand: a detailed REFERENCE.md, form templates, domain notes. Smaller, focused files mean less context per read.
  • assets/ holds static resources: templates, schemas, lookup tables, images.

The big win of scripts/ is determinism. Instead of asking the model to reconstruct a 20-line git pipeline from prose every time, you ship the pipeline and tell the agent to run it.

A complete, working example skill

Here is a skill that drafts release notes from git history. It uses all three optional directories correctly and stays well within the size guidance.

SKILL.md

---
name: release-notes
description: Drafts release notes and a CHANGELOG entry from git history since the last tag. Use when the user asks for release notes, a changelog, "what shipped", or is preparing a version bump or GitHub release.
license: MIT
compatibility: Requires git and Python 3.9+ on PATH.
metadata:
  author: platform-team
  version: "1.2"
---

# Release notes

## Steps

1. Run `python3 scripts/collect_commits.py` from the repository root.
   It prints JSON: the last tag (`since_tag`) and commits grouped by
   Conventional Commit type (`feat`, `fix`, `perf`, `other`, ...).
2. If `since_tag` is null, tell the user there are no tags and ask which
   commit to start from before continuing.
3. Write the notes using the structure in `assets/TEMPLATE.md`.
4. Follow the wording rules in `references/STYLE.md`.
5. Show the draft to the user. Do not edit CHANGELOG.md or create a tag
   unless the user explicitly asks.

## Edge cases

- Commits whose type is `other` need a human-readable summary; never paste
  the raw subject if it is unclear ("wip", "fix stuff"). List them under
  "Needs review" instead.
- A `!` after the type (`feat!:`) means a breaking change. Put it in the
  "Breaking changes" section first, even if it is also a feature.

scripts/collect_commits.py

This script uses only the standard library and was tested against a repository with tags, without tags, and outside a repository:

#!/usr/bin/env python3
"""Print commits since the most recent git tag, grouped by Conventional Commit type."""
import json
import subprocess
import sys


def git(*args: str) -> str:
    result = subprocess.run(["git", *args], capture_output=True, text=True)
    if result.returncode != 0:
        raise RuntimeError(result.stderr.strip() or f"git {' '.join(args)} failed")
    return result.stdout.strip()


def main() -> int:
    try:
        git("rev-parse", "--is-inside-work-tree")
    except (RuntimeError, FileNotFoundError) as exc:
        print(f"error: not inside a git repository ({exc})", file=sys.stderr)
        return 1

    try:
        since = git("describe", "--tags", "--abbrev=0")
        rev_range = f"{since}..HEAD"
    except RuntimeError:
        since, rev_range = None, "HEAD"  # no tags yet: use full history

    groups: dict[str, list[dict[str, str]]] = {}
    for line in git("log", rev_range, "--no-merges", "--pretty=format:%h%x09%s").splitlines():
        if not line:
            continue
        sha, subject = line.split("\t", 1)
        prefix = subject.split(":", 1)[0] if ":" in subject else ""
        kind = prefix.split("(", 1)[0].rstrip("!").lower() or "other"
        groups.setdefault(kind, []).append({"sha": sha, "subject": subject})

    json.dump({"since_tag": since, "groups": groups}, sys.stdout, indent=2)
    print()
    return 0


if __name__ == "__main__":
    sys.exit(main())

Note that compatibility says Python 3.9+ because the script uses built-in generic annotations like dict[str, list[...]], which need 3.9 or later.

references/STYLE.md and assets/TEMPLATE.md

Keep these short and specific. For example:

# Release notes style

- Lead each bullet with the user-visible effect, not the implementation.
- Present tense, no trailing periods, max 15 words per bullet.
- Link the short SHA: [abc1234](../../commit/abc1234).
- Never mention internal ticket numbers.
## vX.Y.Z (YYYY-MM-DD)

### Breaking changes
### Features
### Fixes
### Needs review

Validate before you commit

The spec ships a reference validator, skills-ref. Its README notes it is intended for demonstration rather than production use, and installs from the repository:

git clone https://github.com/agentskills/agentskills.git
cd agentskills/skills-ref
python -m venv .venv && source .venv/bin/activate
pip install -e .

skills-ref validate /path/to/release-notes
skills-ref read-properties /path/to/release-notes

validate checks the frontmatter and naming rules; read-properties prints the parsed metadata as JSON. Run it in CI so a renamed folder or an over-long description fails the build instead of silently disabling the skill.

Where each agent looks for skills

The format is portable; the install location is not. These paths come from each vendor's own documentation:

Agent Project skills Personal skills Manual invocation
Claude Code .claude/skills/<name>/ ~/.claude/skills/<name>/ /skill-name
OpenAI Codex .agents/skills/ (scanned from the working directory up to the repo root) $HOME/.agents/skills /skills or $skill-name
GitHub Copilot .github/skills, .claude/skills, or .agents/skills ~/.copilot/skills or ~/.agents/skills Varies by surface
Cursor .cursor/skills/ or .agents/skills/ (also reads .claude/skills/ and .codex/skills/) ~/.cursor/skills/ or ~/.agents/skills/ / in Agent chat

The practical takeaway: .agents/skills/ is the most portable project location among these four. Codex, Copilot, and Cursor read it directly. Claude Code's documented project path is .claude/skills/, and both Copilot and Cursor also read .claude/skills/. If your team uses Claude Code alongside the others, committing to .claude/skills/ covers Claude Code, Copilot, and Cursor; adding a symlink from .agents/skills covers Codex too.

Copilot's docs list the GitHub Copilot app, Copilot CLI, the Copilot cloud agent, Copilot code review, and agent mode in VS Code, Visual Studio, and JetBrains IDEs as supported surfaces, with the caveat that "supported locations depend on the surface."

Vendor extensions: stay portable on purpose

Several agents extend the frontmatter. That is fine, but it is where portability breaks.

Claude Code adds fields including disable-model-invocation (only a human can trigger the skill, useful for /deploy), user-invocable: false (only the model can trigger it), context: fork to run in a forked subagent, argument-hint, model, effort, hooks, and paths. Its docs also warn that outside Claude Code (claude.ai uploads, the Skills API) only the six standard fields are accepted, and anything else is a hard error at packaging or upload.

Cursor documents disable-model-invocation as well, plus a paths field for scoping a skill to files, and it scopes skills found in nested directories to that subtree automatically.

Codex keeps extras out of SKILL.md entirely: an optional agents/openai.yaml file holds UI metadata, invocation policy (allow_implicit_invocation: false disables automatic activation), and tool dependencies.

A good rule: put only the six spec fields in SKILL.md for any skill you intend to share across tools, and add vendor-specific fields only to skills that are deliberately tool-specific. Unknown fields may be ignored by one agent and rejected by another.

Skills vs AGENTS.md, CLAUDE.md, and MCP

These are complementary, and mixing them up is the most common design mistake.

Mechanism Loaded when Best for
AGENTS.md / CLAUDE.md / Copilot instructions Every session Short, always-true facts: build commands, code style, repo layout
Agent Skill Only when the task matches the description Multi-step procedures, checklists, bundled scripts and templates
MCP server When the agent calls a tool Live access to external systems: APIs, databases, SaaS products

Put "run pnpm test before committing" in AGENTS.md. Put "here is our 12-step release procedure plus the script that collects commits" in a skill. Put "query the production metrics API" behind an MCP server. Skills can and often do tell the agent to use an MCP tool; they do not replace it. If you are building the server side of that, our guide on how to build an MCP server and the comparison of MCP vs REST APIs cover the trade-offs.

Security: a skill is code you are choosing to run

Skills can bundle scripts, and the agent may run them with your permissions. Treat a third-party skill the way you treat a third-party package:

  • Read SKILL.md and every file in scripts/ before installing.
  • Be careful with allowed-tools. Pre-approving Bash broadly removes the confirmation step that would have caught a malicious command. Prefer narrow patterns such as Bash(git:*), and remember the spec marks the field experimental.
  • Watch for prompt injection in references/ files: instructions hidden in a "reference" document are still instructions to the model.
  • Pin shared skills to a commit or review changes in pull requests, the same as any other code.

Frequently Asked Questions

Is SKILL.md the same as AGENTS.md?

No. AGENTS.md (and CLAUDE.md) are loaded into every session and suit short, always-relevant project facts. A SKILL.md is loaded only when the agent decides the task matches its description, so it can hold long procedures, scripts, and templates without costing context on unrelated tasks.

Which fields are required in SKILL.md frontmatter?

Only name and description. The name must be 1–64 lowercase letters, digits, or hyphens and must match the folder name. The description can be up to 1,024 characters and should state both what the skill does and when to use it. license, compatibility, metadata, and the experimental allowed-tools are optional.

Where should I put skills so they work in Claude Code, Codex, Copilot, and Cursor?

There is no single folder all four read, according to their current docs. .agents/skills/ is read by Codex, Copilot, and Cursor; .claude/skills/ is read by Claude Code, Copilot, and Cursor. Many teams commit skills to one of these and symlink the other.

Do Agent Skills replace MCP servers?

No. MCP gives an agent live tools and data from external systems. A skill gives it instructions and local resources. A common pattern is a skill whose instructions tell the agent which MCP tools to call and in what order.

Why isn't my skill being used?

Usually the description. Make it name concrete actions and the phrases users actually type, and check that name matches the directory, since a mismatch fails validation. Most agents also let you invoke a skill explicitly (/skill-name in Claude Code and Cursor, $skill-name in Codex) to confirm it loads.

How big should a skill be?

The spec recommends keeping the SKILL.md body under roughly 5,000 tokens and under 500 lines, with detailed material moved into references/ files that load on demand.

Conclusion

Agent Skills turn tribal knowledge into versioned, testable files that any compliant agent can pick up. The spec is small: a folder, a SKILL.md with a valid name and a precise description, and optional scripts/, references/, and assets/. Get the description right, keep the body short, push determinism into scripts, validate with skills-ref in CI, and stick to the six standard fields for anything you want to share across tools. Then pick the install path that matches your team's agents, since that, not the format, is where the remaining differences are.

If you are standardizing how your team works with coding agents, our comparisons of Claude Code vs Cursor and the roundup of AI context management tools are useful next reads, and our free developer tools include a JSON formatter and Markdown converter that come in handy when authoring skill files.