Writing Skills
Creates well-structured Agent Skills.
Workflow
- Define the skill's task, scope, triggers, and required resources.
- Draft a concise
SKILL.md with operational instructions.
- Add
reference/ files for details used only on some paths.
- Add
scripts/ for deterministic or repeated operations.
- Review discovery, clarity, examples, and validation.
- Ask the user when requirements are ambiguous.
SKILL.md contract
Every skill needs YAML frontmatter:
name is required, matches the parent directory, is at most 64 characters, and uses lowercase letters, numbers, and hyphens with no consecutive, leading, or trailing hyphens.
- Use a gerund name such as
processing-pdfs or analyzing-data.
description is required and stays under 1024 characters. State what the skill does; for model-invoked skills, write in third person and include trigger branches.
- Quote descriptions containing YAML-special characters.
- Add optional runtime fields only when the skill needs them.
Before changing invocation or runtime-specific frontmatter, read SKILL-MECHANICS.md from /writing-for-agents.
Layout
.agents/skills/<name>/
├── SKILL.md
├── reference/ # optional, for rare details and examples
└── scripts/ # optional, for repeatable operations
Keep SKILL.md under 100 lines when possible and under 500 lines at most. Move advanced details, schemas, and large examples to reference/.
Scripts
Add a script when the operation is deterministic, repeated, or needs explicit error handling. Reference it with execution intent, for example: Run scripts/validate.py to check the skill.
Review checklist
- The directory name matches
name.
- The description is specific enough for discovery.
- The main instructions are concise and operational.
- Examples are concrete and relevant.
- Rare details are disclosed in
reference/.
- Scripts are under
scripts/ and referenced from SKILL.md.
- The skill has no stale or time-sensitive core instructions.
Local skills in chezmoi
- Source files live under
dot_agents/skills/.
- Applied files live under
~/.agents/skills/.
- Edit the chezmoi source, then run
chezmoi apply or chezmoi apply --dry-run.
- Do not edit generated files under
~/.agents/skills/ directly unless making a temporary live-only change.
1---2name: writing-skills3description: Creates and reviews Agent Skills, including SKILL.md files, frontmatter, references, and scripts. Use when creating or updating an Agent Skill.4---56# Writing Skills78Creates well-structured Agent Skills.910## Workflow11121. Define the skill's task, scope, triggers, and required resources.132. Draft a concise `SKILL.md` with operational instructions.143. Add `reference/` files for details used only on some paths.154. Add `scripts/` for deterministic or repeated operations.165. Review discovery, clarity, examples, and validation.176. Ask the user when requirements are ambiguous.1819## `SKILL.md` contract2021Every skill needs YAML frontmatter:2223- `name` is required, matches the parent directory, is at most 64 characters, and uses lowercase letters, numbers, and hyphens with no consecutive, leading, or trailing hyphens.24- Use a gerund name such as `processing-pdfs` or `analyzing-data`.25- `description` is required and stays under 1024 characters. State what the skill does; for model-invoked skills, write in third person and include trigger branches.26- Quote descriptions containing YAML-special characters.27- Add optional runtime fields only when the skill needs them.2829Before changing invocation or runtime-specific frontmatter, read `SKILL-MECHANICS.md` from `/writing-for-agents`.3031## Layout3233```text34.agents/skills/<name>/35├── SKILL.md36├── reference/ # optional, for rare details and examples37└── scripts/ # optional, for repeatable operations38```3940Keep `SKILL.md` under 100 lines when possible and under 500 lines at most. Move advanced details, schemas, and large examples to `reference/`.4142## Scripts4344Add a script when the operation is deterministic, repeated, or needs explicit error handling. Reference it with execution intent, for example: `Run scripts/validate.py to check the skill.`4546## Review checklist4748- The directory name matches `name`.49- The description is specific enough for discovery.50- The main instructions are concise and operational.51- Examples are concrete and relevant.52- Rare details are disclosed in `reference/`.53- Scripts are under `scripts/` and referenced from `SKILL.md`.54- The skill has no stale or time-sensitive core instructions.5556## Local skills in chezmoi5758- Source files live under `dot_agents/skills/`.59- Applied files live under `~/.agents/skills/`.60- Edit the chezmoi source, then run `chezmoi apply` or `chezmoi apply --dry-run`.61- Do not edit generated files under `~/.agents/skills/` directly unless making a temporary live-only change.