feat(site): serve the docs to coding agents, and upgrade Astro - #438
Open
vishr wants to merge 1 commit into
Open
feat(site): serve the docs to coding agents, and upgrade Astro#438vishr wants to merge 1 commit into
vishr wants to merge 1 commit into
Conversation
Adds the machine-readable surfaces an AI coding agent looks for, and brings the site's dependencies up to a version without open advisories. Dependencies ------------ astro 6.4.7 -> 7.3.2, @astrojs/starlight 0.40 -> 0.42. Astro 6.x carries an open advisory chain that `npm audit` rates critical: authorization bypass via the decode iteration limit and a rewrite path-canonicalization mismatch, remote code execution through AVIF image optimization, and several XSS vectors including an incomplete fix for CVE-2026-54298. The tree audits clean after the upgrade. The build produces the same pages; no content changes. Agent-readable output --------------------- starlight-dot-md serves a raw Markdown twin of every page at <path>.md, so an agent fetching a doc gets the source instead of parsing rendered HTML. 296 twins, one per page per locale. starlight-llms-txt generates /llms.txt, /llms-full.txt and /llms-small.txt per the llmstxt.org convention. The cookbook is excluded from the small set, which keeps it meaningfully smaller than the full one (140K vs 204K) rather than nominally so. Code blocks are kept in both -- prose without snippets is not usable for a Go framework. This is deliberately not an SEO change. AI search crawlers overwhelmingly ignore llms.txt, and Google states it has no effect on Search or AI Overviews. The audience is Claude Code, Cursor, Copilot and Cline, writing Echo code against our docs. The llms.txt preamble states that this documentation is v5, that the module path is github.com/labstack/echo/v5, and that v4 is a separate incompatible API. Models trained before v5 default to v4 idioms, and v4 code fails against v5 in ways that read as user error rather than version skew. robots.txt ---------- The site had no robots.txt of its own; the only thing served was Cloudflare's managed Content Signals block, which is comments and declares nothing -- no user-agent rules, no signal values, no sitemap. This adds an explicit allow-everything policy, the sitemap location, and Content-Signal values for search, ai-input and ai-train. The per-agent groups are redundant against `User-agent: *` today; they are there so the intent is recorded rather than inferred, and so a change to a crawler's or a CDN's defaults does not silently opt Echo out. context7.json ------------- Context7 is what many coding agents query for library documentation. Its Echo entries are fragmented and the highest-scoring one is pinned to v4.15.0. This file scopes indexing to the English docs and the cookbook, and states the v5/v4 split in `rules`, including the signature change from `func(c echo.Context) error` to `func(c *echo.Context) error`. Claude-Session: https://claude.ai/code/session_01ABWLbEypvJUVLLY26pHxtT
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.
Makes the documentation legible to the AI coding agents developers now use to write Echo code, and takes the site off an Astro release with open advisories.
Why
Echo's docs are currently invisible to agents in three separate ways, and the fixes are independent:
llms.txt, no raw-Markdown twins. An agent that wants a page has to fetch and parse rendered HTML.robots.txtdeclares nothing. The site has norobots.txtof its own — Cloudflare's managed Content Signals block is all that's served, and it is comments only: no user-agent rules, no signal values, noSitemap:line.v4.15.0.The third is the reason agents keep emitting v4 Echo code.
What changed
Astro 6.4.7 → 7.3.2, Starlight 0.40 → 0.42
Not cosmetic.
npm auditon the previous tree reports 7 vulnerabilities, 1 critical, rooted inastroitself:transition:*directive values on hydrated islands, and via View Transition animation propertiesAfter the upgrade the tree audits clean (0 vulnerabilities). The build produces the same pages; there are no content changes in this PR.
Per-page Markdown twins
starlight-dot-mdserves every page as raw Markdown at<path>.md— e.g./guide/routing.md. 296 twins, one per page per locale. Frontmatter and fenced code blocks are preserved.llms.txt/llms-full.txt/llms-small.txtstarlight-llms-txt, by a Starlight core maintainer. The cookbook is excluded from the small set so it is actually smaller — 140K vs 204K, not the 2% difference the defaults produce. Code blocks stay in both; prose without snippets is useless for a Go framework.This is not an SEO change and should not be reviewed as one. AI search crawlers overwhelmingly skip
llms.txt— one study found 408 direct fetches across 500M AI-bot visits over 90 days — and Google states it has no effect on Search or AI Overviews. The audience is Claude Code, Cursor, Copilot and Cline.The preamble is where the value is: it states that these docs are v5, that the module path is
github.com/labstack/echo/v5, and that v4 is a separate incompatible API.robots.txtExplicit allow-everything, plus the sitemap location and
Content-Signal: search=yes, ai-input=yes, ai-train=yes.The per-agent groups are redundant against
User-agent: *today. They are there so intent is recorded rather than inferred. Worth knowing which way the asymmetry runs: blocking training crawlers (GPTBot, ClaudeBot, CCBot) costs no citations, while blocking retrieval and agent crawlers (OAI-SearchBot, Claude-SearchBot, PerplexityBot, ChatGPT-User, Claude-User) is what removes a site from AI answers.context7.jsonScopes Context7 indexing to the English docs and the cookbook — the four translations were diluting the snippet set — and states the v5/v4 split in
rules, including the signature change:Two things needing your decision
ai-train=yes. I defaulted all three content signals toyes, on the reasoning that the goal is for models to know Echo v5. If you want training declined while keeping search and answers, it becomesai-train=no.robots.txt. The zone currently serves Cloudflare's block. Once this deploys there will be two sources; the managed setting should be turned off, or verified to append rather than shadow, so exactly one file is authoritative. Separately, Cloudflare's three-tier Search/Agent/Training default change takes effect 2026-09-15 — worth checking the zone before then so Echo isn't opted out by a default flip.Follow-ups, not in this PR
context7.jsoninlabstack/echo(v5 onmaster, v4 as a previous version) — sent separately.url+public_keyfrom context7.com/dashboard, which only you can generate. The three fragmented records (/labstack/echo,/labstack/echox,/websites/echo_labstack— the last has 15 snippets) need an upstream issue to merge.unpkgand Google Fonts), and JSON-LD were scoped out; JSON-LD in particular has weak evidence behind it for AI citation.Verification
https://claude.ai/code/session_01ABWLbEypvJUVLLY26pHxtT