Write or improve a Baton skill: folder layout, frontmatter (name, when-to-use description, keywords), a short SKILL.md with long material in references/, agent-agnostic wording, and testing that workers pick it up. Use when creating or editing a SKILL.md.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Writing Skills?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/k6w-writing-skills)
---
name: writing-skills
description: "Write or improve a Baton skill: folder layout, frontmatter (name, when-to-use description, keywords), a short SKILL.md with long material in references/, agent-agnostic wording, and testing that workers pick it up. Use when creating or editing a SKILL.md."
keywords: [skill, skills, SKILL.md, write a skill, new skill, frontmatter, references, prompt, instructions, agent instructions, playbook]
---
# Writing skills
A skill is know-how for one kind of work that any worker (Claude, Codex, Gemini or another CLI) can
load on demand. Workers see only its **name and description** until they call `load_skill`, so the
description decides whether it is ever used, and the body decides whether it helps.
## 1. Layout
```
.baton/skills/<name>/ # project skill (commit it); or ~/.config/baton/skills/<name>/
SKILL.md # required: frontmatter + the core instructions
references/<topic>.md # optional: long material, loaded only when needed
examples/ or templates/ # optional: files the worker copies or adapts
```
`baton skill new <name>` creates the folder. A skill with the same name as a built-in one replaces it.
Names are lowercase with dashes, and say the job (`db-migrations`, not `helpers`).
## 2. Frontmatter
```
---
name: db-migrations
description: "Write and run database migrations safely: one change per migration, reversible, tested against a copy of production data. Use when changing the schema or adding a migration."
keywords: [migration, schema, database, sql, alter table]
---
```
- **description**: what it does, then **when to use it**, in plain words a worker's task would contain.
One or two sentences, under 300 characters. Quote it when it contains a colon (YAML). It is shown to the lead and to workers as the menu.
- **keywords** (optional): extra words that should make Baton suggest this skill for a task (when the
lead spawns a worker without skills, Baton suggests the best matches from descriptions and keywords).
## 3. The body
- **Open with the point**: one or two sentences on why this matters and the single rule that matters
most.
- **Steps in the order they happen**, as short numbered sections. Checklists for things that must all
be true at the end.
- **Concrete over abstract**: real commands, file paths, a short example of good output. Explain the
why behind a rule in a clause; agents follow rules they understand and generalise them correctly.
- **Baton-native**: say which tools to use (`claim_files`, `send_message` to the lead, `submit_review`,
acceptance commands, `$PORT` for servers) and what to report back.
- **Agent-agnostic**: no vendor-specific tool names, slash commands or model names. "Run the tests",
not a particular agent's tool syntax.
- **One job per skill.** If it overlaps another skill, cut the overlap and point to the other by name.
Two skills giving different advice for the same situation is a bug.
- **Short**: aim for under ~150 lines. Move long checklists, tables and templates to
`references/<topic>.md` and point to them with
`load_skill("<name>", "references/<topic>.md")`; workers then pay for them only when needed.
- No secrets, no personal paths, no instructions that only make sense in one person's machine.
## 4. Test it
1. `baton skills` (or `/skills`) lists it with the right description.
2. Load it as a worker would (`load_skill("<name>")`) and check the text and the file list; load each
reference file by path.
3. Give a fresh worker a realistic task **without** naming the skill and check whether it chose to
load it. If not, rewrite the description with the words that task used.
4. Give a worker the skill and the task, and read the result against the skill: which steps did it
skip or misread? Tighten those parts, not the parts it already followed.
5. Try one task the skill should **not** trigger for; a description that matches everything is noise.
Checklist details and a review rubric: `load_skill("writing-skills", "references/checklist.md")`.