Skip to content

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.

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 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)

This works for any website (WordPress, React, plain HTML).

  1. Create a file named llms.txt on your computer.
  2. Paste the template above and replace the links with your most important pages.
  3. Upload it to your website’s public root folder (the same place where index.html or robots.txt lives).
  4. 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.

src/pages/llms.txt.ts
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' }
});
}

Once you have deployed the file:

  1. Go back to the Agent Readiness Scanner.
  2. Enter your URL again.
  3. 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.