feat: improve AI documentation discoverability#393
Merged
gregnazario merged 1 commit intomainfrom Mar 16, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Improves AI/LLM discoverability for the Aptos docs site by adding llms.txt link tags, well-known URL redirects, /en/* legacy path redirects, and MCP server details in the generated llms.txt. Also includes MDX formatting fixes.
Changes:
- Added
<link rel="llms-txt">to every page's<head>, a.well-known/llms.txtredirect, and/en/*→/*redirects invercel.json - Added MCP server details to
starlightLlmsTxtconfig inastro.config.mjs - Auto-formatted MDX files for Kotlin SDK docs (zh/es locales)
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| vercel.json | Added redirects for .well-known/llms.txt and /en/* paths |
| src/starlight-overrides/Head.astro | Added <link rel="llms-txt"> tag |
| astro.config.mjs | Added MCP server details to llms.txt generation |
| src/content/docs/{zh,es}/.../*.mdx | MDX formatting fixes (horizontal rules, list spacing) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
- Add <link rel="llms-txt" href="/llms.txt"> to the <head> of every page
so any LLM fetching any page can discover the machine-readable docs
- Add /.well-known/llms.txt -> /llms.txt permanent redirect in vercel.json
(the emerging standard path for llms.txt discovery)
- Add /en and /en/:path* -> / and /:path* permanent redirects at CDN level
so old /en/build-style URLs no longer 404 (saves LLM agents a round-trip)
- Add MCP server mention to llms.txt via starlightLlmsTxt details option
("For AI coding tools, install @aptos-labs/aptos-mcp")
09d238d to
bfc029b
Compare
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.
Summary
Four changes to help AI agents and LLMs discover and navigate the Aptos docs more efficiently:
1.
<link rel="llms-txt">in every page's<head>Any LLM that fetches any page on aptos.dev will now see:
This is the emerging convention for LLMs.txt discovery (analogous to
<link rel="sitemap">).File:
src/starlight-overrides/Head.astro2.
/.well-known/llms.txtredirectAdded a permanent (301) redirect from
/.well-known/llms.txt→/llms.txtat the CDN level.This is the emerging standard well-known path for LLMs.txt, and currently returns a 404.
File:
vercel.json3.
/en/*→/*permanent redirects at CDN levelOld
/en/build-style URLs (from the previous docs site) now 301-redirect to the correct path at the CDN edge, instead of relying solely on the server middleware (which returns a 302). This eliminates dead ends for LLM agents that still have cached/en/URLs.File:
vercel.json4. MCP server mentioned in
llms.txtThe generated
llms.txtnow includes adetailssection that tells LLMs:This complements the
descriptionandoptionalLinksadded in #379.File:
astro.config.mjs(starlightLlmsTxtdetailsoption)Bonus fix
Fixed the MCP server npm URL in
optionalLinksfrom@anthropic-ai/aptos-mcpto@aptos-labs/aptos-mcp(introduced in #379).