skill-writing
When to use
Use this skill when:
- Creating a new skill from scratch
- Improving an existing skill
- Reviewing skill quality
- Deciding what belongs in a skill vs a rule
Typical examples:
- "Create a skill for X"
- "This skill needs improvement"
- "Should this be a skill or a rule?"
Do not use this skill when:
- Writing rules (rules are constraints, not workflows)
- Writing commands (commands are direct invocations)
Goal
- Create executable skills, not documentation
- Ensure every skill answers: When? How? What output?
- Prevent common mistakes: too broad, too generic, missing validation
Preconditions
- Clear understanding of the intended task
- Distinction: rules = always apply, skills = triggered workflows
- Access to a skill template or existing reference skill
Decision matrix: What goes where?
Before creating anything, classify the content:
| If the content is... |
Then it is... |
Action |
| An always-true constraint ("never X", "always Y") |
Rule |
Create/update .augment/rules/ |
| A step-by-step workflow with decisions and validation |
Skill |
Create/update .augment/skills/ |
| A coding convention or reference material |
Guideline |
Create/update .augment/guidelines/ |
Baseline model knowledge (how jq works, what docker exec does) |
Nothing |
Do not create anything |
| Simple tool usage without complex workflow |
Nothing |
Do not create anything |
| Already covered by an existing skill/rule/guideline |
Update |
Extend the existing file |
The critical test
Ask: "Does the model need this to do its job correctly?"
- If the model already knows it → Nothing
- If the model knows it but does it wrong in THIS project → Rule or Guideline
- If the model needs a multi-step workflow to get it right → Skill
Skills and commands share the .claude/skills/ namespace
Skills in src/skills/{name}/SKILL.md AND commands in
src/domains/{domain}/{name}/command.md both project into
.claude/skills/ (see scripts/condense.ts →
generate_claude_skills + generate_claude_commands). Claude treats
the whole directory as native skills.
Implications for skill authors:
- If a same-name command already exists, the skill takes priority and
the command is skipped (
generate_claude_commands honors this).
Don't reuse a command's slug for a skill unless the command should
retire.
- Both artifacts compete on
description for routing. A weak skill
description is shadowed by a stronger same-domain command — and vice
versa. Make trigger phrasing precise (§ 1b below).
- When the workflow has both a "user types
/foo" path AND a "model
picks this up from intent" path, author the skill first and let the
command delegate (skills: frontmatter). Two artifacts with the same
trigger surface fight each other in the router.
When "Nothing" is the right answer
Do NOT create a skill or rule for:
- Standard tool usage (jq, grep, docker exec, git commands)
- Framework basics the model already knows
- Single-command operations without decision logic
- Knowledge that belongs in a skill's procedure as a step, not as its own skill
Size and structure hints
→ See docs/guidelines/agent-infra/size-and-scope.md for full limits.
- Target: 300–900 words. Review for split above 1200 words. Strongly consider split above 1500 words.
- Over the 400-line K6 cap → the router-head contract in
templates/skill.md
applies: entry head (when-to-use · mode table · routing) plus one tasks/ or
references/ file per mode, and the head never inlines more than one mode's
procedure. Gated by lint_skill_router_head with a shrink-only allowlist.
- If multiple workflows exist → split into multiple skills
- If two skills overlap heavily → merge
- If a skill becomes "read the guideline" → it lost its purpose, restore the workflow
Progressive disclosure — the directory is references/, plural
When a skill needs depth the workflow does not, the depth goes in a
references/ subdirectory beside SKILL.md — that exact name, plural. It
was two spellings across nine skills until 2026-08-12 because nothing here
named one; the split cost a rename, not a decision.
- Body: the trigger, the workflow, the ownership statement, and every
heuristic that changes a write decision. A skill whose body is a map to its
own content is loaded and not applied.
references/: corpora, lookup tables, long schemas, worked examples —
read on the path that needs them, never on every activation.
Splitting is not a size escape hatch. The measured estate (n=289, 2026-08-12):
median 1,077 words, p90 1,867, only 6 skills above 2,500 and 4 above 3,000.
So a skill at 1,500 words is ordinary, and moving prose out of the body to hit
a number makes it worse. Split when the material is genuinely
consulted-on-demand; keep the load-bearing part in the body even when that
leaves the file long.
A references/ split does not change the gates that already apply: a
token_budget_class: rich skill still meets its 3,500-token ceiling on the
body alone.
Modes
This skill is a router head. The decision layer above — what goes where, the
critical test, the namespace note, the size and progressive-disclosure hints —
is true across every mode and stays here, as do the Frugality Standards below.
The procedure body and the section-pattern catalogue live in references/; load
the one the task calls for.
| Task |
Mode body |
Covers |
| Author a new skill, or rewrite one end to end |
references/procedure.md |
Steps 0 → 7: inspect + Drafting Protocol, skill-growth gate, trigger definition, pushy description, trigger-eval stub, procedure, validation, safe/unsafe example, output format, quality checklist, eval loop |
| Pick or write an optional / required section pattern |
references/section-patterns.md |
Description-optimizer loop, self-QA loop, known-pitfalls, rationalizations-to-reject, non-negotiable-deliverable, destructive-operation gates, upstream-version-notes, security-constraints, action-reference split, mechanism-teaching, illustrative-not-verbatim, headline metric, contrastive-example |
| Ship a script inside a skill |
references/read-only-scripts.md |
The read-only-by-default rule and its allowlist, whose violation fails the build |
Procedure
- Inspect first. Read the existing skill (or the nearest three matches) and
run the decision matrix above before writing anything. If the answer is
"Nothing", stop — that is a real answer and the cheapest one.
- Authoring or rewriting a skill → load
references/procedure.md and follow steps 0 → 7
in order. The steps are sequenced, not a menu.
- Reaching for a named section pattern → load
references/section-patterns.md and use
the one pattern that matches; the catalogue is not a checklist to satisfy.
- Validate before saving — the quality checklist in
references/procedure.md § 6, the Frugality
Standards below, and ./scripts-run src/scripts/skill_linter at 0 FAIL.
Output format
- Complete SKILL.md file
- No explanations outside the file
- Fully copyable
- No empty sections
Core rules
- Skills are executable thinking processes
- Always include: When to use, Procedure, Output format, Gotchas, Do NOT
- Steps must be verifiable
- Validation must be concrete
- One skill = one job
Cross-references and paths
- Body links to guidelines / contracts use the verbatim relative form
(
../../docs/guidelines/<group>/<name>.md,
../../docs/contracts/<name>.md). The condense-time rewriter
resolves them to depth-aware single-up form — do not pre-rewrite in
source.
- Skills do not declare
load_context: / load_context_eager:;
those frontmatter keys are rule-only. If a skill needs to point at a
context, link to it inline ([context-name](../../contexts/<area>/<file>.md)).
- Never write
.agent-src.uncondensed/ in any skill body link or
example — it ships into .augment/skills/ and breaks consumer
resolution. See rule-writing § 3b for the canonical reference.
Execution metadata (optional)
Skills may declare an execution frontmatter block (type, handler,
timeout_seconds, safety_mode, allowed_tools). Default is manual
(instructional only). See docs/guidelines/agent-infra/runtime-layer.md for
the full specification and assisted / automated semantics.
When to create a project-analysis-* skill
Only if the framework has its own lifecycle producing unique debugging
patterns that project-analysis-core cannot explain (e.g. Laravel,
Symfony, Express, React, Next.js). Not for Tailwind, CSS frameworks,
utility libs, or simple state managers.
Gotchas
- Writing documentation instead of executable steps
- Skipping validation — every Procedure MUST end with a concrete verify step
- Including baseline knowledge the model already has
- Description too long or not a trigger
- Renaming a heading to "Procedure:" without numbered steps or
### sub-headings
- Always run
./scripts-run src/scripts/skill_linter before saving — 0 FAIL required
Frugality Standards
Apply the Frugality Charter
to every skill you author.
Examples in this artifact:
- Per the charter's default-terse rule, the SKILL.md
## Procedure
opens with the action ("Run the linter"), not "Let me walk you
through…".
- Per the cheap-question check, only emit numbered-options output
when consequences differ — never as a stylistic choice.
- Per the post-action summary suppression, the example output ships
the artifact, not a wrapping
## Status / ## Summary block.
Scope-exclusion clause. A skill can shed assumed-knowledge prose without
losing correctness by naming what it does NOT cover: "this skill covers only
<X>; standard <Y> is assumed". One sentence replaces the paragraph that
would otherwise re-teach <Y>, and it is stronger than silence — a reader who
does not have <Y> learns that from the clause instead of from a wrong result.
Pre-save self-check:
- Does any procedure step open with "Let me", "Now I will", "Found
it", "OK", or "Alright"?
- Does the skill prescribe numbered-options output without a real
consequence trade-off?
- Does the example output include a post-action summary block?
- Does the description carry filler ("comprehensive", "advanced",
"powerful")?
Section patterns
The thirteen optional and required section patterns moved verbatim to
references/section-patterns.md. Two of them
are marked required for a named population — security-constraints for
script-bearing skills, and the action-reference split for safety_mode: strict
skills — so a skill in either population reads that file rather than skipping it.
The read-only-by-default script rule moved to
references/read-only-scripts.md.
Do NOT
- Write documentation-style, pointer-only, or too-broad skills ("Laravel skill", "Django skill")
- Skip Procedure or use vague validation
- Exceed size limits (see
docs/guidelines/agent-infra/size-and-scope.md)
- Duplicate rules
- Ship a skill script that mutates the filesystem on its default invocation — gate it behind a flag or allowlist it with a rationale
Encode usage policy in the description
Workflow sequencing, preconditions, ID/output provenance ("copy ids verbatim,
never from memory"), a mandatory "why" intent field, and turn-end contracts
belong INSIDE this artifact's description/frontmatter — where they fire at the
decision point — not in always-on prose. See
tool-description-as-policy.
1---2name: skill-writing3description: Use when deciding 'should this be a skill or a rule?', creating/improving/reviewing agent skills, SKILL.md frontmatter, or procedure sections — even without saying 'skill-writing'.4---56# skill-writing78## When to use910Use this skill when:1112* Creating a new skill from scratch13* Improving an existing skill14* Reviewing skill quality15* Deciding what belongs in a skill vs a rule1617Typical examples:1819* "Create a skill for X"20* "This skill needs improvement"21* "Should this be a skill or a rule?"2223Do not use this skill when:2425* Writing rules (rules are constraints, not workflows)26* Writing commands (commands are direct invocations)2728## Goal2930* Create executable skills, not documentation31* Ensure every skill answers: When? How? What output?32* Prevent common mistakes: too broad, too generic, missing validation3334## Preconditions3536* Clear understanding of the intended task37* Distinction: rules = always apply, skills = triggered workflows38* Access to a skill template or existing reference skill3940## Decision matrix: What goes where?4142Before creating anything, classify the content:4344| If the content is... | Then it is... | Action |45|---|---|---|46| An always-true constraint ("never X", "always Y") | **Rule** | Create/update `.augment/rules/` |47| A step-by-step workflow with decisions and validation | **Skill** | Create/update `.augment/skills/` |48| A coding convention or reference material | **Guideline** | Create/update `.augment/guidelines/` |49| Baseline model knowledge (how jq works, what `docker exec` does) | **Nothing** | Do not create anything |50| Simple tool usage without complex workflow | **Nothing** | Do not create anything |51| Already covered by an existing skill/rule/guideline | **Update** | Extend the existing file |5253### The critical test5455Ask: **"Does the model need this to do its job correctly?"**5657* If the model already knows it → **Nothing**58* If the model knows it but does it wrong in THIS project → **Rule or Guideline**59* If the model needs a multi-step workflow to get it right → **Skill**6061### Skills and commands share the `.claude/skills/` namespace6263Skills in `src/skills/{name}/SKILL.md` AND commands in64`src/domains/{domain}/{name}/command.md` both project into65`.claude/skills/` (see `scripts/condense.ts` →66`generate_claude_skills` + `generate_claude_commands`). Claude treats67the whole directory as native skills.6869Implications for skill authors:7071* If a same-name command already exists, the skill takes priority and72 the command is skipped (`generate_claude_commands` honors this).73 Don't reuse a command's slug for a skill unless the command should74 retire.75* Both artifacts compete on `description` for routing. A weak skill76 description is shadowed by a stronger same-domain command — and vice77 versa. Make trigger phrasing precise (§ 1b below).78* When the workflow has both a "user types `/foo`" path AND a "model79 picks this up from intent" path, author the skill first and let the80 command delegate (`skills:` frontmatter). Two artifacts with the same81 trigger surface fight each other in the router.8283### When "Nothing" is the right answer8485Do NOT create a skill or rule for:8687* Standard tool usage (jq, grep, docker exec, git commands)88* Framework basics the model already knows89* Single-command operations without decision logic90* Knowledge that belongs in a skill's procedure as a step, not as its own skill9192### Size and structure hints9394→ See `docs/guidelines/agent-infra/size-and-scope.md` for full limits.9596* Target: 300–900 words. Review for split above 1200 words. Strongly consider split above 1500 words.97* Over the 400-line K6 cap → the **router-head contract** in `templates/skill.md`98 applies: entry head (when-to-use · mode table · routing) plus one `tasks/` or99 `references/` file per mode, and the head never inlines more than one mode's100 procedure. Gated by `lint_skill_router_head` with a shrink-only allowlist.101* If multiple workflows exist → split into multiple skills102* If two skills overlap heavily → merge103* If a skill becomes "read the guideline" → it lost its purpose, restore the workflow104105### Progressive disclosure — the directory is `references/`, plural106107When a skill needs depth the workflow does not, the depth goes in a108**`references/`** subdirectory beside `SKILL.md` — that exact name, plural. It109was two spellings across nine skills until 2026-08-12 because nothing here110named one; the split cost a rename, not a decision.111112* **Body:** the trigger, the workflow, the ownership statement, and every113 heuristic that changes a write decision. A skill whose body is a map to its114 own content is loaded and not applied.115* **`references/`:** corpora, lookup tables, long schemas, worked examples —116 read on the path that needs them, never on every activation.117118Splitting is not a size escape hatch. The measured estate (n=289, 2026-08-12):119median 1,077 words, p90 1,867, **only 6 skills above 2,500 and 4 above 3,000**.120So a skill at 1,500 words is ordinary, and moving prose out of the body to hit121a number makes it worse. Split when the material is genuinely122consulted-on-demand; keep the load-bearing part in the body even when that123leaves the file long.124125A `references/` split does not change the gates that already apply: a126`token_budget_class: rich` skill still meets its 3,500-token ceiling on the127body alone.128129## Modes130131This skill is a router head. The decision layer above — what goes where, the132critical test, the namespace note, the size and progressive-disclosure hints —133is true across every mode and stays here, as do the Frugality Standards below.134The procedure body and the section-pattern catalogue live in `references/`; load135the one the task calls for.136137| Task | Mode body | Covers |138|---|---|---|139| Author a new skill, or rewrite one end to end | [`references/procedure.md`](references/procedure.md) | Steps 0 → 7: inspect + Drafting Protocol, skill-growth gate, trigger definition, pushy description, trigger-eval stub, procedure, validation, safe/unsafe example, output format, quality checklist, eval loop |140| Pick or write an optional / required section pattern | [`references/section-patterns.md`](references/section-patterns.md) | Description-optimizer loop, self-QA loop, known-pitfalls, rationalizations-to-reject, non-negotiable-deliverable, destructive-operation gates, upstream-version-notes, security-constraints, action-reference split, mechanism-teaching, illustrative-not-verbatim, headline metric, contrastive-example |141| Ship a script inside a skill | [`references/read-only-scripts.md`](references/read-only-scripts.md) | The read-only-by-default rule and its allowlist, whose violation fails the build |142143## Procedure1441451. **Inspect first.** Read the existing skill (or the nearest three matches) and146 run the decision matrix above before writing anything. If the answer is147 "Nothing", stop — that is a real answer and the cheapest one.1482. Authoring or rewriting a skill → load149 [`references/procedure.md`](references/procedure.md) and follow steps 0 → 7150 in order. The steps are sequenced, not a menu.1513. Reaching for a named section pattern → load152 [`references/section-patterns.md`](references/section-patterns.md) and use153 the one pattern that matches; the catalogue is not a checklist to satisfy.1544. **Validate before saving** — the quality checklist in155 [`references/procedure.md`](references/procedure.md) § 6, the Frugality156 Standards below, and `./scripts-run src/scripts/skill_linter` at 0 FAIL.157158## Output format1591601. Complete SKILL.md file1612. No explanations outside the file1623. Fully copyable1634. No empty sections164165## Core rules166167* Skills are executable thinking processes168* Always include: When to use, Procedure, Output format, Gotchas, Do NOT169* Steps must be verifiable170* Validation must be concrete171* One skill = one job172173### Cross-references and paths174175* Body links to guidelines / contracts use the verbatim relative form176 (`../../docs/guidelines/<group>/<name>.md`,177 `../../docs/contracts/<name>.md`). The condense-time rewriter178 resolves them to depth-aware single-up form — do not pre-rewrite in179 source.180* Skills do **not** declare `load_context:` / `load_context_eager:`;181 those frontmatter keys are rule-only. If a skill needs to point at a182 context, link to it inline (`[context-name](../../contexts/<area>/<file>.md)`).183* Never write `.agent-src.uncondensed/` in any skill body link or184 example — it ships into `.augment/skills/` and breaks consumer185 resolution. See `rule-writing` § 3b for the canonical reference.186187### Execution metadata (optional)188189Skills may declare an `execution` frontmatter block (`type`, `handler`,190`timeout_seconds`, `safety_mode`, `allowed_tools`). Default is `manual`191(instructional only). See `docs/guidelines/agent-infra/runtime-layer.md` for192the full specification and `assisted` / `automated` semantics.193194### When to create a `project-analysis-*` skill195196Only if the framework has its own lifecycle producing unique debugging197patterns that `project-analysis-core` cannot explain (e.g. Laravel,198Symfony, Express, React, Next.js). **Not** for Tailwind, CSS frameworks,199utility libs, or simple state managers.200201## Gotchas202203* Writing documentation instead of executable steps204* Skipping validation — every Procedure MUST end with a concrete verify step205* Including baseline knowledge the model already has206* Description too long or not a trigger207* Renaming a heading to "Procedure:" without numbered steps or `###` sub-headings208* **Always run `./scripts-run src/scripts/skill_linter` before saving — 0 FAIL required**209210## Frugality Standards211212Apply the [Frugality Charter](../../contexts/contracts/frugality-charter.md)213to every skill you author.214215**Examples in this artifact:**216- Per the charter's default-terse rule, the SKILL.md `## Procedure`217 opens with the action ("Run the linter"), not "Let me walk you218 through…".219- Per the cheap-question check, only emit numbered-options output220 when consequences differ — never as a stylistic choice.221- Per the post-action summary suppression, the example output ships222 the artifact, not a wrapping `## Status` / `## Summary` block.223224**Scope-exclusion clause.** A skill can shed assumed-knowledge prose without225losing correctness by naming what it does NOT cover: "this skill covers only226`<X>`; standard `<Y>` is assumed". One sentence replaces the paragraph that227would otherwise re-teach `<Y>`, and it is stronger than silence — a reader who228does not have `<Y>` learns that from the clause instead of from a wrong result.229230**Pre-save self-check:**2311. Does any procedure step open with "Let me", "Now I will", "Found232 it", "OK", or "Alright"?2332. Does the skill prescribe numbered-options output without a real234 consequence trade-off?2353. Does the example output include a post-action summary block?2364. Does the description carry filler ("comprehensive", "advanced",237 "powerful")?238239240## Section patterns241242The thirteen optional and required section patterns moved verbatim to243[`references/section-patterns.md`](references/section-patterns.md). Two of them244are marked **required** for a named population — security-constraints for245script-bearing skills, and the action-reference split for `safety_mode: strict`246skills — so a skill in either population reads that file rather than skipping it.247The read-only-by-default script rule moved to248[`references/read-only-scripts.md`](references/read-only-scripts.md).249250## Do NOT251252* Write documentation-style, pointer-only, or too-broad skills ("Laravel skill", "Django skill")253* Skip Procedure or use vague validation254* Exceed size limits (see `docs/guidelines/agent-infra/size-and-scope.md`)255* Duplicate rules256* Ship a skill script that mutates the filesystem on its default invocation — gate it behind a flag or allowlist it with a rationale257258## Encode usage policy in the description259260Workflow sequencing, preconditions, ID/output provenance ("copy ids verbatim,261never from memory"), a mandatory "why" intent field, and turn-end contracts262belong INSIDE this artifact's description/frontmatter — where they fire at the263decision point — not in always-on prose. See264[`tool-description-as-policy`](../../../docs/guidelines/agent-infra/tool-description-as-policy.md).