@open-agent-toolkit/cli 0.3.11 → 0.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/assets/bundle-metadata.json +1 -1
  2. package/assets/docs/cli-utilities/configuration.md +1 -1
  3. package/assets/docs/cli-utilities/tool-packs.md +4 -1
  4. package/assets/docs/docs-tooling/add-docs-to-a-repo.md +80 -15
  5. package/assets/docs/docs-tooling/commands.md +74 -30
  6. package/assets/docs/docs-tooling/index.md +6 -6
  7. package/assets/docs/docs-tooling/workflows.md +26 -9
  8. package/assets/docs/provider-sync/commands.md +1 -1
  9. package/assets/docs/provider-sync/instruction-sync.md +11 -4
  10. package/assets/docs/reference/cli-reference.md +2 -2
  11. package/assets/docs/reference/docs-index-contract.md +20 -4
  12. package/assets/docs/reference/file-locations.md +3 -1
  13. package/assets/docs/reference/oat-directory-structure.md +23 -21
  14. package/assets/docs/workflows/skills/recon.md +4 -1
  15. package/assets/public-package-versions.json +4 -4
  16. package/assets/skills/oat-docs-analyze/SKILL.md +27 -7
  17. package/assets/skills/oat-docs-analyze/references/quality-checklist.md +16 -3
  18. package/assets/skills/oat-docs-apply/SKILL.md +20 -3
  19. package/assets/skills/oat-docs-authoring/SKILL.md +11 -7
  20. package/assets/skills/oat-docs-authoring/references/docs-root-resolution.md +12 -5
  21. package/assets/skills/oat-docs-authoring/references/lifecycle-boundaries.md +7 -7
  22. package/assets/skills/oat-docs-authoring/references/oat-fumadocs-contract.md +13 -3
  23. package/assets/skills/oat-docs-authoring/references/targeted-authoring-workflow.md +5 -4
  24. package/assets/skills/oat-docs-authoring/references/validation.md +11 -1
  25. package/assets/skills/oat-docs-bootstrap/SKILL.md +31 -8
  26. package/assets/skills/oat-docs-bootstrap/assets/AGENTS.md.template +2 -1
  27. package/assets/skills/oat-project-document/SKILL.md +21 -2
  28. package/assets/skills/recon/SKILL.md +1 -1
  29. package/assets/skills/recon/scripts/render-packet.mjs +40 -13
  30. package/assets/templates/docs-markdown/contributing.md +35 -0
  31. package/assets/templates/docs-markdown/index.md +18 -0
  32. package/dist/commands/docs/index-generate/index.d.ts.map +1 -1
  33. package/dist/commands/docs/index-generate/index.js +41 -8
  34. package/dist/commands/docs/init/index.d.ts +17 -2
  35. package/dist/commands/docs/init/index.d.ts.map +1 -1
  36. package/dist/commands/docs/init/index.js +194 -14
  37. package/dist/commands/docs/init/markdown.d.ts +39 -0
  38. package/dist/commands/docs/init/markdown.d.ts.map +1 -0
  39. package/dist/commands/docs/init/markdown.js +317 -0
  40. package/dist/commands/docs/init/resolve-options.d.ts +3 -1
  41. package/dist/commands/docs/init/resolve-options.d.ts.map +1 -1
  42. package/dist/commands/docs/init/resolve-options.js +36 -0
  43. package/dist/commands/docs/init/scaffold.d.ts.map +1 -1
  44. package/dist/commands/docs/init/scaffold.js +11 -0
  45. package/dist/commands/docs/nav/fumadocs.d.ts +7 -0
  46. package/dist/commands/docs/nav/fumadocs.d.ts.map +1 -1
  47. package/dist/commands/docs/nav/fumadocs.js +28 -3
  48. package/dist/commands/shared/agents-md.d.ts +7 -0
  49. package/dist/commands/shared/agents-md.d.ts.map +1 -1
  50. package/dist/commands/shared/agents-md.js +131 -91
  51. package/dist/commands/tools/shared/pack-manifest.d.ts.map +1 -1
  52. package/dist/commands/tools/shared/pack-manifest.js +1 -0
  53. package/dist/config/oat-config.d.ts +2 -1
  54. package/dist/config/oat-config.d.ts.map +1 -1
  55. package/dist/config/oat-config.js +4 -2
  56. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "oatVersion": "0.3.11"
3
+ "oatVersion": "0.3.13"
4
4
  }
@@ -93,7 +93,7 @@ Common keys in `.oat/config.json`:
93
93
  configured value for the current process.
94
94
  - `worktrees.root` — where OAT-managed worktrees live
95
95
  - `git.defaultBranch` — base branch fallback for PR workflows
96
- - `documentation.root`, `documentation.tooling`, `documentation.config` — docs-surface ownership
96
+ - `documentation.root`, `documentation.tooling`, `documentation.config` — docs-surface ownership. With tooling `markdown`, root is the literal content directory (including nested `docs`) and `documentation.index` is authored `<root>/index.md`; Markdown adds no framework config. Framework roots retain app/source semantics. Use `oat docs init --framework markdown` or explicit `--adopt` for setup; optional manifests need external output and never change the authored index. See [Documentation path resolution](../reference/oat-directory-structure.md#documentation-path-resolution)
97
97
  - `documentation.excludes` — a JSON array of globs, relative to the docs directory, that `oat docs generate-index` leaves out of the generated index. `oat config set` takes the list as one comma-separated value (`"a/**,b.md"`) and stores it as an array; repeated `--exclude` flags extend it, and an empty value clears the key
98
98
  - `documentation.requireForProjectCompletion` — whether docs sync is a completion gate
99
99
  - `instructions.claude.shims` — how `oat instructions sync` keeps a `CLAUDE.md` beside each `AGENTS.md`: `none` (the default: no shims; sync removes the ones OAT created and warns about any other `CLAUDE.md`, all or nothing: it removes none while any `CLAUDE.md`, `.claude/CLAUDE.md`, or `CLAUDE.local.md` has content of its own; see [All or nothing](../provider-sync/instruction-sync.md#all-or-nothing)), `pointer`, `symlink`, or `copy`. The `--strategy` flag overrides it for one run. Set it with `oat config set instructions.claude.shims pointer` when contributors need `CLAUDE.md` (see [Claude Code and AGENTS.md](../provider-sync/instruction-sync.md#claude-code-and-agentsmd)); `oat config unset` returns to `none`. Any other value is rejected with exit code `2` rather than read as unset, and `oat config set` can still replace it
@@ -928,7 +928,7 @@ Key behavior:
928
928
  The `docs` pack contains active documentation and instruction-governance
929
929
  workflows:
930
930
 
931
- - **oat-docs-bootstrap** — Guide users through bootstrapping a docs app
931
+ - **oat-docs-bootstrap** — Guide users through Markdown setup/adoption or a docs app
932
932
  end-to-end: preflight detection, input gathering, scaffold (via `oat docs
933
933
  init`) with capability-gated post-patches, build verification, config
934
934
  inspection, and an educational walkthrough.
@@ -943,6 +943,9 @@ init`) with capability-gated post-patches, build verification, config
943
943
 
944
944
  Key behavior:
945
945
 
946
+ - The docs pack includes `docs-markdown/index.md` and `docs-markdown/contributing.md`
947
+ baseline templates alongside framework scaffolds. Repository templates override
948
+ user templates, which override bundled defaults.
946
949
  - Docs pack installs at the selected scope and defaults to user scope on a
947
950
  fresh install.
948
951
  - It complements the `core` pack: `oat-docs` answers questions from bundled
@@ -1,11 +1,11 @@
1
1
  ---
2
- title: Add Docs to a New Repo
3
- description: 'Step-by-step guide for adding an OAT-managed docs app to a repository.'
2
+ title: Add or Adopt Docs in a Repo
3
+ description: 'Step-by-step guide for adding or adopting OAT-managed documentation to a repository.'
4
4
  ---
5
5
 
6
- # Add Docs to a New Repo
6
+ # Add or Adopt Docs in a Repo
7
7
 
8
- Use this path when you want to add an OAT-managed docs app and the docs
8
+ Use this path when you want to add or adopt documentation and the docs
9
9
  analyze/apply workflow to a repository.
10
10
 
11
11
  If you are developing inside the OAT repo itself, replace `oat ...` with
@@ -13,7 +13,7 @@ If you are developing inside the OAT repo itself, replace `oat ...` with
13
13
 
14
14
  ## What this gives you
15
15
 
16
- - a docs app scaffolded with OAT defaults (Fumadocs or MkDocs)
16
+ - plain Markdown files or a docs app scaffolded with OAT defaults (Fumadocs or MkDocs)
17
17
  - `index.md`-driven navigation
18
18
  - docs analysis and apply skills installed via the docs pack
19
19
  - a repeatable workflow for finding gaps, verifying claims, and applying docs changes
@@ -51,9 +51,9 @@ The docs pack installs `authoring-docs`, `oat-docs-authoring`,
51
51
  `oat-agent-instructions-apply`. For this quickstart, the authoring and docs
52
52
  analysis/apply skills are the parts you need immediately.
53
53
 
54
- ## 3. Scaffold the docs app
54
+ ## 3. Set up the documentation surface
55
55
 
56
- Two paths — pick one:
56
+ Choose Markdown files or a framework app, using the guided skill or direct CLI.
57
57
 
58
58
  ### 3a. Preferred: the `oat-docs-bootstrap` skill (guided)
59
59
 
@@ -61,9 +61,11 @@ Two paths — pick one:
61
61
  /oat-docs-bootstrap
62
62
  ```
63
63
 
64
- The 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.
64
+ The docs-bootstrap skill offers Markdown, Fumadocs, and MkDocs. Configured tooling is authoritative; framework evidence is checked before plain-directory evidence. A root README alone does not trigger adoption, and an empty selected target stays fresh setup. Markdown uses file checks and an adopt/audit handoff, with no app questions, dependencies, framework patches, docs-root AGENTS, or site build.
65
65
 
66
- What the skill adds over the raw CLI:
66
+ For framework apps, it 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.
67
+
68
+ What the framework path adds over the raw CLI:
67
69
 
68
70
  - **Preflight + conflict resolution.** Detects existing `documentation` config / docs app dir / root `AGENTS.md` section and walks a deliberate resolution choice (replace, abort, repair, or deferred second-app) before any mutation.
69
71
  - **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.
@@ -90,10 +92,11 @@ oat docs init --app-name my-docs
90
92
 
91
93
  In interactive mode, you'll be prompted to choose a framework:
92
94
 
95
+ - **Markdown** — authored files, context indexes, and Contents maps without a site framework
93
96
  - **Fumadocs** — Next.js-based static site with FlexSearch, Mermaid diagrams, dark/light mode, and code copy buttons
94
97
  - **MkDocs** — MkDocs Material with the OAT contributor contract
95
98
 
96
- Default placement:
99
+ Framework default placement:
97
100
 
98
101
  - monorepo: `apps/my-docs`
99
102
  - single-package repo: `my-docs/` at repo root
@@ -113,8 +116,68 @@ Use 3b when you want a fully headless scaffold (CI, automation) and can accept t
113
116
  For compatible Turbo monorepos, the CLI also patches the repo-root
114
117
  `package.json` by default so root `pnpm build` excludes the new docs app and a
115
118
  root `build:docs` script is available for docs-only builds. Use
116
- `--no-root-patch` to opt out, or `--dry-run` to preview the diff without
117
- writing it.
119
+ `--no-root-patch` to opt out. `--dry-run` is available only for Markdown
120
+ files/config/guidance; it does not preview framework package patches.
121
+
122
+ ### Plain Markdown: fresh setup or additive adoption
123
+
124
+ ```bash
125
+ # Fresh default root: docs/ in every repository shape
126
+ oat docs init --framework markdown --site-name "Project Docs" --yes
127
+
128
+ # Existing content: preview, then explicitly adopt without overwriting files
129
+ oat docs init --framework markdown --target-dir handbook --adopt --dry-run --yes
130
+ oat docs init --framework markdown --target-dir handbook --adopt --yes
131
+ ```
132
+
133
+ Markdown creates missing `index.md` and `contributing.md` baseline pages and
134
+ records `documentation.tooling: "markdown"`, the literal root, and its authored
135
+ `<root>/index.md`. A nested `<root>/docs` remains a subsection. Root managed
136
+ Documentation guidance names these paths; bootstrap creates no docs-root
137
+ `AGENTS.md` and preserves one already present. It creates no app package,
138
+ framework config, dependencies, or install/dev/build commands. Lint/format
139
+ choices default to `none` and never install tools.
140
+
141
+ A default setup records:
142
+
143
+ ```json
144
+ {
145
+ "documentation": {
146
+ "tooling": "markdown",
147
+ "root": "docs",
148
+ "index": "docs/index.md"
149
+ }
150
+ }
151
+ ```
152
+
153
+ A populated target is refused without `--adopt`, including with `--yes`.
154
+ Adoption preserves existing page/index/local-instruction bytes and adds only
155
+ missing baseline files. Missing child indexes, metadata, context, or Contents
156
+ remain audit gaps: run `oat-docs-analyze`, then `oat-docs-apply` for approved
157
+ repairs. Successful config/guidance setup does not prove full content conformity.
158
+ See [Markdown setup details](commands.md#oat-docs-init) for initial Contents
159
+ discovery and repair advice for optional child indexes and unreadable directories.
160
+
161
+ Incompatible declared tooling/root/index or unsafe paths are refused before
162
+ writes. Selecting a framework explicitly retains its existing replacement
163
+ prompt/`--yes` behavior, including over configured Markdown: config may change
164
+ while old Markdown files remain. This is not an automatic content migration.
165
+
166
+ Dry-run writes nothing. Manual-required or blocked guidance returns `partial`
167
+ and exit `1`; files/config are planned, not completed. A real partial run may
168
+ already have created baseline files and config: follow its reported state and
169
+ preserve those files when retrying. Converged repeated adoption returns `ok`,
170
+ exit `0`, and no changes.
171
+
172
+ Markdown indexes are authored. Optional inventories require external output:
173
+
174
+ ```bash
175
+ oat docs generate-index --docs-dir handbook --output .oat/docs-manifest.md
176
+ ```
177
+
178
+ Default generation is refused for configured Markdown. External output cannot
179
+ be inside the full configured content root or overwrite its authored index,
180
+ even with a narrowed `--docs-dir`. It never repoints `documentation.index`.
118
181
 
119
182
  ### 3c. Existing MkDocs content
120
183
 
@@ -132,13 +195,15 @@ refactor, use the assigned migration handoff guide or project plan; do not make
132
195
 
133
196
  ## 4. Start authoring docs with the OAT contract
134
197
 
135
- Use `oat-docs-authoring` for targeted OAT/Fumadocs content edits or local
198
+ Use `oat-docs-authoring` for targeted OAT Markdown/Fumadocs content edits or local
136
199
  restructuring. It uses `authoring-docs` for the portable documentation baseline
137
200
  and adds the OAT-specific navigation, generated-index, and validation contract.
138
201
 
139
202
  Core rules:
140
203
 
141
- - every docs directory should have an `index.md`
204
+ - every non-excluded Markdown-bearing docs directory should have an authored `index.md`
205
+ - preserve useful audience/scope context and nonempty title/description metadata
206
+ - honor asset-only exceptions, configured excludes, and existing local instructions
142
207
  - every `index.md` should include a `## Contents` section
143
208
  - the `## Contents` section should map sibling pages and immediate child directories
144
209
  - `## Contents` links should use `.md`-suffixed relative targets, including `subdir/index.md` for child directories
@@ -214,7 +279,7 @@ Important:
214
279
  3. `oat docs init --app-name my-docs`
215
280
  4. (optional) handle MkDocs migration as a separate workstream; use `oat docs migrate --docs-dir docs --config mkdocs.yml --apply` only for the syntax/frontmatter helper
216
281
  5. Author docs with `index.md` + `## Contents`
217
- 6. `oat docs nav sync --target-dir apps/my-docs` (both frameworks), plus `oat docs generate-index` (Fumadocs)
282
+ 6. Check Markdown files/links, or refresh declared artifacts with `oat docs nav sync --target-dir apps/my-docs` (both frameworks), plus `oat docs generate-index` (Fumadocs)
218
283
  7. `/oat-docs-analyze`
219
284
  8. `/oat-docs-apply`
220
285
  9. Repeat as the codebase changes
@@ -1,13 +1,13 @@
1
1
  ---
2
- title: Docs App Commands
3
- description: 'Docs scaffolding CLI surface for Fumadocs/MkDocs, migration helpers, Fumadocs index generation, and nav sync for both frameworks.'
2
+ title: Documentation Commands
3
+ description: 'Markdown bootstrap/adoption, framework scaffolding, external manifests, and navigation helpers for both frameworks.'
4
4
  ---
5
5
 
6
- # Docs App Commands
6
+ # Documentation Commands
7
7
 
8
8
  OAT includes a dedicated docs command family for bootstrapping and maintaining
9
- documentation apps. Two frameworks are supported: **Fumadocs** (Next.js-based)
10
- and **MkDocs Material**.
9
+ plain Markdown documentation and apps using **Fumadocs** (Next.js-based)
10
+ or **MkDocs Material**.
11
11
 
12
12
  ## Quick Look
13
13
 
@@ -17,14 +17,14 @@ and **MkDocs Material**.
17
17
 
18
18
  ## Command surface
19
19
 
20
- | Command | Purpose |
21
- | ------------------------- | ----------------------------------------------------------------------------- |
22
- | `oat docs init` | Scaffold a new docs app (Fumadocs or MkDocs). |
23
- | `oat docs migrate` | Convert MkDocs admonitions to GFM callouts and inject frontmatter. |
24
- | `oat docs generate-index` | Generate a Fumadocs app-root docs index manifest from the Markdown file tree. |
25
- | `oat docs nav sync` | Regenerate `mkdocs.yml` nav or Fumadocs `meta.json` from `index.md` maps. |
26
- | `oat docs analyze` | CLI entrypoint that points users to the `oat-docs-analyze` skill. |
27
- | `oat docs apply` | CLI entrypoint that points users to the `oat-docs-apply` skill. |
20
+ | Command | Purpose |
21
+ | ------------------------- | ------------------------------------------------------------------------- |
22
+ | `oat docs init` | Set up Markdown files or a docs app; additively adopt Markdown. |
23
+ | `oat docs migrate` | Convert MkDocs admonitions to GFM callouts and inject frontmatter. |
24
+ | `oat docs generate-index` | Generate a manifest from Markdown files, outside authored content. |
25
+ | `oat docs nav sync` | Regenerate `mkdocs.yml` nav or Fumadocs `meta.json` from `index.md` maps. |
26
+ | `oat docs analyze` | CLI entrypoint that points users to the `oat-docs-analyze` skill. |
27
+ | `oat docs apply` | CLI entrypoint that points users to the `oat-docs-apply` skill. |
28
28
 
29
29
  ## Which Generation Command To Run
30
30
 
@@ -33,24 +33,59 @@ Use the framework-specific generated-artifact command:
33
33
  - Fumadocs apps run `fumadocs-mdx` and `oat docs generate-index`. In this repo, `predev` and `prebuild` regenerate `apps/oat-docs/index.md` from `apps/oat-docs/docs`. Run `oat docs nav sync` yourself after structural changes to rewrite the committed `meta.json` sidebar files from authored directory `index.md` `## Contents` sections; the hooks never write them. `prebuild` runs `oat docs nav sync --check`, so a build fails when those files are stale or a page is unlisted.
34
34
  - MkDocs apps use `oat docs nav sync` to regenerate the `nav:` block in `mkdocs.yml` from authored directory `index.md` `## Contents` sections.
35
35
 
36
- Both frameworks keep authored `## Contents` sections as the source of local discovery. The generated artifact differs by framework.
36
+ Markdown needs no generation command or site build; optional inventories require
37
+ explicit external output and retain the authored config index. Both frameworks keep authored `## Contents` sections as the source of local discovery. The generated artifact differs by framework.
37
38
 
38
39
  ## `oat docs init`
39
40
 
40
- Use `oat docs init` to scaffold a docs app that follows the OAT docs contract.
41
+ Use `oat docs init` to bootstrap Markdown documentation or scaffold a framework app.
41
42
 
42
43
  > **Consider the `oat-docs-bootstrap` skill instead.** The skill wraps `oat docs init` with preflight detection, richer input gathering (site name distinct from package name), capability-gated post-patches that close open CLI gaps (site-title metadata, Turbopack root, template-content fixes, docs-app `AGENTS.md` bridge, `## Contents` link extensions, `contributing.md` three-surfaces cleanup), build verification, config inspection, and a seven-section educational walkthrough. See [Add Docs to a Repo §3a](add-docs-to-a-repo.md#3a-preferred-the-oat-docs-bootstrap-skill-guided) for the full flow. The CLI documented here remains the authoritative surface for flags and is the right choice when you need a deterministic, non-interactive scaffold (CI, automation).
43
44
 
44
45
  Key behavior:
45
46
 
46
- - prompts for framework choice (Fumadocs or MkDocs) in interactive mode
47
+ - prompts for Markdown, Fumadocs, or MkDocs in interactive mode
47
48
  - detects monorepo vs single-package repo shape
48
- - defaults to `apps/<app-name>` for monorepos
49
- - defaults to `<app-name>/` at repo root for single-package repos
49
+ - Markdown defaults to literal `docs` in every repo shape; framework apps default
50
+ to `apps/<app-name>` for monorepos
51
+ - framework apps default to `<app-name>/` at repo root for single-package repos
50
52
  - sets `documentation.tooling`, `documentation.root`, and `documentation.index` in `.oat/config.json`
51
- - when the repo root exposes a compatible Turbo `scripts.build`, patches it to exclude the new docs app from the default root build and adds a root-level `build:docs` script
53
+ - for framework apps, when the repo root exposes a compatible Turbo `scripts.build`, patches it to exclude the new docs app from the default root build and adds a root-level `build:docs` script
52
54
  - prints a unified diff before writing the root `package.json` change and returns a manual snippet when the patch is skipped because the build script is missing, non-Turbo, or ambiguous
53
55
 
56
+ Markdown setup:
57
+
58
+ - Creates only authored root `index.md` and `contributing.md` baseline pages,
59
+ with metadata, context and real relative `.md` Contents links.
60
+ - Records literal root/tooling/authored index and managed root guidance; no
61
+ docs-root AGENTS, app package, dependencies, package/Turbo patch or site build.
62
+ - Populated targets require `--adopt` even with `--yes`. Adoption only adds missing
63
+ baseline files; existing malformed indexes and local instructions are preserved
64
+ with audit advice. It does not claim full OAT conformity.
65
+ - When the root `index.md` is missing, its initial Contents map includes existing
66
+ sibling pages and usable immediate child indexes. Readable child-index symlinks
67
+ resolving inside the repository are supported. Unusable child indexes are
68
+ preserved and omitted from the map with audit advice. An existing root index
69
+ is preserved rather than rebuilt.
70
+ - During this discovery, directories containing only `AGENTS.md` or `CLAUDE.md`
71
+ do not trigger missing-index advice. If permissions prevent inspection of a
72
+ nested directory, bootstrap preserves it, reports that it was not inspected,
73
+ and continues checking readable siblings. Required root-baseline and target
74
+ safety checks remain strict; use analyze/apply for approved content repairs.
75
+ - Unsafe roots and incompatible documentation config fail before writes.
76
+ Explicit framework selection retains its existing replacement behavior over
77
+ Markdown config, without migrating or deleting old Markdown content.
78
+ - `--dry-run` reports planned changes without writes. Manual-required/blocked
79
+ guidance yields `partial`/exit `1`; a real partial may already have written
80
+ files/config. Converged adoption is `ok`/exit `0` with no changes.
81
+ - Lint/format defaults are `none`; selecting existing tools never installs them.
82
+
83
+ ```bash
84
+ oat docs init --framework markdown --site-name "Project Docs" --yes
85
+ oat docs init --framework markdown --target-dir handbook --adopt --dry-run --yes
86
+ oat docs init --framework markdown --target-dir handbook --adopt --yes
87
+ ```
88
+
54
89
  Fumadocs scaffold:
55
90
 
56
91
  - thin Next.js app importing from `@open-agent-toolkit/docs-config`, `@open-agent-toolkit/docs-theme`, `@open-agent-toolkit/docs-transforms`
@@ -67,11 +102,14 @@ Supported flags:
67
102
 
68
103
  - `--app-name <name>`
69
104
  - `--target-dir <path>`
70
- - `--framework <fumadocs|mkdocs>` (default: `fumadocs` in non-interactive mode)
71
- - `--description <text>` (site description, optional)
105
+ - `--framework <markdown|fumadocs|mkdocs>` (default: `fumadocs` in non-interactive mode)
106
+ - `--site-name <name>` (site display title or Markdown documentation title)
107
+ - `--description <text>` (documentation description, optional)
72
108
  - `--lint <none|markdownlint-cli2>`
73
109
  - `--format <oxfmt|none>`
74
- - `--no-root-patch`
110
+ - `--adopt` (Markdown only; add missing baseline files, preserve existing bytes)
111
+ - `--dry-run` (Markdown only; nonmutating files/config/guidance preview)
112
+ - `--no-root-patch` (inapplicable to Markdown, as is `--app-name`)
75
113
  - `--yes`
76
114
 
77
115
  Examples:
@@ -128,12 +166,12 @@ Key behavior:
128
166
  - recursively walks the docs directory
129
167
  - extracts page titles from frontmatter (falls back to first `# heading`, then filename title-case)
130
168
  - includes descriptions from frontmatter when present
131
- - resolves omitted paths from `.oat/config.json` rather than the current directory: `--docs-dir` defaults to `<documentation.root>/docs` when that directory exists and to `<documentation.root>` otherwise, and `--output` defaults to the app-root manifest `<documentation.root>/index.md`
169
+ - resolves omitted paths from `.oat/config.json` rather than the current directory: configured Markdown uses the literal `documentation.root` for `--docs-dir` and requires explicit `--output`; other tooling defaults to `<documentation.root>/docs` when present or `<documentation.root>` otherwise, with app-root manifest output `<documentation.root>/index.md`
132
170
  - treats explicitly supplied `--docs-dir` / `--output` paths as overrides resolved from the current directory
133
171
  - fails with exit code `2` before generating or writing anything when an omitted path has no non-empty `documentation.root` to resolve against, or when the configured root is not a directory
134
- - refuses unsafe output targets with exit code `1` before generation, for derived and explicit paths alike, comparing symlink-resolved paths: inside the docs directory it indexes, equal to `documentation.config`, or ending in `.yml` / `.yaml` in any case. A derived output whose existing file lacks the `AUTOGENERATED` header is refused too; naming that path with `--output` overwrites it explicitly. A refused target is an actionable flag error (`1`); unusable path configuration is a separate condition and exits `2`, so scripts can branch on the two
172
+ - refuses unsafe output targets with exit code `1` before generation, for derived and explicit paths alike, comparing symlink-resolved paths: inside the docs directory it indexes, equal to `documentation.config`, or ending in `.yml` / `.yaml` in any case. A derived output whose existing file lacks the `AUTOGENERATED` header is refused too; naming that path with `--output` overwrites it explicitly only when no other output guard applies. Configured Markdown additionally protects its full canonical content root and authored `documentation.index`, independently of selected source; narrowed sources and symlink aliases cannot bypass that guard. A refused target is an actionable flag error (`1`); unusable path configuration is a separate condition and exits `2`, so scripts can branch on the two
135
173
  - refuses a symlink chain that exceeds its own 32-hop cap, naming the path you supplied or the CLI derived rather than an intermediate link, and addressing the flag that owns it: an unusable **output** chain names `--output` and exits `1`; an unusable **docs directory** chain names `--docs-dir` and, when the directory was derived from `documentation.root` rather than passed explicitly, also names the `oat config set documentation.root <path>` repair and exits `2` as unusable path configuration. That cap governs the dangling links the command walks itself; a chain the operating system refuses first surfaces as its own `ELOOP` error with exit `1`, which is what a too-deep chain reports on a platform whose own limit is 32 or lower
136
- - writes configuration only for the Fumadocs manifest transition — recording the manifest it just wrote inside `documentation.root` in `documentation.index`, when `documentation.tooling` is `fumadocs` or the config declares neither `tooling` nor `config`. MkDocs configurations are never written, and `documentation.root` and `documentation.config` are never modified
174
+ - writes configuration only for the Fumadocs manifest transition — recording the manifest it just wrote inside `documentation.root` in `documentation.index`, when `documentation.tooling` is `fumadocs` or the config declares neither `tooling` nor `config`. Markdown and MkDocs configurations are never written, and `documentation.root` and `documentation.config` are never modified
137
175
  - prepends an `AUTOGENERATED` warning comment to the output and rewrites the file on every run; do not hand-edit the generated `index.md`
138
176
  - should be freshness-checked against authored `docs/**/index.md` `## Contents` maps before treating it as navigation evidence
139
177
  - sorting: `index.md` first, then directories before files, then lexical
@@ -143,8 +181,8 @@ Key behavior:
143
181
 
144
182
  Supported flags:
145
183
 
146
- - `--docs-dir <path>` (default: `<documentation.root>/docs`, falling back to `<documentation.root>`)
147
- - `--output <path>` (default: `<documentation.root>/index.md`)
184
+ - `--docs-dir <path>` (Markdown: literal configured root; others: `<root>/docs`, falling back to `<root>`)
185
+ - `--output <path>` (required external output for configured Markdown; otherwise defaults to `<root>/index.md`)
148
186
  - `--exclude <glob>` (repeatable; additive to `documentation.excludes`)
149
187
 
150
188
  ### Exclusion patterns
@@ -165,10 +203,13 @@ A trailing `/` restricts a pattern to directories and never matches a file; with
165
203
  Example:
166
204
 
167
205
  ```bash
168
- # Resolve both paths from .oat/config.json
206
+ # Framework defaults from .oat/config.json
169
207
  oat docs generate-index
170
208
 
171
- # Portable explicit form, resolved from the current directory
209
+ # Optional Markdown manifest: output outside the entire configured content root
210
+ oat docs generate-index --docs-dir handbook --output .oat/docs-manifest.md
211
+
212
+ # Portable explicit framework form, resolved from the current directory
172
213
  oat docs generate-index --docs-dir apps/oat-docs/docs --output apps/oat-docs/index.md
173
214
 
174
215
  # Persist the repository's own exclusions, then add a one-off
@@ -176,7 +217,7 @@ oat config set documentation.excludes "**/CLAUDE.md,**/AGENTS.md"
176
217
  oat docs generate-index --exclude 'drafts/'
177
218
  ```
178
219
 
179
- See [Documentation path resolution](../reference/oat-directory-structure.md#documentation-path-resolution) for the app-root meaning of `documentation.root` and the legacy source-root compatibility rule.
220
+ See [Documentation path resolution](../reference/oat-directory-structure.md#documentation-path-resolution) for Markdown literal roots, framework app roots, and legacy source-root compatibility.
180
221
 
181
222
  The Fumadocs scaffold runs this automatically via `predev`/`prebuild` npm
182
223
  script hooks.
@@ -188,6 +229,9 @@ Use nav sync after adding, removing, renaming, or reordering docs pages.
188
229
  The command reads only the reserved `## Contents` section from each directory
189
230
  `index.md`. It detects the framework from the app directory:
190
231
 
232
+ Plain Markdown needs file/link checks and authored Contents maintenance, without
233
+ site nav generation. Framework apps generate navigation as follows:
234
+
191
235
  - **MkDocs** (`mkdocs.yml`): regenerates the `nav:` block in `mkdocs.yml`.
192
236
  - **Fumadocs** (`source.config.ts`): writes one `meta.json` per docs directory
193
237
  that has an `index.md`. `pages` follows the `## Contents` order with no
@@ -1,18 +1,18 @@
1
1
  ---
2
2
  title: Docs Tooling
3
- description: Standalone adoption lane for docs app setup, docs commands, and docs maintenance workflows.
3
+ description: Standalone adoption lane for Markdown and docs app setup, docs commands, and docs maintenance workflows.
4
4
  ---
5
5
 
6
6
  # Docs Tooling
7
7
 
8
8
  Docs Tooling is the OAT lane for setting up, maintaining, and restructuring a documentation surface with OAT.
9
9
 
10
- Use this section when you are adopting the docs app workflow in a repo, maintaining generated navigation, or using the analyze/apply docs workflows. OAT supports both Fumadocs and MkDocs: the site framework changes the surrounding app setup and generated artifacts, but the underlying documentation contract stays centered on `index.md` and `## Contents`.
10
+ Use this section when you are adopting the docs app workflow in a repo, maintaining generated navigation, or using the analyze/apply docs workflows. OAT supports Markdown, Fumadocs, and MkDocs. Plain Markdown keeps authored files without a site build; the site framework changes the surrounding app setup and generated artifacts, but the underlying documentation contract stays centered on `index.md` and `## Contents`.
11
11
 
12
12
  ## Contents
13
13
 
14
- - [Add Docs to a New Repo](add-docs-to-a-repo.md) - Bootstrap a docs app and adopt the docs workflow in a repo.
15
- - [Docs App Commands](commands.md) - Docs CLI surface for init, migration, index generation, and nav sync.
14
+ - [Add or Adopt Docs in a Repo](add-docs-to-a-repo.md) - Set up Markdown or a docs app and safely adopt existing Markdown.
15
+ - [Documentation Commands](commands.md) - Docs CLI surface for init, migration, index generation, and nav sync.
16
16
  - [Docs Workflows](workflows.md) - How the docs CLI helpers pair with analyze/apply workflows.
17
17
 
18
18
  ## What This Section Is
@@ -21,7 +21,7 @@ This section explains how OAT supports docs surfaces, how the index contract wor
21
21
 
22
22
  ## Who It's For
23
23
 
24
- - Repos adding a docs app for the first time
24
+ - Repos setting up or adopting Markdown documentation or a docs app
25
25
  - Teams maintaining directory indexes and generated navigation
26
26
  - Users who want a controlled analyze/apply flow for docs changes
27
27
 
@@ -40,7 +40,7 @@ This section explains how OAT supports docs surfaces, how the index contract wor
40
40
 
41
41
  ## Go Deeper
42
42
 
43
- - [Add Docs to a Repo](add-docs-to-a-repo.md) - Bootstrap a docs app and adopt the docs workflow in a repo.
43
+ - [Add Docs to a Repo](add-docs-to-a-repo.md) - Set up Markdown or a docs app and safely adopt existing Markdown.
44
44
  - [Commands](commands.md) - Docs CLI surface for init, migration, index generation, and nav sync.
45
45
  - [Workflows](workflows.md) - How the docs CLI helpers pair with analyze/apply workflows.
46
46
  - [Docs Index Contract](../reference/docs-index-contract.md) - Framework-neutral `index.md` rules plus Fumadocs and MkDocs generation notes.
@@ -15,7 +15,7 @@ Install the workflow skills with `oat tools install docs` (preferred) or
15
15
 
16
16
  ### CLI helpers
17
17
 
18
- - `oat docs init` scaffolds a docs app (Fumadocs or MkDocs)
18
+ - `oat docs init` bootstraps/adopts Markdown files or scaffolds a docs app (Fumadocs or MkDocs)
19
19
  - `oat docs migrate` converts MkDocs admonitions to GFM callouts and injects frontmatter
20
20
  - `oat docs generate-index` generates a Fumadocs app-root docs index manifest from the Markdown file tree
21
21
  - `oat docs nav sync` regenerates MkDocs `mkdocs.yml` nav, or strict Fumadocs `meta.json` files, from `index.md` `## Contents` sections
@@ -26,13 +26,14 @@ Install the workflow skills with `oat tools install docs` (preferred) or
26
26
  - `authoring-docs` is the provider-agnostic baseline for evidence-first
27
27
  technical documentation: page types, information architecture, category
28
28
  guidance, templates, and review rubrics
29
- - `oat-docs-authoring` layers the OAT/Fumadocs docs-app contract on top of
29
+ - `oat-docs-authoring` layers the OAT Markdown/Fumadocs authored-source contract on top of
30
30
  `authoring-docs` for targeted authoring, restructuring, link repair, and
31
- local navigation maintenance inside an existing OAT docs app
32
- - `oat-docs-bootstrap` is the guided onramp for adding a docs app to a repo —
31
+ local navigation maintenance inside an existing OAT documentation surface
32
+ - `oat-docs-bootstrap` is the guided onramp for Markdown setup/adoption or adding a docs app —
33
33
  wraps `oat docs init` with preflight detection, richer input gathering (site
34
34
  name distinct from package name), labeled post-patches for open CLI gaps,
35
- build verification, config inspection, and an educational walkthrough
35
+ file-level verification for Markdown or framework build verification, config
36
+ inspection, and an educational walkthrough
36
37
  - `oat-docs-analyze` evaluates a docs surface for structure, drift, coverage,
37
38
  contributor guidance, and docs-app contract issues, then runs the shared
38
39
  auto artifact-review loop to verify the generated analysis artifact's
@@ -60,18 +61,34 @@ skills.
60
61
 
61
62
  ## Typical flow
62
63
 
63
- 1. Bootstrap a docs app with `oat-docs-bootstrap` (preferred — guided, includes post-scaffold patches and walkthrough) or `oat docs init` directly (CLI-only / non-interactive workflows)
64
+ 1. Bootstrap or explicitly adopt a documentation surface with `oat-docs-bootstrap` (preferred — guided, includes post-scaffold patches and walkthrough) or `oat docs init` directly (CLI-only / non-interactive workflows)
64
65
  2. (Optional) If migrating from MkDocs, handle that as a separate migration workstream; `oat docs migrate --docs-dir docs --config mkdocs.yml --apply` is only the syntax/frontmatter helper
65
- 3. Use `oat-docs-authoring` for targeted OAT/Fumadocs authoring work, with `authoring-docs` as the universal documentation-quality baseline
66
- 4. Author docs so every directory has an `index.md` with a `## Contents` section
66
+ 3. Use `oat-docs-authoring` for targeted OAT Markdown/Fumadocs authoring work, with `authoring-docs` as the universal documentation-quality baseline
67
+ 4. Keep authored context and title/description metadata, with an `index.md` and useful `## Contents` in each non-excluded Markdown-bearing directory; preserve asset-only exceptions and local instructions
67
68
  5. Keep local `## Contents` sections current
68
- 6. Refresh generated artifacts:
69
+ 6. Verify files/links and refresh declared derived artifacts:
70
+ - **Markdown:** use the configured root literally, including nested `docs`; authored indexes are editable. No app install/site build/nav sync is required. Optional manifests need explicit external output and never replace the authored config index.
69
71
  - **MkDocs:** `oat docs nav sync`
70
72
  - **Fumadocs:** `oat docs nav sync` for the committed `meta.json` sidebar files (it reports pages no `## Contents` map lists), and `oat docs generate-index` for the root manifest (runs automatically via `predev`/`prebuild` hooks)
71
73
  7. Run `oat-docs-analyze`; by default it verifies the generated analysis artifact
72
74
  through `workflow.autoArtifactReview.analysis`
73
75
  8. Review the artifact and run `oat-docs-apply`
74
76
 
77
+ ## Existing Markdown and partial setup
78
+
79
+ Bootstrap checks declared config before discovery and framework evidence before
80
+ plain-tree candidates. A populated plain tree is offered adopt/audit; `--yes`
81
+ alone does not authorize adoption. `--adopt` preserves existing bytes and adds
82
+ missing baseline files only. Config/guidance success does not prove complete
83
+ content conformity: analyze recommends missing context, metadata, Contents or
84
+ child indexes, and apply performs only approved repairs without replacing useful
85
+ context or local instructions.
86
+
87
+ Use `--dry-run` for a nonmutating Markdown preview. Guidance conflicts may yield
88
+ `partial`/exit `1`, with planned files/config; a real partial reports any already
89
+ created files/config separately. Repeated converged adoption returns no changes.
90
+ See [Commands](commands.md#oat-docs-init) for examples and exit behavior.
91
+
75
92
  ## Progressive disclosure
76
93
 
77
94
  The docs workflow expects local indexes to guide discovery without forcing agents
@@ -236,7 +236,7 @@ Key behavior:
236
236
  - Adopts Claude-only stray files by writing canonical `AGENTS.md` content first, then regenerating `CLAUDE.md` (shim strategies) or removing it (`none`)
237
237
  - Under a shim strategy, skips mismatched files unless `--force` is provided
238
238
  - Skips unreadable canonical or Claude-only sources and reports manual-repair guidance instead of forcing recovery
239
- - Skips the documentation content tree (`<documentation.root>/docs` when that is a directory, otherwise `documentation.root`) plus any `instructions.claude.excludes` paths, so authored pages never receive pointers; app-level instruction files such as `apps/oat-docs/AGENTS.md` are still synced
239
+ - Skips the documentation content tree (literal `documentation.root` for tooling `markdown`, including nested `docs`; otherwise `<documentation.root>/docs` when that is a directory, falling back to `documentation.root`) plus any `instructions.claude.excludes` paths, so authored pages never receive pointers; app-level instruction files such as `apps/oat-docs/AGENTS.md` are still synced
240
240
  - Never deletes an existing `CLAUDE.md` inside an excluded tree
241
241
  - Under `none`, warns about every `CLAUDE.md` that remains after sync, including inside excluded trees, because any one of them makes Claude Code ignore every `AGENTS.md`
242
242
  - Uses pointer content `@AGENTS.md\n`, file symlinks, or hard copies depending on the selected strategy
@@ -41,22 +41,29 @@ to fix.
41
41
 
42
42
  The content root is derived from `documentation.root` in `.oat/config.json`:
43
43
 
44
- - `<documentation.root>/docs` when that path is a directory;
45
- - otherwise `documentation.root` itself.
44
+ - for tooling `markdown`, the literal configured `documentation.root`, even
45
+ when it contains a child directory named `docs`;
46
+ - for other or undeclared tooling, `<documentation.root>/docs` when that path is
47
+ a directory, otherwise `documentation.root` itself.
46
48
 
47
49
  This is the same derivation `oat docs generate-index` uses to pick its default
48
50
  docs directory, so the excluded tree and the indexed tree agree by
49
51
  construction. (`oat docs generate-index --docs-dir` overrides the index side
50
52
  only; it does not change what instruction sync excludes.)
51
53
 
52
- **App-level instruction files are still synced.** `documentation.root`
53
- canonically names the docs _app_ root, and a file like
54
+ **Framework app-level instruction files are still synced.** For framework tooling, `documentation.root`
55
+ names the docs _app_ root, and a file like
54
56
  `apps/oat-docs/AGENTS.md` is instructions for working on the docs app rather
55
57
  than a documentation page. When the app root has a `docs` child, only that
56
58
  child is skipped, and the app root is still synced (under a shim strategy it
57
59
  keeps receiving its `CLAUDE.md` pointer). Opt the app root out explicitly if
58
60
  you do not want it synced.
59
61
 
62
+ For configured Markdown, the entire content root remains excluded, including
63
+ existing local AGENTS files and parent pages outside a nested `docs` subsection.
64
+ Bootstrap preserves local guidance and creates no docs-root AGENTS. Pointer sync
65
+ never replaces authored content or those local instruction files.
66
+
60
67
  Add further paths with `instructions.claude.excludes`, a list of
61
68
  repository-relative directories. Set it with
62
69
  `oat config set instructions.claude.excludes "vendor,third_party/docs"`
@@ -16,7 +16,7 @@ The CLI is also a standalone value path. You can use `oat init`, `oat sync`, `oa
16
16
  - [Config and Local State](../cli-utilities/config-and-local-state.md) - Config, backlog, local paths, diagnostics, and related utility commands.
17
17
  - [Remote Project Management](../cli-utilities/remote-project-management.md) - Explicit remote bindings, policy, host handoffs, and recovery.
18
18
  - [Workflow Gates](../cli-utilities/workflow-gates.md) - Per-skill final commands, review gates, and cross-runtime prompt dispatch.
19
- - [Docs Tooling Commands](../docs-tooling/commands.md) - Docs app scaffolding, migration, index generation, and nav sync.
19
+ - [Docs Tooling Commands](../docs-tooling/commands.md) - Markdown setup/adoption, framework scaffolding, manifests, and nav sync.
20
20
  - [Provider Sync](../provider-sync/index.md) - Sync behavior, provider capabilities, config, and drift management.
21
21
  - [Agentic Workflows](../workflows/index.md) - Tracked project execution, skills, ideas, and workflow routing.
22
22
  - [Workflow & Projects](../workflows/projects/index.md) - Project lifecycle, artifacts, reviews, PR flow, and state-machine docs.
@@ -50,7 +50,7 @@ The first practical expansion path is to keep improving the existing owners: [Do
50
50
  | `oat config ...` / `oat instructions ...` | Config discovery, source-aware config dumps, supported mutations, and instruction-integrity helpers. | [Config and Local State](../cli-utilities/config-and-local-state.md) |
51
51
  | `oat gate ...` | Per-skill final gate config, review-specific gate execution, exec-target registry writes, and cross-runtime prompt dispatch. | [Workflow Gates](../cli-utilities/workflow-gates.md) |
52
52
  | `oat state ...` / `oat index ...` / `internal` | Repo dashboard refresh, repo indexing, validation helpers, and diagnostics. | [Config and Local State](../cli-utilities/config-and-local-state.md) |
53
- | `oat docs ...` | Docs app bootstrap, migration, index generation, nav sync, and docs workflow entrypoints. | [Docs Tooling Commands](../docs-tooling/commands.md) |
53
+ | `oat docs ...` | Markdown bootstrap/adoption, framework setup, external manifests, nav sync, and docs workflow entrypoints. | [Docs Tooling Commands](../docs-tooling/commands.md) |
54
54
  | `oat status` / `oat sync` / `oat providers ...` | Provider sync, drift inspection, provider configuration, and adoption behavior. | [Provider Sync](../provider-sync/index.md) |
55
55
  | `oat project ...` / `oat cleanup ...` | Project scaffolding, active-project status inspection, tracked-project listing, plan validation, archive creation, and project/artifact cleanup commands. | [Workflow & Projects](../workflows/projects/index.md) |
56
56
  | `oat template resolve` | Resolve a lifecycle template in repository, user, then bundle order and optionally copy it into place. | [File Locations](file-locations.md) |