feat(seo): make the site + bot API legible to AI agents and crawlers#346
Merged
Conversation
The whole UI renders behind an ssr:false MeshProvider boundary, so a no-JS fetch (search crawlers, social unfurlers, ChatGPT's URL fetcher / GPTBot, curl) receives an empty <div id="__next"> — nothing describing the app or how to use its bot API. - Server-render the JSON-LD structured data in <head> (was injected client-only), so it appears in the initial HTML for every fetcher. Preserves the per-page extraJsonLd merge. - Add a <noscript> content fallback (SeoFallback), rendered outside the ssr:false boundary: product overview, links to every public route, and a "Bot API for AI agents" section. JS visitors never render it. - Add /llms.txt (llmstxt.org): machine-readable orientation for AI agents — the bot-API entry points plus a self-contained quickstart (onboarding, bearer auth, scopes, key endpoints), built from @/lib/seo and kept in sync with api/v1/README.md. - Give the OpenAPI spec an absolute `servers` URL so /api/swagger is self-locating for tooling / codegen / LLMs. - Tests covering the fallback output, bot-API links, and llms.txt content. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Add the new /llms.txt discovery file to INDEXABLE_ROUTES so it appears in /sitemap.xml alongside the other indexable routes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The whole UI renders behind an
ssr:falseMeshProvider boundary, so a no-JS fetch — search crawlers, social unfurlers, ChatGPT's URL fetcher / GPTBot,curl— receives an empty<div id="__next">. Nothing tells a fetcher what the app is or how to drive its bot API.What
<head>(was injected client-only viajson-ld.tsx), so structured data is in the initial HTML for every fetcher. Preserves the per-pageextraJsonLdmerge; escapes<→<(valid JSON, breakout-proof, no raw-HTML prop).json-ld.tsxdeleted (was only used here).SeoFallback— a<noscript>content block rendered outside thessr:falseboundary (likeMetatags): product overview, links to every public route, and a "Bot API for AI agents" section. JS visitors never render it./llms.txt(llmstxt.org) — machine-readable orientation for AI agents: the bot-API entry points (/api/swagger,/api/skill,/api-docs) plus a self-contained quickstart (4-step onboarding, bearer auth, scopes, key endpoints). Built from@/lib/seo, kept in sync withapi/v1/README.md(register-without-address,botAuthbinds it,botRotateSecret, observer ballot access).servers— absolute base URL added to the spec so/api/swaggeris self-locating for tooling / codegen / LLMs.Verification
src/__tests__/seoFallback.test.ts— 9 tests (fallback renders inside<noscript>with description + all public/bot-API links;/llms.txtstructure, onboarding steps, spec/skill links; JSON-LD route gating). All pass.tscclean for all changed files. (The worktree shows pre-existing environmental errors from uninstalled e2e/notifications deps — unrelated to this PR.)Not in this PR (infra)
Cloudflare's managed
robots.txtat the edgeDisallow: /sGPTBot/ClaudeBot/etc. — a zone/dashboard setting, not code. On-demand ChatGPT browse (ChatGPT-User) isn't blocked, so that path works from this change alone.🤖 Generated with Claude Code