Agent Wranglers

Site architecture

A structure that makes the other rules easy. Pages are data, built once to static HTML and served from memory, with every machine file from one source.

  • Required 1
  • Recommended 4
  • Optional 3

The idea

This is one reference architecture that makes the other rules easy to follow. Any stack works, as long as the Required rules below hold. The pattern is simple. Write each page once, as data. Build every format from it at build time. People get HTML. Agents get Markdown and JSON-LD (structured data search engines read). Crawlers get the sitemap, feeds and llms.txt. Serve the result from memory, with its headers decided in advance. Run in the browser only what needs a browser.

  1. Page data. Each page is one module or file with its path, title, description, date and content.
  2. Build. One script and one stylesheet get hashed names. Every page is rendered with its CSS inline, plus metadata, JSON-LD, SRI and preloads.
  3. Build checks. The build stops on any broken rule. It writes HTML, Markdown and JSON-LD for each page, a manifest, and compressed text files.
  4. Server. Each page has one route and is rendered and compressed once, with its ETag and CSP hashes. Every response carries the security headers.
  5. Machine files. Robots, the sitemap, feeds, llms.txt and the .well-known files are all built from the manifest.
  6. Browser. Scripts only add behaviour, such as the theme, menus, widgets and the service worker.

Required

Optional

Read this with

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/site-architecture">Agent Wranglers website playbook</a>. In code you write, add a comment next to it with the same link.