Skip to content

How to write a SKILL.md that your agent actually uses

By the Toolbay team · Checked against the sources below on

A skill that never runs is almost always a description problem. The agent sees only each skill's name and description until it decides to load one, so the description must say what the skill does and when to use it, in the words a user would type.

Below: the format, the rules from the open Agent Skills specification, and a complete skill you can copy.

The format

A skill is a folder. The folder holds SKILL.md: YAML frontmatter between --- lines, then Markdown instructions. It may also hold scripts/, references/ and assets/ folders that the instructions point to.

folder layout
code-review/
  SKILL.md
  references/
    checklist.md
  scripts/
    changed-files.sh
Frontmatter fields in the Agent Skills spec (agentskills.io, checked 2026-11-24)
FieldRequiredRule
nameYes1-64 characters: a-z, 0-9 and hyphens, no leading, trailing or double hyphen. Must equal the folder name.
descriptionYes1-1024 characters. What it does and when to use it.
licenseNoA licence name or a bundled file.
compatibilityNo1-500 characters.
metadataNoA map of string keys to string values.
allowed-toolsNoSpace-separated. Experimental; support varies by agent.

Claude Code accepts more fields (for example when_to_use, disable-model-invocation and paths) and only really needs description. But claude.ai uploads and the Skills API reject fields outside the six above. To ship one file that works in Claude Code, Cursor and Codex, use only the six.

Write a description that triggers

  • Start with the job: "Reviews a git diff for bugs, missing tests and security issues."
  • Then say when: "Use when the user asks for a code review, a PR review, or to check changes before committing."
  • Use the words people type (review, PR, diff), not internal names.
  • Keep it well under the limit. Claude Code cuts the combined description and when_to_use text at 1,536 characters in its skill list.

A complete example

code-review/SKILL.md
---
name: code-review
description: Reviews uncommitted changes for bugs, missing tests and security issues, and reports each finding with file and line. Use when the user asks for a code review, a PR review, or to check changes before committing.
license: MIT
---

# Code review

1. Run `git diff HEAD` to see the changes. If it is empty, say so and stop.
2. Read each changed file in full, not only the diff lines.
3. Check, in this order:
   - Bugs: wrong conditions, missing null checks, off-by-one, unhandled errors.
   - Tests: is there a test for each changed behaviour? Run the test command from CLAUDE.md or AGENTS.md.
   - Security: secrets in code, unvalidated input, SQL built from strings.
4. Report findings as a list: severity (high, medium, low), file:line, the problem, a suggested fix.
5. Do not edit files. If there are no findings, say "No issues found" and list what you checked.

See references/checklist.md for the full checklist.

Limits that keep a skill fast

  • Keep SKILL.md under 500 lines and the instructions under about 5,000 tokens (spec guidance).
  • Put long material in references/, one level deep, and tell the agent when to read it. It loads only when needed.
  • Number the steps and say what done looks like. Vague skills give vague output.
  • Say what the skill must not do ("Do not edit files"). It stops the agent from wandering.

Test it before you share it

  1. Validate the format: skills-ref validate ./code-review (the reference validator from the agentskills repo).
  2. Install it (see the install guide) and ask for the task in plain words without naming the skill. If it does not load, rewrite the description.
  3. Ask for something close but different. A good skill does not load for that.
  4. Run the same task with and without the skill and compare the outputs. If they are the same, the skill is not helping.

Questions people ask

Why is my skill not triggering?
The description does not match how you asked. Name the task and the trigger words in the description, check the folder name equals the name field, and check SKILL.md is directly inside the skill folder.
Is SKILL.md only for Claude?
No. It is an open format. Claude Code, Cursor and Codex all read SKILL.md folders, and many other agents do too.