How to Add llms.txt
If you used our Agent Readiness Scanner and received a warning about a missing llms.txt file, this guide will help you fix it in under 5 minutes.
What is llms.txt?
Section titled “What is llms.txt?”You likely already have a robots.txt file that tells Google where not to go.
llms.txt is the opposite. It is a proposed standard file that tells Large Language Models (like ChatGPT, Claude, and coding agents) exactly where to go to understand your project. It acts as a concise, markdown-formatted map of your documentation.
Why it matters: without this file, AI coding assistants have to “guess” your documentation structure, often hallucinating features or missing your best guides.
The Format
Section titled “The Format”The file lives at the root of your domain (e.g., https://yoursite.com/llms.txt). It acts as a “Clean Context” provider.
Here is the standard structure:
# Project Name
> A one-line summary of what this project does.
## Core Documentation- [Quickstart](https://yoursite.com/docs/quickstart) - How to get up and running.- [API Reference](https://yoursite.com/docs/api) - Full endpoint details.
## Guides- [Authentication](https://yoursite.com/docs/auth)- [Database Setup](https://yoursite.com/docs/db)How to Implement It
Section titled “How to Implement It”Option 1: The Static File (Fastest)
Section titled “Option 1: The Static File (Fastest)”This works for any website (WordPress, React, plain HTML).
- Create a file named
llms.txton your computer. - Paste the template above and replace the links with your most important pages.
- Upload it to your website’s public root folder (the same place where
index.htmlorrobots.txtlives). - Verify it by visiting
yoursite.com/llms.txt.
Option 2: The Dynamic Route (For Astro/Next.js)
Section titled “Option 2: The Dynamic Route (For Astro/Next.js)”If you have a large documentation site, you should generate this file automatically so it never goes out of date.
For Astro Users (like us):
Create a server endpoint at src/pages/llms.txt.ts to fetch your content collection and render it as text.
import { getCollection } from 'astro:content';
export async function GET(context) { const docs = await getCollection('docs'); // ... logic to format docs into a markdown string ... return new Response('Formatted Markdown String...', { headers: { 'Content-Type': 'text/plain' } });}Validate Your Fix
Section titled “Validate Your Fix”Once you have deployed the file:
- Go back to the Agent Readiness Scanner.
- Enter your URL again.
- Watch your score jump to 100/100.
Now, when a developer asks Cursor or ChatGPT about your library, the agent will check this file first and give accurate answers.