Skip to content

docs: add llms.txt agent directive and markdown content negotiation - #9149

Open
manueldezman wants to merge 7 commits into
Flagsmith:mainfrom
manueldezman:docs/agent-friendly-docs
Open

manueldezman wants to merge 7 commits into
Flagsmith:mainfrom
manueldezman:docs/agent-friendly-docs

Conversation

@manueldezman

@manueldezman manueldezman commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below.

Changes

This change makes the documentation site easier for AI agents to read.

  1. The build now generates llms.txt from the built pages. Each link points to a real page route. The file is generated at build time, so it is not committed.

  2. The build now writes one Markdown file for each docs page next to the HTML route.

  3. A hidden sr-only blockquote at the top of each page points agents to llms.txt and the .md version.

  4. Vercel middleware reads Accept: text/markdown and serves the generated Markdown file. It leaves assets and existing .md paths alone. The Vary: Accept header keeps caches separate.

  5. The existing New Relic redirects now point to new-relic.

How did you test this code?

I ran the full Docusaurus production build. It completed and wrote the static site to docs/build.

I checked the generated output.

  • The build generated 167 Markdown files and one llms.txt.
  • All 167 links in llms.txt point to existing Markdown files.
  • All 167 Markdown files start with the agent directive.
  • The generated HTML contains the hidden directive.
  • The middleware target logic keeps normal pages, trailing slashes, the root path, and protocol-relative paths on the docs host.
  • vercel.json parses as valid JSON.

@manueldezman
manueldezman requested a review from a team as a code owner November 27, 2026 18:21
@manueldezman
manueldezman requested review from Holmus and removed request for a team November 27, 2026 18:21
@vercel

vercel Bot commented Nov 27, 2026

Copy link
Copy Markdown

@manueldezman is attempting to deploy a commit to the Flagsmith Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the docs Documentation updates label Nov 27, 2026

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread docs/src/theme/DocItem/Layout/index.js Resolved
Comment thread docs/static/llms.txt Resolved
Comment thread docs/vercel.json Resolved
Comment thread docs/src/css/custom.css Resolved
Comment thread docs/src/css/custom.css Resolved

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 11 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread docs/middleware.ts Resolved
Comment thread docs/vercel.json Resolved

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 issues found across 5 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval skipped because this PR is from an external contributor.

Re-trigger cubic

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant