# SKILL.md

> The SKILL.md is the main file of an agent skill with metadata and instructions in Markdown.

## How do I write a SKILL.md file?

The Markdown file at the root of a skill folder. Its frontmatter has a 'name' and a 'description' that tells the agent when to use the skill, and the body contains step-by-step instructions that can reference scripts and templates in the same folder.

- Topic: Agent Customization
- Type: file

## Example

Wrong:

```markdown
---
name: helper
description: Helps with stuff.
---
Be helpful and write good code.
```

Right:

```markdown
---
name: db-migration
description: Creates a database migration. Use when the user asks to add, change or drop a table or column.
---
1. Run `npm run db:diff` to see schema changes.
2. Create the file with `npm run db:new <name>`.
3. Follow the patterns in `reference/conventions.md`.
4. Run `npm run db:migrate` and fix any errors.
```

A specific description makes the skill trigger on the right requests, and numbered steps tell the agent exactly what to do.

## Common mistakes

- Pasting all reference material into 'SKILL.md', so the whole file fills the context every time the skill loads.

## Key points

- The 'description' says what the skill does and when to use it, with words users actually type.
- Instructions are steps and checks, not general advice.
- Long reference material lives in separate files linked from 'SKILL.md'.

## Interview questions

### What fields are required in SKILL.md frontmatter?

At minimum a 'name' and a 'description'. Some tools support extra fields, such as allowed tools, but those differ between tools.

### How long should a SKILL.md file be?

Keep the body short, with steps and checks. Put long reference docs, examples and templates in separate files and link to them.

### Can SKILL.md run scripts?

The file itself does not run anything, but its steps can tell the agent to run scripts stored in the skill folder.

## Related cards

- [Agent Skills](https://wonderium.dev/ai/agent-skills.md)
- [Progressive Disclosure](https://wonderium.dev/ai/progressive-disclosure.md)
- [.md](https://wonderium.dev/engineering/md.md)

---

- Level: [Artificial Intelligence](https://wonderium.dev/ai.md)
- HTML version: https://wonderium.dev/ai/skill-md
- Last updated: 2026-11-25
