# Routing

Docs are managed as docs sets, not as one Page per Markdown file.

## Docs Groups

Docs groups reserve namespaces such as `/plugins` or `/internal/tools`.

## Docs Sets

Docs sets represent one documentation site. Their route base is derived from an
optional group plus the docs set slug, such as:

```text
/plugins/payload-markdown-docs
```

## Generated Docs

Generated docs records are internal storage for routing, search, sync correctness, and per-doc overrides.

`index.md` routes to the docs set route base. Nested files route below it.

## Links

Use root-relative links inside the docs set:

```markdown
[Quick start](/getting-started/quick-start)
```

Do not hardcode production docs domains for internal navigation.

## Route Adapter

The `/next` export can resolve docs routes and let an app fall back to normal Pages rendering when no docs route matches. It does not mutate Pages.

## Agent Skills

Agent-facing workflow packs live outside the human docs tree under
`skills/<source>/<agent>/`. They can be copied into project-local agent
directories with `payload-markdown-docs install skill` or published by `push` as
static assets. They are not docs pages and should not be routed as generated
docs records.

Public raw asset URLs such as `/llms.txt` and
`<docsSet.routeBase>/skills/codex` require committed Next route files from
`payload-markdown-docs install routes`. `/api/...` asset URLs are
implementation/internal fallback URLs, not public canonical docs URLs.
