Skip to content

feat: add root llms.txt#520

Merged
Ehesp merged 2 commits into
mainfrom
feat/root-llms-txt
Jul 7, 2026
Merged

feat: add root llms.txt#520
Ehesp merged 2 commits into
mainfrom
feat/root-llms-txt

Conversation

@claude

@claude claude Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Requested by Elliot Hesp · Slack thread

Summary

Adds a product-level llms.txt served at the root domain docs.page/llms.txt.

Before: docs.page/llms.txt returned a 404. The root domain had no machine-readable index — agents landing on docs.page had no llms.txt entry point, even though every hosted docs site already exposes one at docs.page/{owner}/{repo}/llms.txt.

After: docs.page/llms.txt serves a concise, spec-compliant llms.txt that summarises the product and points agents at the documentation (use.docs.page, quickstart, CLI, GitHub) and at the per-repository agent surfaces (per-repo llms.txt / llms-full.txt, the MCP server, search.json, and raw .md/.mdx).

How

The file lives in an app-router route handler at app/src/app/llms.txt/route.ts, mirroring the existing app/src/app/schema.json/route.ts handler. It returns the text with Content-Type: text/plain; charset=utf-8.

Routing note: a public/llms.txt was considered (simplest) but a route handler is more reliable here. The pages-router catch-all (app/src/pages/[[...path]].tsx) returns a 404 for any single-segment path, so serving a bare /llms.txt depends on static-vs-dynamic precedence. An app-router route handler is guaranteed to take precedence over the pages catch-all (as schema.json already demonstrates) and matches the repo's established convention for root-level generated files. The Next 16 middleware (app/src/proxy.ts) does not intercept /llms.txt on the canonical domain — it falls through untouched — and the /:owner/:repo/llms.txt rewrite in app/next.config.ts only matches the three-segment per-repo pattern.

Scope

  • app/ (hosted site, MCP, Ask AI)
  • packages/cli/
  • packages/mdx-bundler/
  • docs/ (product documentation)
  • Repo / CI / other

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / chore

Test plan

  • Verified locally: bun dev in app/, then curl -sS localhost:3000/llms.txt returns HTTP 200 with Content-Type: text/plain; charset=utf-8 and the expected body.
  • bunx biome check clean on the new file.
  • bun run check (full) not run.

Notes for reviewers

All links in the file were verified against the repo (use.docs.page, use.docs.page/quickstart, use.docs.page/reference/cli, the GitHub repo, and the MCP tool names read_doc_page / list_doc_files). The blockquote summary and endpoint list can be tweaked to taste.

Addresses point 1 of #519.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DHjPAWXa8wkqtsVzJVyBne


Generated by Claude Code

Serve a product-level llms.txt at docs.page/llms.txt via an app-router
route handler, mirroring the existing schema.json handler. Points agents
at the docs and the per-repository agent surfaces (llms.txt, llms-full.txt,
MCP, search.json, raw .md/.mdx).

A route handler is used rather than a public/ file because the pages
catch-all returns 404 for single-segment paths; the app-router handler
reliably takes precedence.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@railway-app railway-app Bot temporarily deployed to docs.page / docs.page-pr-520 July 7, 2026 09:24 Destroyed
@railway-app railway-app Bot temporarily deployed to docs.page / docs.page-pr-520 July 7, 2026 09:38 Destroyed
@Ehesp Ehesp marked this pull request as ready for review July 7, 2026 09:41
@cursor

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown

Bugbot is not enabled for this team, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@Ehesp Ehesp changed the title docs: add product-level root llms.txt feat: add root llms.txt Jul 7, 2026
@Ehesp Ehesp merged commit 64ab2e0 into main Jul 7, 2026
3 checks passed
@Ehesp Ehesp deleted the feat/root-llms-txt branch July 7, 2026 09:41
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.

3 participants