write-skill
The facts
Its description
Write a new agent skill or improve one without bloat: the edit ladder, levels, drift and size checks, full diets. (gstack) Triggers: write a skill; improve this skill; add this lesson to the skill; put this skill on a diet
The description the agent reads to decide when to use it. Phrases the author says should start it.
When it starts
A person asks to create a new agent skill, or to revise an existing one — adding a lesson, cutting bloat, or putting a skill on a diet. The description and triggers point at skill authoring and trimming, not at running whatever the skill teaches.
Things a person might say (the model's guesses)
- “Write a skill for our release checklist.”
- “This skill has gotten bloated — put it on a diet.”
- “Add this lesson to the review skill.”
A model's summary of when it is used.
Tools it may use, or may not
allowed-tools: Bash, Read, Write, Edit, Grep, Glob, AskUserQuestion
Tools it may use while it runs without asking you first.
Runs scripts
bin/gstack-skill-start, scripts/question-registry.ts, bin/gstack-question-preference, bin/gstack-question-log, bin/gstack-skill-end (first 5 of 7 lines)
Scripts the text names. Found by matching words, so treat them as pointers.
Files it mentions
references/diet.md
Files the text names, such as ones to read or write. Found by matching words, so treat them as pointers.
Stops for a person
3 lines stop to ask a person
Lines that stop and wait for a person before going on. Found by matching words, so treat them as pointers.
What leads to it
- gstack hands off to this PROACTIVE all, or user names it gstack, line 208
Other skills that hand off to this one, call it, require it or offer it instead, as a model read them.
Names skills outside this collection
- skill-diet diet.md, line 53
Skills the text names that are not in this collection, as a model read them.
Licence
MIT, from LICENSE
The terms its author shares it under, which let it be shown here.
Other files in this skill (2) Close
The text
Most marks come from matching words in the file, so treat them as pointers.
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly --> <!-- Regenerate: bun run gen:skill-docs -->
Raw lines 1 to 22Boilerplate, lines 23 to 79. The same text appears in 45 other files here. Close
Telemetry (run last)
After workflow completion, log telemetry with ONE command. OUTCOME is success/error/abort/unknown; SESSION_ID and TEL_START are the values the preamble's skill-start output echoed. It also drains the artifacts-sync queue (the former skill-end sync step — do not run gstack-brain-sync separately).
PLAN MODE EXCEPTION — ALWAYS RUN: This writes telemetry to $GSTACK_STATE_ROOT/analytics/, matching preamble analytics writes.
~/.claude/skills/gstack/bin/gstack-skill-end --skill "write-skill" --outcome OUTCOME \
--session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \
--error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || trueReplace OUTCOME and USED_BROWSE (yes/no) before running; substitute SESSION_ID/TEL_START from the skill-start echoes. ERROR_MESSAGE/FAILED_STEP are "" unless outcome is error. If the command is missing (stale install), skip telemetry — it never blocks the workflow.
/write-skill: write and improve skills, lean
Raw lines 80 to 1021. Find the skill
Run ~/.claude/skills/gstack/bin/gstack-skill-bill <name|folder>. It resolves exact names only and prints the skill's kind and its size per level. A new skill: make the folder first (in a gstack checkout, follow CONTRIBUTING.md "Adding a new skill"), then write every line by sections 2 and 3.
user: edit it in place.gstack-install: never edit; gstack-upgrade overwrites it. Edit<skill>/SKILL.md.tmplin a gstack checkout, or copy the skill to a folder the user owns.gstack-checkout: editSKILL.md.tmpl, neverSKILL.md, thenbun run gen:skill-docs.
2. Levels
Put each fact on the lowest level that still reaches the agent before it needs it.
| Level | Holds | Loaded |
|---|---|---|
| description | one trigger per case | every session |
| SKILL.md | what every task needs | every use |
references/ | what some tasks need, behind a line saying when to read it | that case |
the tool's --help | flags, values, examples | when the agent picks the command |
| the tool's replies, errors, tests | the right name, the fix, the next step | when a guess is wrong |
3. Edit ladder
Stop at the first step that handles the change.
- Fix it below the skill. A clearer error, a flag, a check or a test in the tool. Prose is for judgment calls.
- Check the model needs it. If a fresh session does the right thing without the line, add nothing.
- Edit, don't append. Change the line that already covers the idea; each meaning lives in one place.
- Pick its level (section 2).
- Rule, not story. One positive rule under a short name; the incident goes in the commit message.
Keep two or three safety lines inline for each risky area: writes, data leaving the machine, paid spend. When code changes a name or flag a skill teaches, update the skill in the same change.
Raw lines 125 to 1364. Check and record
- Run
~/.claude/skills/gstack/bin/gstack-skill-billbefore and after, and putSkill-Size: <before>→<after> bytes (<file>)in the commit message. DUE means it grew over 10% since its lastSkill-Diet:commit: diet it instead of adding. - In a gstack checkout:
bun test test/skill-bin-drift.test.ts test/parity-suite.test.tsand the budgets in CONTRIBUTING.md. A red context-budget ratchet means diet, not a higher ceiling. - Rerun the case that prompted the change in a fresh session.
Look up the rest
- Full diet of a large, bloated or drifted skill → read
references/diet.mdin this skill's folder.
From garrytan/gstack at 3f79d81, 2026-11-01. Skills read by DeepSeek V4.1 Flash on 2026-11-04. Summary and techniques by Claude Opus 5.5 on 2026-11-06.