writing-for-agents

writing-for-agents is a skill for Claude Code, Codex from vinvcn/mattpocock-skills-zh-CN. It costs 31 tokens per session (2,837 once invoked), scanned A, original, MIT.

Guidance for writing instructions that coding agents can follow consistently. It covers skills and files such as AGENTS.md and CLAUDE.md, which tell agents how to work in a project.

In plain words
What is it for?
Use it when creating or editing agent skills, AGENTS.md, or CLAUDE.md. It helps define when supporting documentation should be read and how to keep always-loaded instructions concise.
Why use it?
It helps prevent unclear instructions that agents may follow inconsistently or load at the wrong time. It explains how short context pointers can direct an agent to more detailed documents when needed.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present. Also seen: mentions CLAUDE.md; mentions subagents; mentions AGENTS.md.

Part of the mattpocock-skills plugin — 36 skills shipped together

Good fit Use it when creating or editing agent skills, AGENTS.md, or CLAUDE.md. It helps define when supporting documentation should be read and how to keep always-loaded instructions concise.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vinvcn/mattpocock-skills-zh-cn/writing-for-agents
About the project

mattpocock-skills-zh-CN is a Simplified Chinese localization of a collection of reusable instructions for coding agents. Chinese-speaking developers use the translated skills to support engineering workflows while keeping their original commands, paths, identifiers, and behavior. The catalogue contains the localized skills, instructions, and plugin components.

vinvcn/mattpocock-skills-zh-CN · 4,149 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add vinvcn/mattpocock-skills-zh-CN --skill writing-for-agents
Clone the repo
git clone --depth 1 https://github.com/vinvcn/mattpocock-skills-zh-CN

Made for: Claude Code, Codex.

Or install mattpocock-skills, the plugin that ships this one along with the rest of its 36 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for writing-for-agents

README.md
[![agentmods](https://agentmods.dev/badge/skills/vinvcn/mattpocock-skills-zh-cn/writing-for-agents/github.svg)](https://agentmods.dev/skills/vinvcn/mattpocock-skills-zh-cn/writing-for-agents)
Your own site
<a href="https://agentmods.dev/skills/vinvcn/mattpocock-skills-zh-cn/writing-for-agents"><img src="https://agentmods.dev/badge/skills/vinvcn/mattpocock-skills-zh-cn/writing-for-agents/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for writing-for-agents

Your own site · 80×15
<a href="https://agentmods.dev/skills/vinvcn/mattpocock-skills-zh-cn/writing-for-agents"><img src="https://agentmods.dev/badge/skills/vinvcn/mattpocock-skills-zh-cn/writing-for-agents.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,837 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 31 Aug 2026
  • Snyk pass 31 Aug 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00031 $0.02837
Opus 5 $0.00015 $0.01418
Sonnet 5 $0.00006 $0.00567
Haiku 4.5 $0.00003 $0.00284

Measured 13d ago against content hash 987eb9402fcb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

writing-for-agents scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/productivity/writing-for-agents/SKILL.md · 81 lines

How it starts

The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.

为 agent 消费的任何文档提供参考——一个 skill、一个 AGENTS.md / CLAUDE.md、一个经 pointer 触达的文档。包装方式不同;写作本身并无不同:同样的杠杆让每一份都变得可预测——agent 每次运行都采取相同的 process,而不是产出相同的 output。

当你写的文档是 skill 时,阅读 SKILL-MECHANICS.md 了解 frontmatter、invocation 选择以及 router skills。

Context pointers

context pointer 是 agent context 中持有的一个 reference,它命名某个 context 之外的材料,并对触达它的条件进行编码。某个 skill 的 description 就是其一;AGENTS.md 中命名某个文档的一行是同一个对象。决定 agent 何时以及多可靠地触达材料的,是指针的 措辞,而不是它的目标。一个必须是目标的、却由措辞薄弱的 pointer 承载的内容,是一个 variance bug:先打磨措辞,只有打磨失败时才内联该材料。

一个 pointer 做两件事——说明材料是什么,并列出应触发触达它的 branches(一个 branch 是文档处理的一个独立情形,所以不同的 runs 会沿不同的路径穿过它)。一个始终加载的 pointer 的每个词都会在每一轮付出成本,所以它比正文更该被大力修剪:

  • 把 leading word 放到最前面——pointer 是它做触发工作的地方。
  • 每个 branch 一个 trigger。 如果同义词只是重命名单一 branch,那就是同一个 branch 写了两遍;合并它们,只保留真正不同的 branches。
  • 删掉正文已经承载的 identity。

The two loads

你添加的每个文档和 pointer 都会花掉两个预算之一:

  • Context load ——始终加载的材料对 agent window 的成本:一行 AGENTS.md、一个 skill description、任何每轮都躺在 context 里的东西,无论是否触发都要花 tokens 和注意力。
  • Cognitive load ——对人类的成本:存在哪些文档、何时伸手去取每一份。人类就是 index。这不是要最小化的成本——它是 human agency 的代价;把它花在人的判断起作用的地方,在它不起作用的地方移除它。

只能通过 pointer 触达的材料,以该 pointer 自己那一行为代价逃过 context load;完全没有 pointer 的材料则完全由 cognitive load 承载。

Information hierarchy

一个文档由两类内容构成——steps(agent 执行的有序动作)和 reference(按需查阅的定义、规则、事实)——它们自由混合:全是 steps(一份菜谱)、全是 reference(一次 review 的规则、本 skill),或两者都有。核心决策是每块内容放在 information hierarchy 的哪个位置——一个按 agent 需要材料的即时程度排序的 ladder:

  1. In-file step ——primary tier:agent 按顺序做什么。
  2. In-file reference ——按需查阅。通常是一个合法的 flat peer-set(一次 review 的所有规则都在一个 rung 上)——这是合理的安排,不是坏味道。
  3. Disclosed reference ——推到独立文件中,经 context pointer 触达,只在 pointer 触发时加载。既涵盖同一文件夹里的 sibling 文件,也涵盖存在于任何地方、任何文档都能指向的完全 external reference。

把太少内容下放会让顶层膨胀;把太多内容下放会隐藏 agent 实际需要的材料。那种张力就是整个决策。

Progressive disclosure 是沿 ladder 下移的动作——移出主文件、放到一个 pointer 后面——让顶层保持清晰。它主要不是 token 优化:它是 hierarchy 被保护的方式。Branching 是最干净的 disclosure 测试:内联每个 branch 都需要的内容,只把部分 branches 触达的内容放到 pointer 后面。当一个文档有 steps 时,本应被 disclose 的 in-file reference 会把它们埋起来,把关注它们变成掷硬币——这是一个 variance 杠杆,而不只是可读性杠杆。

Read the full file on GitHub · 81 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 81 lines · 31 tokens per session scan A 987eb9402fcb

Subscribe to this mod's changes

writing-for-agents is a skill published in the GitHub repository vinvcn/mattpocock-skills-zh-CN (4,149 stars, last pushed 5d ago), licensed MIT. It adds 31 tokens to every session and 2,837 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens