Skip to content

feat: add Signature-Agent markdown auto-rewrite for docs#170

Merged
Kinfe123 merged 1 commit intomainfrom
feat/signature-agent-markdown
May 9, 2026
Merged

feat: add Signature-Agent markdown auto-rewrite for docs#170
Kinfe123 merged 1 commit intomainfrom
feat/signature-agent-markdown

Conversation

@Kinfe123
Copy link
Copy Markdown
Member

@Kinfe123 Kinfe123 commented May 9, 2026

Summary by cubic

Adds automatic markdown responses for docs when requests include the Signature-Agent header. Agents can read canonical /docs/<slug> URLs without using .md or Accept: text/markdown.

  • New Features
    • Next.js: withDocs() rewrites Signature-Agent requests on /docs and /docs/:slug* to a generated /api/docs/markdown/[[...slug]] bridge route.
    • Bridge route calls /api/docs with format=markdown, derives path from the slug, and preserves incoming headers. Implemented via @farming-labs/next/api.
    • Core: added DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER, hasDocsMarkdownSignatureAgent(), and markdown.signatureAgentHeader in the discovery spec.
    • Docs, examples, and tests updated; browser HTML remains unchanged; behavior applies only under the configured docs entry route.
    • Static export (output: "export") skips the rewrites and the bridge route.

Written for commit 7ce1d4d. Summary will update on new commits.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

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

Project Deployment Actions Updated (UTC)
docs-website Ready Ready Preview, Comment May 9, 2026 6:30am

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 9, 2026

Open in StackBlitz

@farming-labs/astro

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/astro@170

@farming-labs/astro-theme

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/astro-theme@170

@farming-labs/docs

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/docs@170

@farming-labs/theme

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/theme@170

@farming-labs/next

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/next@170

@farming-labs/nuxt

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/nuxt@170

@farming-labs/nuxt-theme

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/nuxt-theme@170

@farming-labs/svelte

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/svelte@170

@farming-labs/svelte-theme

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/svelte-theme@170

@farming-labs/tanstack-start

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/tanstack-start@170

commit: 7ce1d4d

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 10 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/next/src/config.ts">

<violation number="1" location="packages/next/src/config.ts:1884">
P2: `outputFileTracingIncludes` uses an invalid dynamic route key (`:path*`) for the markdown catch-all route. Use the Next route-path form (`[[...slug]]`) so required docs files are actually traced.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

sitemapManifestTraceFile,
]),
],
"/api/docs/markdown/:path*": [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: outputFileTracingIncludes uses an invalid dynamic route key (:path*) for the markdown catch-all route. Use the Next route-path form ([[...slug]]) so required docs files are actually traced.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/next/src/config.ts, line 1884:

<comment>`outputFileTracingIncludes` uses an invalid dynamic route key (`:path*`) for the markdown catch-all route. Use the Next route-path form (`[[...slug]]`) so required docs files are actually traced.</comment>

<file context>
@@ -1805,6 +1873,22 @@ export function withDocs(nextConfig: NextConfig = {}): NextConfig {
+        sitemapManifestTraceFile,
+      ]),
+    ],
+    "/api/docs/markdown/:path*": [
+      ...new Set([
+        ...(existingTracingIncludes["/api/docs/markdown/:path*"] ?? []),
</file context>

@Kinfe123 Kinfe123 merged commit 54e6b39 into main May 9, 2026
9 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.

1 participant