Authoring
How to add, move, and restructure pages without breaking navigation. The rules
below are the same ones documentation/AGENTS.md enforces for agents; this page
states them for anyone editing the docs by hand.
The navigation contract
Navigation in this site is authored, not configured. There is no hand-rolled sidebar YAML and no separate table of contents to maintain. Instead:
- Every content directory has an
index.md. It is the directory's map page. - Every
index.mdhas a## Contentssection — a bulleted list linking to that directory's leaf pages and child directories. This is the machine-readable local map. - Leaf pages do not need a
## Contents. Only directoryindex.mdfiles carry one.
If a page is not listed in some ## Contents, it is effectively invisible to the
navigation tooling. When you add a page, the same commit must add its link to the
nearest index.md.
overview.md files are deprecated; use index.md with a ## Contents section.
The .md-link convention
Write ## Contents links with their .md suffix and as relative paths:
[Page Title](page.md)for a leaf page in the same directory.[Section Title](subdir/index.md)for a child directory.
The @open-agent-toolkit/docs-transforms remark-links plugin normalizes these at
build time — it strips the .md for Fumadocs routing and collapses
dir/index.md to dir. So the suffixed form both renders correctly and lets
an agent (or a grep-based tool) follow the link straight to the source file
without inferring the extension. Extension-less links ([Page](page)) break that
file-following and diverge from the convention used throughout the site; do not
author them.
The generated-index discipline
The root manifest at documentation/index.md is a generated file-tree of the
whole docs surface. It is produced by:
cd documentation && oat docs generate-index --docs-dir docs --output index.mdThis runs automatically on the predev and prebuild npm scripts, so a normal
pnpm dev or pnpm build regenerates it for you. Do not hand-edit
documentation/index.md — it carries an autogenerated banner and any manual
change is clobbered on the next dev/build. It is a derived artifact, not an
authored map.
The authored maps are the per-directory ## Contents sections. The generated
root manifest reflects the file tree; the ## Contents sections express intent.
When you change structure, edit the ## Contents sections and let the generator
refresh the manifest — never the other way around.
WARNING
If you find yourself editing documentation/index.md directly, stop. Edit the
relevant ## Contents in docs/**/index.md instead, then regenerate.
Adding a page
- Create the Markdown file under
docs/in the directory that best matches the topic. Prefer.md. Reach for.mdxonly when the page genuinely needs embedded JSX — a custom component, an interactive widget, a non-default layout. Plain.mdis friendlier to agents, linters, and grep. - Add frontmatter with at least
titleanddescription(see Markdown Features). - Add a
.md-suffixed link to the page in the nearestindex.md's## Contents. - If the page introduces a new subdirectory, give that subdirectory its own
index.mdwith a## Contentssection. - Update the directory's
meta.jsonif the new page should appear in a specific sidebar position (see Sidebar order).
Restructuring navigation
- Make the change in the authored
## Contentssections of each affectedindex.md. Those are the source of truth. - When moving a page between directories, update both the source and
destination
## Contentsin the same commit so history never contains a broken intermediate state. - When reparenting a whole subtree, revisit the moved directory's
index.mdintro paragraph so its stated scope still matches its new home. - Let the generator refresh
documentation/index.md; do not edit it by hand.
Sidebar order
Each directory's sidebar ordering is controlled by a meta.json next to its
index.md. It lists page slugs in display order, and string entries wrapped in
dashes act as section separators:
{
"pages": ["index", "authoring", "markdown-features", "review-checklist"]
}Pages not listed still resolve, but their sidebar position is left to the
default. When you add a page that needs a specific slot, add its slug to the
parent meta.json.
Local workflow
Work from inside the docs app:
cd documentation
pnpm install # first time only
pnpm dev # live preview; runs generate-index via predevpnpm dev starts the Next.js dev server with hot reload. The predev script
regenerates the root manifest first, so the navigation you preview matches the
current file tree.
Before you push, build the site the way CI does:
cd documentation && pnpm buildpnpm build runs prebuild (regenerating the manifest) and then the production
Next.js build, which surfaces MDX and rendering errors that the dev server
tolerates. A clean pnpm build is the bar for a docs change. Run
pnpm run docs:format:check to verify Markdown formatting, and
pnpm run docs:format to apply it.
Agent-instruction surfaces
Three distinct files carry agent and contributor instructions; keep them in their lanes:
documentation/AGENTS.md— the docs-app agent runtime contract. The authoritative source for how agents add pages, restructure nav, run audit/apply, and avoid clobbering generated files. This section of the docs defers to it.documentation/docs/contributing.md— the scaffold's human-facing contributing page (navigation contract summary, supported Markdown features, local workflow). It is rendered in the site.- Root
AGENTS.md## Documentationsection — the repo-wide pointer that tells any agent working anywhere in the repo that docs live atdocumentation/. It routes to the docs-appAGENTS.md.
When a convention changes, update the surface that owns it and reconcile the others in the same change rather than letting them drift.
Documentation
The docs authoring contract for this Fumadocs site: navigation rules, supported Markdown, and the review checklist agents and humans follow.
Markdown Features
The Markdown and MDX patterns this Fumadocs site actually renders: frontmatter, GFM alerts, Mermaid diagrams, code blocks with a copy button, full-text search, and dark/light mode.