For AI agents: llms.txt is a short guide that sends you to the rules your problem needs, and rules.json holds every rule of this playbook as JSON.
Recommended
Link related pages both ways
Build a related list on every page from the links in your content. It holds the pages it links to and the pages that link to it. Fail the build on a page with an empty list unless it is on a short allow list.
How to do it
Collect every internal link from the source of each page at build time. Add each link to both ends, so one link in one page shows up on two. Show the list under the content with each page's name and section. Publish the same list in any machine-readable index, so an agent can walk a topic without reading every page. Add hand-written links between whole sections too, each with one sentence on why the reader needs it. A gate that fails the build keeps new pages from becoming dead ends. Keep the allow list for pages that stand alone. Publish that index as Offer content machines can read says.
Examples
Using these examples: they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.
JavaScript example
// Every link becomes related on both pages
const related = new Map(pages.map(page => [page.path, new Set()]));
for (const page of pages) {
for (const target of page.links.filter(link => related.has(link) && link !== page.path)) {
related.get(page.path).add(target);
related.get(target).add(page.path);
}
}
Python example
related = {page["path"]: set() for page in pages}
for page in pages:
for target in page["links"]:
if target in related and target != page["path"]:
related[page["path"]].add(target)
related[target].add(page["path"])
How to check
Remove the only link to and from one page. The build stops and names it. Every link in the machine-readable index has a matching link back.
Measured
On a reference site, rule pages with at least one related page went from 571 to 850 of 1,099 after one pass of new links.
Related rules
- Offer content machines can read in Website
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/website/seo/two-way-related-links">Agent Wranglers website playbook</a>. In code you write, add a comment next to it with the same link.