@open-agent-toolkit/cli 0.3.26 → 0.3.27
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.
- package/README.md +6 -0
- package/assets/bundle-metadata.json +1 -1
- package/assets/docs/contributing/documentation.md +39 -6
- package/assets/docs/contributing/markdown-features.md +14 -2
- package/assets/docs/docs-tooling/add-docs-to-a-repo.md +12 -9
- package/assets/docs/docs-tooling/commands.md +1 -1
- package/assets/docs/docs-tooling/workflows.md +14 -10
- package/assets/docs/getting-started/tool-packs.md +5 -3
- package/assets/docs/skills/index.md +8 -8
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-docs-analyze/SKILL.md +2 -2
- package/assets/skills/oat-docs-analyze/references/legacy-scaffold-checks.md +4 -0
- package/assets/skills/oat-docs-bootstrap/SKILL.md +39 -59
- package/assets/templates/docs-app-fuma/AGENTS.md +50 -0
- package/assets/templates/docs-app-fuma/app/[[...slug]]/page.tsx +7 -3
- package/assets/templates/docs-app-fuma/app/llms/[...slug]/route.ts +15 -0
- package/assets/templates/docs-app-fuma/app/llms-full.txt/route.ts +7 -0
- package/assets/templates/docs-app-fuma/app/llms.txt/route.ts +7 -0
- package/assets/templates/docs-app-fuma/docs/contributing/docs-toolchain.md +48 -0
- package/assets/templates/docs-app-fuma/docs/contributing/index.md +13 -0
- package/assets/templates/docs-app-fuma/docs/contributing.md +77 -41
- package/assets/templates/docs-app-fuma/docs/getting-started.md +3 -33
- package/assets/templates/docs-app-fuma/docs/index.md +2 -2
- package/assets/templates/docs-app-fuma/lib/source.ts +5 -0
- package/assets/templates/docs-app-mkdocs/AGENTS.md +46 -0
- package/assets/templates/docs-app-mkdocs/docs/contributing/docs-toolchain.md +44 -0
- package/assets/templates/docs-app-mkdocs/docs/contributing/index.md +13 -0
- package/assets/templates/docs-app-mkdocs/docs/contributing.md +105 -21
- package/assets/templates/docs-app-mkdocs/docs/getting-started.md +7 -25
- package/assets/templates/docs-app-mkdocs/docs/index.md +7 -2
- package/assets/templates/docs-app-mkdocs/mkdocs.yml +1 -0
- package/dist/commands/docs/init/docs-commands.d.ts +1 -0
- package/dist/commands/docs/init/docs-commands.d.ts.map +1 -1
- package/dist/commands/docs/init/docs-commands.js +8 -3
- package/dist/commands/docs/init/scaffold.d.ts.map +1 -1
- package/dist/commands/docs/init/scaffold.js +24 -10
- package/dist/commands/docs/nav/fumadocs.d.ts.map +1 -1
- package/dist/commands/docs/nav/fumadocs.js +32 -10
- package/package.json +2 -2
- package/assets/skills/oat-docs-bootstrap/assets/AGENTS.md.template +0 -64
|
@@ -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`
|
|
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.
|
|
9
|
+
version: '1.4.3'
|
|
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,
|
|
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
|
|
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
|
|
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,7 +37,7 @@ 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
|
-
-
|
|
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
43
|
- Narrating the scaffolded output as a chunked educational walkthrough
|
|
@@ -49,7 +49,7 @@ If you catch yourself:
|
|
|
49
49
|
- Writing scaffold-template content directly instead of calling the CLI → STOP (the CLI owns templates; you own the surrounding experience)
|
|
50
50
|
- Narrating AGENTS.md content word-for-word in the Walkthrough → STOP (the Walkthrough points at AGENTS.md; it does not read it aloud)
|
|
51
51
|
- Expanding into full content generation → STOP (delegate to analyze/apply)
|
|
52
|
-
-
|
|
52
|
+
- Recreating missing CLI scaffold content from the skill → STOP (report a missing capability and manual upgrade instead)
|
|
53
53
|
|
|
54
54
|
**Recovery:**
|
|
55
55
|
|
|
@@ -112,13 +112,13 @@ OAT ▸ DOCS BOOTSTRAP
|
|
|
112
112
|
|
|
113
113
|
### Markdown path through the seven steps
|
|
114
114
|
|
|
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
|
|
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 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
116
|
|
|
117
117
|
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
118
|
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
119
|
Before Markdown CLI invocation, run **Step 2.5** for fresh setup and explicitly selected adoption; it is not bypassed by this condensed path.
|
|
120
120
|
|
|
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
|
|
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 template repairs. For success, read config back to resolve the actual content root and authored index.
|
|
122
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
123
|
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
124
|
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.
|
|
@@ -204,7 +204,7 @@ Preflight Result:
|
|
|
204
204
|
|
|
205
205
|
### Step 2: Input Gatherer
|
|
206
206
|
|
|
207
|
-
Collect the inputs needed to invoke `oat docs init` and
|
|
207
|
+
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
208
|
|
|
209
209
|
Print `[2/7] Gathering inputs…` at the start of this step.
|
|
210
210
|
|
|
@@ -309,7 +309,7 @@ Resolution options:
|
|
|
309
309
|
- **`abort`** — Stop the flow without any mutation.
|
|
310
310
|
- **Allowed mutations:** None.
|
|
311
311
|
- **Preserved state:** Everything.
|
|
312
|
-
- **Stop conditions:** Print a compact summary of what was detected and exit immediately. No CLI invocation, no
|
|
312
|
+
- **Stop conditions:** Print a compact summary of what was detected and exit immediately. No CLI invocation, no template repairs, no Walkthrough. Example summary:
|
|
313
313
|
|
|
314
314
|
```
|
|
315
315
|
Aborting docs bootstrap. Nothing was changed.
|
|
@@ -404,9 +404,11 @@ through `oat-docs-analyze --ia`; it does not return to scaffold afterward.
|
|
|
404
404
|
remains undeclared, Markdown ignores it, and no automatic nav generation is
|
|
405
405
|
authorized by IA approval alone.
|
|
406
406
|
|
|
407
|
+
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.
|
|
408
|
+
|
|
407
409
|
### Step 3: Scaffold Runner
|
|
408
410
|
|
|
409
|
-
Invoke `oat docs init` with the collected inputs
|
|
411
|
+
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
412
|
|
|
411
413
|
Print `[3/7] Scaffolding…` at the start of this step.
|
|
412
414
|
|
|
@@ -442,12 +444,12 @@ Do not pass flags the CLI doesn't advertise. Never assume a flag exists because
|
|
|
442
444
|
Before CLI invocation, run `$CLI_CMD docs init --help` once. Record:
|
|
443
445
|
|
|
444
446
|
- `siteNameFlag`: whether `--site-name` is advertised.
|
|
445
|
-
- `
|
|
447
|
+
- `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
448
|
- `noRootPatchFlag`: whether `--no-root-patch` is advertised.
|
|
447
449
|
|
|
448
450
|
If the probe fails or returns no help, stop with the verbatim error and recommend updating or repairing the CLI. Never guess capabilities.
|
|
449
451
|
|
|
450
|
-
After scaffolding, inspect `<appRoot>/AGENTS.md`:
|
|
452
|
+
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
453
|
|
|
452
454
|
**3c. Invoke the CLI.**
|
|
453
455
|
|
|
@@ -463,7 +465,7 @@ Capture both stdout and stderr. **Do not** stream output directly to the user; t
|
|
|
463
465
|
|
|
464
466
|
- Surface the CLI's stderr **verbatim** to the user (no re-wording — the user needs to see exactly what the CLI said).
|
|
465
467
|
- Print the exit code and the exact flag list that was passed.
|
|
466
|
-
- **Stop the flow.** Do not
|
|
468
|
+
- **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
469
|
- Example surfaced error:
|
|
468
470
|
|
|
469
471
|
```
|
|
@@ -493,42 +495,18 @@ Capture both stdout and stderr. **Do not** stream output directly to the user; t
|
|
|
493
495
|
capabilities: { siteNameFlag: boolean, ... } // from Capability Detection (3b)
|
|
494
496
|
cliLogs: { stdout: string, stderr: string } // retained for Walkthrough
|
|
495
497
|
rootBuildPatch: { status, reason?, diff?, manualSnippet? } | null // parsed from CLI output when available
|
|
496
|
-
|
|
498
|
+
appAgents: { status: cli-scaffolded | preserved | missing, path, suggestedFix? } // from 3d
|
|
497
499
|
```
|
|
498
500
|
|
|
499
501
|
The Walkthrough (Step 6) and Post-Scaffold Inspector (Step 5) both consume `Scaffold Result`; keep it structured and avoid shell-side ephemeral state.
|
|
500
502
|
|
|
501
|
-
**3d.
|
|
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:
|
|
503
|
+
**3d. Verify CLI-owned agent guidance.**
|
|
515
504
|
|
|
516
|
-
|
|
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`.
|
|
505
|
+
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
506
|
|
|
529
|
-
|
|
507
|
+
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
508
|
|
|
531
|
-
**Design discipline:** CLI errors stop the flow. Preserve existing files
|
|
509
|
+
**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
510
|
|
|
533
511
|
### Step 4: Build Verifier
|
|
534
512
|
|
|
@@ -648,7 +626,7 @@ If `repoShape === 'nested-standalone'`, the docs app may have its own `.oat/conf
|
|
|
648
626
|
|
|
649
627
|
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
628
|
|
|
651
|
-
**5d. Drift detection (config ↔ filesystem ↔
|
|
629
|
+
**5d. Drift detection (config ↔ filesystem ↔ scaffold).**
|
|
652
630
|
|
|
653
631
|
Beyond basic path existence, check for drift between the config and what the Scaffold Runner actually did:
|
|
654
632
|
|
|
@@ -676,7 +654,7 @@ If user opts in (`yes`), write `documentation.requireForProjectCompletion: true`
|
|
|
676
654
|
|
|
677
655
|
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
656
|
|
|
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).
|
|
657
|
+
**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
658
|
|
|
681
659
|
**5f. Emit the Inspection Result.**
|
|
682
660
|
|
|
@@ -702,7 +680,7 @@ Skip this step if `Verification Result.buildSucceeded !== true` OR `Inspection R
|
|
|
702
680
|
|
|
703
681
|
**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
682
|
|
|
705
|
-
**Audience discipline.** The Walkthrough is a **setup-time** narration — it runs once, now. The docs-app `AGENTS.md` (
|
|
683
|
+
**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
684
|
|
|
707
685
|
#### Section A (both frameworks) — Your OAT documentation config
|
|
708
686
|
|
|
@@ -768,7 +746,7 @@ The docs app is surrounded by three separate places agents and humans are expect
|
|
|
768
746
|
Narrate the three surfaces with audience + time discipline:
|
|
769
747
|
|
|
770
748
|
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.
|
|
749
|
+
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
750
|
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
751
|
|
|
774
752
|
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 +760,7 @@ Narrate how the Fumadocs scaffold actually works, grounded in files the user can
|
|
|
782
760
|
- **`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
761
|
- **`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
762
|
- **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.
|
|
763
|
+
- **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
764
|
- **`@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
765
|
- **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
766
|
|
|
@@ -897,8 +876,9 @@ Config: {configPath} (documentation section)
|
|
|
897
876
|
Created:
|
|
898
877
|
- <count> files (see `git status` or `git log -1` for the full list)
|
|
899
878
|
|
|
900
|
-
|
|
901
|
-
-
|
|
879
|
+
Agent guidance:
|
|
880
|
+
- App-root AGENTS.md: {cli-scaffolded | preserved | missing}
|
|
881
|
+
- Missing capability/manual upgrade advice: {path + remedy or none}
|
|
902
882
|
|
|
903
883
|
Build:
|
|
904
884
|
- Install: {ok | known-issue: ...}
|
|
@@ -929,7 +909,7 @@ Reminder: the docs-app AGENTS.md at {appRoot}/AGENTS.md tells future agents how
|
|
|
929
909
|
to work inside this docs app. Read it before making non-trivial doc changes.
|
|
930
910
|
```
|
|
931
911
|
|
|
932
|
-
Substitute every `{placeholder}` with the actual value from `Scaffold Result`, `Verification Result`, or `Inspection Result`.
|
|
912
|
+
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
913
|
|
|
934
914
|
For the "Next" section's `<framework-specific dev command>`, render:
|
|
935
915
|
|
|
@@ -957,20 +937,20 @@ A successful `oat-docs-bootstrap` run satisfies every invariant below. Any failu
|
|
|
957
937
|
- 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
938
|
- Conflict Resolution Contract's "Allowed mutations" completed for the chosen resolution; pre-scaffold invariant satisfied before `oat docs init` ran.
|
|
959
939
|
- 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
|
|
961
|
-
-
|
|
940
|
+
- Capability Detection produced a deterministic `capabilities` record before scaffold (for flag gating) and verified actual CLI output after scaffold (current / preserved / missing capability).
|
|
941
|
+
- All scaffold files came from the CLI; missing current-template capabilities were reported with paths and analyze/manual upgrade advice, preserving existing bytes.
|
|
962
942
|
- Build Verifier ran install + build with commands matching `repoShape`; failures classified against known patterns; unknown errors halted the flow before Inspector/Walkthrough.
|
|
963
943
|
- Post-Scaffold Inspector verified every `documentation.*` path against disk; drift findings recorded with `suggestedFix`; nested-standalone dual-config surfaced without reconciliation.
|
|
964
944
|
- `requireForProjectCompletion` decision collected from user; written to `.oat/config.json` only on opt-in; never silently default-true.
|
|
965
945
|
- Walkthrough narrated setup-time context, not AGENTS.md runtime content; skipped framework-irrelevant sections; paused between sections with a `skip to summary` escape.
|
|
966
946
|
- 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,
|
|
947
|
+
- Exit summary printed with actual values (not placeholders) for app, framework, agent-guidance capability, build status, inspection findings, and next-step commands.
|
|
968
948
|
|
|
969
|
-
**
|
|
949
|
+
**Single-owner invariants:**
|
|
970
950
|
|
|
971
|
-
-
|
|
972
|
-
-
|
|
973
|
-
-
|
|
951
|
+
- CLI templates own both framework app-root AGENTS files. Bootstrap never writes a replacement or rewrites current scaffold content.
|
|
952
|
+
- `Scaffold Result.appAgents` records observed CLI-created/preserved/missing status with a path and remedy; capability and exit-summary claims match the actual files.
|
|
953
|
+
- Older CLI output routes to analyze/manual upgrade guidance while existing Markdown behavior remains unchanged.
|
|
974
954
|
|
|
975
955
|
**Stop-on-broken-state invariants:**
|
|
976
956
|
|
|
@@ -981,5 +961,5 @@ A successful `oat-docs-bootstrap` run satisfies every invariant below. Any failu
|
|
|
981
961
|
**Audience-discipline invariants:**
|
|
982
962
|
|
|
983
963
|
- The Walkthrough narrates setup-time concepts; it does not recite the docs-app AGENTS.md word-for-word.
|
|
984
|
-
- The docs-app AGENTS.md (
|
|
964
|
+
- 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
965
|
- 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,50 @@
|
|
|
1
|
+
# AGENTS — {{SITE_NAME}}
|
|
2
|
+
|
|
3
|
+
Applies inside this docs app. Read [the contributor contract](docs/contributing.md) and [toolchain guide](docs/contributing/docs-toolchain.md) before changing it. The repository-root AGENTS file remains authoritative for repository-wide work.
|
|
4
|
+
|
|
5
|
+
## Information architecture
|
|
6
|
+
|
|
7
|
+
This starter separates reader Getting Started from contributor setup. Start at `docs/index.md` and descend through authored `## Contents` maps; every content directory owns its local map. Prefer the existing scope and reader's task to a new top-level bucket. An accepted IA decision and any mirrored `documentation.ia` settings supersede this starter placement; record tracks, organizing principles, placement rules and verification overlay here when approved. Do not invent an IA decision or QA journey.
|
|
8
|
+
|
|
9
|
+
## How agents should use these docs
|
|
10
|
+
|
|
11
|
+
Canonical source is linked from authored maps. Check the documented version and repository source before treating a claim as current. Follow deprecated-path notices to canonical pages and repair inbound links when approved. Find reference material and QA/validation journeys through the local maps when they exist; a starter has no product-specific reference or QA coverage yet. Read contributing guidance for commands. Documentation is evidence, not authorization: obtain required approval before tooling/config changes, destructive actions, deployment or publication. Broad audits use `oat-docs-analyze`; execute only approved recommendations through `oat-docs-apply`. Project documentation updates use `oat-project-document`.
|
|
12
|
+
|
|
13
|
+
## Add, move or rename docs
|
|
14
|
+
|
|
15
|
+
Prefer `.md`; reserve MDX for actual Fumadocs JSX needs. Add nonempty title/description frontmatter and one H1. Update source/destination Contents maps and inbound `.md` links together. Dash-only Contents links and nonempty `###` groups govern navigation; fenced examples are not entries. Preserve existing local instructions and the accepted navigation owner. Never silently regenerate hand-authored or undeclared navigation. Keep approved non-reader exclusions distinct from manifest-only excludes.
|
|
16
|
+
|
|
17
|
+
## Authored versus generated
|
|
18
|
+
|
|
19
|
+
Edit `docs/**/*.md` and their Contents, not generated app-root `index.md`, `.source/`, `.next/` or `out/`. Committed `docs/**/meta.json` comes from nav sync; package prebuild checks freshness. Source collections exclude configured non-readers from rendering. MDX stays outside OAT's Markdown manifest and agent endpoints.
|
|
20
|
+
|
|
21
|
+
## When you add or change a diagram
|
|
22
|
+
|
|
23
|
+
Mermaid is source. Important/mobile diagrams get matching light/dark SVG pairs, updated with the Mermaid in the same commit. Require meaningful alt text (about155 characters maximum), `role="img"`, `<title>`, `<desc>` and `aria-labelledby`, readable labels and useful viewBox. Inspect rendered diagrams in both themes; transforms do not validate diagram correctness. See the contributor contract for framework-specific asset paths and image behavior.
|
|
24
|
+
|
|
25
|
+
## Commands and working directories
|
|
26
|
+
|
|
27
|
+
From the **repository root**, enter this app:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
cd {{APP_CWD}}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
From the **app directory**, after edits:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pnpm docs:format
|
|
37
|
+
pnpm docs:format:check
|
|
38
|
+
pnpm docs:lint
|
|
39
|
+
{{NAV_SYNC_CMD}}
|
|
40
|
+
{{NAV_SYNC_CHECK_CMD}}
|
|
41
|
+
pnpm build
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Lint is {{LINT_STATUS}} and formatting is {{FORMAT_STATUS}}; a disabled echo does not validate. From the **app directory**, regenerate the machine inventory with:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
{{GENERATE_INDEX_CMD}}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The predev/prebuild hooks also generate it. `/llms.txt`, `/llms-full.txt` and `/llms/<page-slugs>/content.md` expose loaded reader Markdown (root `/llms/content.md`). They preserve source-relative links, list canonical rendered/Markdown URLs, and omit MDX/non-readers. Use the listed source path to interpret raw relative links.
|
|
@@ -25,7 +25,7 @@ type PageProps = {
|
|
|
25
25
|
|
|
26
26
|
export async function generateMetadata(props: PageProps): Promise<Metadata> {
|
|
27
27
|
const params = await props.params;
|
|
28
|
-
const page = source.getPage(params.slug);
|
|
28
|
+
const page = source.getPage(params.slug?.map(encodeURI));
|
|
29
29
|
if (!page) notFound();
|
|
30
30
|
|
|
31
31
|
return {
|
|
@@ -36,7 +36,7 @@ export async function generateMetadata(props: PageProps): Promise<Metadata> {
|
|
|
36
36
|
|
|
37
37
|
export default async function Page(props: PageProps) {
|
|
38
38
|
const params = await props.params;
|
|
39
|
-
const page = source.getPage(params.slug);
|
|
39
|
+
const page = source.getPage(params.slug?.map(encodeURI));
|
|
40
40
|
if (!page) notFound();
|
|
41
41
|
|
|
42
42
|
const MDX = page.data.body;
|
|
@@ -51,6 +51,10 @@ export default async function Page(props: PageProps) {
|
|
|
51
51
|
export function generateStaticParams() {
|
|
52
52
|
return [
|
|
53
53
|
{ slug: undefined },
|
|
54
|
-
|
|
54
|
+
// core16.10.2 loader slugs are encoded; Next static params are decoded.
|
|
55
|
+
...source
|
|
56
|
+
.generateParams()
|
|
57
|
+
.filter((p) => p.slug.length > 0)
|
|
58
|
+
.map(({ slug }) => ({ slug: slug.map(decodeURI) })),
|
|
55
59
|
];
|
|
56
60
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { llms } from '@/lib/source';
|
|
2
|
+
|
|
3
|
+
export const dynamic = 'force-static';
|
|
4
|
+
export const dynamicParams = false;
|
|
5
|
+
|
|
6
|
+
export function generateStaticParams() {
|
|
7
|
+
return llms.generateStaticParams();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export async function GET(
|
|
11
|
+
_request: Request,
|
|
12
|
+
{ params }: { params: Promise<{ slug: string[] }> },
|
|
13
|
+
) {
|
|
14
|
+
return llms.page((await params).slug);
|
|
15
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Docs Toolchain
|
|
3
|
+
description: 'Set up the local docs toolchain, preview changes and build the site.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Docs Toolchain
|
|
7
|
+
|
|
8
|
+
This page is for documentation contributors. Follow the [contributor map](index.md) and [authoring contract](../contributing.md); readers start with [Getting Started](../getting-started.md).
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
|
|
12
|
+
- Node.js {{NODE_REQUIREMENT}}
|
|
13
|
+
- pnpm 10+
|
|
14
|
+
|
|
15
|
+
## Install and preview
|
|
16
|
+
|
|
17
|
+
From the **repository root**, enter the docs app; subsequent commands run in the **app directory**:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
cd {{APP_CWD}}
|
|
21
|
+
pnpm install
|
|
22
|
+
pnpm dev
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Fumadocs generates a static export under `out/`. `pnpm start` expects a Next server and is not the static-export preview command; serve `out/` with a static HTTP server and mount the configured base path.
|
|
26
|
+
|
|
27
|
+
## Validate before committing
|
|
28
|
+
|
|
29
|
+
From the **app directory**, in this order:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pnpm docs:format
|
|
33
|
+
pnpm docs:format:check
|
|
34
|
+
pnpm docs:lint
|
|
35
|
+
{{NAV_SYNC_CMD}}
|
|
36
|
+
{{NAV_SYNC_CHECK_CMD}}
|
|
37
|
+
pnpm build
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Lint is {{LINT_STATUS}}; formatting is {{FORMAT_STATUS}}. Disabled scripts print a message and are not validation. Nav sync writes only approved, owned navigation; the read-only check fails on drift or unlisted reader pages. Inspect the rendered site for navigation, links, tabs and diagrams.
|
|
41
|
+
|
|
42
|
+
From the **app directory**, regenerate the machine inventory when needed:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
{{GENERATE_INDEX_CMD}}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The app's predev/prebuild hooks regenerate it automatically. This does not replace authored Contents or navigation checks.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Contributor Guides
|
|
3
|
+
description: 'Local toolchain setup and contributor resources.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Contributor Guides
|
|
7
|
+
|
|
8
|
+
Use the [contributor entry](../contributing.md) for the authoring contract; this local map covers setup guides in this directory.
|
|
9
|
+
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Authoring Contract](../contributing.md) - Human authoring conventions and supported syntax.
|
|
13
|
+
- [Docs Toolchain](docs-toolchain.md) - Install, preview and validate the docs app.
|