feat: agent discovery (Link headers, markdown negotiation, Content-Signal)#433
feat: agent discovery (Link headers, markdown negotiation, Content-Signal)#433sriramveeraghanta merged 1 commit intomasterfrom
Conversation
…gnal) - Add `Content-Signal: search=yes, ai-train=yes, ai-input=yes` to robots.txt - Add `Link` response headers advertising `/api-reference/introduction` (service-doc) and `/sitemap.xml` (sitemap) - Serve source markdown when `Accept: text/markdown` is sent — static `.md` files copied into `dist` by a VitePress `buildEnd` hook, routed via a Vercel `rewrites` header matcher
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe changes add build-time markdown file distribution via a VitePress hook, establish search engine and AI indexing policies through robots.txt directives, and configure Vercel response headers with markdown content rewriting rules for dynamic serving. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@vercel.json`:
- Around line 277-282: Add an explicit root rewrite before the existing wildcard
rule: instead of only having the rewrite object with "source": "/:path*", "has":
[{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }],
"destination": "/:path*.md", add a separate rule that matches "source": "/" with
the same "has" header condition and maps it to "/index.md" (so "/" with Accept:
text/markdown rewrites to "/index.md"); ensure the root rule appears before the
wildcard rewrite so the specific match takes precedence.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4cbfc6f8-8368-4b14-a6dd-386331aac7e4
📒 Files selected for processing (3)
docs/.vitepress/config.tsdocs/public/robots.txtvercel.json
| "rewrites": [ | ||
| { | ||
| "source": "/:path*", | ||
| "has": [{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }], | ||
| "destination": "/:path*.md" | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
: "${PREVIEW_URL:?Set PREVIEW_URL to the Vercel preview origin, e.g. https://docs-git-branch.vercel.app}"
for path in "/" "/introduction/quickstart"; do
echo "== HEAD ${path} with Accept: text/markdown =="
curl -sSI -H "Accept: text/markdown" "${PREVIEW_URL%/}${path}" | sed -n '1,20p'
echo
doneRepository: makeplane/docs
Length of output: 175
🏁 Script executed:
cat -n vercel.json | head -300Repository: makeplane/docs
Length of output: 9452
🏁 Script executed:
cat -n docs/.vitepress/config.ts | head -100Repository: makeplane/docs
Length of output: 4736
🏁 Script executed:
fd -t f "index.md" docs/Repository: makeplane/docs
Length of output: 71
Add explicit root rewrite for Markdown negotiation.
The rewrite pattern /:path* → /:path*.md will match the root path / and incorrectly rewrite it to /.md. Since docs/.vitepress/config.ts copies index.md as the homepage source for Markdown negotiation, requests to / with Accept: text/markdown will 404 or fail to resolve properly.
Proposed fix
"rewrites": [
+ {
+ "source": "/",
+ "has": [{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }],
+ "destination": "/index.md"
+ },
{
"source": "/:path*",
"has": [{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }],
"destination": "/:path*.md"
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "rewrites": [ | |
| { | |
| "source": "/:path*", | |
| "has": [{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }], | |
| "destination": "/:path*.md" | |
| } | |
| "rewrites": [ | |
| { | |
| "source": "/", | |
| "has": [{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }], | |
| "destination": "/index.md" | |
| }, | |
| { | |
| "source": "/:path*", | |
| "has": [{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }], | |
| "destination": "/:path*.md" | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@vercel.json` around lines 277 - 282, Add an explicit root rewrite before the
existing wildcard rule: instead of only having the rewrite object with "source":
"/:path*", "has": [{ "type": "header", "key": "accept", "value":
".*text/markdown.*" }], "destination": "/:path*.md", add a separate rule that
matches "source": "/" with the same "has" header condition and maps it to
"/index.md" (so "/" with Accept: text/markdown rewrites to "/index.md"); ensure
the root rule appears before the wildcard rewrite so the specific match takes
precedence.
Summary
Content-Signal: search=yes, ai-train=yes, ai-input=yestorobots.txtLinkresponse headers on all paths advertising/api-reference/introduction(service-doc) and/sitemap.xml(sitemap)Accept: text/markdownis sent — static.mdfiles copied intodistby a VitePressbuildEndhook, routed via a Vercelrewritesheader matcherAdaptations vs developer-docs PR
rel="describedby"→/llms.txtrelation (nollms.txtindocs/public/here). Add in a follow-up once the file exists.rel="service-doc"points at/api-reference/introduction. That path is not local to this site; the existing/api-reference/:path*redirect invercel.jsonsends agents todevelopers.plane.so.Test plan
pnpm check:formatpassespnpm buildsucceeds and produces 106.mdfiles alongside.htmlindist/docs/.vitepress/dist/robots.txtcontains theContent-SignallinePreview deploy:
curl -I https://<preview>.vercel.app/shows aLink:header withservice-docandsitemaprelationscurl https://<preview>.vercel.app/still returns HTML (regression check)curl -H "Accept: text/markdown" https://<preview>.vercel.app/introduction/quickstartreturns the markdown body — if returned astext/plain, add an explicitContent-Type: text/markdown; charset=utf-8header override in a follow-upSummary by CodeRabbit
New Features
Chores