agentleFS
dafaalzdafaalz/agent-skills/skills/writing-for-agents/SKILL.md

writing-for-agents

Skill2 starsChanged 53 days agoMITView on GitHub

Use when drafting or editing agent instructions, AGENTS.md, CLAUDE.md, prompt runbooks, skill files, context pointers, design specs, or phased implementation plans. Don't use for human marketing copy (author marketing copy directly), general technical writing (use technical-writing), or user-facing product manuals (use technical-writing).

191 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use wait-what, to-questionnaire and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AWSSkill

    wait-what

    Stop. That last message did not land: re-pitch it.

    Also in 115 projects that use this

  • AWSSkill

    to-questionnaire

    Turn a decision you can't fully answer into a questionnaire for someone else to fill in.

    Also in 83 projects that use this

  • J03Fr0stSkill

    writing-for-humans

    Write and revise human-facing prose so it is clear, specific, natural, and faithful to the author's intent and genre. Use for emails, chat messages, articles, reports, documentation, announcements, talks, and other prose when the user asks to draft, diagnose, edit, rewrite, make writing less formulaic or less AI-like, sound more natural or direct, or match a supplied voice. Do not use for agent instructions such as skills or AGENTS.md, code-only work, verbatim transcription, or translation without editorial changes.

    Also in 5 projects that use this

  • liufeng1976Skill

    setup-ts-deep-modules

    Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.

    Also in 34 projects that use this

  • openchamberSkill

    clack-cli-patterns

    Use when creating or modifying OpenChamber CLI commands, prompts, terminal output, non-TTY behavior, `--quiet`, or `--json` behavior.

    Also in 3 projects that use this

  • MicrosoftSkill

    cloud-architecture-diagram

    Create, edit, or troubleshoot Azure-first architecture diagrams as editable draw.io files, with AWS and multicloud topology support and identity, API, and CI/CD flow diagrams. Use for architecture visualization, network boundaries, interaction flows, or missing diagram icons. Not for deploying infrastructure, live cloud discovery, security certification, or unrelated charts.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. 0 are common, 15 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 177 edited versions we read keep these.

  • 15

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write files the agent runs without guessing.

    line 8
  2. Very specific:

    Read the unslop skill for banned words, punctuation bans, and Indonesian calque rules.

    line 10
  3. Very specific:

    Write-Target Boundary. Write only to .agents/state/writing-for-agents/ and documentation files explicitly named by the user or task.

    line 13
  4. Distinctive:

    Run the operational steps in sequence.

    line 24
  5. Distinctive:

    Place each section in one tier (W2):

    line 37
  6. Distinctive:

    Follow these rules to write:

    line 46
  7. Distinctive:

    Use leading words already in model pre-training, like tracer, probe, baseline, invariant, audit, red, instead of long definitions (W4).

    line 48
  8. Distinctive:

    Run checklist at end of file, then fix each failing row:

    line 57
  9. Distinctive:

    Delete lines that do not change agent behavior (W5).

    line 59
  10. Distinctive:

    Read directory layout, manifests, and CLI help at runtime instead of copying them into file.

    line 60
  11. Very specific:

    Verify line budget with wc -l <target-file>.

    line 61
  12. Distinctive:

    Put concept, rules, and edge cases under one heading.

    line 81
  13. Distinctive:

    Prefer positive instruction.

    line 97
  14. Distinctive:

    Delete no-ops. When line restates default behavior, cut it.

    line 103
  15. Distinctive:

    Keep one source of truth. State each rule once.

    line 104
  16. Distinctive:

    Delete dead lines. Remove lines that no longer change behavior.

    line 105
  17. Distinctive:

    Leave code unchanged. Apply prose rules to prose only.

    line 125
  18. Distinctive:

    Run this before deploying any agent file:

    line 129

“Common” is measured: kept by at least 6 in 10 of the 177 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Writing for agents

Write files the agent runs without guessing. This covers skills, AGENTS.md, CLAUDE.md, runbooks, specs, and plans. Vendors package files differently. Same rules govern all packages. Use clear hierarchy, tight leading words, binary done checks, and no slop.

Read the unslop skill for banned words, punctuation bans, and Indonesian calque rules. This skill defines structure and routing. It defers prose fixes to unslop.

<HARD-GATE> Write-Target Boundary. Write only to `.agents/state/writing-for-agents/` and documentation files explicitly named by the user or task. Do not modify application source code, test suites, database schemas, or package lockfiles. </HARD-GATE>

Modes

Declare the active operating mode before executing any steps:

  • Author mode (default): Draft the target file or edit it in place. Run Steps 1 through 4 sequentially.
  • Audit mode: Review without edits. Run Step 1, Step 3, and Step 4. Step 2 is skipped because the existing document already provides the structural skeleton; Step 3 audits that skeleton instead of scaffolding a new one. Emit .agents/state/writing-for-agents/audit-report.md and halt without modifying target files.

Workflow

Run the operational steps in sequence.

Step 1. Scope and budget

Name target type and set its budget before you write:

  • Name target as always-loaded file (AGENTS.md, CLAUDE.md, system prompt) or on-demand pointer (skill description, disclosed reference).
  • List trigger branches. A branch changes what agent does. Put trigger word first in each branch. Drop synonyms that trigger same branch.
  • Set budget. Text loaded each turn spends context load. Text behind pointer spends cognitive load. See W1.

Completion criterion. .agents/state/writing-for-agents/scope.json exists on disk with target_file, target_type, line_budget, and mode.

Step 2. Tier and outline

Place each section in one tier (W2):

  • Primary. Agent runs ordered steps in sequence in main file. Keep file under 250 lines.
  • Secondary. Agent reads rules, definitions, tables on demand. Group one concept with its rules under one heading.
  • Tertiary. Agent loads disclosed files in references/ only through pointer. Move text over 100 lines out of main file.

Completion criterion. .agents/state/writing-for-agents/outline.md exists on disk labeling each section with its tier.

Step 3. Draft

Follow these rules to write:

  • Close each step with done check that you can verify as yes or no and that covers all outputs (W3).
  • Use leading words already in model pre-training, like tracer, probe, baseline, invariant, audit, red, instead of long definitions (W4).
  • State file, endpoint, command, or mechanism. Replace vague feeling with file or command that causes it.
  • Pair each ban with required action on same line (W4).
  • For skill, write frontmatter and layout from Skill files section. Read references/agentskills-spec.md for schema rules. Read references/testing-skills.md and references/google-agent-standards.md for verification standards.

Completion criterion. Draft file exists on disk with every operational step closed by a verifiable binary completion criterion.

Step 4. Verify

Run checklist at end of file, then fix each failing row:

  • Apply unslop rules to prose. Check frontmatter and directory layout for skill.
  • Delete lines that do not change agent behavior (W5).
  • Read directory layout, manifests, and CLI help at runtime instead of copying them into file.
  • Verify line budget with wc -l <target-file>.

Completion criterion. python3 skills/review-a-skill/scripts/lint_skill.py <path-to-skill> exits with status code 0 (for skills), or wc -l <target-file> confirms line count is within budget.

Core rules

W1 Context load and pointers

Each file spends one of two budgets. Context load means tokens present each turn. Cognitive load means time user spends to remember which file to load. Pointer trades context load for small fixed cost. Pointer stays loaded. Text behind it does not.

Pointer names material and lists branches that must read it. Keep one trigger per branch. Put trigger word first. Inline text each branch needs. Put text behind pointer when only some branches need it. If agent keeps missing required file, rewrite pointer wording before moving text inline.

W2 Tiers and splitting

File holds steps, reference, or both. Steps mean ordered actions. Reference means rules, definitions, facts agent reads on demand.

Move too little to reference and main file grows past 250 lines. Move too much and agent loses detail it needs. Split file only when split pays its cost:

  • Split by sequence when agent sees upcoming steps and skips current one.
  • Split by invocation when skill must run on its own. Read references/skill-mechanics.md for invocation modes and router skills, and read references/anthropic-best-practices.md for harness patterns.

Put concept, rules, and edge cases under one heading. When file sprawls, move reference behind pointers and split task by branch or sequence.

W3 Steps and completion criteria

Each step closes with done check that tells agent when step ends. Strong check must pass two checks:

  • Clarity. Agent can separate done from not done. "Ensure understanding" fails this check, so agent claims success early. Rewrite boundary to make done explicit. If boundary stays fuzzy, move later steps to another prompt or subagent.
  • Demand. Check requires specific inspection. "Account for every modified database model" forces inspection. "List the changes" does not.

Strongest checks are verifiable, binary, and exhaustive.

W4 Leading words and positive framing

Leading word means compact concept already in model pre-training. Tracer, probe, baseline, invariant, audit, red use existing prior without long definition. Replace definition with word that carries it:

  • "fast, deterministic, low overhead" becomes "tight".
  • "a test that genuinely catches the issue" becomes "red".

Prefer positive instruction. Ban repeats banned concept, and model repeats it. Write "one-line bullet points" instead of "do not write long paragraphs". When ban guards hard invariant, pair it on same line with required action.

W5 Anti-slop beyond unslop

Agent copies tone and density of files it reads. Long instructions produce long prose and extra tool calls. unslop covers words and punctuation. These rules cover agent files:

  • Match reader. Write at density agent must produce.
  • Delete no-ops. When line restates default behavior, cut it. Test rule against real agent runs before keeping it.
  • Keep one source of truth. State each rule once. Env files, directory layout, command help state themselves. Document convention only when env does not state it.
  • Delete dead lines. Remove lines that no longer change behavior.

Anti-patterns

IDTitlePattern descriptionWhy it failsConcrete fix
WFA-1Vague adjectivesInstructs agent to "Make it robust" or "Ensure quality"Agent hallucinates arbitrary checksSpecify exact invariant or assertion
WFA-2Deep conditionalsNests if-else logic 4+ levels deep in narrative proseInstruction drift and skipped branchesFlatten into a decision table
WFA-3Prose wallsPacks dense operational instructions into uninterrupted paragraphsAgent drops secondary constraintsSplit into bulleted constraints
WFA-4Fuzzy exitUses subjective exit condition like "Ensure it looks right"Premature termination without verificationAnchor to exit code or file existence
WFA-5Passive voiceWrites "changes should be applied" without actorAmbiguous responsibility for actionsUse direct imperative verbs
WFA-6Runbook creepInlines exhaustive reference catalogs into main runbookContext budget blowoutMove reference manuals to references/

Boundaries

Apply structure and style rules to prose only. Leave these byte for byte:

  • Code fences and inline code, including YAML frontmatter blocks and JSON.
  • SQL, shell commands, file paths, and tree output.
  • Quoted slop examples that show banned pattern on purpose.

Leave code unchanged. Apply prose rules to prose only. Never rename symbol, restyle sample, or reflow command to satisfy prose rule.

Quick audit checklist

Run this before deploying any agent file:

CheckPassing condition
Frontmatter1 to 64 character kebab-case name equal to directory, description with "Use when" and "Don't use for"
HierarchyPrimary steps, secondary rules, and tertiary references separated
Context loadMain file under 250 lines, reference over 100 lines moved to references/
Completion criteriaEvery step ends on an artifact-anchored binary criterion
Anti-patternsAnti-pattern table adheres to 5-column schema with stable IDs
VerificationPasses lint_skill.py with zero errors and line budget is verified

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.