write-docs

A writing guide for project documentation such as README and Markdown files. It says to document the reasons behind the code and point to the code for details that may change.

In plain words
What is it for?
Use it when creating or revising docs to decide what explanations belong there and what exact lists, flags, or file details should be left to the code.
Why use it?
It prevents documentation from becoming a second, outdated copy of the source code.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/dzhng/duet-agent/write-docs
Any agent
npx skills add dzhng/duet-agent --skill write-docs
Clone the repo
git clone --depth 1 https://github.com/dzhng/duet-agent

Made for: Claude Code, Codex.

Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 878 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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 $0.00093 $0.00878
Opus 5 $0.00046 $0.00439
Sonnet 5 $0.00019 $0.00176
Haiku 4.5 $0.00009 $0.00088

Measured 2d ago against content hash 522d8171a706, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

write-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 2d 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.

Origin

This is a copy

100% identical to write-docs — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.agents/skills/write-docs/SKILL.md · 73 lines

How it starts

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

Write Docs

A doc is a glossary: it names the moving parts, says why each exists, and carries the principles a reader can't derive by grepping. The code is the source of truth for what exists right now — the doc must never race it. Before writing any line, ask the one question that governs this skill: could the reader get this faster and more reliably by reading the code? If yes, point them at the code instead of copying it in.

Keep vs shed

Keep — a reader cannot grep their way to these:

  • The WHY: why a thing exists, the principle behind a split, the taxonomy file names don't reveal.
  • Non-obvious discoveries: platform quirks, "if you remove this, X breaks because Y", a contract two files silently share.
  • Pointers to where things live, and what KIND of thing lives there plus the rule for what belongs.

Shed — the code or its git history already holds these, so a copy only rots:

  • Exact rosters: scene names, scenario tables, helper lists, class ids, file lists, command/flag matrices.
  • Narrative and changelog: "we renamed X", "the old Y was removed as a dup", what was tried and abandoned.
  • Exact counts, tick values, current constants, line numbers — anything that just restates the code.

Point, don't transcribe

Where you're tempted to list specifics, name the folder or the single file that owns them and send the reader there — prefer a folder over a file, a source-of-truth registry over a transcribed copy. Describe a helper module by the kind of helper it holds and the rule for what belongs in it, not its current roster. One concrete touchstone is fine to ground a principle; a full inventory is the smell. "The matchups live in the table that defines them; the ids key off the class registry" stays true after the next edit — reproducing either does not.

One home per fact

Every fact has exactly one canonical home; every other doc links to it. Repetition across docs is a maintenance bug — copies drift and the reader can't tell which is current. A root/global doc gets a short section plus pointers to the sub-docs. When two docs explain the same thing, pick the hub and cut the other to a pointer.

Read the full file on GitHub · 73 lines

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. 2d ago First seen · 73 lines · 93 tokens per session scan A 522d8171a706

Subscribe to this mod's changes

write-docs is a skill published in the GitHub repository dzhng/duet-agent (42 stars, last pushed 3d ago), licensed Apache-2.0. It adds 93 tokens to every session and 878 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to write-docs, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories