brain-write-skill
Skill2 starsChanged 12 days agoMITView on GitHub
Create, change, split or rename one of this brain's own skills, or an agent a skill dispatches, so it fits the brain's conventions: placed in the routing map first, named <prefix>-<verb>-<object>, a description that says what it does NOT do, must-obey rules inline, a router when an entry point fans out, and a gate on output that must not be improvised. Use when work keeps being reinvented or judged wrong, when a skill grew too big, when renaming one, or when the skill gate refuses a write to a skill or agent file. Does NOT write scripts, which is brain-write-script; does NOT record a fact, which is brain-write-practice; and does NOT change a brain-* skill, which is brain-upstream.
In this repository10 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- brain-retroSkill
- brain-setupSkill
- brain-syncSkill
- brain-upstreamSkill
- brain-write-modSkill
- brain-write-practiceSkill
- brain-write-scriptSkill
- template-intakeSkill
- template-make-brainSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 2 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
When brain.json role is template, ask the person whether the skill ships to every brain (brain-*) or stays in the template (template-*).
- Distinctive: line 40
If the gate refused a write to a skill file, this sequence is the answer, not a waiver.
- Distinctive: line 42
Does it earn a skill?: Only work that will happen again and is not obvious to do well: a sequence someone would reinvent, or judgement …
- Very specific: line 48
Place it in the tree before writing it: Read references/routing.md.
- Very specific: line 64
every must-obey rule inline: references/ do not load by themselves, so a rule left there is a rule skipped.
- Very specific: line 70
Gate its output: when it must not be improvised.
- Very specific: line 75
Check: Read references/conventions.md for what each finding means.
- Very specific: line 119
Leave a skill out of the map without a ## Not drawn row saying why.
- Very specific: line 120
Leave a must-obey rule only in references/.
- Very specific: line 131
If it joins a fan-out: the router's rules.json has a rule and a case for it, and _meta/brain route <router> --check passes.
- Very specific: line 133
If its output must not be improvised: a brain.json gates rule covers the path it writes.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Write a skill for this brain
A skill here is placed in a routing map, gated by a hook and checked by lint; generic skill-writing advice covers none of that, so follow this sequence even when another skill-writing skill is installed.
Where this sits
<!-- where:begin — generated by _meta/brain routing sync; do not edit -->Runs after: brain-retro · brain-setup
Hand to next: brain-sync · brain-write-script
Reserved output: writing .claude/agents/<prefix>-*.md needs this skill to have run.
Reserved output: writing .claude/skills/<prefix>-*/** needs this skill to have run.
Reserved output: writing docs/ROUTING.md needs this skill to have run.
<!-- where:end -->Call it directly when: the skill gate refused a write to a skill or docs/ROUTING.md, or
brain-retro proposed a skill edit the person accepted; steps 7 to 9 apply to every change.
In the template
When brain.json role is template, ask the person whether the skill ships to every brain
(brain-*) or stays in the template (template-*). Editing a brain-* skill is allowed here. A
brain-* skill is drawn in _meta/ROUTING-META.md, its gate rules go in _meta/gates.json, and it
is written for any brain: conventions read from brain.json and CLAUDE.md, no prefix, path or
person hard-coded. Run the template's tests after a change.
Sequence
For a new skill, run every step. For a change to an existing one, start with
_meta/brain routing show <skill>, skip only the steps the change cannot touch, and always run 7 to 9.
If the gate refused a write to a skill file, this sequence is the answer, not a waiver.
- Does it earn a skill? Only work that will happen again and is not obvious to do well: a
sequence someone would reinvent, or judgement someone would get wrong. A fact is a practice
(
brain-write-practice), a query or helper is a script (brain-write-script), and something done once is neither. Work already under way counts as covered: a skill on an unmerged branch, or an open suggestion indocs/UPSTREAM.md. Say so and stop: every skill costs every session its description. - Place it in the tree before writing it. Read
references/routing.md. Run_meta/brain routing showand settle, with the person where it is not obvious: where the work enters (an existing entry node, or a new one in the words a person would say), what runs before it, what it hands to, whether it is a gate on someone's path, and whether it ends where a person acts. If an entry point now fans out to three or more skills by kind of input, write or extend a router, with a rule and a test case for the new skill. Draw it indocs/ROUTING.md, or list it under## Not drawnwith the reason. Placement sets the boundaries: a skill placed after it is written overlaps its neighbours, and nothing hands to it. - Name it
<prefix>-<verb>-<object>: the prefix frombrain.json, a verb from the families the brain already has (ls .claude/skills). Readreferences/conventions.mdfor steps 3 to 5. - Description, on one line in double quotes (unquoted, YAML refuses
:and cuts at#): what it does; when to use it, in a person's words; what it does NOT do, naming the sibling ("which is<name>"). Routers and other skills read descriptions to decide;lintchecks the names resolve. - Body, about 100 lines:
- the sequence and the judgement inline, with the reason for any step that is not obvious: the reason is what survives a case the author never saw;
- every must-obey rule inline:
references/do not load by themselves, so a rule left there is a rule skipped; lookup material goes there, behind "Readreferences/<file>" at its step; - where its output goes (a project folder,
docs/, outside the brain;CLAUDE.mdmaps the folders), or the next agent writes it wherever it is standing; - an empty
## Where this sitsforrouting sync, and a hand-written**Call it directly when:**line under it; then## Done when, as checkable conditions.
- Gate its output when it must not be improvised. Read
references/gates.md. Gate anything that leaves the brain (a post, PR or release text, config applied to a live system, a reply to someone) and anything a later step trusts without checking again. Add the rule tobrain.jsongates, with awhy, andspend_on_revisionwhen every revision needs the skill's review again. A path no rule covers is unguarded, so the body must say exactly where that output is written. - Check. Read
references/conventions.mdfor what each finding means. Run_meta/brain routing sync, then_meta/brain lint(no BROKEN; tell the person why each GAP left stays),_meta/brain routing sync --check, and_meta/brain route <router> --checkper changed router. - Run it on a real case before trusting it, through the Skill tool, or ask the person for one (and record why not, if there is none). Two runs that read a step differently mean that step is not doing its job: explain why it matters, rather than adding capitals or "NEVER", which get talked past.
- Hand on. A script it needs goes to
brain-write-script; never write one inline here. Then commit throughbrain-sync.
Agents
An agent (.claude/agents/<prefix>-<role>.md) is a helper a skill dispatches with the Agent tool:
its own context for a large read, a cheaper model, or a narrower set of tools. Write one only when a
skill's step needs that; otherwise the step stays in the skill. It is never an entry point, so it is
not drawn in the map: the skill that dispatches it names it, and lint reports one no skill names.
---
name: <prefix>-<role>
description: "What it does and when a skill hands it work; what it does NOT do."
tools: Read, Grep, Glob
model: sonnet
---List its tools, read-only unless its job is to write (without tools it gets every tool, MCP ones
included), and give the reason in its body for any write tool or Bash. Name the cheapest model that
does the job. The body says what it is given and what it returns: a report, never the files it read,
so the dispatching skill makes any fix. A checker gives each claim a verdict: verified (with its
source), unverified (with the risk of trusting it) or falsified; with no source to reach, a claim is
unverified, never verified. Then run step 7.
Splitting and renaming
Split a skill that passed about 150 lines, or that has two entry points, by where its parts sit in
the tree, not by topic: each part gets its own node, edges, description and ## Done when. Run the
sequence from step 2 for each part, and move every edge, router rule and gate rule that named the
old skill. Rename only with _meta/brain rename-skill OLD NEW: a dry run that lists every file it
would change. Read the list, then add --apply; it rewrites the name in places no hand rename gets
all of (router rules, map ids, brain.json gates). Then run step 7.
Do not
- Rename a skill by hand: references left behind break routing silently.
- Leave a skill out of the map without a
## Not drawnrow saying why. - Leave a must-obey rule only in
references/. - Arm a gate waiver, or add a
gates_offorgate_exemptentry, yourself: each needs the person's express say-so, this time, with their reason. A refusal means invoke the skill it names. - Edit between the
where:markers (routing syncwrites that block), or change abrain-*skill or_meta/in a brain (record it throughbrain-upstream).
Done when
- The skill is drawn in the routing map, or listed under
## Not drawnwith a reason. _meta/brain lintshows no BROKEN, and every GAP left was explained to the person._meta/brain routing sync --checkpasses.- If it joins a fan-out: the router's
rules.jsonhas a rule and a case for it, and_meta/brain route <router> --checkpasses. - If its output must not be improvised: a
brain.jsongatesrule covers the path it writes. - It was tried on a real case, or the person said why not.
- An agent lists its tools and a model, and the skill that dispatches it names it.
- It is handed to
brain-syncto commit.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

