Tasks
AI Documentation: Agents, Add-ons, Prompts
Checked 2026-10-31
Loading poll...
For documentation, use AI to draft from sources you control (code, comments, tickets, release notes), to keep pages in one consistent shape and to propose updates inside the same pull request as the change. A person who knows the product checks every claim and runs every example. Model cost per page is cents; review time is the real cost. Checked 31 October 2026.
The job in one table
Documentation task | AI first pass | Human check |
|---|---|---|
Reference pages from code | Lists functions, options and defaults | Are they accurate and complete? |
How-to guides | Drafts steps from a working setup | Run every step on a clean machine |
Release notes | Groups merged changes by type | Remove internal detail; confirm claims |
README and onboarding | Drafts from the repo | What a new person truly needs |
Doc updates after a change | Proposes edits for affected pages | Is the new behaviour described correctly? |
Answering doc questions | Searches and quotes your pages | Fix the page when the answer is wrong |
Style and consistency | Applies a style sheet | The style sheet itself |
Deciding what to document | Nothing | Product and support knowledge |
What the job is
Good documentation tells a reader how to do a thing and what to expect, and it stays true when the product changes. Most teams fail at the second half. Pages are written once and drift. People stop trusting them, and support gets the questions the docs should have answered.
AI helps with the grind: producing a first draft in the right shape, listing every option from the code and noticing which pages mention a function that just changed. It hurts when it is trusted to know the product. A model that has not run your software will describe an option that sounds right and does not exist. The fix is the same as in every other job on this site: ground the draft in sources, and have a person who knows the product sign it off.
Which agent fits
Your setup | Pick | Why | Page |
|---|---|---|---|
Docs live in the code repository | A terminal agent that reads the repo and edits Markdown | Sees code and docs together | |
Docs live in an editor-centred workflow | An editor agent | Draft beside the code | |
A repeatable docs routine | A skill with your style rules | Same output shape each time | |
A dedicated docs worker | A subagent with read access to code and write access to docs only | Cannot change the product | |
Docs in a CMS | An agent with the CMS add-on | Edits through exposed tools | |
A repeatable design | A build guide for a docs agent | A tested pattern |
If the docs sit in a public repository, check the project's contribution rules on AI-assisted changes before you open pull requests. Policies differ by project, and we do not summarise them here.
Add-ons and kit items that help
Need | Add-on or kit item | What it gives | Page |
|---|---|---|---|
Current library docs | Context7 | Version-specific docs, so examples use real APIs | |
Merged changes and issues | GitHub MCP | Pull requests, issues and commits for release notes | |
Release notes in your format | Release notes skill | Groups changes by type in plain sentences | |
A doc drafting routine | Docs writer skill | Steps, structure and checks | |
Pull request descriptions | PR description command | A summary reviewers and doc writers can reuse | |
Check screenshots and flows | Playwright MCP | Drive the app so the steps match | |
Publish to a workspace | Notion MCP | Create and update pages | |
Standing rules | CLAUDE.md or AGENTS.md | Style, terms and paths, every session |
The starter files are at CLAUDE.md starter and AGENTS.md starter. Prompts for documentation sit in the prompt library. Claude Code's docs say a skill's body loads only when it is used, so a long style guide in a skill costs almost nothing until needed, while the same text in CLAUDE.md costs tokens every session. See context window.
A safe workflow, step by step
- Write the style sheet once. Voice, terms, how to show commands, how to name things.
- Pick the source for each page. Code, an existing doc, a ticket or a recorded demo. No source, no page.
- Draft from the source. Tell the agent: describe only what appears in the source; mark anything you could not confirm.
- Run every example. Commands and code blocks must run on a clean environment.
- Review for claims. A person who knows the product reads for accuracy, not for style.
- Keep the draft with its sources. A comment or a front-matter list of files and commits it was based on.
- Update in the same pull request as the change. A rule that a code change touching public behaviour must include a doc diff.
- Check links and examples in CI.
- Set an owner and a review date on each page.
Step 6 is the one that makes later updates cheap. When a source file changes, you know which pages to look at, and an agent can propose the edit.
A page template that keeps drafts honest
Give the agent a fixed shape so reviewers know where to look.
Section | Content | Source rule |
|---|---|---|
Answer first | One to three sentences saying what the page helps you do | Written last, from the rest |
Before you start | Requirements and versions | Copied from the code or package files |
Steps | Numbered, one action each, with the expected result | Each step run on a clean machine |
Options | A table of settings with defaults | Generated from the code, then checked |
Troubleshooting | The three most common errors and fixes | From real tickets, not guessed |
Related | Links to neighbouring pages | Checked for dead links |
Sources | The files and commits the page is based on | Kept in the page's front matter or a comment |
The sources row is easy to skip and costly to omit. Without it, the next person has no way to know which parts of the page a code change makes false.
Release notes from merged changes
Release notes are the easiest first win, because the input is structured: a list of merged pull requests with titles and labels. A good routine asks the agent to group changes under fixed headings, write one plain sentence for each, drop internal detail such as ticket numbers and branch names, and flag any change it cannot describe from the title alone. A person then removes anything that should not be public, checks that every behaviour claim is right and adds the one-line summary. Our release notes skill packages this. If you publish on several surfaces, such as a changelog page, a readme and a release post, generate them from one reviewed list so they cannot disagree.
Answering questions from the docs
A question-answering assistant over your docs is a different job from writing them, and it is a strong test of them. Retrieve the relevant pages, send only those to the model and require it to quote the page and link to it. When it cannot answer, it should say so and log the question. A weekly list of unanswered questions is the best backlog a docs team can have. Keep this assistant read-only, and fix the page rather than patching the answer.
Common mistakes
- Drafting from memory. Always point the agent at the source.
- Publishing without running the examples. A broken command costs more trust than a missing page.
- Writing pages nobody owns. Each page needs a name and a review date.
- Letting the model pad. Short, exact pages are easier to keep true.
- Documenting everything. Start with the pages support asks about most.
- Skipping the reader. Say who the page is for, and write for that person.
What it costs
Model. From Anthropic's pricing page, checked 31 October 2026: Sonnet 5.5 is $2 per million input tokens and $10 per million output; Haiku 5.5 is $0.10 and $0.50.
Worked example (the token counts are our assumptions). Documenting one module with 10,000 input tokens (code and notes) and a 2,500-token page:
Model | Cost per page | 100 pages |
|---|---|---|
Sonnet 5.5 | $0.02 + $0.025 = about $0.045 | about $4.50 |
Haiku 5.5 | $0.001 + $0.00125 = about $0.0023 | about $0.23 |
An agent that reads a whole repository, runs commands to check examples and revises will use more. See Claude API pricing.
Seats. A terminal or editor agent plan, if you do not use the API: Claude Code Pro $20 ($17 annual), Codex Plus $20, Copilot Pro $10, Cursor Plus $8, from our pricing pages. See AI coding agent pricing compared.
People. A reviewer reading a 2,000-word page for accuracy takes perhaps fifteen to thirty minutes. That is a good trade against writing it from scratch, and it is the number to track.
Risks and how to review them
Risk | What it looks like | Control |
|---|---|---|
Invented features | An option or flag that does not exist | Ground in code; reviewer checks each option against the source |
Broken examples | A command that errors | Run all code blocks in CI |
Outdated pages | Docs describe last year's behaviour | Link pages to source files; update in the same pull request |
Leaking internals | Private names, roadmap items or credentials in public docs | A "public only" rule; scan before publishing |
Tone drift | Pages sound different from each other | A style sheet in a skill; periodic read-through |
Over-long pages | The agent pads | A length target; remove filler |
Wrong audience | Written for developers when users read it | State the reader in the brief |
Copied text | Output too close to someone else's docs | Check sources; write from your own material |
For public docs, treat anything the model says about a third-party tool as unverified until you have read that tool's own documentation. Library examples are a common failure; Context7 reduces it by giving the agent current docs, and you still run the code.
Measure it
Metric | What it tells you |
|---|---|
Share of doc claims a reviewer corrected | Draft accuracy |
Pages touched in the same pull request as the code | Whether updates keep pace |
Pages not reviewed in the last 12 months | Drift |
Support questions that cite a doc page | Whether people use them |
Examples failing in CI | Rot |
A falling count of "how do I" support tickets for a documented topic is the best sign the page works. See AI customer support.
Keeping a docs folder healthy over time
A short monthly routine prevents most rot. Have the agent list pages whose source files changed since the page was last edited. Have it run every code block and report failures. Have it check links. Then a person reads the list, fixes the pages that matter and retires the ones nobody needs. Put the routine in a skill so it runs the same way each month, and keep a count of stale pages on a dashboard everyone can see.
Who should do what
If you are | Start with |
|---|---|
A solo maintainer | A README and quick-start drafted from the code, with every command run |
A small team | A docs writer skill, release notes from merged pull requests |
A larger team | A docs subagent limited to the docs folder, doc diffs required in pull requests |
A product with a public API | Reference pages generated from the code, with hand-written guides |
A company with many docs | An owner per page and a monthly stale-page report |
Related tasks: AI code review so docs and code are reviewed together, AI testing agent so examples are tested, and AI tools for business for choosing across jobs. If your docs are for plugins or a product with its own hub, keep the source in the repository and publish from there.
Our take
AI is a strong drafting and upkeep tool for documentation, and a weak authority on your product. Draft from sources, run every example, review for facts and tie each page to the files it came from so changes can be found. The cost per page is cents; keeping a human owner for each page is the real commitment. We built this page from vendor documentation, our kit items and published specs, and have not run a documentation programme with these tools.
Questions
Can AI write my documentation?
It can draft it from your code, comments and notes, and keep drafts in a consistent shape. A person who knows the product must check every claim, command and example before it is published.
What is the biggest risk with AI-written docs?
Confident errors: invented options, wrong commands and examples that do not run. Tie each statement to a source and run the code samples.
How do I stop docs going out of date?
Make the update part of the change. Have the agent propose doc edits in the same pull request as the code, and run the examples in CI.
What does it cost?
In our worked example, documenting one module on Claude's published prices costs under five cents. The real cost is review time and keeping a human owner for each page.
Loading poll...