Write for agents

From melodic-software/claude-code-plugins · View interactive version

Write for agents is an AI agent skill from the GitHub repository melodic-software/claude-code-plugins. Write or trim agent-consumed markdown: CLAUDE.md or AGENTS.md content, .claude/rules files, agent-loaded reference docs, navigation pointers, and doc-plus-pointer extractions. Use when: 'add this to CLAUDE.md', 'trim this AGENTS.md', 'cut it down to what earns its place', 'prune what an agent could

How to use this skill

Skill file

Write For Agents

Why this skill exists

The docs-hygiene siblings audit docs that already exist. This skill is the write-side complement:

it fires while the doc is written, so the problems the audits catch are never created. Its scope

is any markdown an agent will consume; the auto-read surfaces (CLAUDE.md scopes, .claude/rules,

auto-memory, and their kin) are the high-value core because their cost recurs every session. Read

CODE0 when you need to know

whether, when, and how much of a target file the harness loads. Write differently for an

always-loaded surface than for an on-demand one.

Budget both loads

Every line spends two budgets, and cutting one can overspend the other:

surfaces: we count each added line as diluting the agent's adherence to the rest, not only as

tokens. Governed marketplace-wide by plugin-philosophy's Instruction economy: an instruction

earns its place with observed-stumble evidence, or it goes. Pointer: for the size guidance,

see write effective instructions.

where things live. Ten tiny fragment files can be cheaper for the agent and ruinous for the

human; one 500-line file the reverse. When the two budgets conflict, say which one you spent

and why.

Fewer words spends less of both. The universal brevity rules apply: no more words than the meaning

needs, no filler, hedging, intensifiers, expletive openings, or restatement of an adjacent line;

active voice; one idea per sentence; a factual register with nothing sold. /writing:be-concise (if enabled)

owns those rules; without it, apply them from this

paragraph. Take those rules and no more of that doctrine: its human-only rules do not transfer. A

bottom-line-first opening, headings written to be skimmed, bullet lists for scanning, and bounded

bold serve a person moving down a page fast; an agent needs the rule stated where it applies, not

staged for a skim.

Know which surfaces are system prompt

Three vehicles shape the system prompt: a subagent definition's body, an output style, and the

launch flags that replace or append to it (--system-prompt, --append-system-prompt, and their

-file forms). Write CLAUDE.md files, rules, and skill bodies as instructions read in the

conversation, not as system prompt, stating the rule, its scope, and its reason. A rule that must hold at system-prompt level goes in a subagent body, an output

style, or a launch flag.

<https://code.claude.com/docs/en/memory#troubleshoot-memory-issues>; for a subagent body, see

<https://code.claude.com/docs/en/sub-agents#write-subagent-files>; for output styles, see

<https://code.claude.com/docs/en/output-styles#how-output-styles-work>; for the flags, see

<https://code.claude.com/docs/en/cli-reference#system-prompt-flags>; for skill content, see

<https://code.claude.com/docs/en/skills#skill-content-lifecycle>.

Write pointers that cover their branches

A pointer is a routing instruction: the reader decides from the pointer text alone whether to

follow it, without opening the target.

see…", never "See the following doc for information about deploys").

output specifically, read X"), so both the follow and the skip are informed decisions.

cohesion problem. Before adding it, consider restructuring so things that change together live

together: a pointer papering over low cohesion outlives the reorganization that would have

removed it. (Audit-side remediation home: harness-memory:audit's C5 fix guidance, if that

plugin is enabled.)

knows it is starting (a release, a deploy, a migration) goes behind a pointer that names that

trigger. Triage keyed to an error symptom stays on the always-loaded surface: the agent cannot

follow a pointer for a symptom it has not yet recognized. Correlate with the /doctor trim in

my CLAUDE.md is too large.

The sibling audit skill owns the full pointer-quality criteria. Invoke

/docs-hygiene:audit-progressive-disclosure via the Skill tool to grade a draft against them,

rather than failing them at audit time.

Separate steps from reference, and co-locate what runs together

Steps are read in order and executed; reference is jumped into and queried. Mixing them hurts

both: lookup tables interrupt a procedure's thread, and reference buried in a procedure is

unfindable.

with a conditioned pointer.

three sections away. Distance a reader must jump during execution is a defect.

who-reads-when lines, not topic lines.

Give every step a completion criterion

A step is done when its criterion says so, not when text resembling the step has been produced.

complete when Y appears" beats "run X".

goal-state is reached will be marked complete at first plausible output. Make the criterion

the goal-state, never the attempt.

up), state it in the step; an obligation after "done" is otherwise dropped.

a step that sends the human to look up something the agent could read is a defect.

a subagent dispatch); an inline call leaves the later steps in context.

A task-shaped or long-run instruction also names the whole task's finish line and its stops:

action, not a summary that names the next step, an offer to continue, or a list of choices that

block nothing.

hard-to-undo, or outward action. Never pair a keep-going rule with turning off permission prompts

or confirmation gates.

on the scrollback; reuse a ledger the workflow already has. The final report opens with what is

blocked on the human, then what changed and what was found.

Pointer: when judging what a long run loses to compaction, fetch

What survives compaction

live.

Split by sequence; choose invocation by the rubric

When one doc serves two moments in time, split it at the moment boundary: the reader at step one

should not scroll past material for step nine. Splitting an instruction surface into skills with

different invocation modes is a different axis with its own decision rubric: follow the

invocation-mode rubric

(§ Splitting by invocation) rather than deciding it ad hoc.

Prompt the positive

Write what to do, not what to avoid: a prohibition drags the banned behavior into context, and

pretrained leading words are the compact anchors that steer ("Prefer X" over "Never do Y unless").

Keep a negation only when the positive form genuinely loses the constraint, and state the positive

alternative in the same sentence. A design exclusion is the exception that stays negative: name

the specific styles to leave out ("no hero banner, no pill-shaped buttons"),

since "avoid a generic look" swaps one default for another.

Ask for outcomes, not thinking. Whether a "think carefully" line helps depends on the target model,

so follow /harness-config:audit-instructions (if enabled) criterion I8-f for the model the text will run on.

A line telling the model to think less or

not at all is I8-c's, scoped per model the same way. Never ask the model to show or reproduce

its reasoning in the reply, which some models decline; ask for what the reader needs, such as the

rationale in two or three sentences or the evidence as a list.

Be strict with precise words

Words like "reasonably", "tasteful" and "where appropriate" are too soft to force the agent to

follow them, so it falls back to its defaults: those sentences don't change behavior. State the

condition or the boundary instead, which narrows the answers the agent has to choose from. State a

number only where the requirement itself fixes one (a field limit, a count a parser checks), not as

a cap on prose length. An example of the form:

Bad:  Keep the summary reasonably short and mention the tests where appropriate.
Good: The summary says what changed and why, and nothing else. Name each test command you ran
      with its pass and fail counts.

Prompting Claude Fable 5.2: review instructions written for earlier models.

Strict means precise, not loud. State each rule in plain words with its scope and reason, and

write no all-caps and no marker words (IMPORTANT, MUST, NEVER, ALWAYS, CRITICAL) to make

it stick. A plain firm word (never, always) stays when the sentence gives the rule's scope and

reason. For a rule that must hold every time, name the call /corrections:codify "<the rule>" (if enabled)

for the user; this skill does not build the mechanism. When /corrections:codify (if enabled) is among the

available skills, hand it the choice of mechanism; it picks the strongest rung of the enforcement

ladder that can decide the rule and proves the check. Otherwise, propose the strongest mechanism

that can decide the rule: a change that makes the mistake impossible first, then a check that

blocks it, then a test, and an instruction only when nothing a machine runs can decide it. Say

that the corrections plugin was not available, so the proposal is unproven. A line that keeps

getting missed means the file needs to be shorter. Bold is structure only: a list-item label

or a defined term at its first use, never a whole sentence or a rule

(ADR 0098).

How to think about improvements.

What you can stop doing.

Leading words

A leading word is a compact concept the model already holds from pretraining, repeated as a token

and never re-explained, so it anchors a region of behavior in few tokens.

prior.

sentence on one idea, is a candidate to collapse into one word.

The no-op test

Run it sentence by sentence. An instruction the model already follows by default spends load and

says nothing. Running the document, not debate, settles whether a sentence changes behavior.

Delete a failing sentence whole. A word too weak to beat the default is a no-op too; the fix is a

stronger word: a more precise one, and a firm one only for a hard limit

(Be strict with precise words).

After writing

already exists? Invoke /docs-hygiene:extract-ssot via the Skill tool. A new shared home still

waits for the third occurrence; below that it remedies the repetition in place.

/domain-driven-design:ubiquitous-language curate (if enabled) via the Skill tool rather

than hand-writing the entry. A skill defining its own working vocabulary is out of that skill's

scope and stays where it is.

sibling via the Skill tool (/docs-hygiene:audit-noise, /docs-hygiene:audit-derivability,

/docs-hygiene:audit-progressive-disclosure) rather than expanding this write into an audit.

Related

What this skill does not do

action shape and body structure are /playbooks:skill-authoring (if enabled) territory (description shape

and caps: ## Descriptions; body size: ## Body), enforced by /skill-quality:check (if enabled). Prose

inside an already-authored SKILL.md is still this skill's, since a SKILL.md is agent-consumed

markdown. The boundary is authorship against wording, not a whole file this skill may not look

at; read otherwise, the largest agent-facing surface most repos have is governed by no

authoring doctrine at all.

at the writing moment only.

a different reader and different rules: they belong to the sibling

docs-hygiene:write-for-humans, which fires at this same moment and resolves the consuming

project's own style guide first.

eval suite, deliberately not on a forcing hook.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.