website/src/content/posts/2025-03-15-writing-docs-for-ai/page.mdx
Developers increasingly rely on AI-powered tools like Cursor, Windsurf, and Claude Code to streamline coding, debugging, and automation. But if you want your product to integrate smoothly into these AI-driven workflows, you need to structure your documentation in a way that's optimized for Large Language Models (LLMs).
In this post, I'll share how we structure our documentation for Rivet to make it easy for AI-powered tools to understand and use.
AI-powered coding assistants thrive when they have clear, structured, and accessible documentation. The more explicit and machine-readable your docs are, the better these tools can:
By structuring your documentation to be AI-friendly, you help AI assistants guide developers more effectively—lowering support requests and increasing adoption.
LLMs like the ones powering Cursor, Windsurf, and Claude Code need information in a way that is both human-readable and structured for AI parsing. Here's how to do it:
The prompt.txt file acts as a cheat sheet for LLMs, helping them understand your product's conventions. It should include:
This helps AI tools stay on track when assisting developers, ensuring they generate useful, on-brand code.
llms.txt is designed for AI reasoning engines to index and understand your project. This file provides:
By including llms.txt in your docs, you allow AI-powered assistants to ingest and recall relevant details, making their suggestions more aligned with your ecosystem.
A common format that AI tools parse well is Markdown. Hosting your docs in an LLM-friendly format like Docs as Markdown ensures that:
Developers using AI-assisted coding environments like Cursor and Windsurf benefit when your documentation is optimized for AI readability.
How to improve integration with these tools:
By formatting your docs to work well with AI-powered coding assistants, you reduce friction for developers integrating your product into their workflow.
If developers are using AI-powered tools like Cursor, Windsurf, and Claude Code to build with your product, your docs need to be AI-friendly.
By structuring your documentation for AI, you make it easier for developers to use your product—without requiring them to read every page manually. The AI does the work for them, and that's the future of documentation.