Skip to content

docs: improve agent-friendly docs score (AFDocs quick wins)#23

Merged
rachaelrenk merged 2 commits intomainfrom
rachael/afdocs-quick-wins
May 5, 2026
Merged

docs: improve agent-friendly docs score (AFDocs quick wins)#23
rachaelrenk merged 2 commits intomainfrom
rachael/afdocs-quick-wins

Conversation

@rachaelrenk
Copy link
Copy Markdown
Contributor

@rachaelrenk rachaelrenk commented May 5, 2026

Summary

Addresses failing AFDocs scorecard checks to improve the agent-friendly docs score from 82/100 (B) toward 95+ (A).

Changes

Task 1: llms.txt directive on all pages

  • HTML: Added a visually-hidden div in CustomHeader.astro with a link to /llms.txt and a note about .md URL availability.
  • Markdown: Modified docs-markdown-integration.js to prepend a blockquote directive to every generated .md file.

Task 2: Content negotiation middleware

  • New src/middleware.ts -- Astro middleware that rewrites requests to the .md variant when agents send Accept: text/markdown or are identified by user-agent. Uses the existing shouldServeMarkdown() helper from src/lib/docs-markdown.js.

Task 3: Content-start-position verification

  • Verified the link rel alternate type text/markdown already appears early in head -- no repositioning needed. Tasks 1+2 are the primary mitigations.

Task 4: llms.txt coverage improvement

  • Fixed university/** to guides/** in the starlightLlmsTxt customSets config (directory was renamed but config was not updated).
  • Added community pages (contributing, open-source-partnership, refer-a-friend) to the Support customSet.
  • Corrected the exclude config comment to clarify it only applies to llms-small.txt, not llms-full.txt.

Task 7: MCP discovery file

  • Added public/.well-known/mcp.json pointing to the existing Kapa MCP at https://warp.mcp.kapa.ai/sse. Team consensus (Petra, Ben, Hong Yi) was that a custom MCP server is not needed -- Warp has built-in product knowledge, and this check is primarily a Mintlify upsell.

AFDocs checks addressed

Check Before After
llms-txt-directive-html FAIL PASS
llms-txt-directive-md FAIL PASS
content-negotiation FAIL PASS
content-start-position FAIL Mitigated
llms-txt-coverage 80% Improved
MCP Server Discoverable FAIL PASS

References

Co-Authored-By: Oz oz-agent@warp.dev

- Add llms.txt directive to all HTML pages (visually-hidden div in header)
  and all generated .md files (blockquote at top)
- Add Astro middleware for Accept: text/markdown content negotiation,
  using existing shouldServeMarkdown() helper
- Fix llms.txt coverage: university/** → guides/** (directory was renamed),
  add community pages to Support customSet
- Add MCP discovery file at .well-known/mcp.json pointing to Kapa MCP
- Verify <link rel=alternate type=text/markdown> already appears early
  in <head> — no repositioning needed

Checks addressed:
  llms-txt-directive-html (FAIL → PASS)
  llms-txt-directive-md (FAIL → PASS)
  content-negotiation (FAIL → PASS)
  content-start-position (mitigated via Tasks 1+2)
  llms-txt-coverage (80% → improved)
  MCP Server Discoverable (FAIL → PASS)

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label May 5, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 5, 2026 10:25pm

Request Review

@rachaelrenk rachaelrenk self-assigned this May 5, 2026
@rachaelrenk rachaelrenk changed the title feat: improve agent-friendly docs score (AFDocs quick wins) docs: improve agent-friendly docs score (AFDocs quick wins) May 5, 2026
Comment thread public/.well-known/mcp.json Outdated
{
"name": "Warp Documentation",
"description": "Search and retrieve Warp documentation — the agentic development environment and Oz, Warp's programmable agent platform.",
"url": "https://warp.mcp.kapa.ai/sse",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we have to do to get this to work? Going to the URL gives me a 404. cc @dannyneira

The Kapa MCP server uses OAuth authentication at the base URL, not
an SSE endpoint at /sse. Remove the incorrect path and transport field.

Co-Authored-By: Oz <oz-agent@warp.dev>
@rachaelrenk
Copy link
Copy Markdown
Contributor Author

rachaelrenk commented May 5, 2026

Good catch @hongyi-chen, the /sse path was wrong, fixed in d93f0a1 (base URL is just https://warp.mcp.kapa.ai).

Browsing directly will still return a 401 — that's expected. The Kapa MCP server uses OAuth authentication, so only MCP clients that handle the OAuth flow can connect (e.g., Claude, Cursor). The .well-known/mcp.json file is a discovery endpoint that tells those clients where to connect, not a human-facing URL.

@rachaelrenk rachaelrenk merged commit de2d3ea into main May 5, 2026
8 checks passed
rachaelrenk added a commit that referenced this pull request May 5, 2026
… counts

- Fix stale /sse path in afdocs-fix MCP example (matches PR #23 fix)
- Add URL validation in afdocs_audit.mjs to prevent shell injection
- Remove hardcoded baseline score from SKILL.md reporting instructions
- Soften hardcoded page counts in known-exceptions.md (varies by run)
- Scope page-size exception to /changelog/ only, not all large pages

Co-Authored-By: Oz <oz-agent@warp.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants