What Is a SKILL.md File?
A SKILL.md file is a structured Markdown document that defines a reusable capability for an AI coding agent. It tells the agent what skill it can use, when to use it, and how to execute it — all in plain Markdown with optional metadata at the top.
Think of a SKILL.md as a recipe. Instead of describing how to review a pull request or run a deployment in every conversation, you write it once in a SKILL.md file, and the agent reads it whenever that skill is needed. One file, one skill, no code.
Every SKILL.md has two parts:
- Frontmatter metadata — YAML block at the top with the skill's name, description, version, and trigger tags
- Instructions — the body contains step-by-step procedures, examples, conventions, and completion criteria
The agent reads the metadata to decide whether this skill applies to the current task, then follows the instructions in the body to execute it.
Basic SKILL.md File Format
---
name: conventional-commits
description: "Writes commit messages in Conventional Commits format. Load when the task involves staging changes and committing."
version: 1.0.0
tags: [git, commits, conventions]
---
# Conventional Commits
## Steps
1. Check staged files with `git diff --cached --stat`
2. Determine the type (feat/fix/chore/docs/refactor) from the primary change
3. Write the commit message: `type(scope): brief description`
4. Commit with `git commit -m "..."` (no `-s` flag)
The file format is what makes SKILL.md powerful. It's just Markdown — no special syntax, no proprietary schema. Any tool that reads Markdown can use it.
How to Use a SKILL.md File
Using a SKILL.md file depends on which AI agent tool you're running. Here's how it works in practice:
With Hermes Agent
Hermes Agent (by Nous Research) has the most mature SKILL.md system. Skills live in a skills/ directory. At session start, Hermes scans the skill descriptions and loads the ones whose triggers match your task. During the session, the agent follows the skill's steps — running commands, editing files, checking results.
With Other Agent Tools
Support varies, but the plain-Markdown format means any agent-supporting tool can adopt SKILL.md with minimal effort. The file is designed to be tool-agnostic: if your agent reads Markdown, it can read SKILL.md.
General Workflow
- Create a SKILL.md file with the format above — name, description, steps, examples
- Place it where your agent can find it (a
skills/directory, a remote store, or a project folder) - Trigger it — the agent loads the skill when the task matches its description
- Execute — the agent follows the steps, checks results, and completes the task
- Evolve — when your process changes, update the SKILL.md and every future session picks it up
How to Create a SKILL.md
Creating a SKILL.md file takes about ten minutes. Here's the process:
1. Choose One Skill
Pick one thing your agent should do: review a PR, write a commit message, deploy to staging, generate a changelog. One file, one skill.
2. Write the Frontmatter
---
name: deploy-staging
description: "Deploys the current branch to the staging environment. Runs tests first, then builds and deploys. Load when the task is 'deploy to staging' or 'ship to staging'."
version: 1.0.0
tags: [deploy, staging, CI]
---
The description is the most important field — this is what the agent reads to decide whether to load your skill.
3. Write the Steps
Each step should be checkable — the agent knows it's done when something specific happens.
## Steps
1. Run tests: `pnpm test`
2. If tests pass, build: `pnpm build`
3. Deploy: `fly deploy --app my-app-staging`
4. Verify: `curl -s -o /dev/null -w "%{http_code}" https://staging.myapp.com`
4. Add Examples and Pitfalls
Show the agent what success looks like and what could go wrong.
## Examples
- `feat(auth): add OAuth2 login flow`
- `fix(api): handle null response from payment gateway`
## Pitfalls
- Don't deploy if tests fail — stop and report the failures
- Don't deploy a branch behind main — rebase first
5. Set Completion Criteria
The clearest way to tell the agent it's done.
## Completion
The staging environment is running the deployed branch. The health check returns 200.
SKILL.md File Format Explained
The SKILL.md format has two parts: the frontmatter block and the body.
Frontmatter (YAML)
The frontmatter is an optional YAML block between --- delimiters at the top of the file. It contains:
| Field | Required | Description |
|---|---|---|
name | Yes | Short identifier (lowercase, hyphens) |
description | Yes | What the skill does and when to load it (≤1024 chars) |
version | No | Semantic version for tracking changes |
tags | No | Categories for matching triggers (e.g., git, deploy, review) |
Body (Markdown)
The body is the actual skill procedure. A well-structured body includes:
- Trigger conditions — when this skill applies
- Ordered steps — what the agent does, in sequence
- Examples — concrete before/after the agent can match against
- Pitfalls — what to watch out for
- Completion criteria — how to know the skill's job is done
There's no rigid schema for the body. The format stays flexible because different skills need different levels of detail. A deployment skill might be four steps and a URL check; a code-review skill might be twelve steps with branching logic.
SKILL.md Example: PR Review
Here's a complete SKILL.md example that teaches an agent to review a pull request:
---
name: pr-review
description: "Reviews a pull request: checks code style, test coverage, security-sensitive patterns, and changelog. Load when the task involves reviewing a PR."
version: 1.1.0
tags: [code-review, github, prs]
---
# PR Review
## Steps
1. Fetch the PR diff: `gh pr view <number> --json body,diff,files`
2. Check each modified file for:
- Security: `eval()`, hardcoded secrets, SQL concatenation
- Tests: is there a corresponding test file? Was it updated?
- Style: does it match the project's conventions?
3. Verify the changelog was updated if the PR adds a new feature
4. Comment with `gh pr comment <number> --body "<markdown>"`
## Pitfalls
1. Don't block on personal style preferences
2. Security issues are the only hard-block — everything else is a suggestion
## Completion
A comment has been posted on the PR: what looks good, what to fix (with severity), and any unanswered questions.
SKILL.md Best Practices
- One skill per file. If a SKILL.md does two things, split it into two files.
- Write a tight description. "Reviews a PR: checks code style, tests, and security" beats "A skill for reviewing things." The description is what the agent uses to decide whether to load the skill.
- Use checkable steps. "Run the tests" is vague. "Run
pnpm testand confirm exit code 0" is checkable. - Include real examples. Agents generalize better from concrete examples than from rules.
- Keep it short. A SKILL.md longer than ~100 lines gets skimmed. Link to detailed reference docs if needed.
- Never put secrets in the file. SKILL.md files are loaded into agent sessions and may be shared or committed. Credentials belong in environment variables.
- Update it when the process changes. A stale SKILL.md is worse than none — the agent follows it confidently and gets the wrong result.
- Version it. Start with
1.0.0, bump when the steps change significantly. The agent can check whether it has the latest version.
Common Mistakes
- The kitchen sink. One giant SKILL.md that tries to cover every scenario. The agent can't tell which parts apply.
- Steps without verification. "Run the tests" with no follow-up. Every step should end with something the agent can check.
- No trigger. A SKILL.md with a vague description won't be loaded when it's needed. Be specific: "Load when the task is 'deploy to staging'" not "Handles deployment."
- Conflicting skills. A "fast-deploy" skill that skips tests and a "safe-deploy" skill that runs them first — loading both confuses the agent. Skills for the same domain should agree.
Frequently Asked Questions
What is a SKILL.md file? A SKILL.md file is a Markdown document that defines a reusable capability for an AI coding agent. It contains metadata (name, description, tags) followed by step-by-step instructions the agent follows to complete a task.
What does SKILL.md stand for?
SKILL.md is a naming convention — the file is named SKILL.md (or skill.md) and lives inside a skill directory. The name signals to the agent that this file defines a skill, not a project overview.
What is the SKILL.md file format?
The format is plain Markdown with an optional YAML frontmatter block between --- delimiters at the top. The frontmatter contains metadata (name, description, version, tags), and the body contains the skill's instructions as Markdown.
How do I create a SKILL.md? Choose one skill your agent needs, write the YAML frontmatter with a name and description, then write the procedure as ordered steps with examples, pitfalls, and completion criteria. Place it in your agent's skills directory.
How do I use a SKILL.md? Your agent loads the SKILL.md automatically when the task matches its description. The agent reads the metadata to decide if the skill applies, then follows the steps in the body to execute it.
Is SKILL.md the same as .cursorrules or CLAUDE.md? No. CLAUDE.md and .cursorrules describe the project (commands, architecture, conventions) and are loaded every session. SKILL.md describes a specific capability and is loaded on demand by trigger. They work together — project context files set the baseline, skills add task-level procedures.
Can I have multiple SKILL.md files? Yes. A project can have dozens of SKILL.md files, one per skill. Start with three (PR review, deployment, changelog) and add more as you find yourself repeating the same instructions.
Should I commit SKILL.md files to git? Yes. SKILL.md files are project assets — they belong in the repo like any other documentation. Committing them means they're versioned and reviewed in PRs.
