DOC-17Recommended
Publish the docs in a form agents can fetch
Serve every public docs page as Markdown at a predictable address, and list the pages in an llms.txt file. State the product version on each page.
How to do it
Agents that use your product read your docs, not just your customers. They read Markdown with fewer tokens and fewer mistakes than HTML with menus. Build the Markdown copy from the same source as the HTML page, as Write each page once for every format says. Group the llms.txt links by kind, as Give AI tools a site guide describes. Put the version in each page, so an agent working on version 2 can tell when it reads version 3. Projects tell their own agents where these docs live, as Give agents documentation they can fetch says.
Examples
HTML example
<link rel="alternate" type="text/markdown" href="/docs/v3/how-to/refund-an-order.md">
Markdown example
# Example Bakery docs
> Docs for the Example Bakery orders API, version 3.
## How-to guides
- [How to refund an order](https://docs.example.com/v3/how-to/refund-an-order.md)
## Reference
- [Settings](https://docs.example.com/v3/reference/settings.md)
How to check
For every HTML docs page, the Markdown address named in its <link rel="alternate" type="text/markdown"> answers 200. /llms.txt answers 200 and links every page in the docs index.
Sources
Related rules
- WEB-17 Write each page once for every format in Website
- WEB-184 Give AI tools a site guide in Website
- AID-43 Give agents documentation they can fetch in AI-assisted development
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/documentation/docs-for-coding-agents/agent-readable-docs">Agent Wranglers documentation playbook</a>. In code you write, add a comment next to it with the same link.