Skip to content

feat: add /llms.txt endpoints for LLM-friendly documentation#2674

Open
claw-explorer wants to merge 1 commit intofreeCodeCamp:mainfrom
claw-explorer:feat/llms-txt-endpoint
Open

feat: add /llms.txt endpoints for LLM-friendly documentation#2674
claw-explorer wants to merge 1 commit intofreeCodeCamp:mainfrom
claw-explorer:feat/llms-txt-endpoint

Conversation

@claw-explorer
Copy link
Copy Markdown

Summary

Adds two new routes that serve LLM-friendly plain text documentation following the llms.txt specification:

  • GET /llms.txt — Returns a top-level index of all available documentation with links to each doc section.
  • GET /:doc/llms.txt — Returns a per-documentation index with all entries grouped by type, linking to individual pages.

Format

The output follows the llms.txt standard:

# DevDocs

> DevDocs combines multiple API documentations in a fast, organized, and searchable interface.

## Documentation

- [CSS](https://devdocs.io/css/)
- [JavaScript](https://devdocs.io/javascript/)
...

Per-doc endpoints group entries by type:

# JavaScript

> JavaScript documentation on DevDocs.

## Array

- [Array.from()](https://devdocs.io/javascript/global_objects/array/from)
- [Array.isArray()](https://devdocs.io/javascript/global_objects/array/isarray)
...

## Promise

- [Promise.all()](https://devdocs.io/javascript/global_objects/promise/all)
...

Why

LLM tools and AI-powered development environments need efficient, structured access to documentation. The llms.txt standard (used by FastHTML, Context7, and others) provides a lightweight way to expose documentation in a format that works well with fixed-context-window LLMs.

Implementation

  • Routes are defined before the catch-all doc route to avoid conflicts
  • Uses existing settings.docs manifest and per-doc index.json files
  • No new dependencies required
  • Served as text/plain with Markdown formatting

Closes #2520

Add two new routes that serve LLM-friendly plain text documentation
following the llms.txt specification (https://llmstxt.org/):

- GET /llms.txt - Returns a top-level index of all available
  documentation with links to each doc section.

- GET /:doc/llms.txt - Returns a per-documentation index with
  all entries grouped by type, linking to individual pages.

The format follows the llms.txt standard:
- Title as a Markdown heading
- Description as a blockquote
- Sections with links in Markdown format

This enables LLM tools and AI-powered development environments
to efficiently discover and reference DevDocs documentation.

Closes freeCodeCamp#2520
@claw-explorer claw-explorer requested a review from a team as a code owner April 2, 2026 20:21
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.

llms.txt end points for each doc route

1 participant