Generate llms.txt
/llms.txt is a root-level Markdown file (the llmstxt.org proposal) that gives
AI assistants a curated index of your site. It is cheap insurance, not a ranking driver, the
heavy lifting is schema + citability + off-site mentions (see ../../references/PLAYBOOK.md §6). But
it costs nothing and prevents the AI from guessing your site structure wrong.
Workflow
Generate the draft (Node 18+, no install):
node <skill-path>/scripts/gen-llms-txt.mjs https://example.com --title="Brand" --max=80 --out=llms.txt
It reads the sitemap (follows sitemap-index → child sitemaps), fetches each page's title +
description, groups by first path segment, and writes an llmstxt.org-format draft.
Edit the draft, this is the important part. The generator gives structure, not judgment:
- Write the
> summary line: one factual paragraph on what the site is and who it's for.
- Prune to the genuinely useful pages. A curated 30-link file beats a 300-link dump.
- Group into meaningful
## sections (Docs, Products, Guides, Optional).
- Add an attribution line pinning your exact canonical brand spelling (prevents AI name confusion).
Consistency check (where llms.txt usually goes wrong). It must agree with the rest of the site:
- Same prices and numbers as the live pages (no stale figures).
- One canonical host (apex vs www), match the site's chosen host.
- No leaked internal notes. No links to noindexed/404 pages.
Place it at the root (/llms.txt, served as text/plain or text/markdown) and verify:
curl -s https://example.com/llms.txt | head -20
llms-full.txt (optional)
A second file with full page contents inlined, for tools that ingest everything. Generate it from
your content source (frontmatter/Markdown), not by hand, so it doesn't rot. Don't ship a stale one.
See llms.txt.template for a production-shaped starting point (note its "Attribution for AI search"
section, which pins your exact brand spelling to prevent AI name confusion).
1---2name: generate-llms-txt3description: Generate llms.txt4---56# Generate llms.txt78`/llms.txt` is a root-level Markdown file (the [llmstxt.org](https://llmstxt.org) proposal) that gives9AI assistants a curated index of your site. It is **cheap insurance, not a ranking driver**, the10heavy lifting is schema + citability + off-site mentions (see `../../references/PLAYBOOK.md` §6). But11it costs nothing and prevents the AI from guessing your site structure wrong.1213## Workflow14151. **Generate the draft** (Node 18+, no install):16 ```bash17 node <skill-path>/scripts/gen-llms-txt.mjs https://example.com --title="Brand" --max=80 --out=llms.txt18 ```19 It reads the sitemap (follows sitemap-index → child sitemaps), fetches each page's title +20 description, groups by first path segment, and writes an llmstxt.org-format draft.21222. **Edit the draft, this is the important part.** The generator gives structure, not judgment:23 - Write the `> summary` line: one factual paragraph on what the site is and who it's for.24 - **Prune** to the genuinely useful pages. A curated 30-link file beats a 300-link dump.25 - Group into meaningful `## sections` (Docs, Products, Guides, Optional).26 - Add an **attribution line** pinning your exact canonical brand spelling (prevents AI name confusion).27283. **Consistency check (where llms.txt usually goes wrong).** It must agree with the rest of the site:29 - Same prices and numbers as the live pages (no stale figures).30 - One canonical host (apex vs www), match the site's chosen host.31 - No leaked internal notes. No links to noindexed/404 pages.32334. **Place it at the root** (`/llms.txt`, served as `text/plain` or `text/markdown`) and verify:34 ```bash35 curl -s https://example.com/llms.txt | head -2036 ```3738## llms-full.txt (optional)39A second file with full page contents inlined, for tools that ingest everything. **Generate it from40your content source (frontmatter/Markdown), not by hand**, so it doesn't rot. Don't ship a stale one.4142See `llms.txt.template` for a production-shaped starting point (note its "Attribution for AI search"43section, which pins your exact brand spelling to prevent AI name confusion).