Agent docs guild
Docs rot quietly. A feature ships, the page describing the old behavior stays
up, and no one owns the drift. A guild hands each part of the job to its own
agent: one finds what is missing or wrong, one writes, an engineer checks it
against the code, and one sweeps for staleness on a cadence. Coverage and
freshness are separate jobs, so they get separate agents.
Method
- Gap analyst diffs docs against reality. Compare the documented surface,
public API, CLI flags, config keys, and user flows, against the code and the
changelog. Output
gaps.md, one row per undocumented or contradicted topic,
ranked by how many users hit it. A missing endpoint outranks a typo.
- Drafter writes one page per gap. Load
technical-writer-role. Produce a
page.md per topic: what it does, a minimal working example, parameters, and
failure modes. Pull real signatures and defaults from source instead of
inventing them.
- Technical reviewer verifies against code. Load
backend-engineer-role or
the module owner. The reviewer runs every example and confirms each claim
maps to current behavior, returning findings anchored to file:line. A page
that reads well but describes stale behavior fails.
- Loop draft and review until examples run. The drafter fixes each finding
or defends it. Cap at two rounds; a claim neither side can settle escalates
to the module owner rather than shipping unverified.
- Freshness sweeper runs on a schedule. On a cron cadence, scan merged
pages for version drift, dead links, and examples that no longer compile
against
main. Output staleness-report.md: page, symptom, suspected
cause. It reopens work, it does not fix it.
- Route stale pages back as fresh gaps. Each staleness finding becomes a
row the gap analyst re-ranks, closing the loop so a shipped page that goes
stale re-enters the pipeline instead of quietly lying to readers.
Run it
In Claude Code, run gap, draft, and review as subagents in sequence, one page
per draft subagent to keep contexts small, and fan the drafters out in parallel
when the gaps are independent. Keep gaps.md and the pages as files on a docs
branch, and schedule the sweeper as a recurring job that reopens gaps.md.
Terminate a cycle when gaps.md holds no open rows and every merged page passed
review; the freshness loop never terminates, it recurs. To port, use a CrewAI
sequential Crew with a scheduled kickoff, an AutoGen GroupChat with a reviewer
critic, or a LangGraph graph with a periodic trigger feeding the gap node.
Signals it works
- Every merged page had its examples executed by the reviewer, not just read.
- Gaps rank by user impact, so the most-hit missing page gets written first.
- A feature that shipped last week already has a gap row or a live page.
Boundaries
This guild produces reference and task docs, not marketing copy or API design
decisions. It defers tone and information architecture to the project's docs
convention, and it will not publish a page the technical reviewer never cleared.
Whether a topic deserves a page at all stays with the docs owner.
1---2name: agent-docs-guild3description: Run a team of documentation agents that finds the gaps, drafts the pages, gets them reviewed against the code, and sweeps for staleness on a schedule. Use when a codebase has outrun its docs and you need both new coverage and a way to stop pages from rotting.4---56# Agent docs guild78Docs rot quietly. A feature ships, the page describing the old behavior stays9up, and no one owns the drift. A guild hands each part of the job to its own10agent: one finds what is missing or wrong, one writes, an engineer checks it11against the code, and one sweeps for staleness on a cadence. Coverage and12freshness are separate jobs, so they get separate agents.1314## Method15161. **Gap analyst diffs docs against reality.** Compare the documented surface,17 public API, CLI flags, config keys, and user flows, against the code and the18 changelog. Output `gaps.md`, one row per undocumented or contradicted topic,19 ranked by how many users hit it. A missing endpoint outranks a typo.202. **Drafter writes one page per gap.** Load `technical-writer-role`. Produce a21 `page.md` per topic: what it does, a minimal working example, parameters, and22 failure modes. Pull real signatures and defaults from source instead of23 inventing them.243. **Technical reviewer verifies against code.** Load `backend-engineer-role` or25 the module owner. The reviewer runs every example and confirms each claim26 maps to current behavior, returning findings anchored to `file:line`. A page27 that reads well but describes stale behavior fails.284. **Loop draft and review until examples run.** The drafter fixes each finding29 or defends it. Cap at two rounds; a claim neither side can settle escalates30 to the module owner rather than shipping unverified.315. **Freshness sweeper runs on a schedule.** On a cron cadence, scan merged32 pages for version drift, dead links, and examples that no longer compile33 against `main`. Output `staleness-report.md`: page, symptom, suspected34 cause. It reopens work, it does not fix it.356. **Route stale pages back as fresh gaps.** Each staleness finding becomes a36 row the gap analyst re-ranks, closing the loop so a shipped page that goes37 stale re-enters the pipeline instead of quietly lying to readers.3839## Run it4041In Claude Code, run gap, draft, and review as subagents in sequence, one page42per draft subagent to keep contexts small, and fan the drafters out in parallel43when the gaps are independent. Keep `gaps.md` and the pages as files on a docs44branch, and schedule the sweeper as a recurring job that reopens `gaps.md`.45Terminate a cycle when `gaps.md` holds no open rows and every merged page passed46review; the freshness loop never terminates, it recurs. To port, use a CrewAI47sequential Crew with a scheduled kickoff, an AutoGen GroupChat with a reviewer48critic, or a LangGraph graph with a periodic trigger feeding the gap node.4950## Signals it works5152- Every merged page had its examples executed by the reviewer, not just read.53- Gaps rank by user impact, so the most-hit missing page gets written first.54- A feature that shipped last week already has a gap row or a live page.5556## Boundaries5758This guild produces reference and task docs, not marketing copy or API design59decisions. It defers tone and information architecture to the project's docs60convention, and it will not publish a page the technical reviewer never cleared.61Whether a topic deserves a page at all stays with the docs owner.