How to Write Your Own Agent Skill (SKILL.md), and Where Each Tool Looks for It (November 2026)

Glasp AI Tools

Glasp AI Tools

Nov 21, 2026

5 min read

A skill is a folder whose name matches the skill's name, holding a SKILL.md that starts with YAML frontmatter (name and description, both required) followed by the instructions in Markdown. Under the open specification, name is at most 64 characters of lowercase letters, digits and hyphens, and description is at most 1,024 characters and says both what the skill does and when to use it. The same folder then works in Claude Code, Codex, Cursor and VS Code, as long as it sits in a folder that tool reads and uses only the standard fields. The rules below are from the specification and each vendor's documentation as of November 2026.


The minimum skill

The Agent Skills quickstart builds a dice skill at .agents/skills/roll-dice/SKILL.md:

  • First, a frontmatter block between two lines of three hyphens, with name: roll-dice and a description that begins "Roll dice using a random number generator. Use when asked to roll a die (d6, d20, etc.), roll dice, or generate a random dice roll."

  • Then the body in plain Markdown: a short instruction that starts "To roll a die, use the following command that generates a random number from 1 to the given number of sides", followed by the command.

The page explains that name "must match the folder name", that the description "is how the agent decides whether to activate it", and that the body is what the agent follows once the skill is active. Anthropic's skills repository ships a similar starting template with Examples and Guidelines sections.


The frontmatter rules

  • name: 1 to 64 characters, lowercase letters, digits and hyphens only, not starting or ending with a hyphen, no double hyphens, and matching the parent folder. (Agent Skills specification)

  • description: 1 to 1,024 characters; it "should describe both what the skill does and when to use it" and include keywords that help agents match tasks. The specification contrasts a useful description with "Helps with PDFs." (same page)

  • Optional: license, compatibility (up to 500 characters, only for real environment needs), metadata (string keys and values) and allowed-tools (experimental, support varies by agent). (same page)

  • Claude adds two restrictions of its own: names cannot contain XML tags or the reserved words anthropic and claude. (Claude documentation: Agent Skills)


Size and structure

  • Optional folders: scripts/ for code the agent can run, references/ for documents it reads when needed, assets/ for templates and data. (Agent Skills specification)

  • Keep SKILL.md under 500 lines and the instructions under about 5,000 tokens; move detail into reference files, link them with relative paths, and keep references one level deep from SKILL.md. (same page)

  • Check the result with skills-ref validate ./my-skill, from the skills-ref library in the specification repository, whose code is Apache 2.0 and documentation CC BY 4.0. The specification says the command checks the frontmatter and naming rules. (same page)


Where to put it, by tool

  • Claude Code: ~/.claude/skills/<skill-name>/SKILL.md for every project, .claude/skills/<skill-name>/SKILL.md for one repository, or inside a plugin. Claude Code accepts extra fields such as disable-model-invocation, context and model, but warns that outside Claude Code any field the specification does not allow makes packaging or upload fail. (Claude Code documentation: skills)

  • Claude apps: the skill folder is uploaded as a ZIP, managed under Customize > Skills, with code execution turned on under Settings > Capabilities. (Claude Help Center: using Skills in Claude) Anthropic's developer documentation notes that custom skills do not sync between claude.ai, the API and Claude Code. (Claude documentation: Agent Skills)

  • Codex and the ChatGPT desktop app: .agents/skills from the working directory up to the repository root, $HOME/.agents/skills for the user, /etc/codex/skills for administrators. An optional agents/openai.yaml sets appearance, invocation policy and tool dependencies. (OpenAI documentation: build skills)

  • Cursor: .agents/skills/ or .cursor/skills/ in the project, ~/.agents/skills/ or ~/.cursor/skills/ for the user, and it also reads .claude/skills/ and .codex/skills/. Cursor adds optional fields such as paths and disable-model-invocation. (Cursor documentation: skills)

  • VS Code with GitHub Copilot: .github/skills/ in the project and ~/.copilot/skills/ for the user, with .claude/skills/ and .agents/skills/ read for the Claude and Codex harnesses. The page warns that an invalid name makes the skill "silently fail to load". (VS Code documentation: agent skills)

A project folder at .agents/skills/<skill-name>/ is read by Codex, Cursor and VS Code per their pages; Claude Code's page lists .claude/skills/ instead, which Cursor and VS Code also read.


Writing the description and testing it

Anthropic's skill-creator skill, in the same skills repository, treats the description as the main trigger and suggests making it "a little bit 'pushy'", since Claude tends to under-trigger skills. Its process writes two or three realistic test prompts, runs each with and without the skill, and then tunes the description against a set of should-trigger and near-miss queries. OpenAI's page gives similar advice: put the key use cases and trigger words first in the description.

Which tools support skills at all is in the guide to where Agent Skills work, and existing skills to learn from are in the guide to Agent Skills catalogs.


FAQ

Does a skill written for Claude work in Codex or Cursor?

The folder format and the name and description fields are shared. A skill moves cleanly when it uses only the standard fields and is placed in a folder the other tool reads.

What is the most common reason a skill does not load?

The pages read point to the name: it must be lowercase with hyphens and match the folder name, and VS Code says an invalid name makes the skill fail to load without an error.

Does a skill need scripts?

No. A SKILL.md alone is a complete skill. OpenAI's page suggests instructions over scripts unless the task needs deterministic behavior or outside tools.

Compiled by Glasp from public pages read on November 21, 2026. No skill was written, validated or run for this page; field names and folders are as each vendor's documentation stated on that day.

Comments

Add a comment