Skip to content

Raise Agent-Friendly Docs score for 2code.akr.moe - #387

Merged
AkaraChen merged 2 commits into
devfrom
cursor/raise-afdocs-agent-score-4e93
Aug 20, 2026
Merged

Raise Agent-Friendly Docs score for 2code.akr.moe#387
AkaraChen merged 2 commits into
devfrom
cursor/raise-afdocs-agent-score-4e93

Conversation

@AkaraChen

@AkaraChen AkaraChen commented Aug 20, 2026

Copy link
Copy Markdown
Owner

The live site scores 59/100 (F) and is capped because afdocs 0.19 only discovers two pages (single-page-sample). /blog is a built-in non-doc exclusion, so the English homepage plus blog index were the only sampleable HTML pages. This PR keeps the existing site-config/llms.txt pipeline (sibling products stay generated, no handwritten public/llms.txt) and makes the real product/blog pages discoverable.

Does not invent a /docs site (that URL stays 404). Does not bind 2code to Hermes/Yoi/vibe-infra.

Local verification

npx afdocs@0.19.0 check http://127.0.0.1:3000 --canonical-origin https://2code.akr.moe --format scorecard

Overall Score: 100 / 100 (A+) — 37 pages sampled (uncapped). Every previously failing check is PASS. cd website && bun test is green.

Production will show the new score after this deploys to https://2code.akr.moe.

Checks

Check What changed
Discovery / uncapped score Existing homepage copy is also served at /features, /faq, /install, /getting-started (and /zh-cn/…). That gives crawlers ≥5 English HTML pages that are not under /blog. Blog posts stay at /blog for humans and SEO.
llms-txt-directive-html Server-rendered, clip-rect (not display:none) pointer near the top of every page: “For AI agents: a documentation index is available at /llms.txt”, plus .md / Accept: text/markdown.
llms-txt-directive-md Blockquote at the top of every generated markdown page pointing at /llms.txt.
content-negotiation Middleware honors Accept: text/markdown and serves Content-Type: text/markdown from the same handlers as the .md URLs. Browsers keep HTML.
redirect-behavior Removed window.location.replace locale hop. Same-host HTTP 302 in middleware (cookie + Accept-Language). Crawlers are not redirected. Footer language switch sets the cookie so English still wins.
llms-txt-coverage /llms.txt is generated from the same catalog as sitemap.ts (app/lib/public-pages.ts). Every catalog HTML page has a .md twin listed. Coverage is 100% of sitemap doc pages.
llms-txt-links-markdown Catalog links in llms.txt point at .md URLs, not HTML.
markdown-content-parity Homepage and product .md are generated from the same i18n strings as the HTML. Blog index/post markdown includes title, lede, dates, reading time, and body. Header/footer/screenshots marked data-markdown-ignore. Deleted the handwritten public/index.md / public/zh-cn.md stubs.
cache-header-hygiene /llms.txt and .md handlers send Cache-Control: public, max-age=300, must-revalidate plus ETag. Static HTML pages use revalidate = 3600. /llms-full.txt gets max-age=300 via netlify.toml.

Human UI / SEO

  • Homepage, blog URLs, and header hash links (/#features, /#faq) are unchanged.
  • Footer gains Install / Getting started.
  • Locale UX is the same, just HTTP instead of JS.
  • RSS stays on the blog footer and as rel=alternate on the blog indexes (feeds are not sitemap URLs, so afdocs does not treat XML as a docs page).

Verify after deploy

npx afdocs check https://2code.akr.moe --format scorecard
Open in Web Open in Cursor 

Generate llms.txt from the same page catalog as the sitemap, point those
links at .md URLs, and serve homepage/product markdown from the same i18n
copy as the HTML so parity is not a stub. Honor Accept: text/markdown,
replace the JS locale hop with a same-host 302, add a clip-rect llms.txt
directive on every page, and publish existing product copy at stable
non-/blog URLs so afdocs can sample more than two pages.

Co-authored-by: AkaraChen <AkaraChen@users.noreply.github.com>
@netlify

netlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploy Preview for grand-selkie-225f87 ready!

Name Link
🔨 Latest commit 4ef4d0d
🔍 Latest deploy log https://app.netlify.com/projects/grand-selkie-225f87/deploys/6a86c6e66299d00008d499f8
😎 Deploy Preview https://deploy-preview-387--grand-selkie-225f87.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Keep crypto out of Edge middleware, drop XML/txt non-pages from the
sampled set, match homepage markdown to HTML segments, and give static
HTML pages an hourly revalidate so cache-header-hygiene passes.

Co-authored-by: AkaraChen <AkaraChen@users.noreply.github.com>
@AkaraChen
AkaraChen marked this pull request as ready for review August 20, 2026 10:17
@AkaraChen
AkaraChen merged commit fa2465a into dev Aug 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants