zudo-doc can automatically generate `llms.txt` and `llms-full.txt` files, making your documentation easily consumable by AI tools and large language models.

[Dynamic content unavailable in text export]

The [llms.txt standard](https://llmstxt.org/) is an emerging convention that helps AI tools discover and read your documentation. Many AI-powered tools already look for these files.



## How It Works

When enabled, zudo-doc generates two files at build time:

- **`/llms.txt`** — An index listing all documentation pages with their titles, descriptions, and URLs
- **`/llms-full.txt`** — The full content of all documentation pages combined into a single file

These files provide a machine-friendly view of your documentation that AI tools can consume without parsing HTML.

## Enabling llms.txt

The create-zudo-doc initializer **enables this feature by default**. When configuring `zudoDoc()` directly, the package default is `false`. To explicitly control it, set `llmsTxt` in `zfb.config.ts`:

```ts title="zfb.config.ts"
export default defineConfig(
  zudoDoc({
    // ...
    llmsTxt: true, // initializer default; package default is false
  }),
);
```

To disable it:

```ts
llmsTxt: false,
```

## Generated Output

### llms.txt (Index)

The index file lists each documentation page with its title, description, and URL:

```
# My Documentation

> Site description from settings

## Docs

- [Introduction](/docs/getting-started/introduction): Learn what the project is and how it works.
- [Configuration](/docs/guides/configuration): Global settings and configuration reference.
```

### llms-full.txt (Full Content)

The full content file includes the complete text of every documentation page, separated by headings:

```
# My Documentation

> Site description from settings

## Introduction

Welcome to the project...

## Configuration

The project is configured through...
```

## Page Exclusion

Pages with any of the following frontmatter fields are automatically excluded from both generated files:

- `draft: true` — Draft pages excluded from build
- `unlisted: true` — Built but hidden pages
- `search_exclude: true` — Pages excluded from search

```mdx
---
title: Internal Notes
search_exclude: true
---
```

## Multi-Locale Support

When locales are configured, zudo-doc generates separate llms.txt files for each locale:

- **English (default):** `/llms.txt` and `/llms-full.txt`
- **Japanese:** `/ja/llms.txt` and `/ja/llms-full.txt`

Each locale's files contain only the pages from that locale's content directory. URLs in each file use the appropriate locale prefix.

## HTML Discovery

When `llmsTxt` is enabled, zudo-doc adds `<link>` tags to the `<head>` of every page, helping AI tools discover the files even when the site is deployed at a subpath:

```html
<link rel="alternate" type="text/plain" href="/my-docs/llms.txt" title="llms.txt" />
<link rel="alternate" type="text/plain" href="/my-docs/llms-full.txt" title="llms-full.txt" />
```

This supplements the standard path-based discovery (`/llms.txt` at the domain root) which may not work when your site uses a `base` path like `/my-docs/`.

## Agent export and MCP links

When `agentExport: true` is enabled, the slim `llms.txt` index links each documentation page to its clean, complete `/agent/v1/pages/<page-key>.md` alternative. With export disabled, its existing page links stay unchanged. The full-content file keeps canonical human-page source URLs. When `mcp: true` is also enabled, the index advertises the separate `<base>/mcp` endpoint. The generated Markdown and MCP endpoint are described in [Agent-readable export](https://zudo-doc.takazudomodular.com/docs/guides/agent-export) and [MCP server](https://zudo-doc.takazudomodular.com/docs/guides/mcp-server).

Agents do not necessarily read `llms.txt` just because you supply a homepage URL. For browser-only use, explicitly give the client the `llms.txt` URL or a generated Markdown page URL. `llmsTxt` is on by default in the initializer; the package-level setting defaults to `false` when you configure `zudoDoc` yourself.

## Dev Mode

The generated files are available during development via zfb's devMiddleware. When running `pnpm dev`, requests to `/llms.txt` and `/llms-full.txt` are handled dynamically — no build step needed.

[Dynamic content unavailable in text export]

No need to build before testing. The llms.txt files work immediately with `pnpm dev`, just like search.



## Production Build

During `pnpm build`, the files are written to the `dist/` directory as static text files alongside the rest of your site.