Skip to content

docs(website): Serve llms.txt, llms-full.txt and per-page markdown - #4171

Merged
ntucker merged 3 commits into
masterfrom
claude/project-thread-czcpmd
Oct 5, 2026
Merged

ntucker merged 3 commits into
masterfrom
claude/project-thread-czcpmd

Conversation

@ntucker

@ntucker ntucker commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Nathaniel · project thread

Builds on #4170 (reuses its docsToMarkdown renderer).

Before: agents reading dataclient.io get rendered HTML, or raw MDX from GitHub with unresolved partials and both frameworks mixed together.

After: the site follows the llms.txt convention, per framework:

React Vue
Index of every page /llms.txt /vue/llms.txt
All docs in one file /llms-full.txt /vue/llms-full.txt
Any page as markdown /docs/api/useSuspense.md /vue/api/useSuspense.md

Both include the REST and GraphQL docs. The index is grouped by sidebar category, and links between pages point at their .md versions. The Agent Skills page links to these.

How: a postBuild plugin (website/llms-plugin.js) walks each docs instance's sidebar and renders every page with docsToMarkdown from #4170, so partials are inlined and only that framework's content remains. Verified with a full yarn build: 94 React and 77 Vue index entries, 134 .md pages, and every .md link in the output resolves to a generated file.

🤖 Generated with Claude Code

https://claude.ai/code/session_019Thexffk5U4eiDWhHe6HQt


Note

Low Risk
Changes are limited to static site build output and documentation links; no runtime app or security-sensitive behavior.

Overview
Adds a Docusaurus postBuild plugin that emits llms.txt-style artifacts for React and Vue: index files at /llms.txt and /vue/llms.txt, bundled docs at llms-full.txt, and a .md file for every doc URL (with internal links rewritten to those markdown URLs). Rendering uses the same docsToMarkdown pipeline as agent skills, so partials resolve and each output is framework-specific while still including shared REST and GraphQL docs.

The plugin is registered in docusaurus.config.ts with React/Vue framework paths and shared doc instances. The Agent Skills getting-started page gains a Docs for LLMs section pointing agents at these URLs when skills are not installed.

Reviewed by Cursor Bugbot for commit 3a23647. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3a23647

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ntucker ntucker self-assigned this Oct 4, 2026
@vercel

vercel Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs-site Ready Ready Preview Oct 5, 2026 3:24am UTC

Request Review

@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.06%. Comparing base (f9fb603) to head (758603d).
⚠️ Report is 2 commits behind head on claude/project-thread-3wqhk3.

Additional details and impacted files
@@                      Coverage Diff                      @@
##           claude/project-thread-3wqhk3    #4171   +/-   ##
=============================================================
  Coverage                         98.06%   98.06%           
=============================================================
  Files                               163      163           
  Lines                              3095     3095           
  Branches                            616      616           
=============================================================
  Hits                               3035     3035           
  Misses                               18       18           
  Partials                             42       42           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ntucker
ntucker marked this pull request as ready for review October 4, 2026 22:19

ntucker commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

Staff engineer (Cursor agent): LGTM at 758603df, nothing to change in this PR. Reusing docsToMarkdown from #4170 is the right altitude. A generic llms.txt plugin from npm wouldn't inline partials or split by framework, so the ~170-line postBuild plugin is justified. Failing the build loudly when a page has no render for its framework is also the right call.

FOLLOW_UP (after merge, not for this PR): the framework-to-docs-instance-to-route mapping now lives in three places: the docs instances in docusaurus.config.ts, ROUTES in framework-docs/docsToMarkdown.mjs (already marked "keep in sync with docusaurus.config.ts"), and the frameworks/shared options plus the hardcoded CORE path in llms-plugin.js. The next framework, or a moved route base, has to touch all three, and missing one fails quietly (wrong links) instead of failing the build. Later, export one table (framework, instance id, route base, llms path, display name) from framework-docs/ and have all three read it.

One note for the record, no action needed: shared REST and GraphQL pages are rendered once as React and reused in the Vue files. That matches how the site serves /rest/ and /graphql/ today, and neither has :::vue blocks. If they ever get framework-specific content, the single /rest/*.md will need a version for each framework.

ntucker commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

Agreed on the follow-up: the three copies exist as described (docs instances in docusaurus.config.ts, ROUTES in docsToMarkdown.mjs, frameworks/shared/CORE in llms-plugin.js). It's queued as its own PR after this and #4170 merge, since the shared table would change #4170's module.


Generated by Claude Code

ntucker commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator Author

Sol review bot (GPT-6.1 Sol, High):

Personal review of 758603dfb98942c0c9986239a1fc56201db876bc: no actionable correctness or regression findings in this PR's diff.

Validation: exercised the real postBuild plugin and renderer against all current source docs with simulated Docusaurus loaded-doc metadata. Generated 134 Markdown pages, 94 unique React index links and 77 unique Vue index links; all generated .md links resolve, REST/GraphQL pages are included in both indexes, and draft/unlisted pages are omitted. Reviewed sidebar grouping/deduplication, Vue source mapping, and hash/query preservation. Current-head Cursor Bugbot is successful. This was a focused plugin/renderer check, not a full Docusaurus website build.

Base automatically changed from claude/project-thread-3wqhk3 to master October 5, 2026 02:12
claude added 2 commits October 5, 2026 02:36
Agents can now read the docs as plain markdown: /llms.txt (React, REST,
GraphQL) and /vue/llms.txt (Vue, REST, GraphQL) index every page, the
llms-full.txt files hold all of it, and every page has a markdown copy
at its URL + .md. Pages are rendered by docsToMarkdown, the same
renderer the skill references use, so partials are inlined and only
that framework's content remains. Links between pages point at their
markdown.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Thexffk5U4eiDWhHe6HQt
Derive each framework's llms.txt header from a small frameworks map,
map Vue mirror pages back to docs/core via the docs instance's own path
instead of a regex, and fail the build if a listed page renders nothing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Thexffk5U4eiDWhHe6HQt

ntucker commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Sol review bot (GPT-6.1 Sol, High):

Reviewed updated head 9b0557a072e633a572f2c4b83ab4fb2adf50c6b4. No actionable regressions introduced by this PR's three-file diff.

Validation used the pinned Docusaurus 3.10.2 metadata processing, actual sidebars, Vue mirror, and real postBuild renderer. Generated 134 Markdown pages and checked link targets, framework directives, sidebar grouping, draft/unlisted exclusion, and the new agent-skills links. Current-head Bugbot/build/typecheck/references checks succeeded. A complete website build was not run.

One dependency issue surfaced beyond the earlier link-existence check: on Windows, website/framework-docs/index.js:37–41,91 passes backslash paths into POSIX document-ID parsing. The inherited renderer therefore misses Vue IDs, and /vue.md links useSuspense to /docs/api/useSuspense.md instead of /vue/api/useSuspense.md. The destination exists but contains React content. Normalizing paths fixes this. This originates in the renderer from #4170 and also reproduces without the new plugin, so I am reporting it as a pre-existing dependency issue rather than a regression in #4171. The earlier simulated metadata check normalized these paths and missed this case.

Shared REST/GraphQL content still includes React examples in the Vue full export; this was explicitly accepted in the existing discussion and is unchanged.

ntucker commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Confirmed the Windows path issue: walk() in framework-docs/index.js returns path.sep paths that docIdOf() parses with path.posix, so docIds('vue') misses nested pages on Windows. This affects the site's own Vue link rewriting too, not only llms output, so it will be fixed in its own PR rather than this one.

On shared REST/GraphQL docs: the next push renders them per framework for each llms-full.txt, so their links to core pages point at /vue/... in the Vue export. Their examples remain React-only, the same as on the site.


Generated by Claude Code

Vue's llms-full.txt rendered REST and GraphQL pages as React, so their
links to core pages sent Vue agents to /docs instead of /vue. Shared
docs now render per framework (the single /rest and /graphql .md files
stay the React render, like their HTML pages).

Also simplifies the plugin: page records instead of reshaping sidebar
docs in place, docs/core from docsToMarkdown's ROOT, Docusaurus'
aliasedSitePathToRelativePath, packages derived from shared docs, and
one page joiner. The Agent Skills llms links use inline :react/:vue
instead of two duplicated blocks.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Thexffk5U4eiDWhHe6HQt

ntucker commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Sol review bot (GPT-6.1 Sol, High):

Re-reviewed latest head 3a236475fae0e12d950e17b8fa9944548a1ebb52, including the per-framework shared-doc rendering and plugin refactor since my previous review. No new actionable correctness or regression findings.

The actual postBuild plugin, pinned Docusaurus 3.10.2 metadata processing, sidebars, mirror and renderer passed focused checks into fresh output folders: 134 Markdown pages, 94 unique React index entries, 77 unique Vue entries, and no missing generated Markdown targets in individual pages or full exports. All 37 shared REST/GraphQL pages match their expected Vue render in Vue's full export; normalized-path checks confirm Vue core links stay under /vue/. The new inline Agent Skills directives emit the correct links for each framework. Shared standalone Markdown remains the default React render as documented.

The previously reported Windows document-ID issue still reproduces with native Windows paths; normalizing paths restores correct Vue routing. The author has acknowledged it for a separate fix. React examples remain in shared REST/GraphQL prose, consistent with the site and the accepted design; this commit corrects their framework-sensitive links.

Current-head Bugbot, build, typecheck and references checks are successful. This review ran focused metadata/plugin checks, not a complete local Docusaurus website build.

@ntucker
ntucker merged commit a69ce8f into master Oct 5, 2026
23 checks passed
@ntucker
ntucker deleted the claude/project-thread-czcpmd branch October 5, 2026 03:42
ntucker pushed a commit that referenced this pull request Oct 5, 2026
Master already carries #4170 and #4171 (squashed), so the conflicting files
take master's version and only this PR's docsInstances.js wiring is
re-applied on top: llms-plugin.js derives `frameworks` and `shared` from
DOCS_INSTANCES instead of plugin options, skillReferences.mjs reads the
React/Vue route bases from it, and .cursor/hooks.json keeps master's
pre-push hook placement.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RhxGsX5z7SGhQbUUNfsvsv

This branch was successfully deployed

1 active deployment
Preview — 3a236475 Deployed Oct 5, 2026 by vercel[bot]
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.

2 participants