feat: agent-friendly docs (llms.txt + markdown endpoints)#448
Open
feat: agent-friendly docs (llms.txt + markdown endpoints)#448
Conversation
…gnaling) Implement the Agent-Friendly Documentation spec (agentdocsspec.com) to make docs discoverable and consumable by AI agents.
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
Implements the Agent-Friendly Documentation spec so AI agents can discover and consume our docs programmatically.
What gets deployed
Components
astro-agent-docs.mjs— Astro integration (astro:build:donehook).mdfile into build output (frontmatter stripped, title prepended as# heading, UTF-8 BOM)llms.txtindex with pages grouped by sidebar section, using absolute URLs with the versioned base pathrehype-agent-signaling.mjs— Rehype plugin<blockquote class="agent-signaling">at the top of every HTML page/llms.txtfor documentation discoveryclip: rect(0,0,0,0)(notdisplay:none) so it survives HTML-to-markdown conversionWorkflow changes (
docs.yml)publish-versioned-docsnow checks if the deployed version is the latest (viaversions.json)llms.txtto root so agents discover it at the well-known/llms.txtpathllms.txtis built from the same source as the versioned docs — zero content driftWhy
.mdfiles live inside versioned foldersThe
.mdfiles andllms.txtare generated during the same Astro build as the HTML pages. This means:llms.txtlinks to its own.mdfiles/llms.txtis just a copy from the latest version's build output, deployed in the same workflow stepChecks this addresses
llms-txt-exists/llms.txtat rootllms-txt-validllms-txt-links-resolve.mdfilesllms-txt-links-markdown.mdURLsmarkdown-url-support.mdfiles served alongside HTMLllms-txt-directivecontent-negotiationAcceptheader routinghttp-status-codesredirect-behaviorllms.txtdiscoveryTest plan
PUBLIC_BASE_PATH=/0.2/llms.txtcontains all 31 pages grouped by section with correct absolute URLs.mdendpoints have clean content (no frontmatter, title heading, UTF-8 BOM)<blockquote>present in HTML outputnpx afdocs check https://cli.internetcomputer.orgto confirm improvements