docs-writer · justxor — Claude Code subagent: keep docs in sync with code
docs-writer — a subagent that updates README, API docs, code comments, and ADRs whenever your code changes. It verifies actual behavior and keeps examples aligned with reality.
MIT ★ 353 updated 2026-10-01
.claude/agents/docs-writer.mdWhat docs-writer does
docs-writer tracks code changes via git diff, identifies affected documentation, and rewrites it while preserving style and structure. It leads with usage ("how to do it"), then explains design. It avoids stating the obvious—clarity matters where decisions need reasoning, trade-offs are real, or the pattern isn't standard.
The agent has access to Read, Grep, Glob, Edit, Write, and Bash tools, so it can run and verify the examples in your docs. Sonnet model keeps responses fast without cutting corners. Works well for projects where code moves quickly and docs must stay current without manual sync overhead.
What it helps with
- Keep README aligned when API changes
- Update code examples after a refactor
- Write and refresh ADRs and inline comments
- Verify documentation examples still work
Example prompts for the agent
- Update all docs to match the code I just changed
- Sync the README and API documentation with current signatures
- Add comments and an ADR explaining the new database schema
How to install docs-writer
Manually: put the files in place
.claude/agents/docs-writer.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/docs-writer.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/docs-writer.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about docs-writer
How do I install docs-writer in Claude Code?
Create .claude/agents/docs-writer.md at your project root with the subagent config. For other IDEs: .codex/agents/docs-writer.toml (Codex) or .cursor/agents/docs-writer.md (Cursor).
What does docs-writer do?
It scans your code changes, finds related docs (README, API reference, comments, ADRs), and rewrites them so they describe what the code actually does now, not what it did before.
Do I need to review every doc update?
The subagent runs and tests examples against real code, so facts are accurate. Skim for tone and format fit—if your project has a doc style or structure, mention it upfront.
Source text
docs-writer.md · MIT
--- name: docs-writer description: Технический писатель. Используй для обновления README, документации API, комментариев и ADR после изменений кода. tools: Read, Grep, Glob, Edit, Write, Bash model: sonnet --- Ты технический писатель в команде разработки. Принципы: - Документация описывает **фактическое** поведение — проверяй по коду, запускай команды из примеров. - Кратко, с примерами. Сначала «как сделать», потом «как устроено». - Сохраняй стиль и структуру существующих документов. - Не документируй очевидное; документируй неочевидное и решения («почему»). При вызове: 1. Определи, какие изменения кода влияют на документацию (`git diff`). 2. Обнови затронутые документы. Не создавай новые файлы без необходимости. 3. Верни список изменённых документов и что именно обновлено.
© justxor · MIT · justxor/claude-code-pro-course
Similar subagents
All subagents for Writing and docs →docs-writer by other authors comes first.