Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 25, 2026

Adds /llms.txt endpoint that generates a plain-text documentation index from MDX sources, optimized for LLM consumption.

Implementation

  • Route handler (src/app/llms.txt/route.ts): Leverages existing getDocs() utility to extract titles, descriptions, URLs, and table of contents from all documentation
  • Static caching: Configured with force-static and revalidate: false to generate once at build time
  • Output format: Returns text/plain with hierarchical structure suitable for context injection

Example Output

# Documentation

## pmndrs/docs

Documentation generator for `pmndrs/*` projects.

URL: /getting-started/introduction

### Table of Contents

- pmndrs/docs
- INSTALL
- Configuration
...

Housekeeping

  • Added package-lock.json and next-env.d.ts to .gitignore (auto-generated artifacts)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • codesandbox.io
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/docs/docs/node_modules/next/dist/compiled/jest-worker/processChild.js (dns block)
  • opencollective.com
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/docs/docs/node_modules/next/dist/compiled/jest-worker/processChild.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

i'd like to add a /llms.txt static route that is generated on build -


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 25, 2026 17:11
Co-authored-by: abernier <76580+abernier@users.noreply.github.com>
Co-authored-by: abernier <76580+abernier@users.noreply.github.com>
Co-authored-by: abernier <76580+abernier@users.noreply.github.com>
Copilot AI changed the title [WIP] Add /llms.txt static route generated on build Add /llms.txt static route for LLM-friendly documentation index Jan 25, 2026
Copilot AI requested a review from abernier January 25, 2026 17:15
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