Skip to content

Generate llms.txt and llms-full.txt from the docs build - #757

Open
tylrcc wants to merge 1 commit into
WordPress:trunkfrom
tylrcc:add/755-llms-txt
Open

tylrcc wants to merge 1 commit into
WordPress:trunkfrom
tylrcc:add/755-llms-txt

Conversation

@tylrcc

@tylrcc tylrcc commented Nov 11, 2026 •

Copy link
Copy Markdown

Closes #755.

The docs site had no llms.txt, so AI tools and coding agents had no simple way to read the user guide. Following the implementation the issue lays out:

  • vitepress-plugin-llms added as a devDependency in docs/package.json only — not the root package, whose postinstall (electron-builder, esbuild) a docs build should not pay for.
  • docs/.vitepress/config.mjs imports it and adds it to vite.plugins, next to the existing vite.server block, with a comment saying why the files are generated rather than hand-written.
  • The lockfile changes are the plugin's dependency subtree from npm install --save-dev vitepress-plugin-llms; the vitepress version is unchanged.

As the issue notes, the files will be served at https://wordpress.github.io/contributor-toolkit/llms.txt (project Pages subpath) and go live with the next manually-run docs.yml release, not on merge.

Verification — npm run docs:build from the repo root, then the three checks from the issue against docs/.vitepress/dist/:

  • llms.txt lists every guide page with a link — all 21 pages under docs/guide/ are present.
  • llms-full.txt (119 KB) contains the full guide text.
  • testing.md is in neither file. It is in srcExclude; the only 'testing' hits in llms-full.txt are ordinary prose inside guide pages.

Pre-PR review (per AGENTS.md, against .github/instructions/code-review.instructions.md, on this branch's diff — 3 files, all under docs/): Architecture — the plugin sits in the docs package, matching the separation that package exists for; generation at build time keeps the files in sync with the guide. Security — build-time-only devDependency in the docs package; nothing ships in the app and no app dependency changed. Performance — no runtime cost; the build measured 57s here including generation. Cross-platform — the plugin is plain JS with no platform-specific behaviour. Tests — the docs package has no test suite; the build-and-inspect checks above are the verification, and a dead link would fail the build (ignoreDeadLinks: false). No findings needed fixing; nothing deferred.

The docs site had no llms.txt, so AI tools and coding agents had no
simple way to read the user guide and guessed or scraped the HTML.

Add vitepress-plugin-llms as a devDependency of the docs package
(not the root package) and register it under vite.plugins in
docs/.vitepress/config.mjs, next to the existing vite.server block.
The files are generated on every docs build, so a page added or
renamed cannot leave them behind the way a hand-written file would.

Verified with npm run docs:build: dist/llms.txt lists all 21 guide
pages with links, dist/llms-full.txt (119 KB) contains the full
guide, and the srcExclude'd testing.md appears in neither.
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Pre-merge checks: Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Description check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ryanwelcher
ryanwelcher requested a balanced review from Copilot November 11, 2026 20:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add llms.txt to the docs site

2 participants