-
Notifications
You must be signed in to change notification settings - Fork 14
Improve agent discovery of llms.txt #925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,61 @@ | ||||||
| // Inject an llms.txt discovery directive into every HTML page. | ||||||
| // Surfaces: | ||||||
| // - <link rel="llms-txt"> + <link rel="alternate" type="text/markdown"> in <head> | ||||||
| // - A visually-hidden anchor at the very start of <body> for crawlers that | ||||||
| // only scan text content for the llms.txt URL. | ||||||
| // | ||||||
| // Agents (Claude Code, Cursor, OpenCode, afdocs checkers) use these signals | ||||||
| // to locate the navigational index without having to guess /llms.txt. | ||||||
|
|
||||||
| const LLMS_URL_ABS = "https://docs.envio.dev/llms.txt"; | ||||||
| const LLMS_FULL_URL_ABS = "https://docs.envio.dev/llms-full.txt"; | ||||||
|
|
||||||
| function LLMSDirectivePlugin() { | ||||||
| return { | ||||||
| name: "envio-llms-directive", | ||||||
| injectHtmlTags() { | ||||||
| return { | ||||||
| headTags: [ | ||||||
| { | ||||||
| tagName: "link", | ||||||
| attributes: { | ||||||
| rel: "llms-txt", | ||||||
| href: LLMS_URL_ABS, | ||||||
| type: "text/markdown", | ||||||
| }, | ||||||
| }, | ||||||
| { | ||||||
| tagName: "link", | ||||||
| attributes: { | ||||||
| rel: "alternate", | ||||||
| type: "text/markdown", | ||||||
| href: LLMS_URL_ABS, | ||||||
| title: "llms.txt", | ||||||
| }, | ||||||
| }, | ||||||
| { | ||||||
| tagName: "link", | ||||||
| attributes: { | ||||||
| rel: "alternate", | ||||||
| type: "text/markdown", | ||||||
| href: LLMS_FULL_URL_ABS, | ||||||
| title: "llms-full.txt", | ||||||
| }, | ||||||
| }, | ||||||
| { | ||||||
| tagName: "meta", | ||||||
| attributes: { | ||||||
| name: "llms-txt", | ||||||
| content: LLMS_URL_ABS, | ||||||
| }, | ||||||
| }, | ||||||
| ], | ||||||
| preBodyTags: [ | ||||||
| `<a href="${LLMS_URL_ABS}" rel="llms-txt" style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">Envio docs llms.txt — agent-facing documentation index</a>`, | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hidden anchor is focusable while visually hidden. Line 54 adds an offscreen link that can still receive keyboard focus, creating an invisible tab stop on every page. Make it non-focusable and hidden from assistive tech. Suggested fix- `<a href="${LLMS_URL_ABS}" rel="llms-txt" style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">Envio docs llms.txt — agent-facing documentation index</a>`,
+ `<a href="${LLMS_URL_ABS}" rel="llms-txt" tabindex="-1" aria-hidden="true" style="position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;">Envio docs llms.txt — agent-facing documentation index</a>`,📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| ], | ||||||
| }; | ||||||
| }, | ||||||
| }; | ||||||
| } | ||||||
|
|
||||||
| module.exports = LLMSDirectivePlugin; | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "hyperSyncChainCount": 87, | ||
| "generatedAt": "2026-05-14T19:09:24.019Z", | ||
| "generatedAt": "2026-05-18T09:29:23.922Z", | ||
| "source": "https://chains.hyperquery.xyz/active_chains" | ||
| } |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,13 +8,37 @@ | |
| { | ||
| "source": "/mcp", | ||
| "destination": "/api/mcp" | ||
| }, | ||
| { | ||
| "source": "/docs/:path((?!.+\\.md$).+)", | ||
| "has": [ | ||
| { "type": "header", "key": "accept", "value": ".*text/markdown.*" } | ||
| ], | ||
| "destination": "/docs/:path.md" | ||
| }, | ||
| { | ||
| "source": "/blog/:path((?!.+\\.md$).+)", | ||
| "has": [ | ||
| { "type": "header", "key": "accept", "value": ".*text/markdown.*" } | ||
| ], | ||
| "destination": "/blog/:path.md" | ||
|
Comment on lines
+13
to
+24
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
jq -r '.rewrites[]?.source' vercel.json | nl -baRepository: enviodev/docs Length of output: 100 🏁 Script executed: cat vercel.jsonRepository: enviodev/docs Length of output: 1053 Root The existing rewrite patterns require a path segment after Suggested fix "rewrites": [
{
"source": "/mcp",
"destination": "/api/mcp"
},
+ {
+ "source": "/docs",
+ "has": [
+ { "type": "header", "key": "accept", "value": ".*text/markdown.*" }
+ ],
+ "destination": "/docs.md"
+ },
{
"source": "/docs/:path((?!.+\\.md$).+)",
"has": [
{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }
],
"destination": "/docs/:path.md"
},
+ {
+ "source": "/blog",
+ "has": [
+ { "type": "header", "key": "accept", "value": ".*text/markdown.*" }
+ ],
+ "destination": "/blog.md"
+ },
{
"source": "/blog/:path((?!.+\\.md$).+)",
"has": [
{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }
],
"destination": "/blog/:path.md"
}
],🤖 Prompt for AI Agents |
||
| } | ||
| ], | ||
| "redirects": [ | ||
| { | ||
| "source": "/blog/tags/:tag*", | ||
| "destination": "/blog/tag/:tag*", | ||
| "permanent": true | ||
| }, | ||
| { | ||
| "source": "/docs/HyperIndex/contract-import", | ||
| "destination": "/docs/HyperIndex/quickstart", | ||
| "permanent": true | ||
| }, | ||
| { | ||
| "source": "/docs/HyperIndex/contract-import.md", | ||
| "destination": "/docs/HyperIndex/quickstart.md", | ||
| "permanent": true | ||
| } | ||
| ] | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Supported-networks matcher is too strict and misses target files.
Lines 327/332/337 check for
"/supported-networks/"indoc.filePath, but these pages are typically filenames likesupported-networks.md. That prevents the intended network-page buckets from being used.Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents