Add Docs to a New Repo
Use this path when you want to add an OAT-managed docs app and the docs analyze/apply workflow to a repository.
If you are developing inside the OAT repo itself, replace oat ... with
pnpm run cli -- ....
What this gives you
- a docs app scaffolded with OAT defaults (Fumadocs or MkDocs)
index.md-driven navigation- docs analysis and apply skills installed via the docs pack
- a repeatable workflow for finding gaps, verifying claims, and applying docs changes
1. Initialize OAT in the repo
oat init --scope projectThis sets up the base OAT structure used by the CLI and installed tool packs.
2. Install the docs workflow skills
Preferred direct path:
oat tools install docsInteractive path:
oat tools installLegacy pack-specific path:
oat init tools docsThe docs pack installs oat-docs-analyze, oat-docs-apply,
oat-agent-instructions-analyze, and oat-agent-instructions-apply. For this
quickstart, the docs pair is the part you need immediately.
3. Scaffold the docs app
Two paths — pick one:
3a. Preferred: the oat-docs-bootstrap skill (guided)
/oat-docs-bootstrapThe docs-bootstrap skill wraps oat docs init with a seven-step guided flow: preflight detection (repo shape + existing-setup conflict surfacing), richer input gathering (including a site name distinct from the package name), the CLI invocation itself, labeled post-patches for open CLI gaps, install + build verification, post-scaffold config inspection, and a chunked educational walkthrough.
What the skill adds over the raw CLI:
- Preflight + conflict resolution. Detects existing
documentationconfig / docs app dir / rootAGENTS.mdsection and walks a deliberate resolution choice (replace, abort, repair, or deferred second-app) before any mutation. - Richer inputs. Asks for a site name separate from the package name, so
createDocsConfig()/ layout branding / page metadata all converge on the same display title. - Post-scaffold patches for open CLI gaps. Applied only when capability detection shows the CLI hasn't closed the gap. Each patch is labeled (e.g.,
<!-- FP-12 patch -->) so it can be removed deterministically when the upstream fix lands:- FP-11 — Turbopack
rootfor nested-standalone Fumadocs apps (suppresses the multiple-lockfile warning) - FP-12 —
export const metadata = { title, description }inapp/layout.tsx(the only thing that populates page<title>, meta description, and Open Graph —DocsLayout.branding.titleonly renders nav chrome, andcreateDocsConfig()ignorestitle/descriptionentirely) - FP-13 — four scaffold-content fixes (empty per-page
description:frontmatter, bare install/build commands missing--filterorcd-prefix for monorepo/nested shapes, falsedocs:lintclaim whenlint=none, Node version line that doesn't match the consuming repo's.nvmrc/engines.node) - FP-15 — writes a task-framed
<appRoot>/AGENTS.mdbridge file when the CLI hasn't scaffolded one. The bridge is the docs app's runtime agent reference (separate audience fromdocs/contributing.md) - FP-16 — rewrites
docs/index.md## Contentslinks to the.md-suffixed form that@open-agent-toolkit/docs-transformsnormalizes at build time (agent-friendlier than extension-less; routes correctly) - FP-17 — trims
docs/contributing.md's "Agent guidance" section to a one-line pointer at the docs-appAGENTS.md, restoring the three-surfaces separation
- FP-11 — Turbopack
- Build verification. Runs install + build, classifies failures against known patterns, stops on unknown errors rather than guessing.
- Config inspection. Reads
.oat/config.jsonback, verifies paths exist on disk, handles the nested-standalone dual-config case, and collects therequireForProjectCompletionopt-in explicitly. - Root-build explanation. When the CLI safely patches a compatible Turbo root
buildscript, the walkthrough explains why the filter was added, shows the diff shape, and documents how to adjust or revert it. When the CLI skips the patch, the walkthrough relays the recommended manual snippet. - Educational walkthrough. Seven sections covering the
documentationconfig, the two-index.mdmodel, the## Contentscontract (with extension discipline), the three agent-instruction surfaces (rootAGENTS.mdpointer / docs-appAGENTS.md/docs/contributing.md), Fumadocs internals (or MkDocs Minimum Contract), and the OAT docs ecosystem (oat-project-document,oat-docs-analyze,oat-docs-apply). - Optional content kickoff. Hands off to
oat-docs-analyze+oat-docs-applyif you want to populate initial repo-specific content immediately.
Capability-gated: every post-patch self-ratchets off as CLI fixes land upstream. The skill's labeled markers (<!-- FP-NN patch -->) are how you find them later when the CLI catches up.
3b. Direct CLI (deterministic / non-interactive)
oat docs init --app-name my-docsIn interactive mode, you'll be prompted to choose a framework:
- Fumadocs — Next.js-based static site with FlexSearch, Mermaid diagrams, dark/light mode, and code copy buttons
- MkDocs — MkDocs Material with the OAT contributor contract
Default placement:
- monorepo:
apps/my-docs - single-package repo:
my-docs/at repo root
You can override the target and framework explicitly:
# Fumadocs (non-interactive)
oat docs init --app-name my-docs --framework fumadocs --yes
# MkDocs (non-interactive)
oat docs init --app-name my-docs --framework mkdocs --yesUse 3b when you want a fully headless scaffold (CI, automation) and can accept the raw CLI output without the guided post-patches.
For compatible Turbo monorepos, the CLI also patches the repo-root
package.json by default so root pnpm build excludes the new docs app and a
root build:docs script is available for docs-only builds. Use
--no-root-patch to opt out, or --dry-run to preview the diff without
writing it.
3a. Migrating from MkDocs (optional)
If you have an existing MkDocs site and want to switch to Fumadocs, use the migration command after scaffolding:
oat docs migrate --docs-dir docs --config mkdocs.yml --applyThis converts MkDocs admonitions to GFM callouts and injects frontmatter
metadata. Run without --apply first to preview changes.
4. Start authoring docs with the OAT contract
Core rules:
- every docs directory should have an
index.md - every
index.mdshould include a## Contentssection - the
## Contentssection should map sibling pages and immediate child directories
For MkDocs apps, regenerate navigation after adding or moving pages:
oat docs nav sync --target-dir apps/my-docsFor Fumadocs apps, the docs index is generated automatically via
predev/prebuild hooks. You can also run it manually:
oat docs generate-index --docs-dir docsThe generated app-root index.md is machine-owned and now starts with an
AUTOGENERATED warning comment. Edit authored pages under docs/, not the
generated root index.
5. Analyze the docs surface
Use the skill, not the CLI stub, for the real analysis workflow.
If your host supports slash-skill invocation:
/oat-docs-analyzeOtherwise invoke the skill by name in your agent host.
What oat-docs-analyze checks:
- index contract coverage
- nav drift
- stale or contradicted repo-checkable claims
- missing or thin content coverage based on repo features
- contributor/setup guidance gaps
6. Review the artifact and apply approved changes
Run the apply skill after analysis:
/oat-docs-applyoat-docs-apply consumes the analysis artifact, asks for approval, and applies
only the approved, evidence-backed recommendations.
Important:
oat docs analyzeandoat docs applyare CLI guidance entrypoints- the actual analysis/apply workflow runs through the skills
Typical loop
oat init --scope projectoat tools install docsoat docs init --app-name my-docs- (optional)
oat docs migrate --docs-dir docs --config mkdocs.yml --apply - Author docs with
index.md+## Contents oat docs nav sync --target-dir apps/my-docs(MkDocs) oroat docs generate-index(Fumadocs)/oat-docs-analyze/oat-docs-apply- Repeat as the codebase changes