How to Write a Documentation Style Guide AI Agents Follow

With DocStar, a documentation style guide stops being a PDF nobody opens and becomes a short file your AI coding agent reads before it writes a single page. Put your rules in your repo's AGENTS.md (or CLAUDE.md), connect Claude Code, Cursor or Codex to the DocStar MCP, and the agent drafts and fixes your docs in your voice, saves everything as drafts, and waits for you to review and publish. This guide shows what to put in an AI-ready style guide and how to make your agent follow it every time.
What is a documentation style guide for AI agents?
A documentation style guide for AI agents is a short, plain-text set of writing rules (voice, terms, page structure, formatting and what never to publish) stored where a coding agent reads it automatically, such as AGENTS.md. Unlike a traditional style guide, it is written as direct instructions an agent can check its own output against.
Agents follow rules literally. "Be friendly but professional" gives an agent nothing to check; "Address the reader as 'you'. Never use 'simply'." does.
| Traditional style guide | Style guide for AI agents |
|---|---|
| Long document in a wiki | One short section or file in the repo |
| Written for people to absorb over time | Written as rules an agent checks on every page |
| Examples of good prose | Do / don't pairs and exact terms |
| Enforced in human review | Followed while drafting, then confirmed in review |
| Often out of date | Versioned next to the code it describes |
Why a style guide matters more in DocStar
In DocStar, one published page does a lot of work. The same collection becomes your docs site, an llms.txt entry and a Markdown copy of every page, and it is searchable through your collection's MCP server. For API collections, endpoint docs also become MCP tools AI assistants can call and commands in the DocStar CLI.
So inconsistent writing costs more. If one page says "workspace" and another "organization" for the same thing, a person might work it out; an AI assistant reading your docs through your MCP server may not. A clear style guide keeps every page, and every surface built from it, saying the same thing the same way. Our documentation best practices guide covers the structure side; the style guide covers the words.
What to put in your AI-ready style guide
Keep it under a page. Agents read the whole file on every task, and short rules get followed. Here are the sections we recommend for a DocStar docs collection.
1. Voice and reader
Who the reader is ("developers integrating our API" or "admins setting up the product").
How you address them ("you", never "the user").
Tone in one line ("plain, direct, no marketing language").
Banned words ("simply", "just", "easy", "obviously").
2. Terminology
A table of the exact names for your product's objects, and the words not to use. This is the section that prevents most confusion for people and agents alike.
| Use | Don't use |
|---|---|
| workspace | org, account, team space |
| API key | token, secret key (unless it really is a different thing) |
| collection | project, site |
3. Page structure
One topic per page.
First two sentences say what the page is for and what the reader will have at the end.
Steps are numbered, one action each, and end with a check ("You should now see...").
Page names are the reader's task ("Reset a password"), not the feature name.
Slugs are short and lowercase.
4. API endpoint docs
If you document an API in DocStar, add rules for endpoints, because these are the docs AI assistants act on:
Every endpoint has a clear description of what it does.
Every parameter is described, with type and whether it's required.
Every request has a full JSON body example.
Every endpoint shows a success response and the common error responses.
Use full URLs, not placeholders.
5. What never goes in public docs
This is a judgment call only your team can make, so write it down: internal and admin endpoints, unreleased features, customer names, and anything you would not want an AI assistant to repeat. DocStar's own docstar.md already tells coding agents to document only the endpoints your users call and never private or admin ones; your style guide should add anything specific to your product.
How to make your AI agent follow it with DocStar
DocStar is built to be run by AI agents. You don't paste your style guide into every prompt; you put it where the agent reads it, connect the agent to DocStar, and ask for the work in plain language.
Step 1: Put the style guide where your agent reads it
Coding agents read an instruction file in the root of your repo on every task. DocStar's GitHub Sync guide lists which file each one uses:
| AI assistant | Instruction file |
|---|---|
| Codex, Cursor and most other agents | AGENTS.md |
| Claude Code | CLAUDE.md (or put @AGENTS.md in it to reuse AGENTS.md) |
| GitHub Copilot | .github/copilot-instructions.md |
Add a ## Docs style guide section to that file, or keep the rules in their own Markdown file and add one line pointing to it. New to these files? Read What Is AGENTS.md?
Step 2: Connect your agent to the DocStar MCP
Add https://mcp.docstar.io/mcp to Claude Code, Cursor, Codex or another assistant (or add DocStar from your assistant's connector directory). The first time the agent needs your workspace, you sign in to DocStar in your browser. There is no API key to copy, and the agent works only with the workspaces and collections your DocStar account can access, with the same permissions you have. See Connect your AI assistant.
Step 3: Let the agent write the style guide for you
You don't have to start from a blank file. Open your agent in your product's repo and paste:
Use the DocStar MCP to read every published page in our docs collection, and read our code for the names we use for objects and endpoints. Then draft a documentation style guide as a "Docs style guide" section in AGENTS.md, under one page: voice and reader, a terminology table (the term to use and the terms to avoid), page structure, API endpoint rules, formatting, and what must never go in public docs. Base the rules on what our best pages already do, and list the places where our existing pages disagree with each other so I can pick the winner. Don't change any DocStar pages yet.
The agent reads your pages and code, proposes the rules, and flags the conflicts ("12 pages say workspace, 5 say organization"). You decide which term wins.
Step 4: Apply it to your existing docs
Once you have approved the guide, ask the agent to bring your docs in line:
Using the DocStar MCP and the "Docs style guide" in AGENTS.md, check every page in our docs collection against the style guide. Give me a list of pages that break it, grouped by rule. Then fix them as drafts, show me the changes before you save, and don't publish.
A connected agent can find the right collection and pages, read each one, rewrite it, and save the new version. It asks before it changes anything, and every edit is saved as a draft, so nothing reaches your live docs until you publish. For a broader pass that also checks accuracy and gaps, see How to Audit Your Docs with an AI Agent.
[Screenshot: Coding agent listing style-guide violations by rule from the DocStar MCP]
Step 5: Review and publish
Your role is the part only a person should do: the judgment calls. Confirm the terminology choices, check that the tone sounds like your team, make sure nothing private slipped in, and read the drafts for accuracy. Our guide to reviewing AI-written docs before they go live has a checklist. Then publish, and every surface built from the collection picks up the change.
Keep it current
A style guide only works if every new page follows it, including the ones written next month.
Every new doc follows it automatically. Because the rules live in
AGENTS.md, your coding agent reads them every time it writes or updates a page through the DocStar MCP. No reminder needed.Docs change with the code. With GitHub Sync, OpenAPI files live in
api-docs/and Markdown pages indocs/, next to your code.docstar.mdplus one line inAGENTS.mdtells your agent to update the endpoint's spec in the same change, and on push a GitHub Action sends the changed files to DocStar. Style-guide fixes and spec changes show up in the pull request diff, so you review docs like code.Update the guide when the product changes. When you rename something, ask the agent: "Update the terminology table in AGENTS.md for the rename from X to Y, then find every DocStar page that uses the old name and fix it as a draft."
One honest limit: this works when the agent does the writing. If someone edits a page by hand without the rules, or changes code without an agent, pages can drift from the style guide, and DocStar does not police your repo for you. A monthly check with the prompt in Step 4 catches what slips through.
Your style guide and your MCP server
If you document an API in DocStar, your collection's MCP server lets your users' AI assistants call it, and you can add a Skill (the guide assistants read before using your API) and Instructions (rules they follow every time they connect). Your style guide shapes how your docs are written; the skill and instructions shape how other assistants use them. Keep the terminology identical in both.
Prefer to write it yourself?
You can. Write the guide by hand in AGENTS.md using the five sections above, then edit pages in the DocStar editor. The editor's AI tools can rephrase a draft for you, and DocStar's Writing Good AI Prompts guide recommends saying the style you want in every prompt. The agent path is faster for a whole collection, but the rules are the same.
Why teams choose DocStar
Agent-first. Connect Claude Code, Cursor or Codex with one URL and browser sign-in. The agent writes in your style; you review and publish.
Safe by design. The agent asks before changing anything, and every edit starts as a draft.
Write once, serve everywhere. One collection is your docs site,
llms.txt, Markdown copies, an MCP server and, for API docs, a CLI, all in the same voice.Docs next to the code. GitHub Sync keeps docs in the same pull request as the code they describe.
FAQ
Where should I keep a documentation style guide for AI agents? In the instruction file your coding agent reads automatically: AGENTS.md for Codex, Cursor and most agents, CLAUDE.md for Claude Code, or .github/copilot-instructions.md for GitHub Copilot.
Can DocStar's MCP rewrite my existing pages to match the style guide? Yes. Connect your agent to the DocStar MCP and ask it to check and fix pages against the guide. It reads each page, rewrites it, asks before saving, and saves every change as a draft for you to publish.
Will my agent publish pages without asking? No. The DocStar MCP shows you what it will create, change or publish and waits for your OK, and edits are saved as drafts until you publish.
Do I need GitHub Sync to use a style guide with DocStar? No. The style guide works with any agent connected to the DocStar MCP. GitHub Sync adds docs that live in your repo and change in the same pull request as the code.
How long should the style guide be? Under a page. Short, specific rules with a terminology table get followed; long essays get skimmed by people and agents alike.
Get started free
Write your style guide once, and let your AI agent apply it to every page in DocStar. Get started free.
Keep reading

Documentation Best Practices for People and AI Agents
Documentation best practices for people and AI agents: structure, writing, AI-readable publishing and upkeep, and how an AI agent applies them in DocStar.

How to Debug Failed MCP Tool Calls
Why MCP tool calls fail with 401, 404 or 422 errors, and how to read MCP logs and let your AI agent find the cause and fix the API docs behind it.