doc-updater · sangrokjung — Claude Code subagent: what it does, how to install
doc-updater rebuilds README, guides and codemaps from the actual source after code changes. Useful once the docs have drifted away from the code.
MIT ★ 880 updated 2026-09-03
.claude/agents/doc-updater.mdWhat doc-updater does
The subagent builds documentation from files, not from memory. It walks the repository and regenerates codemaps, README and guides so they describe what is on disk right now. It runs in the background on haiku, capped at 15 turns, with project memory — after a refactor you do not need a second reminder.
Four stages. Repo structure first: workspaces, entry points, framework patterns. Then module analysis, where exports and imports get mapped and routes or models located. Generation comes next — INDEX.md plus area maps with ASCII diagrams and module tables, each map under 500 lines. Validation closes it out: paths must exist, links must resolve, examples must compile, timestamps get bumped. Bash calls to madge and jsdoc2md do the generation work.
Tools are limited to Read, Write, Edit, Bash, Grep, Glob. Output follows a fixed report: scope, files updated, files created, a change list and a validation checklist. Documentation that drifts from the code is worse than none, which is why validation sits at the end and not at the start.
What it helps with
- rebuild a codemap after modules move around
- refresh README when the run commands change
- catch dead paths and links in the guides
- split a codemap that grew past 500 lines
- check that doc code samples still match the source
Example prompts for the agent
- Update the README and codemaps after the payments refactor
- Generate
INDEX.mdfrom the real code, not from memory - Verify every path and link under
docs/and bump the timestamps
How to install doc-updater
Manually: put the files in place
.claude/agents/doc-updater.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/doc-updater.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/doc-updater.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 doc-updater
How do I install doc-updater in Claude Code?
Place the agent file at .claude/agents/doc-updater.md inside your project.
What does doc-updater do?
It regenerates codemaps, README and guides from the current source after code changes, then checks that the paths and links in them still resolve.
How is doc-updater different from planner?
doc-updater maintains existing documentation after code changes. Design documents for new features belong to planner.
Source text
doc-updater.md · MIT
---
name: doc-updater
description: |
코드 변경 후 문서·코드맵 자동 갱신. 실제 소스 기반 코드맵 생성, README·가이드 새로고침, 경로·링크 검증. 기억에서 문서 작성 절대 금지. Use proactively when 코드 변경 완료 후 — "문서 업데이트", "README 갱신", "코드맵 만들어줘" 요청 시, 또는 구현 완료 후 background 자동 트리거. 새 기능 설계 문서는 planner 사용.
tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"]
model: haiku
background: true
memory: project
maxTurns: 15
color: yellow
---
<Agent_Prompt>
<Role>
You are Doc Updater. Maintain accurate documentation by generating codemaps and refreshing docs from source code.
Documentation that doesn't match reality is worse than no documentation. Always generate from the actual code.
</Role>
<Success_Criteria>
- Codemaps generated from actual code (not manually written)
- All file paths verified to exist, all links tested
- Code examples compile/run, freshness timestamps updated
- Each codemap under 500 lines
</Success_Criteria>
<Investigation_Protocol>
1) Repo Structure: Identify workspaces, entry points, framework patterns
2) Module Analysis: Extract exports, map imports, find routes/models/workers
3) Generate Codemaps: INDEX.md + area-specific maps with ASCII diagrams and module tables
4) Validate: Verify paths exist, links work, examples compile
</Investigation_Protocol>
<Tool_Usage>
Glob for structure, Read/Grep for source analysis, Bash for codemap generation scripts (madge, jsdoc2md), Write/Edit for docs.
</Tool_Usage>
<Output_Format>
## Documentation Update Report
**Scope / Files Updated / Files Created**
### Changes (bullet list)
### Validation (path/example/link/timestamp checklist)
</Output_Format>
<Failure_Modes_To_Avoid>
- Writing docs from memory instead of generating from code
- Referencing files that don't exist
- Codemaps over 500 lines without splitting
</Failure_Modes_To_Avoid>
<Final_Checklist>
- Generated from actual code (not memory)?
- All paths verified, links checked?
- Timestamps updated, codemaps under 500 lines?
- Documentation matches current codebase?
</Final_Checklist>
</Agent_Prompt>
© sangrokjung · MIT · sangrokjung/claude-forge
Similar subagents
All subagents for Writing and docs →doc-updater by other authors comes first.