Writes and edits documentation so its prose holds only what code cannot express. Use when the user says "document this", or when writing or editing a README, a docs/ or architecture page, AGENTS.md, or doc comments. Not for design docs; use writing-technical-design-docs. Not for other prose; use writing-prose.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Writing Documentation?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/bostonaholic-writing-documentation)
---
name: writing-documentation
description: Writes and edits documentation so its prose holds only what code cannot express. Use when the user says "document this", or when writing or editing a README, a docs/ or architecture page, AGENTS.md, or doc comments. Not for design docs; use writing-technical-design-docs. Not for other prose; use writing-prose.
---
# Writing documentation
Documentation, comments included, puts in prose only what code cannot express. Prose that restates the code goes stale, and nothing fails when it does.
## The test
- For each sentence, ask: could the reader get this by opening the file it names? If yes, cut the sentence and name the file or symbol.
- Prefer a name, a type, an assertion, or a test over prose when one can hold the fact.
## Keep
- One diagram of the components, each arrow pointing from the dependent to what it depends on.
- Where things live: paths and entry points.
- Rules that span files: ordering, idempotency, locks, transactions, "X never calls Y".
- Decisions, each with the alternative it rejected and the reason.
- Traps: intended behavior that looks like a bug, and limits an outside system imposes.
## Cut
- Method signatures and argument lists.
- Constant values.
- Enumerations of codes and states.
- Field and column lists.
- Step-by-step narration of what a function does.
- Ticket and PR numbers, dates, and "previously".
## Editing an existing page
- Edit the page in place. Do not split or move pages unless asked.
- Before deleting text, check whether a code comment or test already states it. A decision, cross-file rule, or trap that exists nowhere else stays, shortened to one or two lines.
- Check every claim you keep or add against the code. When the code contradicts one, decide which side is wrong as [docs and code](shared/docs-vs-code.md) says.
## Sentences and source comments
- For sentence style, call the Skill tool with `writing-prose`. If it is not installed, write short, plain sentences with no em dashes.
- For comments in source files, doc comments included, call the Skill tool with `writing-no-comments` and follow its keep list. If it is not installed, apply the Keep and Cut lists above to each comment.
- Without a Skill tool, follow the [skill call rules](shared/skill-calls.md).
## Report
Citations go in the report, never in the page. Use this default and adapt it:
- Per page: words before and after (`wc -w`).
- Each claim the code contradicted: the page line, the code's `path:line`, and what you changed.
- Each claim kept or added: the `path:line` that supports it.