Writing Skills
Skills are tools, not pipelines. Each one loads into context every time it fires, so every line costs tokens on every use. Write the minimum that changes behavior; push the rest to sibling files.
When to use
- Creating or editing a skill under
skills/<phase>/<name>/.
- Skip when you're using a skill — this is only for authoring.
Skill types
Match the form to the need (see references/reference.md for how much detail each needs):
- Instruction — a prose procedure. Most skills.
- Template — ships a
{{placeholder}} file to copy (like assets/skill-template.md).
- Script — bundles a tested, deterministic script when prose would be error-prone.
- Reference — a doc loaded on demand for lookup; large is fine, it isn't always-loaded.
The format (non-negotiable)
Frontmatter: name (kebab-case, matches the directory) and description (capability + "Use when…" trigger, ≤1024 chars, third person, never a workflow summary).
Body under 500 lines and 5000 tokens — the ceilings every compliant agent
assumes. Aim well under: most capability skills land near 80–120 lines, and a
body past ~200 should have to justify itself. Intent + procedure only; cut
marketing ("why this matters") and long worked examples.
Aim under the target by removing content, never by compressing prose.
Dropping articles and verbs until a sentence reads as a noun stack — Bind exact source/contracts/external inputs and a stable-ID surface — buys line
count and costs comprehension: an agent that must decompress an instruction
before acting is likelier to act on the wrong reading. If a body needs 140
clear lines, take them.
Progressive disclosure, split by what the agent does with the file. A file
it fills in and emits — a document template — goes to assets/. A file it
reads to decide or check — a rubric, a checklist, a reviewer brief, a worked
example, a lookup table — goes to references/. Bundled executable code goes
to scripts/. SKILL.md names each file and says when to open it; it never
inlines them.
Complexity gate up top. State when to skip the skill. Ceremony must scale down with task size.
Lint-clean markdown. Fill-in placeholders use {{double-curly}} — <angle> brackets render as HTML and trip linters. Fence code blocks with a language. Blank lines around lists.
Instructions, not facts. An agent can obey an instruction; it cannot obey
a fact. Write the body as ## Step N: sections of numbered one-line acts.
Put each outcome on its own line as condition → act. Mark every handoff with a bold
REQUIRED SUB-SKILL: naming the skill to invoke, at the step where the flow
reaches it, and say what this skill never does itself. Put the exact text of a question
to the user, and the right-versus-wrong shape of an output, in a fenced
block; put a command in a bash block only where running it is the act.
Cut every line that fails "would the agent get this wrong without it?".
Discipline skills are the exception
A few skills exist to hold an agent to a discipline it is tempted to skip under
pressure—for example routing, TDD, YAGNI, verifying completion, systematic
debugging, and receiving review. For these only:
- Keep the rationalization table (each tempting excuse → its rebuttal) and red-flag list in the body, never a sibling — a tempted agent won't choose to load a sibling file, and the counter must be in context when the temptation hits. You cannot lazy-load willpower.
- They run longer than a capability skill, and that is expected. Each extra line still has to earn its place by passing a pressure test (
references/testing.md), not by sounding good.
- Everything else (capability, template, reference, meta) has no temptation to counter — keep it lean.
Step 1: Decide it is a skill
- Write one only if an agent reliably gets this wrong without guidance.
Plain prompt text or a one-off → do not.
- An exact fragile sequence → a tested script, not prose.
- Split activities only when each is independently invokable. Otherwise one
cohesive skill.
Step 2: Write it
- Choose the phase folder (
planning…maintenance) or common/. Create
skills/<phase>/<name>/ from assets/skill-template.md.
- Write
description as a trigger. Test it: does it say when, not
how? Lists steps → rewrite.
- Write the body: When to use (incl. Skip),
## Step N: sections of
one-line acts (format rule 6), Common mistakes.
- Move anything heavy to a sibling:
assets/ if the agent fills it in,
references/ if the agent reads it.
- Verify the shape (below). Then prove the behavior at the failure surface:
trigger, artifact or side effect, or pressured discipline. Read
references/testing.md. An agent explaining the rule is not evidence that
it follows it.
Available scripts
scripts/check-skill.sh — checks one skill directory against the Agent
Skills standard: frontmatter, name charset and length, description limit,
body ceilings, reference resolution, and whether bundled scripts answer
--help. Read-only, and portable to any skill directory, including outside
this repository. Run it in Verify before done; --help lists the checks and
exit codes.
Verify before done
Run the conformance check and read what it returns:
bash scripts/check-skill.sh path/to/skill
Exit 0 conforms; exit 1 lists what fails. It replaces hand-counting lines and
eyeballing paths — both of which this library got wrong before it existed.
Markdown lints clean · description states triggers, not a summary.
A skill library will usually add house rules on top — no external references,
no vendor model names, manifest registration. Run its gate too; conforming to
the standard is necessary, not sufficient.
The targeted before/after proof observes behavior, reports every run, and does
not turn unchanged skills into a costly coverage exercise.
Common mistakes
- A body that reads like documentation — it reloads into context every invocation.
- A description that summarizes the workflow → the model follows the summary and skips the skill body.
- Inlining templates/examples that belong in sibling files.
- No complexity gate → ceremony on trivial tasks (the #1 complaint about heavy skill libraries).
- Shipping a skill you never watched fail without — you don't know it prevents the right failure.
See references/reference.md for examples and reasoning, and references/testing.md for proving a skill actually changes behavior.
1---2name: writing-skills3description: Use when creating or editing a skill in this library — its format, its sibling files, and how to prove it works. Fires on add a skill for X and this skill isn't triggering, even if nobody says authoring. Skip using a skill.4---56# Writing Skills78Skills are tools, not pipelines. Each one loads into context every time it fires, so every line costs tokens on every use. Write the minimum that changes behavior; push the rest to sibling files.910## When to use1112- Creating or editing a skill under `skills/<phase>/<name>/`.13- **Skip** when you're *using* a skill — this is only for authoring.1415## Skill types1617Match the form to the need (see `references/reference.md` for how much detail each needs):1819- **Instruction** — a prose procedure. Most skills.20- **Template** — ships a `{{placeholder}}` file to copy (like `assets/skill-template.md`).21- **Script** — bundles a tested, deterministic script when prose would be error-prone.22- **Reference** — a doc loaded on demand for lookup; large is fine, it isn't always-loaded.2324## The format (non-negotiable)25261. **Frontmatter**: `name` (kebab-case, matches the directory) and `description` (capability + "Use when…" trigger, ≤1024 chars, third person, **never** a workflow summary).272. **Body under 500 lines and 5000 tokens** — the ceilings every compliant agent28 assumes. Aim well under: most capability skills land near 80–120 lines, and a29 body past ~200 should have to justify itself. Intent + procedure only; cut30 marketing ("why this matters") and long worked examples.3132 Aim under the target by **removing content**, never by compressing prose.33 Dropping articles and verbs until a sentence reads as a noun stack — `Bind34 exact source/contracts/external inputs and a stable-ID surface` — buys line35 count and costs comprehension: an agent that must decompress an instruction36 before acting is likelier to act on the wrong reading. If a body needs 14037 clear lines, take them.383. **Progressive disclosure**, split by what the agent does with the file. A file39 it fills in and emits — a document template — goes to `assets/`. A file it40 reads to decide or check — a rubric, a checklist, a reviewer brief, a worked41 example, a lookup table — goes to `references/`. Bundled executable code goes42 to `scripts/`. `SKILL.md` names each file and says *when* to open it; it never43 inlines them.444. **Complexity gate up top.** State when to *skip* the skill. Ceremony must scale down with task size.455. **Lint-clean markdown.** Fill-in placeholders use `{{double-curly}}` — `<angle>` brackets render as HTML and trip linters. Fence code blocks with a language. Blank lines around lists.466. **Instructions, not facts.** An agent can obey an instruction; it cannot obey47 a fact. Write the body as `## Step N:` sections of numbered one-line acts.48 Put each outcome on its own line as `condition → act`. Mark every handoff with a bold49 `REQUIRED SUB-SKILL:` naming the skill to invoke, at the step where the flow50 reaches it, and say what this skill never does itself. Put the exact text of a question51 to the user, and the right-versus-wrong shape of an output, in a fenced52 block; put a command in a `bash` block only where running it is the act.53 Cut every line that fails "would the agent get this wrong without it?".5455## Discipline skills are the exception5657A few skills exist to hold an agent to a discipline it is tempted to skip under58pressure—for example routing, TDD, YAGNI, verifying completion, systematic59debugging, and receiving review. For these only:6061- Keep the **rationalization table** (each tempting excuse → its rebuttal) and **red-flag list** in the *body*, never a sibling — a tempted agent won't choose to load a sibling file, and the counter must be in context when the temptation hits. You cannot lazy-load willpower.62- They run longer than a capability skill, and that is expected. Each extra line still has to earn its place by passing a pressure test (`references/testing.md`), not by sounding good.63- Everything else (capability, template, reference, meta) has no temptation to counter — keep it lean.6465## Step 1: Decide it is a skill66671. Write one only if an agent reliably gets this wrong without guidance.68 Plain prompt text or a one-off → do not.692. An exact fragile sequence → a tested script, not prose.703. Split activities only when each is independently invokable. Otherwise one71 cohesive skill.7273## Step 2: Write it74751. Choose the phase folder (`planning`…`maintenance`) or `common/`. Create76 `skills/<phase>/<name>/` from `assets/skill-template.md`.772. Write `description` as a trigger. Test it: does it say **when**, not78 **how**? Lists steps → rewrite.793. Write the body: **When to use** (incl. Skip), `## Step N:` sections of80 one-line acts (format rule 6), **Common mistakes**.814. Move anything heavy to a sibling: `assets/` if the agent fills it in,82 `references/` if the agent reads it.835. Verify the shape (below). Then prove the behavior at the failure surface:84 trigger, artifact or side effect, or pressured discipline. Read85 `references/testing.md`. An agent explaining the rule is not evidence that86 it follows it.8788## Available scripts8990- **`scripts/check-skill.sh`** — checks one skill directory against the Agent91 Skills standard: frontmatter, `name` charset and length, `description` limit,92 body ceilings, reference resolution, and whether bundled scripts answer93 `--help`. Read-only, and portable to any skill directory, including outside94 this repository. Run it in *Verify before done*; `--help` lists the checks and95 exit codes.9697## Verify before done9899- Run the conformance check and read what it returns:100101 ```bash102 bash scripts/check-skill.sh path/to/skill103 ```104105 Exit 0 conforms; exit 1 lists what fails. It replaces hand-counting lines and106 eyeballing paths — both of which this library got wrong before it existed.107- Markdown lints clean · description states triggers, not a summary.108- A skill library will usually add house rules on top — no external references,109 no vendor model names, manifest registration. Run its gate too; conforming to110 the standard is necessary, not sufficient.111- The targeted before/after proof observes behavior, reports every run, and does112 not turn unchanged skills into a costly coverage exercise.113114## Common mistakes115116- A body that reads like documentation — it reloads into context every invocation.117- A description that summarizes the workflow → the model follows the summary and skips the skill body.118- Inlining templates/examples that belong in sibling files.119- No complexity gate → ceremony on trivial tasks (the #1 complaint about heavy skill libraries).120- Shipping a skill you never watched fail without — you don't know it prevents the right failure.121122See `references/reference.md` for examples and reasoning, and `references/testing.md` for proving a skill actually changes behavior.