llms.txt for the docs site
Written 2026-11-21 on docs/llms-txt-plan. Every phase is built. What we know records how the docs build works today, Design proposes what to publish and how to generate it, and Decisions records what the maintainer settled on 2026-11-21.
Goal
Give language models and the tools built on them a way to read jsprismarine.dev as Markdown, without scraping the rendered HTML. Generate every file from the same staged pages and project data the site already builds from, so the files never need editing by hand and never drift from the site.
What we know
The llms.txt format
The llms.txt proposal asks for a Markdown file at /llms.txt on the site's root with, in order:
- An H1 with the project's name. This is the only required part.
- A blockquote with a short summary.
- Optional paragraphs or lists with more context, and no headings.
- H2 sections, each a list of
- [Title](/plans/url): noteslinks. - An H2 section named
Optional, whose links a reader may skip when it needs a short context.
The proposal also asks sites to serve each page as Markdown at the page's URL with .md appended, and many sites publish a second file, /llms-full.txt, with the text of every linked page in one file. Neither is part of the core format, but both are common: tools that fetch one URL want the full file, and tools that browse want the per-page Markdown.
How the docs build works
tools/docs/assemble.mtsstages each published page fromdocs/<section>/and the root documents intotools/docs/site/. Staging fills every docs fact with its current value, rewrites relative links to site-absolute routes, and drops the files a section marksunpublished. The staged Markdown is the right text for a model: it is current and its links work.tools/docs/sections.mtsalready reads a page's title (pageTitle) and its summary (pageSummary, from thedescriptionfront matter or the first sentence), and maps a page to its route (pageRoute,pageUrl). The section indexes, the search index and the link preview cards use these, so llms.txt can too.overviewGroupsreads the groups of a section's overview page, such as the guide's "Play" and "Host a server". The site menu and the sidebar use them.loadProject()lists the published packages with their descriptions, andcode-data.mtsloads the commands, settings and errors from the code.docs:apiwrites the API reference as Markdown undersite/api/withtypedoc-plugin-markdown.buildEndinsite/.vitepress/config.mtswritesrobots.txtand_headersinto the built site after VitePress renders it. The site is served by Cloudflare Pages at the root manifest'shomepage.- Some pages are Vue components with no Markdown body: the landing page, the addon marketplace and each addon page, Packages, Parity, Benchmarks, Releases and Contributors. Their content comes from JSON data that the build already loads.
Size
Measured on 2026-11-21 from the Markdown under docs/:
| Content | Files | Bytes |
|---|---|---|
| Guides and data-driven | 29 | 560k |
| Errors | 53 | 460k |
| Decisions and plans | 56 | 1.1M |
| Research | 61 | 5.1M |
At roughly four bytes per token, the guides and data-driven pages alone are about 140k tokens. Plans and research are dated records, not documentation of the current code, and are ten times as large.
Design
Files
Publish four kinds of file, all at the site's root or beside the page they mirror:
| URL | What it holds |
|---|---|
/llms.txt | The index in the llms.txt format, linking each page's Markdown. |
/llms-full.txt | The full text of the guides, data-driven pages, addons and the root documents. |
/<route>.md | Each page as Markdown. A folder's index is /<folder>/index.md, so /guide/ is /guide/index.md. |
/api/llms.txt | An index of the API reference by package, linking each package's TypeDoc Markdown. |
The API reference gets its own index because it is large and only someone writing code against a package needs it. /llms.txt links it from its Optional section. It lists the packages by area, as the package directory does, each at its package page's Markdown copy, which lists the package's classes, functions and types. TypeDoc writes the reference as Markdown, so every API page gets a copy as a staged page does: 1,303 pages and about 19 MB on 2026-11-21, the largest the protocol package's index at 806 kB.
What /llms.txt contains
# JSPrismarine
> <the root package.json description>
- <the version and license, the Minecraft releases the server accepts, the platforms the prebuilt
executables cover and the Node.js version, and the demo server's address, from loadProject()>
## Play
## Host a server
## Build add-ons and plugins
## Work on JSPrismarine
<the guide overview's groups, each a section with the overview's links and descriptions>
## Addons
## Errors
## Data-driven engine
<each section in sections.mts order, its pages in its sidebar's order>
## Packages
<each published package in its package area's order: its API reference, with its manifest description>
## Optional
- [API reference](https://github.com/JSPrismarine/JSPrismarine/blob/master/../../../../../api): ...
- <each page of the sections marked optional: brand, decisions, plans and research>
- <every other page: the section overviews no group links, Packages, Parity, Contributing and so on>Each link's text is the page's title from pageTitle and its note is the page's summary from pageSummary, the same text the section index cards show. A guide overview link keeps the overview's own text and description. Links are absolute URLs under the site's homepage, since a reader of the file may have fetched it without the site around it.
sections.mts marks a section optional to list it under Optional, and dated to label its pages. A page appears in the first place that lists it, so a data-driven page a guide group links is not listed again under the data-driven engine. Every page except the landing page and the API reference's own pages appears exactly once.
Decisions, plans and research appear in Optional with a link per page, each labeled with when it was written or whether it still holds. They describe the code as it was when each was written, so a model that reads them as current documentation gives wrong answers, but an agent working on the repository often needs one by name. The label tells it how old the page is:
- A plan or research note carries the verb and date
pageDatereads from its opening sentence, such as "Written 2026-11-12. Report pseudonymous usage statistics ...". - A decision carries the
Status:line it opens with, such as "Status: accepted, 2026-11-15". - A page with neither carries the date its source last changed in git, such as "Updated 2026-11-02". On 2026-11-21 that was 19 plans and research notes, whose opening sentences say what they cover rather than when.
What /llms-full.txt contains
The Markdown copy of every page /llms.txt links outside Optional, Packages and the sections sections.mts marks lookup (the errors), in the same order, each page once and under a block giving its URL:
---
url: https://jsprismarine.dev/guide/running
---
# Running JSPrismarine
...That keeps it near the size of the guides and data-driven pages, about 140k tokens. Errors stay out because a model looking up an error needs one page, which the per-page Markdown serves, and 460 kB of error catalog would crowd out the guides for a reader with a smaller context.
FULL_TEXT_BUDGET in llms.mts caps the file at 800,000 bytes, about 200k tokens. The build fails when the file would be larger, and says to split a section off or move one to Optional.
Turning a page into Markdown for a model
The per-page files and llms-full.txt use the staged Markdown, through pageMarkdown in tools/docs/llms.mts. Staging has already filled the docs facts and taken their markers out, and the staged pages use no VitePress containers, since they are written for GitHub. pageMarkdown makes two changes:
- Remove the front matter. Its
titlebecomes the H1 when the page has none, and itsdescriptionthe paragraph under the title when the page has no opening paragraph. - Turn site-absolute and relative links into absolute URLs, pointing at the
.mdfile when the target is a page that has one, and keep the anchor. A link to a heading on the same page stays as written.
A page built from a Vue component gets a Markdown body written from the data the component renders, by a function in tools/docs/llmsPages.mts that buildEnd passes to the writers as generated:
- Packages: each package by its area, with its version, description, API reference and npm page, from
loadProject()andpackageAreas. - Addon pages and the marketplace: each addon's install command, version, publisher and README, and the marketplace's addons grouped as JSPrismarine's and the community's.
buildMarketkeeps each README as Markdown beside the HTML the page shows, with its links resolved the same way, andassemble.mtswrites the copies tosite/addons/markdown-copies.jsonforbuildEndto publish. A community addon's copy says it is listed without review and that its README is the author's text. - Releases: the newest releases' changes by level, from the changelog that
changelog.mtsparses for the Releases page too. - Parity: the behavior score and the score over every comparison, each family's counts, and each family's first open gaps, from the same summary the page renders. The page fetches every case; the copy links it for them.
- Benchmarks: the newest run's median for every figure, by scenario and server, whether the run was quiet, with wall clock figures marked indicative, and a link to its raw
results.json. - The landing page, Contributors and the Brand kit get no Markdown page.
/llms.txtlists the last two underOptionalat their HTML pages.
Where the code goes
A module tools/docs/llms.mts with the functions above and a test file beside it, tools/docs/llms.test.ts. It runs from buildEnd in the VitePress config, next to robots.txt, since by then both the staged pages and the API Markdown exist and siteConfig.pages lists every page VitePress built. Reading the page list from VitePress, rather than from docs/, means a page added to any section, or left unpublished, is listed or left out without changing llms.mts.
buildEnd also:
- Adds
Content-Type: text/markdown; charset=utf-8for/*.mdto_headers, since Cloudflare Pages would otherwise serve them as a download or asapplication/octet-stream. - Adds a
<link rel="alternate" type="text/markdown" href="<page>.md">to each page's<head>throughtransformPageData, so a tool on an HTML page can find its Markdown.
The site footer gets a link to /llms.txt.
Tests
llms.test.ts, run by the docs package's test script, checks the generated files against the staged site:
- Every page outside the landing page and the API reference's own pages is linked from
/llms.txtexactly once, and every link to a staged page names its Markdown copy. - Every decision, plan and research link carries its date, status or last change.
- No generated Markdown contains a fact marker, front matter, a VitePress container or a site-absolute link.
/llms.txtparses as the format asks: one H1, a blockquote, H2 sections of links./llms-full.txtholds each documentation page once, in order, and leaves out lookup sections andOptional.- A full text over
FULL_TEXT_BUDGETfails the build rather than being written, so a section that grows past what a model can read stops the build and the maintainer decides what to move.
The test uses a small staged site as a fixture rather than the full build, so it runs in the docs package's test script without TypeDoc or the parity suite.
Docs
Add a short section to the contributing guide's docs part saying the files exist and that they are generated, so nobody edits a checked-in copy. There is no checked-in copy: the files exist only in the built site.
Phases
- Done:
llms.mtswith the page-to-Markdown function and per-page.mdfiles for the staged sections, the_headersentry and the tests for them. - Done:
/llms.txtfrom the sections, overview groups and packages, and the footer link. - Done:
/llms-full.txtwith its byte budget. - Markdown bodies for the component pages, in three pull requests:
- Done: Packages and Releases.
- Done: the addon pages and the marketplace.
- Done: Parity and Benchmarks.
- Done:
/api/llms.txtfrom the package areas, and a Markdown copy of every API page. - Done: the
<link rel="alternate">head entry, on every page that has a Markdown copy.
Each phase is one pull request, and each leaves the site working with what it adds.
Decisions
Settled by the maintainer on 2026-11-21.
Plans, research and decisions are listed page by page under Optional
Each link carries its page's date or status, as Design describes. An agent working on the repository often needs a particular plan or ADR, and a link to a section index costs it a fetch it may not make. The date answers the risk that a model reads an old plan as the current design, and a reader that skips Optional never sees them.
Errors stay out of /llms-full.txt
An error lookup starts from a code or a message, and the error's page answers it in one fetch. The catalog would add about 115k tokens and nearly double the full file, which a model with a smaller context pays for in guides it can no longer read. /llms.txt still links every error page.
No per-section full files until the byte budget trips
The full file is about 140k tokens, which fits the context of the models most tools use. When the budget fails the build, splitting the full file by section, such as /guide/llms-full.txt, is the first fix to consider, before moving pages to Optional.
No Accept: text/markdown negotiation for now
Answering a page's normal URL with Markdown needs a Pages Function, which runs on every request to the site, static files included, and adds a runtime to deploy, test and watch. The .md URLs, the <link rel="alternate"> entry and /llms.txt already lead a tool to the Markdown. Revisit it if Cloudflare offers Markdown for agents on Pages without code, or if the site's logs show tools asking for Markdown at page URLs.