@open-agent-toolkit/cli 0.3.26 → 0.3.28

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 (104) hide show
  1. package/README.md +12 -0
  2. package/assets/bundle-metadata.json +1 -1
  3. package/assets/docs/contributing/documentation.md +48 -6
  4. package/assets/docs/contributing/markdown-features.md +14 -2
  5. package/assets/docs/docs-tooling/add-docs-to-a-repo.md +22 -9
  6. package/assets/docs/docs-tooling/check.md +154 -0
  7. package/assets/docs/docs-tooling/commands.md +15 -10
  8. package/assets/docs/docs-tooling/index.md +1 -0
  9. package/assets/docs/docs-tooling/meta.json +7 -1
  10. package/assets/docs/docs-tooling/workflows.md +18 -10
  11. package/assets/docs/getting-started/tool-packs.md +5 -3
  12. package/assets/docs/reference/cli-reference.md +2 -0
  13. package/assets/docs/reference/configuration.md +1 -0
  14. package/assets/docs/skills/index.md +8 -8
  15. package/assets/public-package-versions.json +4 -4
  16. package/assets/skills/oat-docs-analyze/SKILL.md +14 -3
  17. package/assets/skills/oat-docs-analyze/references/legacy-scaffold-checks.md +4 -0
  18. package/assets/skills/oat-docs-authoring/SKILL.md +1 -1
  19. package/assets/skills/oat-docs-authoring/references/validation.md +4 -0
  20. package/assets/skills/oat-docs-bootstrap/SKILL.md +92 -61
  21. package/assets/skills/oat-docs-bootstrap/references/pr-ci.md +89 -0
  22. package/assets/templates/docs-app-fuma/AGENTS.md +57 -0
  23. package/assets/templates/docs-app-fuma/app/[[...slug]]/page.tsx +7 -3
  24. package/assets/templates/docs-app-fuma/app/llms/[...slug]/route.ts +15 -0
  25. package/assets/templates/docs-app-fuma/app/llms-full.txt/route.ts +7 -0
  26. package/assets/templates/docs-app-fuma/app/llms.txt/route.ts +7 -0
  27. package/assets/templates/docs-app-fuma/docs/contributing/docs-toolchain.md +85 -0
  28. package/assets/templates/docs-app-fuma/docs/contributing/index.md +13 -0
  29. package/assets/templates/docs-app-fuma/docs/contributing.md +83 -41
  30. package/assets/templates/docs-app-fuma/docs/getting-started.md +3 -33
  31. package/assets/templates/docs-app-fuma/docs/index.md +3 -3
  32. package/assets/templates/docs-app-fuma/gitignore.template +12 -0
  33. package/assets/templates/docs-app-fuma/lib/source.ts +5 -0
  34. package/assets/templates/docs-app-fuma/package.json.template +2 -1
  35. package/assets/templates/docs-app-fuma/pnpm-workspace.yaml +5 -0
  36. package/assets/templates/docs-app-mkdocs/AGENTS.md +48 -0
  37. package/assets/templates/docs-app-mkdocs/docs/contributing/docs-toolchain.md +46 -0
  38. package/assets/templates/docs-app-mkdocs/docs/contributing/index.md +13 -0
  39. package/assets/templates/docs-app-mkdocs/docs/contributing.md +111 -21
  40. package/assets/templates/docs-app-mkdocs/docs/getting-started.md +7 -25
  41. package/assets/templates/docs-app-mkdocs/docs/index.md +7 -2
  42. package/assets/templates/docs-app-mkdocs/gitignore.template +8 -0
  43. package/assets/templates/docs-app-mkdocs/mkdocs.yml +1 -0
  44. package/assets/templates/docs-app-mkdocs/package.json.template +3 -2
  45. package/dist/commands/config/index.d.ts.map +1 -1
  46. package/dist/commands/config/index.js +35 -3
  47. package/dist/commands/docs/check/check.d.ts +3 -0
  48. package/dist/commands/docs/check/check.d.ts.map +1 -0
  49. package/dist/commands/docs/check/check.js +48 -0
  50. package/dist/commands/docs/check/check.types.d.ts +17 -0
  51. package/dist/commands/docs/check/check.types.d.ts.map +1 -0
  52. package/dist/commands/docs/check/check.types.js +1 -0
  53. package/dist/commands/docs/check/checker.d.ts +8 -0
  54. package/dist/commands/docs/check/checker.d.ts.map +1 -0
  55. package/dist/commands/docs/check/checker.js +82 -0
  56. package/dist/commands/docs/check/commands.d.ts +5 -0
  57. package/dist/commands/docs/check/commands.d.ts.map +1 -0
  58. package/dist/commands/docs/check/commands.js +232 -0
  59. package/dist/commands/docs/check/diagrams.d.ts +5 -0
  60. package/dist/commands/docs/check/diagrams.d.ts.map +1 -0
  61. package/dist/commands/docs/check/diagrams.js +197 -0
  62. package/dist/commands/docs/check/files.d.ts +21 -0
  63. package/dist/commands/docs/check/files.d.ts.map +1 -0
  64. package/dist/commands/docs/check/files.js +121 -0
  65. package/dist/commands/docs/check/markdown.d.ts +60 -0
  66. package/dist/commands/docs/check/markdown.d.ts.map +1 -0
  67. package/dist/commands/docs/check/markdown.js +125 -0
  68. package/dist/commands/docs/check/mermaid-runtime.d.ts +3 -0
  69. package/dist/commands/docs/check/mermaid-runtime.d.ts.map +1 -0
  70. package/dist/commands/docs/check/mermaid-runtime.js +57 -0
  71. package/dist/commands/docs/check/navigation.d.ts +4 -0
  72. package/dist/commands/docs/check/navigation.d.ts.map +1 -0
  73. package/dist/commands/docs/check/navigation.js +104 -0
  74. package/dist/commands/docs/check/reader-rules.d.ts +6 -0
  75. package/dist/commands/docs/check/reader-rules.d.ts.map +1 -0
  76. package/dist/commands/docs/check/reader-rules.js +214 -0
  77. package/dist/commands/docs/index.d.ts.map +1 -1
  78. package/dist/commands/docs/index.js +2 -0
  79. package/dist/commands/docs/init/docs-commands.d.ts +1 -0
  80. package/dist/commands/docs/init/docs-commands.d.ts.map +1 -1
  81. package/dist/commands/docs/init/docs-commands.js +8 -3
  82. package/dist/commands/docs/init/index.d.ts +1 -0
  83. package/dist/commands/docs/init/index.d.ts.map +1 -1
  84. package/dist/commands/docs/init/index.js +8 -0
  85. package/dist/commands/docs/init/scaffold.d.ts +1 -0
  86. package/dist/commands/docs/init/scaffold.d.ts.map +1 -1
  87. package/dist/commands/docs/init/scaffold.js +61 -13
  88. package/dist/commands/docs/nav/contents.d.ts +4 -0
  89. package/dist/commands/docs/nav/contents.d.ts.map +1 -1
  90. package/dist/commands/docs/nav/contents.js +10 -0
  91. package/dist/commands/docs/nav/fumadocs.d.ts.map +1 -1
  92. package/dist/commands/docs/nav/fumadocs.js +32 -10
  93. package/dist/config/documentation-check.d.ts +38 -0
  94. package/dist/config/documentation-check.d.ts.map +1 -0
  95. package/dist/config/documentation-check.js +132 -0
  96. package/dist/config/oat-config.d.ts +2 -0
  97. package/dist/config/oat-config.d.ts.map +1 -1
  98. package/dist/config/oat-config.js +4 -0
  99. package/dist/config/resolve.d.ts.map +1 -1
  100. package/dist/config/resolve.js +1 -0
  101. package/dist/release/public-package-contract.d.ts.map +1 -1
  102. package/dist/release/public-package-contract.js +3 -0
  103. package/package.json +11 -2
  104. package/assets/skills/oat-docs-bootstrap/assets/AGENTS.md.template +0 -64
@@ -1,6 +1,6 @@
1
1
  {
2
- "cli": "0.3.26",
3
- "docs-config": "0.3.26",
4
- "docs-theme": "0.3.26",
5
- "docs-transforms": "0.3.26"
2
+ "cli": "0.3.28",
3
+ "docs-config": "0.3.28",
4
+ "docs-theme": "0.3.28",
5
+ "docs-transforms": "0.3.28"
6
6
  }
@@ -4,9 +4,9 @@ description: Run when you need to evaluate documentation structure, navigation,
4
4
  argument-hint: '[target] [--ia] [--ia-guidance <path|url>]'
5
5
  disable-model-invocation: true
6
6
  user-invocable: true
7
- allowed-tools: Read, Write, Bash(git:*), Bash(oat config:*), Bash(oat docs nav sync --check:*), Bash(pnpm:*), Bash(bash:*), Bash(jq:*), Bash(node:*), Bash(mkdir:*), Bash(date:*), Bash(echo:*), Bash(cd:*), Bash(pwd:*), Glob, Grep, AskUserQuestion, Task
7
+ allowed-tools: Read, Write, Bash(git:*), Bash(oat config:*), Bash(oat docs nav sync --check:*), Bash(oat docs check:*), Bash(pnpm:*), Bash(bash:*), Bash(jq:*), Bash(node:*), Bash(mkdir:*), Bash(date:*), Bash(echo:*), Bash(cd:*), Bash(pwd:*), Glob, Grep, AskUserQuestion, Task
8
8
  metadata:
9
- version: '1.7.1'
9
+ version: '1.7.3'
10
10
  ---
11
11
 
12
12
  # Docs Analysis
@@ -196,7 +196,7 @@ Capture the evidence sources that will justify later findings and recommendation
196
196
  - existing `index.md` trees and repeated directory patterns
197
197
  - exact missing or stale paths, commands, and page references
198
198
 
199
- For framework apps, also read [Legacy scaffold checks](references/legacy-scaffold-checks.md). Apply those checks to the actual installed app, cite the observed file and source contract, and report discrepancies in Findings and Recommendations. These are read-only checks, not bootstrap post-patches. Do not change app-shell configuration during analysis or assume docs-apply can edit it; identify the manual upgrade needed when outside apply's current scope.
199
+ For framework apps, also read [Legacy scaffold checks](references/legacy-scaffold-checks.md). Apply those checks to the actual installed app, cite the observed file and source contract, and report discrepancies in Findings and Recommendations. Include missing app-root AGENTS capability and missing page-specific Next metadata, accepting equivalent valid customized arrangements. These are read-only checks, not bootstrap scaffold repairs. Do not change app-shell configuration during analysis or assume docs-apply can edit it; identify the manual upgrade needed when outside apply's current scope.
200
200
 
201
201
  Do **not** infer docs structure conventions from a tiny sample of pages when the broader
202
202
  tree or config disagrees.
@@ -457,6 +457,17 @@ where the docs should live, and what specific subtopics the codebase shows shoul
457
457
 
458
458
  ### Step 6: Check Navigation and Drift
459
459
 
460
+ Probe the installed `oat docs check --help`, then run its read-only
461
+ `oat docs check --target-dir <resolved-root> --json` (or the repo’s documented
462
+ source/local CLI equivalent). Retain exact findings and exit; errors fail while
463
+ warning-only passes. Use stable rule IDs/locations as evidence for recommendations,
464
+ including reader limits, contributor commands, Mermaid/SVG and provenance. It
465
+ executes no page code or documented commands and needs no build. Missing capability
466
+ or unusable Git diagram base is explicitly unverified. Preserve specialized local
467
+ validators; portable success does not establish coverage or claim accuracy. Review
468
+ narrow reason-bearing exceptions from actual config, never invent blanket
469
+ suppressions or automatic navigation ownership.
470
+
460
471
  If a generated root index or manifest exists:
461
472
 
462
473
  1. Compare generated entries with the authored `## Contents` graph.
@@ -12,5 +12,9 @@ Evaluate existing framework apps against the current contracts below. A match pr
12
12
  | Contents links omit `.md` despite real Markdown targets | Medium: recommend `.md`-suffixed source links, which the build transforms into routes. | Authored Contents contract and docs-transforms links plugin |
13
13
  | Contributing duplicates agent runtime rules rather than pointing to app-root `AGENTS.md` | Low: recommend consolidating runtime instructions into the existing agent guidance after approval; preserve custom rules. | Docs-app guidance and contributing audience boundary |
14
14
  | MkDocs setup says `setup-docs.sh` creates a virtual environment, config calls `tooling` an object, or index points at an assumed `docs/index.md` | Medium: verify the actual script and `.oat/config.json`. The scaffold installs with the selected Python, uses a framework string, and seeds index/config as `mkdocs.yml`. | MkDocs setup script, documentation schema and scaffold config |
15
+ | Framework app has no app-root AGENTS.md | Medium: missing current CLI scaffold capability. Recommend a CLI update and manual review of the canonical framework template; preserve existing files and never recreate a bootstrap-owned template. | Current CLI Fumadocs/MkDocs AGENTS scaffolds |
16
+ | Fumadocs pages inherit only layout/site metadata | Medium: inspect the catch-all page and any relevant layout/metadata producers for page-specific title and description. Recommend manual app-shell review when absent. Accept equivalent valid Next `generateMetadata`, static per-page exports or customized layouts that produce correct page-specific metadata; do not demand the template's exact spelling. | Current page template and Next Metadata API |
17
+ | Reader Getting Started contains contributor toolchain setup | Medium: recommend moving setup into a contributor guide and restoring a first-safe-reader-result entry, with inbound links and old URLs reviewed. | Reader-first current framework scaffolds |
18
+ | MkDocs/Material is presented as the actively developed default | Medium: cite Material's maintenance/security window through May 5, 2027 and Zensical successor from the [upstream changelog](https://squidfunk.github.io/mkdocs-material/changelog/). Distinguish Material from MkDocs core and retained pins from current upstream maintenance. | Material upstream support statement |
15
19
 
16
20
  A user-owned dynamic app may intentionally omit static export. Do not apply a static-export finding to it without evidence that static output is required. Likewise, verify commands and filenames against the target repository; these patterns identify discrepancies, not authority to overwrite customization.
@@ -6,7 +6,7 @@ disable-model-invocation: false
6
6
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
7
7
  user-invocable: true
8
8
  metadata:
9
- version: '1.2.0'
9
+ version: '1.2.1'
10
10
  ---
11
11
 
12
12
  # OAT Docs Authoring
@@ -45,6 +45,10 @@ When navigation, file placement, or `## Contents` changes:
45
45
  If generated output is ignored, absent by policy, or cannot be produced in the
46
46
  current environment, record the exact reason in the handoff.
47
47
 
48
+ ## Portable checker
49
+
50
+ Run the installed `oat docs check --target-dir <resolved-root> --json` when available, or the repository’s documented source/local CLI equivalent. It is read-only and needs no site build. Keep findings and exit: errors fail, warning-only passes. Review warnings, repair authored metadata/maps/links and explicitly sync owned navigation; never add blanket exclusions to pass. Missing CLI capability is unverified, not a successful check. Preserve existing app-specific validators. See the installed checker command docs for stable rule IDs and narrow reason-bearing `documentation.check` exceptions.
51
+
48
52
  ## Local Contract Checks
49
53
 
50
54
  Before finishing:
@@ -1,17 +1,17 @@
1
1
  ---
2
2
  name: oat-docs-bootstrap
3
- description: Use when bootstrapping or adopting an OAT documentation surface in a repo. Guides the user through preflight detection, richer input gathering than the raw CLI, `oat docs init` invocation with gated post-patches for open CLI gaps, build verification, post-scaffold config inspection, and an educational walkthrough. Supports plain Markdown (file-level path), Fumadocs (full path), and MkDocs (lean path with defined minimum contract).
3
+ description: Use when bootstrapping or adopting an OAT documentation surface in a repo. Guides the user through preflight detection, richer input gathering than the raw CLI, CLI-owned `oat docs init` scaffolding, build verification, post-scaffold config inspection, and an educational walkthrough. Supports plain Markdown (file-level path), Fumadocs (full path), and MkDocs (lean path with defined minimum contract).
4
4
  argument-hint: '<optional-target-dir> [--ia-guidance <path|url>]'
5
5
  disable-model-invocation: true
6
6
  user-invocable: true
7
7
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
8
8
  metadata:
9
- version: '1.4.2'
9
+ version: '1.4.4'
10
10
  ---
11
11
 
12
12
  # Docs Bootstrap
13
13
 
14
- Bootstrap or adopt documentation in this repo and guide the user through understanding how it works. Wraps `oat docs init` with preflight detection, richer input gathering, the gated FP-15 docs-app AGENTS.md bridge, build verification, post-scaffold config inspection, and an educational walkthrough covering the `index.md` + `## Contents` navigation contract, scaffolded agent-instruction surfaces, and the OAT docs ecosystem (`oat-project-document`, `oat-docs-analyze`, `oat-docs-apply`).
14
+ Bootstrap or adopt documentation in this repo and guide the user through understanding how it works. Wraps `oat docs init` with preflight detection, richer input gathering, CLI-owned docs-app AGENTS.md scaffolding, build verification, post-scaffold config inspection, and an educational walkthrough covering the `index.md` + `## Contents` navigation contract, scaffolded agent-instruction surfaces, and the OAT docs ecosystem (`oat-project-document`, `oat-docs-analyze`, `oat-docs-apply`).
15
15
 
16
16
  ## Prerequisites
17
17
 
@@ -23,12 +23,12 @@ Bootstrap or adopt documentation in this repo and guide the user through underst
23
23
 
24
24
  **OAT MODE: Docs Bootstrap**
25
25
 
26
- **Purpose:** Turn `oat docs init` scaffolding into a support-rich onboarding experience — preflight, inputs, CLI invocation with gated post-patches, build verification, config inspection, educational walkthrough, and optional content kickoff. Three paths: Markdown (authored content without an app), Fumadocs (full), and MkDocs (lean with defined minimum contract).
26
+ **Purpose:** Turn `oat docs init` scaffolding into a support-rich onboarding experience — preflight, inputs, CLI-owned scaffold invocation, build verification, config inspection, educational walkthrough, and optional content kickoff. Three paths: Markdown (authored content without an app), Fumadocs (full), and MkDocs (lean with defined minimum contract).
27
27
 
28
28
  **BLOCKED Activities:**
29
29
 
30
30
  - No reimplementing CLI scaffold logic (the CLI remains the source of truth for template rendering, version resolution, and configuration writes)
31
- - No fabricating files the CLI does not create, with one documented exception: the FP-15 bridge AGENTS.md, which is written only when the CLI has not scaffolded one and whose content is migrated upstream when the CLI fix lands
31
+ - No fabricating scaffold files the CLI does not create; report older CLI output through analyze and recommend a manual CLI/template upgrade
32
32
  - No expanding scope into content authoring (that's `oat-docs-analyze` / `oat-docs-apply` / `oat-project-document`)
33
33
  - No silent failures — every error has a surfaced remediation
34
34
 
@@ -37,9 +37,11 @@ Bootstrap or adopt documentation in this repo and guide the user through underst
37
37
  - Inspecting repo state read-only before any mutation
38
38
  - Prompting the user for richer inputs than the CLI asks for (notably a site name separate from the package/app name)
39
39
  - Invoking `oat docs init` non-interactively with collected flags
40
- - Applying gated, idempotent post-patches for open CLI gaps (FP-15) only when capability detection shows the CLI has not addressed them
40
+ - Inspecting native scaffold capabilities and reporting missing current-template guidance without rewriting it
41
41
  - Running install + build and classifying failures against known patterns
42
42
  - Reading `.oat/config.json` back to verify paths and prompting for `requireForProjectCompletion`
43
+ - Presenting concrete PR CI edits from `references/pr-ci.md`, writing only the approved diff while preserving existing workflows
44
+ - Presenting the exact effective-install-root compatibility policy below and writing only that approved root-policy edit while preserving existing settings/conflicts
43
45
  - Narrating the scaffolded output as a chunked educational walkthrough
44
46
  - Delegating optional initial content population to `oat-docs-analyze` + `oat-docs-apply`
45
47
 
@@ -49,7 +51,7 @@ If you catch yourself:
49
51
  - Writing scaffold-template content directly instead of calling the CLI → STOP (the CLI owns templates; you own the surrounding experience)
50
52
  - Narrating AGENTS.md content word-for-word in the Walkthrough → STOP (the Walkthrough points at AGENTS.md; it does not read it aloud)
51
53
  - Expanding into full content generation → STOP (delegate to analyze/apply)
52
- - Applying a post-patch without running capability detection first → STOP (patches must be gated on deterministic probes and file-shape checks)
54
+ - Recreating missing CLI scaffold content from the skill → STOP (report a missing capability and manual upgrade instead)
53
55
 
54
56
  **Recovery:**
55
57
 
@@ -112,14 +114,14 @@ OAT ▸ DOCS BOOTSTRAP
112
114
 
113
115
  ### Markdown path through the seven steps
114
116
 
115
- The detailed framework procedures below apply to Fumadocs/MkDocs. When the selected tooling is `markdown`, use this path for Steps 2–7 instead; never run framework post-patches, the FP-15 AGENTS bridge, dependency discovery/install, package/Turbo patches, or a site build. Step 1 remains the shared read-only detector.
117
+ The detailed framework procedures below apply to Fumadocs/MkDocs. When the selected tooling is `markdown`, use this path for Steps 2–7 instead; never run framework scaffold repairs, docs-root AGENTS creation, dependency discovery/install, package/Turbo patches, or a site build. Step 1 remains the shared read-only detector.
116
118
 
117
119
  1. **Preflight and routing:** Read `documentation.tooling` as a non-empty string. A non-string value (including a legacy object with a `framework` field) is invalid/undeclared tooling in the CLI; surface it for a user decision before proceeding, without silently clearing or retagging it. Declared tooling is authoritative: configured Markdown uses `documentation.root` literally, including when it contains a child named `docs`; declared frameworks or unknown stacks are not plain-doc adoption candidates. With no declared tooling, check framework evidence first (`mkdocs.yml`, Fumadocs/Next config and docs-app package scripts/dependencies), then inspect the chosen dedicated content directory for authored `.md`/`.mdx` pages. A repository-root README alone is insufficient; an empty selected directory is fresh setup. For a populated plain tree, default to `oat-docs-analyze` then `oat-docs-apply` for approved repairs and exit without scaffolding. Offer **adopt and audit**, **audit only**, or **abort** when adoption is explicitly requested. Audit only delegates read-only to `oat-docs-analyze` and exits. Adoption requires the explicit user choice and CLI `--adopt`; `--yes` alone never authorizes it. An incompatible declared root/index/tooling requires a user decision, with no silent clearing or retagging. Keep the existing explicitly authorized framework replacement path when a framework is selected.
118
120
  2. **Gather inputs:** Offer “Markdown (plain files), Fumadocs, or MkDocs?” Collect documentation title (`--site-name`), dedicated relative target directory (default `docs` in every repo shape), and optional description. Reuse an existing compatible configured Markdown root. Ask no app/package name, package-manager, site-runtime, or dependency questions. Lint and format default to `none`; describe selected existing repository tools only, without installing them. Validate a nonempty title and a dedicated in-repository target, excluding the repository root and escaping symlinks. Confirm fresh setup or additive adoption, title, root, and audit handoff. `appName` is absent and `conflictResolution` is `adopt`, `audit`, `abort`, or null for this path.
119
121
  Before Markdown CLI invocation, run **Step 2.5** for fresh setup and explicitly selected adoption; it is not bypassed by this condensed path.
120
122
 
121
- 3. **Invoke CLI:** Probe `$CLI_CMD docs init --help` and require advertised Markdown/`--adopt` support before invocation; if missing, report the needed CLI update rather than fabricating scaffold files. Run `$CLI_CMD docs init --framework markdown --target-dir <root> --site-name <title> --description <description> --lint none --format none --yes`, adding `--adopt` only for explicit adoption. Pass the selected lint/format values when using existing tools. Never pass app-only flags. An optional `--dry-run` previews file/config/guidance changes without writes; it does not count as a completed bootstrap. Capture terminal/JSON results, exact exit, created/preserved files, config changes, guidance action, and audit advice. `partial`/exit 1 with manual-required or blocked guidance means unresolved guidance; real runs may have created files, whereas dry-runs have only planned files. Report actual state and stop before claiming completion. Other refusals also stop without post-patches. For success, read config back to resolve the actual content root and authored index.
122
- 4. **Verify files:** Print `[4/7] Verifying files…`. Check config root/index, baseline file existence, nonempty `title`/`description`, useful audience/scope context and populated `## Contents` links resolving to actual sibling pages or child `index.md`s. Honor excludes and asset-only exceptions; preserve local AGENTS instructions. Fresh setup creates only authored `index.md` and `contributing.md` in the target; verify no docs-root AGENTS, app package, framework config, dependencies, or root build changes. Run already documented lint/link/format checks when applicable; otherwise inspect files/links directly. Adoption preserves existing bytes and may leave missing child indexes, metadata, context, or links: record these as audit gaps for analyze/apply rather than repairing them or calling the tree fully conformant. Distinguish successful setup verification from content-conformance findings.
123
+ 3. **Invoke CLI:** Probe `$CLI_CMD docs init --help` and require advertised Markdown/`--adopt` support before invocation; if missing, report the needed CLI update rather than fabricating scaffold files. Run `$CLI_CMD docs init --framework markdown --target-dir <root> --site-name <title> --description <description> --lint none --format none --yes`, adding `--adopt` only for explicit adoption. Pass the selected lint/format values when using existing tools. Never pass app-only flags. An optional `--dry-run` previews file/config/guidance changes without writes; it does not count as a completed bootstrap. Capture terminal/JSON results, exact exit, created/preserved files, config changes, guidance action, and audit advice. `partial`/exit 1 with manual-required or blocked guidance means unresolved guidance; real runs may have created files, whereas dry-runs have only planned files. Report actual state and stop before claiming completion. Other refusals also stop without template repairs. For success, read config back to resolve the actual content root and authored index.
124
+ 4. **Verify files:** Print `[4/7] Verifying files…`. Check config root/index, baseline file existence, nonempty `title`/`description`, useful audience/scope context and populated `## Contents` links resolving to actual sibling pages or child `index.md`s. Honor excludes and asset-only exceptions; preserve local AGENTS instructions. Fresh setup creates only authored `index.md` and `contributing.md` in the target; verify no docs-root AGENTS, app package, framework config, dependencies, or root build changes. Run `$CLI_CMD docs check --target-dir <literal-root>` and already documented lint/link/format checks when applicable. Errors block conformance; warnings remain review items. Use `references/pr-ci.md` to present checker-only PR wiring with empty build/manifest inputs unless a generated external manifest was separately configured; apply only the approved workflow diff. Adoption preserves existing bytes and may leave missing child indexes, metadata, context, or links: record these as audit gaps for analyze/apply rather than repairing them or calling the tree fully conformant. Distinguish successful setup verification from content-conformance findings.
123
125
  5. **Inspect config:** `documentation.tooling` is the string `markdown`; `root` is the literal content directory; `index` is its authored entrypoint, normally `<root>/index.md`. Markdown introduces no `documentation.config`. Preserve unrelated config/excludes/completion settings. Verify deterministic managed root Documentation guidance names that root, Markdown tooling, authored index, and `<root>/contributing.md`; preserve manual/local guidance and surface unresolved disposition. The Step 5e completion opt-in remains available using the docs root rather than an app name, without silently changing an existing value. No nested app-config reconciliation or framework patch inspection applies.
124
126
  6. **Walkthrough:** In short chunks, show actual config and `<root>/index.md`: useful context plus the Contents map, title/description metadata, sibling `page.md` and child `section/index.md` links, exclusions and asset-only exceptions. Explain adding a page/section and updating the nearest authored map without overwriting existing context. Root AGENTS Documentation guidance and `<root>/contributing.md` establish agent/human conventions; a preexisting local AGENTS file remains authoritative, but bootstrap creates none. Authored indexes are edited directly. Optional generated inventories require explicit external output, e.g. `$CLI_CMD docs generate-index --docs-dir <root> --output .oat/docs-manifest.md`; output must stay outside the full configured content root and cannot overwrite the configured authored index even with a narrowed `--docs-dir`. Generation does not repoint `documentation.index`. Markdown bootstrap never generates a manifest automatically. Skip framework deep dives and preview-server/build commands.
125
127
  7. **Audit handoff and summary:** Offer `oat-docs-analyze` against the literal configured root, followed by `oat-docs-apply` only for approved repairs. An adopted incomplete tree needs that audit; config/guidance alone prove no full conformance. Explain `oat-project-document` for source-backed project deltas. Summarize tooling, actual root/authored index, created/preserved files, guidance/config disposition, ordered IA guidance locators/provenance and proposal recommendation/conflicts, file-check outcomes, unresolved audit gaps, optional manifest ownership, and exact skill handoff. For dry-run/partial/refusal, label the outcome accordingly rather than printing BOOTSTRAP COMPLETE. No app, install, build, patch, or dev-command fields apply.
@@ -204,7 +206,7 @@ Preflight Result:
204
206
 
205
207
  ### Step 2: Input Gatherer
206
208
 
207
- Collect the inputs needed to invoke `oat docs init` and apply post-scaffold patches. The skill asks for richer inputs than the CLI prompts for — most importantly, a **site name** separate from the package/app name. Ask one question at a time, surfacing defaults from the Preflight Result, and end with a coherence check before scaffold.
209
+ Collect the inputs needed to invoke `oat docs init` and inspect its CLI-owned output. The skill asks for richer inputs than the CLI prompts for — most importantly, a **site name** separate from the package/app name. Ask one question at a time, surfacing defaults from the Preflight Result, and end with a coherence check before scaffold.
208
210
 
209
211
  Print `[2/7] Gathering inputs…` at the start of this step.
210
212
 
@@ -309,7 +311,7 @@ Resolution options:
309
311
  - **`abort`** — Stop the flow without any mutation.
310
312
  - **Allowed mutations:** None.
311
313
  - **Preserved state:** Everything.
312
- - **Stop conditions:** Print a compact summary of what was detected and exit immediately. No CLI invocation, no post-patches, no Walkthrough. Example summary:
314
+ - **Stop conditions:** Print a compact summary of what was detected and exit immediately. No CLI invocation, no template repairs, no Walkthrough. Example summary:
313
315
 
314
316
  ```
315
317
  Aborting docs bootstrap. Nothing was changed.
@@ -404,9 +406,11 @@ through `oat-docs-analyze --ia`; it does not return to scaffold afterward.
404
406
  remains undeclared, Markdown ignores it, and no automatic nav generation is
405
407
  authorized by IA approval alone.
406
408
 
409
+ For MkDocs/Material, disclose the legacy support status before scaffold: [Material upstream](https://squidfunk.github.io/mkdocs-material/changelog/) promises critical fixes/security updates through May 5, 2027, then maintenance ends, and identifies [Zensical](https://zensical.org/) as its successor. This is Material's window, not MkDocs core EOL or a promise that the retained old Python pins receive every fix. No implicit Python upgrade is authorized.
410
+
407
411
  ### Step 3: Scaffold Runner
408
412
 
409
- Invoke `oat docs init` with the collected inputs and then apply gated post-patches for any CLI gaps the Capability Detection sub-procedure reports as still-open. The Scaffold Runner probes CLI capabilities, invokes the CLI, and applies the AGENTS.md bridge if still needed. Template content is CLI-owned; report old-scaffold shapes through `oat-docs-analyze`.
413
+ Invoke `oat docs init` with the collected inputs. The Scaffold Runner probes capabilities, invokes the CLI and verifies its output. The CLI owns framework app-root AGENTS.md and all template content; report missing capabilities and older scaffold shapes through `oat-docs-analyze` with a manual CLI/template upgrade recommendation. Never create a second template owner in this skill.
410
414
 
411
415
  Print `[3/7] Scaffolding…` at the start of this step.
412
416
 
@@ -414,7 +418,7 @@ Print `[3/7] Scaffolding…` at the start of this step.
414
418
 
415
419
  For an explicitly fresh Fumadocs/MkDocs app, current CLI init writes `documentation.navOwner: nav-sync` and generates navigation after successful scaffold/config. An explicitly selected new app in a repository with prior docs config is fresh creation; preserve the old app's authored files. This does not authorize regeneration of an existing app: keep undeclared/hand-authored ownership untouched and use the existing analyze/apply handoff. IA approval alone never authorizes navigation writes. Markdown and dry runs run no nav sync.
416
420
 
417
- Inspect the generated package scripts rather than adding a duplicate patch: Fumadocs `prebuild` and MkDocs `docs:build` run `nav sync --check`, using external `oat` from the app directory with `--target-dir .`, or source-workspace CLI with the explicit quoted repo-relative app. A stale navigation check requires fixing authored Contents and explicitly syncing owned navigation before retrying, not deleting the check or silently regenerating an undeclared owner.
421
+ Inspect the generated package scripts rather than adding a duplicate patch: `docs:check` runs the portable checker and MkDocs `test` runs the same real check. Framework builds run the checker before navigation/build. Fumadocs `prebuild` and MkDocs `docs:build` run `nav sync --check`, using external `oat` from the app directory with `--target-dir .`, or source-workspace CLI with the explicit quoted repo-relative app. A stale navigation check requires fixing authored Contents and explicitly syncing owned navigation before retrying, not deleting the check or silently regenerating an undeclared owner.
418
422
 
419
423
  **3a. Assemble CLI flags.**
420
424
 
@@ -442,12 +446,12 @@ Do not pass flags the CLI doesn't advertise. Never assume a flag exists because
442
446
  Before CLI invocation, run `$CLI_CMD docs init --help` once. Record:
443
447
 
444
448
  - `siteNameFlag`: whether `--site-name` is advertised.
445
- - `agentsMdScaffoldFlag`: whether help or the installed template file list confirms native `AGENTS.md` scaffolding.
449
+ - `agentsMdScaffold`: whether the installed framework template file list confirms native app-root `AGENTS.md` scaffolding; if unavailable, record unknown and verify actual output after invocation. Do not infer a CLI flag from this capability.
446
450
  - `noRootPatchFlag`: whether `--no-root-patch` is advertised.
447
451
 
448
452
  If the probe fails or returns no help, stop with the verbatim error and recommend updating or repairing the CLI. Never guess capabilities.
449
453
 
450
- After scaffolding, inspect `<appRoot>/AGENTS.md`: absent permits the FP-15 bridge; any existing file is preserved. Check template output against the current scaffold contract. Older output with missing metadata, unresolved Node-version advice, missing generated-files guidance, extension-less Contents links, duplicated agent instructions, or a Fumadocs wrapper that loses static export settings becomes a finding under `oat-docs-analyze`'s legacy scaffold checks (load that skill from installed scope and resolve `references/legacy-scaffold-checks.md` from its own directory). Record the observed path and evidence, then offer analyze; do not reinstate template patches. Ambiguous or user-authored shapes are reported for review, never overwritten.
454
+ After scaffolding, inspect `<appRoot>/AGENTS.md`: absence is a missing-capability finding with analyze/manual upgrade advice; any existing file is preserved. No missing-file bridge is permitted. Check template output against the current scaffold contract. Older output with missing metadata, unresolved Node-version advice, missing generated-files guidance, extension-less Contents links, duplicated agent instructions, or a Fumadocs wrapper that loses static export settings becomes a finding under `oat-docs-analyze`'s legacy scaffold checks (load that skill from installed scope and resolve `references/legacy-scaffold-checks.md` from its own directory). Record the observed path and evidence, then offer analyze; do not reinstate template patches. Ambiguous or user-authored shapes are reported for review, never overwritten.
451
455
 
452
456
  **3c. Invoke the CLI.**
453
457
 
@@ -463,7 +467,7 @@ Capture both stdout and stderr. **Do not** stream output directly to the user; t
463
467
 
464
468
  - Surface the CLI's stderr **verbatim** to the user (no re-wording — the user needs to see exactly what the CLI said).
465
469
  - Print the exit code and the exact flag list that was passed.
466
- - **Stop the flow.** Do not apply any post-patches. Do not proceed to Build Verifier. A failed scaffold produces an undefined state; guessing at recovery is worse than letting the user diagnose.
470
+ - **Stop the flow.** Do not repair scaffold output. Do not proceed to Build Verifier. A failed scaffold produces an undefined state; guessing at recovery is worse than letting the user diagnose.
467
471
  - Example surfaced error:
468
472
 
469
473
  ```
@@ -493,42 +497,18 @@ Capture both stdout and stderr. **Do not** stream output directly to the user; t
493
497
  capabilities: { siteNameFlag: boolean, ... } // from Capability Detection (3b)
494
498
  cliLogs: { stdout: string, stderr: string } // retained for Walkthrough
495
499
  rootBuildPatch: { status, reason?, diff?, manualSnippet? } | null // parsed from CLI output when available
496
- patchesApplied: [] // populated by the FP-15 bridge in 3d
500
+ appAgents: { status: cli-scaffolded | preserved | missing, path, suggestedFix? } // from 3d
497
501
  ```
498
502
 
499
503
  The Walkthrough (Step 6) and Post-Scaffold Inspector (Step 5) both consume `Scaffold Result`; keep it structured and avoid shell-side ephemeral state.
500
504
 
501
- **3d. Apply the remaining bridge.**
502
-
503
- FP-15 is the only post-scaffold patch. It is gated by detected capability and file absence, is idempotent, and appends `{ id, status: 'applied' | 'skipped', reason? }` to `Scaffold Result.patchesApplied`. All other scaffold content comes from the CLI template.
504
-
505
- **FP-15: AGENTS.md write-if-missing (Fumadocs/MkDocs only).**
506
-
507
- Never apply this bridge to Markdown: its root is the content directory and bootstrap must not create a docs-root AGENTS file.
508
-
509
- Gate: run **only if** `capabilities.agentsMdScaffoldFlag === false` AND `<appRoot>/AGENTS.md` does not exist on disk.
510
-
511
- - If the CLI scaffolded `AGENTS.md` itself, skip with `status: 'skipped', reason: 'CLI scaffolds AGENTS.md'`.
512
- - If the file already exists (user hand-authored, or a previous skill run wrote it), **never overwrite**. Skip with `status: 'skipped', reason: 'AGENTS.md already present — not overwriting'`.
513
-
514
- Procedure when gate passes:
505
+ **3d. Verify CLI-owned agent guidance.**
515
506
 
516
- 1. Read the template from `.agents/skills/oat-docs-bootstrap/assets/AGENTS.md.template`.
517
- 2. Substitute placeholders:
518
- - `{{SITE_NAME}}` → `{siteName}` (Input Result)
519
- - `{{APP_DIR}}` → `{targetDir}` (Input Result; the scaffolded app path relative to repo root)
520
- - `{{REPO_NAME}}` → `{repoName}` (Preflight Result)
521
- - `{{GENERATE_INDEX_CMD}}` → derive from the scaffolded `<appRoot>/package.json`:
522
- 1. Parse JSON and inspect `scripts.predev` first, then `scripts.prebuild`.
523
- 2. Find the `fumadocs-mdx &&` segment and use the trimmed command that follows it.
524
- 3. If neither script contains that segment, fall back by repo shape: monorepo uses `pnpm -w run cli -- docs generate-index --docs-dir {appDir}/docs --output {appDir}/index.md`; nested-standalone and single-package use `oat docs generate-index --docs-dir docs --output index.md` from the app root.
525
- 3. Write the rendered content to `<appRoot>/AGENTS.md`.
526
- 4. Wrap the entire file in an HTML comment banner at the top — not for idempotency (file existence is the idempotency check), but so the user knows this file was written by the skill and can be regenerated: `<!-- Generated by oat-docs-bootstrap (FP-15 bridge). Safe to hand-edit after generation. -->`.
527
- 5. Record `{ id: 'FP-15', status: 'applied', target: '<appRoot>/AGENTS.md' }` in `patchesApplied`.
507
+ Inspect the actual app-root AGENTS.md and compare createdFiles with the preflight snapshot. Record `Scaffold Result.appAgents` as `cli-scaffolded`, `preserved`, or `missing`, including the path and missing-capability/manual upgrade advice. A missing file on older CLI output becomes an analyze finding; recommend updating the CLI and reviewing the current canonical framework template manually. Do not copy an asset, create a replacement file or overwrite user content. The skill ships no AGENTS template.
528
508
 
529
- When the CLI eventually scaffolds `AGENTS.md` natively and `agentsMdScaffoldFlag` becomes `true`, the bridge template in this skill can be retired (or folded back into the skill as a reference for how the CLI's template evolved).
509
+ Check that Getting Started serves readers, contributor setup lives under `docs/contributing/`, and contributing points one level up to app-root AGENTS.md. Verify framework-specific authored/generated rules, IA/agent-use guidance and commands with explicit working directories. Record observed gaps rather than fixing them during bootstrap.
530
510
 
531
- **Design discipline:** CLI errors stop the flow. Preserve existing files, report legacy output through analyze, and apply only the absent-file AGENTS bridge. Template upgrades belong to the CLI rather than bootstrap rewrites.
511
+ **Design discipline:** CLI errors stop the flow. Preserve existing files and report legacy output through analyze/manual upgrade. Template rendering and upgrades remain CLI-owned.
532
512
 
533
513
  ### Step 4: Build Verifier
534
514
 
@@ -538,6 +518,40 @@ Print `[4/7] Verifying build…` at the start of this step.
538
518
 
539
519
  Skip this step entirely if `Scaffold Result.scaffoldSucceeded !== true` — a failed scaffold produces an undefined state; installing and building on top of it makes things worse.
540
520
 
521
+ **4a prerequisite: inspect and approve Fumadocs install-root policy.**
522
+
523
+ Before running install, read the CLI's `installationAdvice` and the generated
524
+ toolchain guide. Locate the actual pnpm installation root, including any enclosing
525
+ `pnpm-workspace.yaml`; a workspace member's package is not that root. Current
526
+ Fumadocs loses handler properties added by `mdast-util-to-markdown` 2.2.0, so valid
527
+ bold/italic content can fail compilation. Preserve all content and framework APIs.
528
+ The required compatibility constraint is exactly 2.1.2 in the effective root's
529
+ `pnpm-workspace.yaml`:
530
+
531
+ ```yaml
532
+ overrides:
533
+ mdast-util-to-markdown: 2.1.2
534
+ ```
535
+
536
+ A newly scaffolded independent app has its own root YAML (`packages: []` plus
537
+ this override); inspect it and install there. The CLI never creates this boundary
538
+ in monorepo mode or under an enclosing pnpm workspace. For an existing workspace
539
+ root, PRESENT the exact concrete YAML diff and obtain explicit approval before
540
+ writing it. Preserve package globs and all unrelated settings; add the entry to
541
+ an existing `overrides` map, never duplicate the map or replace the file. A
542
+ conflicting existing pin requires the owner's decision; a declined/skipped edit
543
+ stays a manual setup requirement and verification remains pending. Do not create
544
+ a local boundary that splits a workspace member. Do not implement a policy merger
545
+ or silently extend CLI root-package patching: it changes build scripts only,
546
+ and `--no-root-patch` neither sets nor approves dependency policy.
547
+
548
+ Honor the selected manager (pnpm 10+); effective-root YAML works in pnpm 10 and 12.
549
+ A member-only override is ignored in 10, and 12 also ignores `package.json`'s
550
+ `pnpm.overrides`. After install, inspect actual `pnpm why mdast-util-to-markdown`
551
+ from that root, confirm 2.1.2, retain the root config/lockfile, then run checker and
552
+ build. Label this a constrained fresh install; do not promise unconstrained
553
+ resolution, change user-scope pnpm, or delete bold/italic to avoid the failure.
554
+
541
555
  **4a. Install dependencies.**
542
556
 
543
557
  Command varies by repo shape (from Preflight Result) and framework (Fumadocs only uses pnpm; MkDocs uses Python tooling — handled in the MkDocs Minimum Contract, Step 6):
@@ -548,6 +562,8 @@ Command varies by repo shape (from Preflight Result) and framework (Fumadocs onl
548
562
 
549
563
  For Fumadocs, capture both stdout and stderr. Print a start line (`Installing dependencies…`) and a completion line with duration.
550
564
 
565
+ Before building, run `$CLI_CMD docs check --target-dir <configured-root>` from the repo root. Keep its JSON/findings and exit; metadata/maps/links, contributor commands and real Mermaid syntax are checked without executing page code. Errors stop verification; review warnings and route content repairs through analyze/apply. Never add blanket suppressions to pass bootstrap.
566
+
551
567
  **4b. Build.**
552
568
 
553
569
  Command varies by shape:
@@ -594,6 +610,7 @@ Record internally for the Post-Scaffold Inspector and Walkthrough:
594
610
 
595
611
  ```
596
612
  Verification Result:
613
+ installRootPolicy: { path, disposition: 'scaffolded' | 'approved' | 'manual' | 'conflict', resolvedVersion } | null
597
614
  installSucceeded: boolean
598
615
  buildSucceeded: boolean
599
616
  knownIssues: Array<{ pattern, severity: 'benign' | 'flagged' | 'surface-only' | 'auto-fixed', detail }>
@@ -648,7 +665,7 @@ If `repoShape === 'nested-standalone'`, the docs app may have its own `.oat/conf
648
665
 
649
666
  The parent config describes the repo's docs; the nested config (when present) scopes OAT operations executed from inside the docs app. Do **not** try to reconcile the two or rewrite one to match the other — they serve different scopes by design. Surface what you found; let the user decide.
650
667
 
651
- **5d. Drift detection (config ↔ filesystem ↔ patches).**
668
+ **5d. Drift detection (config ↔ filesystem ↔ scaffold).**
652
669
 
653
670
  Beyond basic path existence, check for drift between the config and what the Scaffold Runner actually did:
654
671
 
@@ -676,7 +693,7 @@ If user opts in (`yes`), write `documentation.requireForProjectCompletion: true`
676
693
 
677
694
  If user opts out (default), record the decision in `InspectionState.issues` as `{ severity: 'info', detail: 'requireForProjectCompletion remains false (not opted in)' }` and move on; do not write to the config.
678
695
 
679
- **Write-once discipline:** 5e is the only point in this skill where `.oat/config.json` is mutated outside of the CLI's own writes. Preflight is read-only (Step 1). Input Gatherer is read-only (Step 2). Scaffold Runner's writes flow through the CLI (Step 3c). Post-patches (Step 3d) mutate scaffold output files, not the config. If you find yourself about to write `.oat/config.json` anywhere else, stop — it belongs here.
696
+ **Write-once discipline:** 5e is the only point in this skill where `.oat/config.json` is mutated outside of the CLI's own writes. Preflight is read-only (Step 1). Input Gatherer is read-only (Step 2). Scaffold Runner's writes flow through the CLI (Step 3c). Step 3d inspects scaffold output without writing files. If you find yourself about to write `.oat/config.json` anywhere else, stop — it belongs here.
680
697
 
681
698
  **5f. Emit the Inspection Result.**
682
699
 
@@ -692,6 +709,16 @@ Inspection Result:
692
709
 
693
710
  The Walkthrough's Section D (Configuration readback) references `issues[]` verbatim — format it so it reads cleanly when printed to the user.
694
711
 
712
+ **PR CI wiring (after config inspection):** Load `references/pr-ci.md` now.
713
+ Resolve its concrete inputs from the inspected config/scripts, present the exact
714
+ workflow diff, and write only after approval. Preserve existing workflow content
715
+ and use full-history checkout/fetch for the applicable diagram base. Execute its
716
+ checker, real framework build and configured-manifest freshness commands locally;
717
+ record exits and unverified portions. Markdown follows the same recipe with no
718
+ build/default manifest. Include the approved workflow path or declined/pending
719
+ status in the exit summary. This is bootstrap setup authority, not permission to
720
+ rewrite an existing app or introduce deployment.
721
+
695
722
  ### Step 6: Educational Walkthrough
696
723
 
697
724
  Narrate the scaffolded docs app as a chunked conversation, not a wall of text. The Walkthrough's job is to turn the user from "I ran a scaffold" into "I know how this docs app works". It is **not** a re-explanation of the CLI's output, nor a recitation of the AGENTS.md content — both are live files the user can read; the Walkthrough contextualizes them.
@@ -702,7 +729,7 @@ Skip this step if `Verification Result.buildSucceeded !== true` OR `Inspection R
702
729
 
703
730
  **Format discipline.** Each section below is a short spoken-style chunk (3–6 short paragraphs), references concrete paths from the `Scaffold Result` / `Inspection Result`, and ends with a single-sentence "what this means for you" takeaway. After each section, pause and check the user wants to continue: `Ready for the next section? (yes / skip to summary)`. If the user says `skip to summary`, jump directly to Step 7's Exit summary.
704
731
 
705
- **Audience discipline.** The Walkthrough is a **setup-time** narration — it runs once, now. The docs-app `AGENTS.md` (FP-15 bridge or CLI-scaffolded) is the **runtime** reference future agents will read when working inside the docs app. These are different audiences at different times; the Walkthrough does not duplicate the AGENTS.md content. If you find yourself reading AGENTS.md content aloud, stop — point the user at the file path instead.
732
+ **Audience discipline.** The Walkthrough is a **setup-time** narration — it runs once, now. The docs-app `AGENTS.md` (CLI-scaffolded or existing authored) is the **runtime** reference future agents will read when working inside the docs app. These are different audiences at different times; the Walkthrough does not duplicate the AGENTS.md content. If you find yourself reading AGENTS.md content aloud, stop — point the user at the file path instead.
706
733
 
707
734
  #### Section A (both frameworks) — Your OAT documentation config
708
735
 
@@ -768,7 +795,7 @@ The docs app is surrounded by three separate places agents and humans are expect
768
795
  Narrate the three surfaces with audience + time discipline:
769
796
 
770
797
  1. **Root `AGENTS.md` `## Documentation` section** — the repo-wide pointer. A 4-line breadcrumb every agent working anywhere in the repo reads first. Written/updated by `oat docs init` (or `oat-docs-apply`). Purpose: "docs live here; here's the framework; here's the config path." Not a tutorial — a signpost.
771
- 2. **Docs-app `AGENTS.md`** at `<appRoot>/AGENTS.md` — the ongoing reference for agents who are **working inside the docs app**, not setting it up. This is the FP-15 bridge file (or CLI-scaffolded equivalent if `capabilities.agentsMdScaffoldFlag === true`). Task-framed sections: "When you need to add a new page", "When you need to restructure navigation", "When you need to audit or bulk-edit docs". **Audience discipline:** this file exists for the agent working on docs content **six months from now**, not for the agent running this skill today. Everything in it should still be useful at that time. If content would only matter at setup time, it belongs in this Walkthrough, not in `AGENTS.md`.
798
+ 2. **Docs-app `AGENTS.md`** at `<appRoot>/AGENTS.md` — the ongoing reference for agents who are **working inside the docs app**, not setting it up. The CLI scaffolds it for both frameworks; older output without it receives analyze/manual upgrade advice, never a skill-created replacement. Task-framed sections: "When you need to add a new page", "When you need to restructure navigation", "When you need to audit or bulk-edit docs". **Audience discipline:** this file exists for the agent working on docs content **six months from now**, not for the agent running this skill today. Everything in it should still be useful at that time. If content would only matter at setup time, it belongs in this Walkthrough, not in `AGENTS.md`.
772
799
  3. **`docs/contributing.md`** — human-authoring conventions. Markdown feature reference (code blocks, mermaid, GFM alerts), frontmatter requirements, linting/formatting commands (if enabled). Not agent instructions — human reference. Agents working with docs content may read it for the Markdown feature list, but its primary audience is a human contributor.
773
800
 
774
801
  End with: "Three surfaces, three audiences, three lifetimes. Root `AGENTS.md` = repo-wide pointer. Docs-app `AGENTS.md` = future agents working inside the docs app. `contributing.md` = humans. Keeping them separate keeps each one useful."
@@ -782,6 +809,7 @@ Narrate how the Fumadocs scaffold actually works, grounded in files the user can
782
809
  - **`app/layout.tsx` — `DocsLayout` renders the chrome.** The `<DocsLayout>` component from `@open-agent-toolkit/docs-theme` wraps every docs page with the top nav, sidebar, and search UI. It accepts a `branding` prop with `title`, `logo`, etc. **Runtime insight (worth knowing):** the compiled theme bundle only forwards `branding.title` into the nav header chrome — it doesn't use it for page metadata, social cards, or browser tab titles. The CLI template also includes `export const metadata = { title, description }` in `layout.tsx`: the chrome title and the document title are two separate concerns, and both surfaces must be configured. **Anti-pattern to avoid:** passing `title` / `description` to `createDocsConfig()` in `next.config.js` is a no-op — the wrapper accepts `basePath` and `turbopack`, not metadata. If your HTML `<head>` comes back empty (no `<title>`, no meta description, no Open Graph), the `export const metadata` in `layout.tsx` is missing.
783
810
  - **`next.config.js` — `createMDX()` picks up `docs/`.** The Fumadocs MDX pipeline uses `@open-agent-toolkit/docs-config`'s `createDocsConfig()` wrapper, which under the hood calls `createMDX()` with the docs directory hardcoded to `docs/`. Both `.md` and `.mdx` files are compiled at build time; frontmatter becomes typed metadata accessible from layouts and listings. **Default to `.md`** for plain content pages — agents, linters, grep rules, and the `remark-links` plugin all handle `.md` more predictably than `.mdx`. Reach for `.mdx` only when a page actually needs a JSX component inline (an embedded `<Callout>`, an interactive widget, a custom layout). FlexSearch indexes them identically.
784
811
  - **FlexSearch static indexing.** Search is client-side — on build, Fumadocs scans every `.md`/`.mdx` file under `docs/` and emits a precomputed FlexSearch index that loads alongside the first route. No server; no search API call. That's also why renaming a page without a redirect loses deep links silently: the old index entry stops existing at the next build, and the new one doesn't know the old slug.
812
+ - **Page metadata and agent Markdown.** The page route reads loaded title/description in `generateMetadata`; layout metadata supplies site defaults. Equivalent valid customized Next metadata arrangements are allowed. Static `/llms.txt`, `/llms-full.txt`, and `/llms/<page-slugs>/content.md` (root `/llms/content.md`) enumerate the same loaded reader `.md` set, including readers outside a hand-authored sidebar. Raw links remain source-relative; use each entry's source path and canonical rendered URL. MDX and configured non-readers are excluded.
785
813
  - **`@open-agent-toolkit/docs-theme` branding.** The theme package centralizes the nav/sidebar/footer look and forwards only a small surface of props. Don't expect `branding` to influence metadata; use the Next.js `metadata` export for that.
786
814
  - **Turbopack app root.** For `nested-standalone` only, the template passes `dirname(fileURLToPath(import.meta.url))` through `createDocsConfig({ turbopack: { root } })`. Monorepo and single-package scaffolds leave root discovery to Next.js so workspace dependencies remain reachable. This works in ESM and retains static export, trailing slashes, unoptimized images, and base-path settings. Report older wrappers to analyze instead of replacing them.
787
815
 
@@ -897,12 +925,15 @@ Config: {configPath} (documentation section)
897
925
  Created:
898
926
  - <count> files (see `git status` or `git log -1` for the full list)
899
927
 
900
- Patches applied:
901
- - FP-15 docs-app AGENTS.md: {applied | skipped}
928
+ Agent guidance:
929
+ - App-root AGENTS.md: {cli-scaffolded | preserved | missing}
930
+ - Missing capability/manual upgrade advice: {path + remedy or none}
902
931
 
903
932
  Build:
904
933
  - Install: {ok | known-issue: ...}
905
934
  - Build: {ok | known-issue: ...}
935
+ - Install policy: {effective-root YAML + resolved 2.1.2 | manual/conflict/pending; constrained install}
936
+ - PR CI: {approved workflow path + checker/build/freshness exits | declined | pending}
906
937
  - Known issues (from Verification Result.knownIssues): {list or 'none'}
907
938
 
908
939
  Inspection:
@@ -929,7 +960,7 @@ Reminder: the docs-app AGENTS.md at {appRoot}/AGENTS.md tells future agents how
929
960
  to work inside this docs app. Read it before making non-trivial doc changes.
930
961
  ```
931
962
 
932
- Substitute every `{placeholder}` with the actual value from `Scaffold Result`, `Verification Result`, or `Inspection Result`. If a patch was `skipped` because the CLI already handled it (e.g., `agentsMdScaffoldFlag === true`), say so explicitly rather than printing `n/a` — the user should know when the CLI has caught up with the skill.
963
+ Substitute every `{placeholder}` with the actual value from `Scaffold Result`, `Verification Result`, or `Inspection Result`. Report whether app guidance came from the CLI, was preserved, or is missing; never print a successful scaffold capability that was not observed.
933
964
 
934
965
  For the "Next" section's `<framework-specific dev command>`, render:
935
966
 
@@ -957,20 +988,20 @@ A successful `oat-docs-bootstrap` run satisfies every invariant below. Any failu
957
988
  - Input Gatherer collected the full Input Result (framework, siteName, appName, targetDir, siteDescription, lint, format) plus any `conflictResolution` required by Preflight conflicts; all inputs validated before scaffold.
958
989
  - Conflict Resolution Contract's "Allowed mutations" completed for the chosen resolution; pre-scaffold invariant satisfied before `oat docs init` ran.
959
990
  - Scaffold Runner invoked `oat docs init` non-interactively with capability-gated flags; CLI exited zero; `Scaffold Result.appRoot` resolved from `.oat/config.json` (not from input alone).
960
- - Capability Detection produced a deterministic `capabilities` record before scaffold (for flag gating) and classified each patch target after scaffold (scaffold-shape / patched-shape / drift).
961
- - Every applied post-patch is idempotent and file-type aware: code-file patches use syntactically valid code comments when markers are useful, while rendered Markdown patches rely on content-shape checks instead of hidden FP comments. No patch ran without passing both its capability gate and its file-shape check.
991
+ - Capability Detection produced a deterministic `capabilities` record before scaffold (for flag gating) and verified actual CLI output after scaffold (current / preserved / missing capability).
992
+ - All scaffold files came from the CLI; missing current-template capabilities were reported with paths and analyze/manual upgrade advice, preserving existing bytes.
962
993
  - Build Verifier ran install + build with commands matching `repoShape`; failures classified against known patterns; unknown errors halted the flow before Inspector/Walkthrough.
963
994
  - Post-Scaffold Inspector verified every `documentation.*` path against disk; drift findings recorded with `suggestedFix`; nested-standalone dual-config surfaced without reconciliation.
964
995
  - `requireForProjectCompletion` decision collected from user; written to `.oat/config.json` only on opt-in; never silently default-true.
965
996
  - Walkthrough narrated setup-time context, not AGENTS.md runtime content; skipped framework-irrelevant sections; paused between sections with a `skip to summary` escape.
966
997
  - Optional Content Kickoff delegated to `oat-docs-analyze` + `oat-docs-apply` on accept; handed off with specific commands on decline.
967
- - Exit summary printed with actual values (not placeholders) for app, framework, patches applied, build status, inspection findings, and next-step commands.
998
+ - Exit summary printed with actual values (not placeholders) for app, framework, agent-guidance capability, build status, inspection findings, and next-step commands.
968
999
 
969
- **Ratcheting invariants:**
1000
+ **Single-owner invariants:**
970
1001
 
971
- - When a CLI capability is detected as present (`capabilities.{flag} === true`), the corresponding post-patch is **skipped** — not applied redundantly. The skill self-ratchets as CLI fixes land.
972
- - Every patch's `status` is recorded in `Scaffold Result.patchesApplied` as `applied` / `skipped` with a `reason`. The Exit summary surfaces this so the user sees which CLI gaps the skill had to cover vs. which the CLI handled directly.
973
- - When `capabilities.agentsMdScaffoldFlag === true` (CLI has added native AGENTS.md scaffolding), the FP-15 bridge in this skill is skipped and can be retired from the assets directory.
1002
+ - CLI templates own both framework app-root AGENTS files. Bootstrap never writes a replacement or rewrites current scaffold content.
1003
+ - `Scaffold Result.appAgents` records observed CLI-created/preserved/missing status with a path and remedy; capability and exit-summary claims match the actual files.
1004
+ - Older CLI output routes to analyze/manual upgrade guidance while existing Markdown behavior remains unchanged.
974
1005
 
975
1006
  **Stop-on-broken-state invariants:**
976
1007
 
@@ -981,5 +1012,5 @@ A successful `oat-docs-bootstrap` run satisfies every invariant below. Any failu
981
1012
  **Audience-discipline invariants:**
982
1013
 
983
1014
  - The Walkthrough narrates setup-time concepts; it does not recite the docs-app AGENTS.md word-for-word.
984
- - The docs-app AGENTS.md (FP-15 bridge or CLI-native) contains only guidance that would still be useful six months after scaffold — no "how this was set up" content.
1015
+ - The docs-app AGENTS.md (CLI-scaffolded or existing authored) contains only guidance that would still be useful six months after scaffold — no "how this was set up" content.
985
1016
  - The three agent-instruction surfaces (root `AGENTS.md` `## Documentation`, docs-app `AGENTS.md`, `docs/contributing.md`) are kept distinct by audience + lifetime; the Walkthrough's Section D makes this explicit to the user.
@@ -0,0 +1,89 @@
1
+ # Pull-request docs checks
2
+
3
+ Load this recipe during bootstrap config inspection, including Markdown setup.
4
+ Present the exact workflow diff for the selected repo and get approval before
5
+ writing it. Preserve existing triggers, jobs, permissions and steps. Existing-app
6
+ repair remains analyze/apply work; this recipe does not authorize scaffold or CI
7
+ replacement, deployment, or publication.
8
+
9
+ ## Resolve the concrete inputs
10
+
11
+ Read the actual shared config and package scripts, then substitute these values
12
+ in the existing PR workflow (or propose a new docs job if none exists):
13
+
14
+ - `DOCS_ROOT`: configured repository-relative documentation root.
15
+ - `DOCS_CONTENT`: literal root for Markdown; actual framework content directory.
16
+ - `DOCS_TOOLING`: `markdown`, `fumadocs` or `mkdocs`.
17
+ - `DOCS_BUILD_SCRIPT`: actual app build script (`build` for Fumadocs,
18
+ `docs:build` for the starter MkDocs app); empty for Markdown.
19
+ - `DOCS_MANIFEST`: only an explicitly configured **generated Markdown inventory**,
20
+ such as a Fumadocs app-root `index.md`. Leave empty for Markdown unless the
21
+ user separately configured an external inventory. An authored Markdown index
22
+ or MkDocs YAML is not a generated Markdown inventory.
23
+
24
+ Use Node >=22.17 and the repo's package-manager pin. Provision the selected CLI
25
+ version through the repo's existing dependency installation; framework starters
26
+ declare it in their app package. Add the app's `node_modules/.bin` to `GITHUB_PATH`
27
+ when the binary is installed there. A Markdown-only repo uses its existing approved
28
+ CLI provision; do not introduce an app, dependency install or build just for this
29
+ recipe. For MkDocs use the selected Python environment and the existing pinned
30
+ requirements/setup script. Do not upgrade framework or Python packages implicitly.
31
+ In a workspace install from the workspace root; for a nested standalone app,
32
+ install in that app. Keep existing unrelated setup steps. For Fumadocs, first
33
+ inspect the approved effective-root `pnpm-workspace.yaml` compatibility override
34
+ (`mdast-util-to-markdown: 2.1.2`) from Step4a; verify actual resolution and retain
35
+ the lockfile. Do not use member-only policy, silently merge a conflicting root
36
+ setting or claim an unconstrained install. A pending/declined root edit leaves
37
+ setup unverified.
38
+
39
+ Checkout needs full history so the read-only diagram comparison can use
40
+ `origin/main` (or the configured `documentation.check.diagramBaseRef`). For a
41
+ custom base fetch that ref explicitly. A missing base leaves static checks active
42
+ but reports diagram freshness unverified; do not label that result verified.
43
+
44
+ ## Verification steps
45
+
46
+ This concrete example uses a Fumadocs root `docs-site`. Substitute every env value
47
+ from the inspected repo, retaining the same checker → build → configured-manifest
48
+ order. The `oat` binary must be on PATH from the provision above. Generated manifests
49
+ are committed; the freshness step rejects an untracked output too.
50
+
51
+ ```yaml
52
+ - uses: actions/checkout@v5
53
+ with:
54
+ fetch-depth: 0
55
+ # Keep the repo's Node/package-manager/dependency setup here.
56
+ - name: Verify documentation
57
+ env:
58
+ DOCS_ROOT: docs-site
59
+ DOCS_CONTENT: docs-site/docs
60
+ DOCS_TOOLING: fumadocs
61
+ DOCS_BUILD_SCRIPT: build
62
+ DOCS_MANIFEST: docs-site/index.md
63
+ shell: bash
64
+ run: |
65
+ set -euo pipefail
66
+ oat docs check --target-dir "$DOCS_ROOT"
67
+ if [ "$DOCS_TOOLING" != markdown ]; then
68
+ (cd "$DOCS_ROOT" && pnpm run "$DOCS_BUILD_SCRIPT")
69
+ fi
70
+ if [ -n "$DOCS_MANIFEST" ]; then
71
+ git ls-files --error-unmatch -- "$DOCS_MANIFEST"
72
+ oat docs generate-index --docs-dir "$DOCS_CONTENT" --output "$DOCS_MANIFEST"
73
+ git diff --exit-code -- "$DOCS_MANIFEST"
74
+ fi
75
+ ```
76
+
77
+ Run those exact commands locally from the repository root after installation,
78
+ with the same concrete inputs and PATH. Record checker, real framework build and
79
+ freshness exits separately. A seeded missing description must fail the checker;
80
+ a stale committed configured manifest must fail the final diff. Restore fixtures
81
+ after each control. A command-order stub is not a framework build. Markdown uses
82
+ empty build/manifest inputs and runs only the checker.
83
+
84
+ If a check fails, repair the authored metadata/maps/links or explicitly sync owned
85
+ navigation; never remove the check, silently regenerate a hand-authored sidebar,
86
+ or add a blanket exclusion. Review warnings and narrow reason-bearing exceptions.
87
+ A build that regenerates an inventory does not prove committed freshness: keep
88
+ the final Git diff after the build. Report unverified or declined CI changes in
89
+ the bootstrap exit summary rather than claiming CI is wired.