writing-docs

writing-docs is a skill for Claude Code from WangChangxin0809/repo-agent-harness. It costs 141 tokens per session (3,697 once invoked), scanned A, original, MIT.

A set of instructions for writing and reorganizing documentation for both coding agents and people. It routes documents into how-to, reference, decision, or execution-plan folders based on why they are being read.

In plain words
What is it for?
Use it when writing a document, runbook, decision record, reference page, or execution plan. It also governs a script that checks documentation writes and keeps the routing table accurate.
Why use it?
It prevents documentation from becoming unused material by matching each document to a specific task, lookup need, design decision, or active piece of work.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: mentions CLAUDE.md; mentions subagents.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 scripts/index/build.py.

Part of the repo-agent-harness plugin — 6 skills, 1 agent, 4 hooks shipped together

Good fit Use it when writing a document, runbook, decision record, reference page, or execution plan. It also governs a script that checks documentation writes and keeps the routing table accurate.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/WangChangxin0809/repo-agent-harness
agentmods
npx agentmods add skills/wangchangxin0809/repo-agent-harness/writing-docs

Made for: Claude Code.

Or install repo-agent-harness, the plugin that ships this one along with the rest of its 6 skills, 1 agent, 4 hooks.

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-docs

README.md
[![agentmods](https://agentmods.dev/badge/skills/wangchangxin0809/repo-agent-harness/writing-docs/github.svg)](https://agentmods.dev/skills/wangchangxin0809/repo-agent-harness/writing-docs)
Your own site
<a href="https://agentmods.dev/skills/wangchangxin0809/repo-agent-harness/writing-docs"><img src="https://agentmods.dev/badge/skills/wangchangxin0809/repo-agent-harness/writing-docs/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-docs

Your own site · 80×15
<a href="https://agentmods.dev/skills/wangchangxin0809/repo-agent-harness/writing-docs"><img src="https://agentmods.dev/badge/skills/wangchangxin0809/repo-agent-harness/writing-docs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 141 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,697 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.
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.00141 $0.03697
Opus 5 $0.00071 $0.01849
Sonnet 5 $0.00028 $0.00739
Haiku 4.5 $0.00014 $0.00370

Measured 10d ago against content hash 06fe51e9700d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

writing-docs 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 10d 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/writing-docs/SKILL.md · 298 lines

How it starts

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

Writing docs an agent will actually use

Governs: shared/scripts/context/before_write.py

A document is read because something happened. That event is its reading trigger, and it decides everything: where the file goes, how long it may be, and what shape it takes. Documents written without one become reference material nobody references.

Fix the top level; leave the interior free

Directory Trigger What it holds
how-to/ I am about to do a thing Ordered steps, each ending in an observable criterion
reference/ I need to look up a fact Facts keyed for lookup, carried by working examples
decisions/ Why is it like this? Numbered from the PR, dated, superseded rather than edited
exec-plans/ What are we in the middle of? Goal · steps with state · what would abort it

Four directories, fixed. Inside each one, organise however suits the material. Both halves are evidence, not taste: a mandated shallow top level with a free interior is the arrangement that survived a decade across hundreds of OpenStack repositories, while two controlled studies — one on 65 people, one on 1,650 agent sessions — each found no effect from documentation shape. So the constraint sits where something was measured and stays off where nothing was. Templates in references/kinds.md are advice.

Additions to the top level are fine once docs/index.md routes them. A directory that forks a required name (adr/, howto/, plans/) is an error either way — that fork is how one bucket silently becomes two.

A file that does not fit any of the four is usually two files.

The one shape rule that is a requirement

Three parts per step, all three present:

### 3. Rebuild the index

    python3 scripts/index/build.py

Criterion: `scripts/index/query.py --stats` reports a symbol count within 5% of
`git grep -c 'def \|class '`. A wildly lower count means the parser silently
skipped a language.

This one is required while the rest of the shape guidance is advice, because it is content rather than form. Of five context signals measured against SWE-bench Verified, reproduction instructions were worth +56.3% — three times edit location and more than everything else combined. Steps without a criterion are read as gestures and executed as gestures.

Read the full file on GitHub · 298 lines

Files

What ships with it

1 file 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. 10d ago First seen · 298 lines · 141 tokens per session scan A 06fe51e9700d

Subscribe to this mod's changes

writing-docs is a skill published in the GitHub repository WangChangxin0809/repo-agent-harness (2 stars, last pushed 11d ago), licensed MIT. It adds 141 tokens to every session and 3,697 once invoked, about $0.0007 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-31.

Related

Other skills, from other repositories