Overview
Agents prefer a short summary over five paragraphs, raw Markdown over hydrated HTML, and named rules over loose advice. This guide retrofits an existing site with those properties. /llms.txt and /ai.txt are community proposals, and Google states that AI Overviews and AI Mode need no special files or markup, so treat the agent files as a convenience, not a ranking lever. The checklist below links to the page that covers each step.
Prerequisites
- Stable URLs; agents cite them.
- Frontmatter with at least
title,summary, andcategory. The summary is the routing hint.
Steps
1. Write a one-sentence summary per page
Put it in frontmatter and reuse it for the meta description, the llms.txt note, and JSON-LD description, so the three never disagree.
2. Ship the agent index
Generate /llms.txt, /llms-full.txt, /llms-context.txt, and per-category /llms-full/<category>.txt from frontmatter in the build; see ship-llms-txt. If you publish /ai.txt, state real preferences and keep them consistent with robots.txt; the format is in ai-txt. Crawler allow and block rules still live in robots.txt.
3. Add JSON-LD
One entity type per page kind (usually Article), generated from frontmatter; see add-jsonld-to-static-site. HowTo and FAQPage no longer earn Google rich results, so ship them only if the markup is accurate.
4. Serve raw Markdown next to every page
Emit <slug>.md beside each <slug>.html at build time, and link it from llms.txt. If the repo is public, raw.githubusercontent.com URLs also work. Markdown costs agents fewer tokens than HTML and keeps code blocks intact.
5. Name the rules
Agents cite a named, numbered rule more accurately than a paragraph. State the rule first, then the rationale.
## Rule: five wikilinks per page
Every page links to at least five neighbors, so an agent reaches related pages in one hop.6. Keep pages atomic
One topic per page; when a section outgrows the page, split it and link. Agents follow links more cheaply than they re-read long pages.
Verify it worked
curl -sI https://yourdomain.com/llms.txt | head -1 # HTTP/2 200
curl -s https://yourdomain.com/foo | grep -o 'application/ld+json' # present in the HTML
curl -sI https://yourdomain.com/foo.md | head -1 # HTTP/2 200Model check: give a model the page URL and ask for a two-sentence summary and the key rule. If the summary matches your frontmatter and the rule comes back verbatim, the page is agent-ready.
Common errors
/llms.txtlists a page twice. Give each page one category.- Summaries run past one sentence. Cut them; the summary routes, it does not teach.
- No Markdown source is reachable, so agents parse HTML and lose structure.
ai.txtcontradictsrobots.txt. Decide the policy once and mirror it.
FAQ
Do I need llms.txt to appear in Google AI Overviews?
No; Google states that AI Overviews and AI Mode need no special files or markup, so treat /llms.txt and /ai.txt as a convenience for agents, not a ranking lever.
Should I serve Markdown versions of my pages for AI agents?
Yes; emit <slug>.md beside each <slug>.html and link it from llms.txt, because Markdown costs agents fewer tokens than HTML and keeps code blocks intact.
Is FAQPage or HowTo schema still worth adding?
Only when the markup is accurate; HowTo and FAQPage no longer earn Google rich results.
How do I test whether a page is agent-ready?
Give a model the page URL and ask for a two-sentence summary and the key rule; if the summary matches your frontmatter and the rule comes back verbatim, the page is ready.