/fabrika:writing-for-agentsfrom fabrika
Guides writing documents consumed by agents — skills, AGENTS.md, CLAUDE.md — focusing on context pointers, trigger wording, and the trade-off between context load and cognitive load.
Ships in fabrika. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Imported verbatim from
mattpocock/skills,skills/productivity/writing-for-agents/, MIT licensed (Copyright (c) 2026 Matt Pocock). SeeLICENSE. Body text is upstream's; only this note is ours. Re-sync by re-copying from upstream rather than editing in place.
Reference for writing any document an agent consumes — a skill, an AGENTS.md / CLAUDE.md, a doc reached by a pointer. The packaging differs; the writing does not: the same levers make each one predictable — the agent taking the same process every run, not producing the same output.
When the document you're writing is a skill, read SKILL-MECHANICS.md for frontmatter, invocation choice, and router skills.
A context pointer is a reference held in the agent's context that names some out-of-context material and encodes the condition for reaching it. A skill's description is one; a line in AGENTS.md naming a doc is the same object. The pointer's wording, not its target, decides when the agent reaches the material — and how reliably. A must-have target behind a weakly worded pointer is a variance bug: sharpen the wording first, and inline the material only if sharpening fails.
A pointer does two jobs — state what the material is, and list the branches that should trigger reaching it (a branch is a distinct case the document handles, so different runs take different paths through it). Every word of an always-loaded pointer costs on every turn, so it earns even harder pruning than the body:
Every document and pointer you add spends one of two budgets:
AGENTS.md line, a skill description, anything sitting in context every turn, spending tokens and attention whether or not it fires.Material reached only through a pointer escapes context load at the price of the pointer's own line; material with no pointer at all rides entirely on cognitive load.
A document is built from two content types — steps (the ordered actions the agent performs) and reference (definitions, rules, facts consulted on demand) — that mix freely: all steps (a recipe), all reference (a review's rules, this skill), or both. The core decision is where each piece sits on the information hierarchy, a ladder ranked by how immediately the agent needs the material:
Push too little down and the top bloats; push too much and you hide material the agent actually needs. That tension is the whole decision.
Progressive disclosure is the move down the ladder — out of the main file and behind a pointer — so the top stays legible. Not primarily a token optimisation: it is how the hierarchy is protected. Branching is the cleanest disclosure test: inline what every branch needs, and push behind a pointer what only some branches reach. When a document has steps, in-file reference that should be disclosed buries them and turns attending to them into a coin-flip — a variance lever, not just a legibility one.
Co-location is the within-file companion: where the ladder decides how far down a piece sits, co-location decides what sits beside it once there. Keep a concept's definition, rules, and caveats under one heading rather than scattered, so reading one part brings its neighbours with it. The test: the document should read like documentation written for the agent — grouped material reads that way; scattered material does not. (Distinct from duplication: that repeats one meaning in two places; scattering fragments one meaning across many.)
Sprawl is the failure mode here: a document simply too long, even when every line is live and unique. Attention thins across the excess, and every extra line is one more to keep relevant. The cure is the ladder: disclose reference behind pointers, and split by branch or sequence so each path carries only what it needs.
Every step ends on a completion criterion — the condition that tells the agent the work is done. Two properties make it a lever:
The strongest criteria are both checkable and exhaustive.
Splitting one document into two spends one of the two loads, so split only when the cut earns it:
SKILL-MECHANICS.md.A leading word is a compact concept already living in the model's pretraining that the agent thinks with while running the document (lesson, fog of war, tracer bullets). Repeated as a token, never as a sentence, it accumulates a distributed definition and anchors a whole region of behaviour in the fewest tokens, by recruiting priors the model already holds. Coining your own works if you define it clearly, but a made-up word recruits no priors — you pay in definition tokens what a pretrained word gives free; reach for an existing word first.
It anchors twice. In the body, execution: the agent reaches for the same behaviour every time the word appears, and inside flat reference it focuses attention on a class of thing to look for. In a pointer, invocation: when the same word lives in your prompts, your docs, and your codebase, the agent links that shared language to the material and reaches it more reliably.
Hunt for opportunities to refactor with leading words. A triad spelled out at three sites, a pointer spending a sentence to gesture at one idea — each is a passage begging to collapse into a single token:
You win twice: fewer tokens, and a sharper hook for the agent to hang its thinking on. Assume every document is carrying restatements that leading words retire — go find them.
Negation is the failure mode beside this lever: steering by prohibition drags the forbidden behaviour into context and makes it more available, not less. Don't think of an elephant, and the elephant is all there is; the negation is a weak modifier the strongly-activated concept overruns, so the ban half-reads as an instruction to do the thing. Prompt the positive — state the target behaviour ("write one-line comments") so the banned one is never spoken. A prohibition earns its place only as a hard guardrail you cannot phrase positively; even then, pair it with the positive target so attention lands on what to do.
package.json scripts, config files, the directory layout, --help output — and a document that restates it is a cache: a copy of a lookup, earning its load only when the lookup is expensive. Cache what the agent cannot find by looking: the unwritten convention, the reason behind a choice, the gotcha no config confesses. Leave the one-file, one-command lookups to the environment, where they cannot go stale.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kamp-us/phoenix --plugin fabrika29 skills in this plugin
/adrRecord one architecture decision as an `NNNN-slug.md` file in the repo's decision corpus. Trigger on "/adr", "save this as an ADR", "record this decision", "ADR for X" — and reach for it whenever a technical preference, convention, or invariant gets settled in conversation that future agents must respect, even when nobody asks for an ADR./architecture-auditAudit a folder for architectural friction and hand the findings to grilling for human selection. Use when choosing where to deepen a codebase; use review for PR judgment. Audited code stays read-only./buildExecute one triaged, agent-ready issue end to end and land it as a PR — or, given a PR number, enter repair mode on that PR's branch. Trigger on "work the next issue", "pick up an issue", "implement issue #N", "build #N", "repair PR #N", "fix the FAIL on #N", and whenever triaged backlog work needs turning into a pull request. Rendered-visual construction is `build-ui`'s lane, not this skill's — unless a shell preloads both, and then the diff's class picks the law per file./build-uiExecute one triaged issue whose deliverable is a rendered visual surface, and land it as a PR — or, given a PR number, enter repair mode. Trigger on "build the UI for #N", "implement the page/component/screen", "make the visual change in #N", "repair the design FAIL on PR #N", and whenever backlog work's deliverable is something a user will see rendered. Text construction — code-as-text, prose, plans — is `build`'s lane, unless a shell preloads both, and then the diff's class picks the law per file; judging a rendered surface is `review-ui`'s./campaignDeclare a campaign, flip one campaign's lifecycle state, or read the ROADMAP `## Campaigns` table. Trigger on "/campaign", "declare a campaign", "start that campaign" (and any other flip between active, paused and done), "which campaigns are active". Homing issues onto a milestone is `triage`'s; judging the roadmap against its milestones is `guard roadmap-guard check`'s./check-epic-planGate one planned epic's task ledger and, only on a clean floor, flip its planned children and the epic itself to pickable. Trigger on "gate epic #N", "check the plan for epic #N", "run the plan gate", "is epic #N's ledger clean", "make epic #N's children pickable", and whenever a planned epic's ledger needs clearing before its children can be built. It does not plan (`plan-epic`) and never reviews a pull request (`review`).Other plugins' skills for the same job