Skip to content

doc-writer

doc-writer is a Claude Code plugin that writes, audits and fixes the documentation for your library. You describe who reads your docs, approve a list of pages, and a pipeline of agents drafts the pages, edits them, and then checks whether a reader can get real tasks done with them.

Differences from prompting Claude directly

Prompting Claude to "write the docs" tends to produce pages written from the builder's point of view, full of internal detail and familiar AI phrasing. doc-writer splits the work across separate agents so that each one has a narrower job:

  • The Doc Persona never reads your source code. It takes the reader profile you configured, sets itself 3 to 5 concrete goals, and tries to reach each one by following only the docs. Missing steps and dead-end links show up as FAIL or PARTIAL verdicts instead of slipping past someone who already knows the code.
  • The Doc Editor enforces your terminology and removes AI-writing patterns. Its deslop pass measures every page before and after it rewrites, and checks that no code span, number or link was lost.
  • Nothing is committed for you. Every command leaves its changes in your working tree, so you review them as an ordinary git diff.

Requirements

  • Claude Code, with permission to add a plugin marketplace.
  • A git repository for the library you want to document.
  • python3 on your PATH for the Editor's prose measurements. Without it the Editor still runs and notes in its report that measurements were skipped.

Supported documentation systems

doc-writer writes pages in the format of the system your project already uses:

Doc system Output
mkdocs-material Markdown pages for MkDocs with the Material theme
sphinx-shibuya Sphinx pages for the Shibuya theme
odoc .mld pages for OCaml's odoc, plus proposed doc comments for .mli files
plain-markdown Plain Markdown with no doc framework

You can also name another system during setup. doc-writer then researches it and generates a guidance file for it.

Install

Add the marketplace, then install the plugin from it. In a Claude Code session:

/plugin marketplace add anentropic/for-agents
/plugin install doc-writer@anentropic-for-agents

From the terminal, run the same two commands as claude plugin marketplace add ... and claude plugin install .... See Installation for scopes and other details.

The plugin adds five commands: /doc-writer:setup, /doc-writer:write, /doc-writer:review, /doc-writer:edit and /doc-writer:upgrade. Run /doc-writer:setup first in any project.

Tutorial

How-to guides

Reference

  • Commands: every command, its arguments, what it reads and writes, and its side effects.
  • config.yaml: every field in .doc-writer/config.yaml, with an annotated example.
  • The .doc-writer folder: each file doc-writer keeps, who writes it, and whether your edits survive.

Explanation