Agent Skills · Learn · The open SKILL.md standard
Guide

How to write a SKILL.md

A good skill is small, specific, and triggers on the right tasks. Here's the workflow — agent-agnostic, so the result works across Hermes, Cursor, Codex, Gemini CLI, OpenCode, Claude Code and more.

1. Scope it to one job

The best skills do one thing well. "Generate Conventional Commit messages" is a skill; "help with git" is a category. A tight scope makes the description easy to write and the triggering reliable.

2. Write the frontmatter — the description is everything

---
name: conventional-commits
description: Write Conventional Commits messages from a staged git diff.
  Use when the user is committing code or asks for a commit message.
license: MIT
---

State what it does and when to use it. The agent matches the user's task against this text, so be concrete. See the frontmatter reference for every field.

3. Write concise, imperative instructions

Speak to the agent. Short sections, numbered steps, concrete examples. Cut anything the model already knows — you're adding your conventions, not a tutorial. Because some agents read only the body (not the frontmatter), make the body self-contained.

4. Bundle scripts and references if needed

Drop helper scripts in scripts/ and longer docs in references/. Reference them from the SKILL.md by relative path; the agent loads them on demand. Keep the SKILL.md itself lean — point to references rather than inlining everything.

5. Test the trigger

Install it (see the install guide) and try the tasks it should fire on — and a few it shouldn't. If it doesn't load when expected, tighten the description. If it loads too eagerly, narrow it.

6. Keep it portable

Avoid hard-coding one agent's tool names or paths in the instructions. If a step needs a specific tool, describe the goal ("run the test suite") so any agent can satisfy it. Portable skills reach the widest audience across the 40+ compatible clients.

How to write a skill — answered

How long should a SKILL.md be?
As short as it can be while still capturing your conventions. Lean on the body for the essentials and push long material into references/ files the agent loads on demand. Brevity improves both triggering and the model's focus.
How do I make a skill work across multiple agents?
Keep the body self-contained (some agents ignore frontmatter), and describe goals rather than hard-coding one agent's tool names or paths. Then install it into each agent's skills or rules directory — see the install guide.
Why isn't my skill triggering?
Almost always the description. Rewrite it to state what the skill does and the exact situations to use it in, using words a user would actually say. Then re-test on tasks that should and shouldn't fire it.