Skip to content

feat: agent discovery (Link headers, markdown negotiation, Content-Signal)#433

Merged
sriramveeraghanta merged 1 commit intomasterfrom
feat/agent-discovery
Apr 21, 2026
Merged

feat: agent discovery (Link headers, markdown negotiation, Content-Signal)#433
sriramveeraghanta merged 1 commit intomasterfrom
feat/agent-discovery

Conversation

@sriramveeraghanta
Copy link
Copy Markdown
Member

@sriramveeraghanta sriramveeraghanta commented Apr 21, 2026

Summary

  • Add Content-Signal: search=yes, ai-train=yes, ai-input=yes to robots.txt
  • Add Link response headers on all paths 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

Adaptations vs developer-docs PR

  • Dropped the rel="describedby"/llms.txt relation (no llms.txt in docs/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 in vercel.json sends agents to developers.plane.so.

Test plan

  • pnpm check:format passes
  • pnpm build succeeds and produces 106 .md files alongside .html in dist/
  • docs/.vitepress/dist/robots.txt contains the Content-Signal line

Preview deploy:

  • curl -I https://<preview>.vercel.app/ shows a Link: header with service-doc and sitemap relations
  • Default curl https://<preview>.vercel.app/ still returns HTML (regression check)
  • curl -H "Accept: text/markdown" https://<preview>.vercel.app/introduction/quickstart returns the markdown body — if returned as text/plain, add an explicit Content-Type: text/markdown; charset=utf-8 header override in a follow-up

Summary by CodeRabbit

  • New Features

    • Added search engine optimization signals for improved indexing and AI training preferences
    • Included API documentation links in response headers
    • Enabled markdown content-type negotiation for API requests
  • Chores

    • Optimized build pipeline for documentation handling

…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
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

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

Project Deployment Actions Updated (UTC)
docs Building Building Preview Apr 21, 2026 1:01pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

📝 Walkthrough

Walkthrough

The 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

Cohort / File(s) Summary
VitePress Build Configuration
docs/.vitepress/config.ts
Added buildEnd hook that recursively copies all .md files (excluding .vitepress, public, node_modules) from source directory to build output, preserving relative paths. Updated filesystem imports to include copyFileSync, mkdirSync, readdirSync, statSync.
Search & AI Policy
docs/public/robots.txt
Introduced Content-Signal directive specifying search engine and AI crawling preferences (search=yes, ai-train=yes, ai-input=yes) for indexing and training policies.
Vercel Deployment Configuration
vercel.json
Added global headers rule injecting Link response headers pointing to API documentation and sitemap. Added rewrites rule to serve .md file content when requests include markdown Accept headers.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰✨ A build hook hops through directories deep,
Copying markdown files while the servers sleep!
Search bots and AI training find their way,
Vercel rewrites guide content to display—
Distributed knowledge, properly indexed, hooray!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title directly and clearly summarizes the main changes: agent discovery via Link headers, markdown content negotiation, and Content-Signal directive additions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/agent-discovery

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1039ae5 and b26c3a9.

📒 Files selected for processing (3)
  • docs/.vitepress/config.ts
  • docs/public/robots.txt
  • vercel.json

Comment thread vercel.json
Comment on lines +277 to +282
"rewrites": [
{
"source": "/:path*",
"has": [{ "type": "header", "key": "accept", "value": ".*text/markdown.*" }],
"destination": "/:path*.md"
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 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
done

Repository: makeplane/docs

Length of output: 175


🏁 Script executed:

cat -n vercel.json | head -300

Repository: makeplane/docs

Length of output: 9452


🏁 Script executed:

cat -n docs/.vitepress/config.ts | head -100

Repository: 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.

Suggested change
"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.

@sriramveeraghanta sriramveeraghanta merged commit 1d4dc61 into master Apr 21, 2026
6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the feat/agent-discovery branch April 21, 2026 15:17
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