fix(docs): emit .md URLs in AI indexes + build-time cross-link validator#276
Merged
Conversation
All AI discovery surfaces (llms.txt, llms-full.txt, agent-skills SKILL.md files, V3 library catalog docUrl) now emit raw .md URLs instead of .html. This lets Studio's fetch_fliplet_doc short-circuit the doomed .html round- trip: web_fetch refuses non-Google HTML (USE_WEB_SEARCH), so every .html doc URL previously wasted a round-trip before falling back to .md anyway. Also adds validateCrossLinks() to bin/build-agent-indexes.mjs — a fence-aware build-time link rot detector wired into --strict mode. Resolves ../, ./, /-rooted, bare, and .md/.html/extensionless links; skips external hosts and asset extensions. Escape hatches: <!-- lint-ignore-link --> on the offending link, or LINK_ALLOWLIST for known exceptions. 157/157 tests pass. Author docs updated in CONTRIBUTING.md and CLAUDE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying fliplet-cli with
|
| Latest commit: |
3fba541
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9cf82b88.fliplet-cli.pages.dev |
| Branch Preview URL: | https://fix-ai-docs-md-urls.fliplet-cli.pages.dev |
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
llms.txt,llms-full.txt, agent-skills SKILL.md files, V3 library catalogdocUrl) now emit raw.mdURLs instead of.html. This makes Studio'sfetch_fliplet_docshort-circuit work immediately —web_fetchrefuses non-Google HTML, so every.htmlURL was guaranteed to waste a round-trip before falling back to.mdanyway.validateCrossLinks()tobin/build-agent-indexes.mjs— a fence-aware build-time link rot detector wired into--strictmode. Resolves../,./,/-rooted, bare, and.md/.html/extensionless links; skips external hosts and asset extensions. Escape hatches:<!-- lint-ignore-link -->on the offending link, orLINK_ALLOWLISTfor known exceptions.CONTRIBUTING.md("Internal links" section) andCLAUDE.md(build pipeline note).Context
Part of a two-lever fix for Studio V3 doc-fetch inefficiency (see companion Studio PR). Lever 2 here: once deployed to CF Pages, the index will serve
.mdURLs so the short-circuit fires even for new builder sessions that haven't loaded updated Studio code yet.Root cause:
apps-ai-web-fetch.js:388returnsUSE_WEB_SEARCHfor all non-Google HTML — a server-side design decision. Every.htmldoc URL fromllms.txtwas hitting this wall, costing a wasted fetch + fallback on every single doc lookup.Verification: 157/157 tests pass (
npm run test:unit). Regenerated.well-known/*artifacts have 0.htmlentries.Test plan
cd docs && npm run test:unit— 157/157 passnode bin/build-agent-indexes.mjs— no errors,.well-known/llms.txtcontains only.mdURLsnode bin/build-agent-indexes.mjs --strict— passes on clean tree/.well-known/llms.txtserves.mdentries🤖 Generated with Claude Code