docs/agents/writing-docs.md holds the doc/comment rules and done-check, reached via a pointer in CLAUDE.md (AGENTS.md and QWEN.md import it). docs/agents/domain.md gains the procedure for new or conflicting terms. Refs #55 (agent guide #62) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1.9 KiB
Writing docs
How to write and update this repo's docs and code comments. The source is the truth: docs explain why and point at the source for what.
Rules
-
Source-of-truth line. Every doc outside
docs/research/anddocs/agents/opens with a> **Source of truth:** …line. It names the files, services or keys the doc explains and says the source wins on disagreement. In the body, name keys and flags (LLAMA_PARALLEL,--cache-reuse) and leave their values in the source. When a doc and its source disagree, fix the doc in the same change. -
The README index is the doc map. Every new doc gets a row in
README.md's Docs table. -
Code comments are pointers. In
docker-compose.yml,.env.exampleandscripts/, a comment is a one-line# see docs/<file>.md#<section>pointer, and the explanation goes in that doc section. Two things stay inline as one line, next to the pointer:- a warning about data loss, security, or an edit that breaks the stack or a script
- on
.env.examplekeys thatupdate.shfills in, the marker "auto-filled by update.sh — leave blank"
A
ponytail:note becomes a pointer too, with its reasoning moved into the doc. -
A source change carries its doc. When you change code that has a pointer, update the doc section it names in the same change.
-
docs/research/is frozen history. New research goes in a new file plus a row indocs/research/README.md. When a research doc goes stale, change its status in that index and leave the file itself untouched.
Terminology follows CONTEXT.md. For a term that isn't there, see domain docs → New or conflicting terms.
Done when
- every pointer in the code you touched resolves to an existing heading
- every doc you touched opens with its source-of-truth line
- no doc you touched restates a value from its source