Skip to content
Agent Memory
Skill

/writing-for-agents

Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.

BOOST
From plugin
docs-governance
22219 skills7 agents8 commands1 hook
Install
$ npx -y skills add qshanx/docs-governance --skill writing-for-agents --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/writing-for-agents

Context preview

The summary Claude sees to decide when to auto-load this skill.

Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.

SKILL.md

writing-for-agents.SKILL.md
name: writing-for-agents
description: Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.

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, since the agent takes the same _process_ every run rather than producing the same output.

When the document you're writing is a skill, read [`SKILL-MECHANICS.md`](SKILL-MECHANICS.md) for frontmatter, invocation choice, and router skills.

Context pointers

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:

  • **Front-load the leading word**: the pointer is where it does its triggering work.
  • **One trigger per branch.** Synonyms that rename a single branch are one branch written twice; collapse them and keep only genuinely distinct branches.
  • **Cut identity the body already carries.**

The two loads

Every document and pointer you add spends one of two budgets:

  • **Context load** is the cost of always-loaded material on the agent's window: an `AGENTS.md` line, a skill description, anything sitting in context every turn, spending tokens and attention whether or not it fires.
  • **Cognitive load** is the cost on the human: which documents exist and when to reach for each. The human is the index. Not a cost to minimise: it is the price of human agency; spend it where human judgement matters, remove it where it does not.

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.

Information hierarchy

A document is built from two content types: **steps** (the ordered actions the agent performs) and **reference** (definitions, rules, facts consulted on demand). The two 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:

1. **In-file step** is the primary tier: what the agent does, in order. 2. **In-file reference** is consulted on demand. Often a legitimately flat peer-set (every rule of a review on one rung), which is a fine arrangement, not a smell. 3. **Disclosed reference** is pushed out into a separate file, reached by a context pointer, loaded only when the pointer fires. Spans a sibling file in the same folder through fully external reference that lives anywhere and any document can point at.

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.

Steps and completion criteria

Every step ends on a **completion criterion**, the condition that tells the agent the work is done. Two properties make it a lever:

  • **Clarity**: can the agent tell done from not-done? A vague bound ("understanding reached") invites **premature completion**: ending the step before it is genuinely done, attention slipping to _being done_. The visible steps still ahead (the **post-completion steps**) supply the pull; the criterion's clarity is the resistance. Defend in order: **sharpen the bound first** (local and cheap); only if it is irreducibly fuzzy _and_ you observe the rush, hide the later steps by splitting the sequence. Hiding only works across a real context boundary (a hand-off or a subagent dispatch; an inline call leaves the later steps in context and clears nothing).
  • **Demand**: how much it requires. "Every modified model accounted for" forces thorough work where "produce a change list" does not. Demand drives **legwork** (the digging the agent does within the work, latent in the wording rather than written as its own step), and it is not step-bound: "every rule applied"
Read more
Ships withdocs-governance

A knowledge, decision, and verification governance system for long-running AI-assisted projects. It turns a strong agent's one-off work into shared project capability that future agents can inherit, verify, and evolve.

Get the whole plugin

Other skills on docs-governance.

agent-entrypoints
Skill

agent-entrypoints

创建、优化或审查项目及模块级 AGENTS.md / CLAUDE.md 等 Agent 入口文档时使用。根据项目事实精简规则、设置按需读取指针,支持模块两入口布局,并检查规则是否可执行、入口是否冲突。

agent-workflow-governance
Skill

agent-workflow-governa…

用户要求整体检查项目治理规则的承载位置、精简常驻约束,或判断散落资料能否沉淀为 Skill、脚本或 Hook 时使用。只读识别主源、重复工作流与自动化缺口,给出证据和最小建议;单项文档维护直接使用已有专项 Skill。

architecture-docs
Skill

architecture-docs

判断项目是否需要架构文档,或生成、完善、审查 ARCHITECTURE.md 及已有架构说明。用于模块分工、状态归属、依赖关系或核心流程需要梳理时;依据项目证据记录结构,区分当前实现与已确认设计。

docs-audit
Skill

docs-audit

只读审计现有项目文档,检查资料散乱、入口难找、断链、内容过时、重复主源及当前与历史混用。用于用户要求“审计文档”“检查文档是否过时”“看看文档哪里乱”,或阶段交接前检查文档体系时。

docs-governance
Skill

docs-governance

作为面向长期 AI 协作项目的知识、决策与验证治理总入口,把优秀 Agent 的一次性工作沉淀为可继承、可验证、可持续演进的项目集体能力;根据用户意图把任务路由到活文档、领域上下文与…