@agentskit/doc-bridge 1.0.1 → 1.1.1

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 (48) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/CONTRIBUTING.md +7 -0
  3. package/README.md +81 -15
  4. package/SECURITY.md +1 -1
  5. package/action.yml +2 -2
  6. package/dist/cli/program.js +1248 -316
  7. package/dist/cli/program.js.map +1 -1
  8. package/dist/config/index.d.ts +1 -1
  9. package/dist/config/index.js +338 -13
  10. package/dist/config/index.js.map +1 -1
  11. package/dist/{index-CPUJbTbg.d.ts → index-DGI9TBLE.d.ts} +906 -11
  12. package/dist/index.d.ts +65 -11
  13. package/dist/index.js +1084 -171
  14. package/dist/index.js.map +1 -1
  15. package/docs/RELEASE.md +19 -21
  16. package/docs/getting-started.md +27 -2
  17. package/docs/landing/assets/doc-bridge-hero.webp +0 -0
  18. package/docs/landing/assets/doc-bridge-surfaces.webp +0 -0
  19. package/docs/landing/assets/doc-bridge-two-way.webp +0 -0
  20. package/docs/landing/index.html +70 -10
  21. package/docs/playbook/doc-bridge-pattern.md +2 -2
  22. package/docs/recipes/index-pipeline.md +2 -2
  23. package/docs/schemas/memory-candidate-v1.md +10 -1
  24. package/docs/spec/cli.md +1 -0
  25. package/docs/spec/config-v1.md +51 -6
  26. package/docs/spec/documentation-standard-v1.md +131 -0
  27. package/ecosystem-claims.json +187 -0
  28. package/ecosystem-upstream.json +9 -0
  29. package/ecosystem.json +231 -0
  30. package/package.json +14 -2
  31. package/scripts/check-ecosystem-upstream.mjs +50 -0
  32. package/src/cli/program.ts +43 -9
  33. package/src/config/index.ts +7 -1
  34. package/src/config/load-config.ts +4 -14
  35. package/src/config/schema.ts +91 -0
  36. package/src/conformance/documentation-standard-v1.ts +502 -0
  37. package/src/conformance/ecosystem-contract.ts +175 -0
  38. package/src/gates/run-gates.ts +33 -4
  39. package/src/index-builder/human-adapters/core.ts +12 -5
  40. package/src/index-builder/human-adapters/docusaurus.ts +29 -44
  41. package/src/index-builder/human-adapters/index.ts +15 -3
  42. package/src/index-builder/scan-corpus.ts +6 -6
  43. package/src/index.ts +17 -0
  44. package/src/lib/bounded-text.ts +25 -0
  45. package/src/lib/paths.ts +20 -2
  46. package/src/lib/static-js-literal.ts +261 -0
  47. package/src/lib/walk.ts +23 -4
  48. package/src/version.ts +1 -1
package/docs/RELEASE.md CHANGED
@@ -4,13 +4,19 @@
4
4
 
5
5
  ```bash
6
6
  pnpm install
7
+ pnpm audit --audit-level low
7
8
  pnpm typecheck
9
+ pnpm check:ecosystem-upstream
8
10
  pnpm test
11
+ pnpm coverage
9
12
  pnpm build
10
13
  pnpm smoke:packaged
14
+ node bin/ak-docs.js index
15
+ node bin/ak-docs.js gate run
16
+ node bin/ak-docs.js conformance run documentation-standard-v1 --text
11
17
  ```
12
18
 
13
- Expect: packaged smoke prints `packaged smoke passed` and includes demo `query package example --agent`.
19
+ Expect: zero known vulnerabilities, coverage above the repository threshold, packaged smoke prints `packaged smoke passed`, and every required and recommended documentation rule passes without exceptions.
14
20
 
15
21
  ## Version
16
22
 
@@ -21,45 +27,37 @@ pnpm changeset # if new entry needed
21
27
  pnpm version-packages # bumps package.json + CHANGELOG from .changeset/*
22
28
  ```
23
29
 
24
- Current track: **`1.0.0` stable** (alpha series ended at `0.1.0-alpha.5`).
30
+ Current track: **`1.1.1` stable** (alpha series ended at `0.1.0-alpha.5`).
25
31
 
26
- ## Publish (npm)
32
+ ## Publish (npm + GitHub)
27
33
 
28
- Requires npm auth for the `@agentskit` org (`npm whoami` / `NPM_TOKEN`).
34
+ Stable releases are published only by `.github/workflows/release.yml` from an immutable semver tag. The workflow re-runs the complete security, test, coverage, packaged-smoke, dogfood, and conformance matrix, publishes with npm provenance through the `npm` environment, verifies the registry result, uploads the tarball to GitHub Releases, and then marks the release latest.
29
35
 
30
36
  ```bash
31
- pnpm release
32
- # equivalent:
33
- # pnpm build && pnpm test && changeset publish
37
+ git tag v1.1.1
38
+ git push origin v1.1.1
34
39
  ```
35
40
 
36
- Or one-shot after version bump:
41
+ For recovery of an existing immutable tag, use the guarded manual dispatch. Never move or recreate a release tag.
37
42
 
38
43
  ```bash
39
- npm publish --access public
44
+ gh workflow run release.yml --ref master -f tag=v1.1.1
40
45
  ```
41
46
 
42
47
  Confirm:
43
48
 
44
49
  ```bash
45
- npm view @agentskit/doc-bridge version
46
- npx ak-docs@0.1.0-alpha.x --version
50
+ npm view @agentskit/doc-bridge@1.1.1 version dist.integrity
51
+ npx ak-docs@1.1.1 --version
52
+ gh release view v1.1.1
47
53
  ```
48
54
 
49
- ## GitHub
50
-
51
- ```bash
52
- git tag v1.0.0
53
- git push origin master --tags
54
- gh release create v1.0.0 --title "v1.0.0 — AgentHandoff stable" --notes-file CHANGELOG.md
55
- ```
56
-
57
- Enable GitHub Pages (Settings → Pages → GitHub Actions) for landing deploy from `.github/workflows/pages.yml`.
55
+ GitHub Pages must remain configured for GitHub Actions; `.github/workflows/pages.yml` deploys the landing page from `docs/landing`.
58
56
 
59
57
  ## Post-publish smoke (fresh machine)
60
58
 
61
59
  ```bash
62
- npm i -D @agentskit/doc-bridge@0.1.0-alpha.x
60
+ npm i -D @agentskit/doc-bridge@1.1.1
63
61
  npx ak-docs init
64
62
  npx ak-docs index
65
63
  npx ak-docs query package example --agent
@@ -1,5 +1,16 @@
1
1
  # Getting started
2
2
 
3
+ doc-bridge turns your existing docs into an **AgentHandoff** index:
4
+
5
+ - `startHere` — what the agent reads first
6
+ - `editRoots` — where the agent is allowed to work
7
+ - `checks` — what proves the edit
8
+ - `humanDoc` — the human-facing guide for the same area
9
+
10
+ It also runs the inverse loop: local agent memory becomes a classified,
11
+ reviewable documentation draft. Start with CLI. Add MCP when agents should call
12
+ it automatically. Add CI when the bridge becomes part of review.
13
+
3
14
  ## Install
4
15
 
5
16
  ```bash
@@ -60,6 +71,17 @@ Project root for `--config path/to/doc-bridge.config.json` is the **directory of
60
71
 
61
72
  See [config-v1](./spec/config-v1.md) and [examples](./examples.md).
62
73
 
74
+ ## Use surfaces
75
+
76
+ | Surface | When to use | Command |
77
+ |---------|-------------|---------|
78
+ | CLI | You want to inspect or debug the bridge yourself | `ak-docs query package <id> --agent` |
79
+ | MCP | You want coding agents to resolve handoffs before editing | `ak-docs mcp install --cursor` |
80
+ | CI | You want stale indexes and broken links to fail PRs | `ak-docs index && ak-docs gate run` |
81
+ | Adapters | You already have Fumadocs, Docusaurus, or markdown docs | configure `corpus.human` |
82
+ | Memory pipeline | You want agent notes turned into reviewable docs | `ak-docs memory promote --pr --dry-run` |
83
+ | Optional RAG/chat | You want a terminal assistant grounded in the same index | `ak-docs rag ingest && ak-docs chat` |
84
+
63
85
  ## MCP (Cursor / Claude)
64
86
 
65
87
  ```json
@@ -90,10 +112,13 @@ ak-docs bootstrap agent-docs # draft agent docs from human site
90
112
  ```bash
91
113
  ak-docs memory ingest
92
114
  ak-docs memory classify
93
- ak-docs memory promote # draft only — never auto-merges
115
+ ak-docs memory promote # prints a safe draft body
116
+ ak-docs memory promote --pr --dry-run
117
+ ak-docs memory promote --pr # opens a GitHub draft PR via gh
94
118
  ```
95
119
 
96
- Sources include `.agent-memory/**` and `.cursor/rules/*.mdc`.
120
+ Sources include `.agent-memory/**` and `.cursor/rules/*.mdc`. Promotion is
121
+ draft-only and never auto-merges.
97
122
 
98
123
  ## Optional chat + RAG (AgentsKit)
99
124
 
@@ -3,8 +3,8 @@
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>doc-bridge — AgentHandoff for your monorepo</title>
7
- <meta name="description" content="Deterministic routing for coding agents: edit the right package, run the right checks, bridge to human docs. No API key required." />
6
+ <title>doc-bridge — docs your agents can act on</title>
7
+ <meta name="description" content="Turn human docs into executable handoffs for agents, and turn agent memory into reviewable documentation drafts. MCP, CLI, CI. No API key required." />
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com" />
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
10
  <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap" rel="stylesheet" />
@@ -105,6 +105,22 @@
105
105
  .dot-y { background: var(--amber); }
106
106
  .dot-g { background: var(--green); }
107
107
  .terminal-body { padding: 1.25rem 1.5rem; overflow-x: auto; }
108
+ .hero-image {
109
+ display: block;
110
+ width: 100%;
111
+ margin: 0 0 2rem;
112
+ border: 1px solid var(--border);
113
+ border-radius: var(--radius);
114
+ box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
115
+ }
116
+ .section-image {
117
+ display: block;
118
+ width: 100%;
119
+ margin: 0 0 1.5rem;
120
+ border: 1px solid var(--border);
121
+ border-radius: var(--radius);
122
+ box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
123
+ }
108
124
  .t-dim { color: var(--muted); }
109
125
  .t-ok { color: var(--green); }
110
126
  .t-bad { color: var(--red); }
@@ -145,6 +161,25 @@
145
161
  text-decoration: none;
146
162
  }
147
163
  .used-by a:hover { border-color: var(--accent-dim); }
164
+ .surface-table {
165
+ width: 100%;
166
+ border-collapse: collapse;
167
+ overflow: hidden;
168
+ border: 1px solid var(--border);
169
+ border-radius: var(--radius);
170
+ background: var(--surface);
171
+ }
172
+ .surface-table th,
173
+ .surface-table td {
174
+ padding: 0.9rem 1rem;
175
+ border-bottom: 1px solid var(--border);
176
+ text-align: left;
177
+ vertical-align: top;
178
+ font-size: 0.92rem;
179
+ }
180
+ .surface-table th { color: var(--text); font-weight: 600; }
181
+ .surface-table td { color: var(--muted); }
182
+ .surface-table tr:last-child td { border-bottom: 0; }
148
183
  .badge-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
149
184
  .badge-row img { height: 22px; }
150
185
  footer {
@@ -173,16 +208,19 @@
173
208
  <main>
174
209
  <section class="hero">
175
210
  <div class="wrap">
176
- <div class="eyebrow">AgentHandoff for your monorepo</div>
177
- <h1>Your agent never edits the wrong package again.</h1>
211
+ <div class="eyebrow">Docs your agents can act on</div>
212
+ <h1>Turn repo docs into executable handoffs.</h1>
178
213
  <p class="lead">
179
- Deterministic handoffs: <strong>startHere</strong>, <strong>editRoots</strong>, <strong>checks</strong>, and a bridge to human docs.
180
- Layer 0 works without any LLM or API key.
214
+ doc-bridge gives every coding agent the same contract: <strong>startHere</strong>,
215
+ <strong>editRoots</strong>, <strong>checks</strong>, and <strong>humanDoc</strong>.
216
+ Then it turns agent memory back into reviewable documentation drafts.
217
+ Use it from CLI, MCP, and CI. No LLM or API key required.
181
218
  </p>
182
219
  <div class="cta-row">
183
220
  <a class="btn btn-primary" href="#demo">See 60s demo</a>
184
221
  <a class="btn btn-ghost" href="https://github.com/AgentsKit-io/doc-bridge#readme">Read README</a>
185
222
  </div>
223
+ <img class="hero-image" src="assets/doc-bridge-hero.webp" alt="doc-bridge maps human docs into structured agent handoffs for CLI, MCP, and CI" />
186
224
  <div class="grid-2" id="demo">
187
225
  <div class="terminal">
188
226
  <div class="terminal-bar"><span class="dot dot-r"></span><span class="dot dot-y"></span><span class="dot dot-g"></span></div>
@@ -221,10 +259,32 @@
221
259
  </div>
222
260
  </section>
223
261
 
262
+ <section>
263
+ <div class="wrap">
264
+ <h2>Use it where agents already work</h2>
265
+ <p class="section-lead">One index, multiple surfaces. Start with the CLI; wire MCP and CI when the first handoff is useful.</p>
266
+ <img class="section-image" src="assets/doc-bridge-surfaces.webp" alt="doc-bridge index used through CLI, MCP, CI, and documentation adapters" />
267
+ <table class="surface-table">
268
+ <thead>
269
+ <tr><th>Surface</th><th>What it does</th><th>How you use it</th></tr>
270
+ </thead>
271
+ <tbody>
272
+ <tr><td>CLI</td><td>Query ownership, inspect handoffs, run doctor, search docs.</td><td><code>ak-docs query package auth --agent</code></td></tr>
273
+ <tr><td>MCP</td><td>Lets Cursor, Claude Code, and Codex-style agents resolve before editing.</td><td><code>ak-docs mcp install --cursor</code></td></tr>
274
+ <tr><td>CI</td><td>Blocks stale indexes and broken human-doc bridges.</td><td><code>ak-docs index && ak-docs gate run</code></td></tr>
275
+ <tr><td>Adapters</td><td>Connect Fumadocs, Docusaurus, plain markdown, and pnpm workspaces.</td><td><code>fumadocs</code> · <code>docusaurus</code> · <code>plain-markdown</code></td></tr>
276
+ <tr><td>Memory pipeline</td><td>Classifies local agent memory and drafts documentation updates.</td><td><code>ak-docs memory promote --pr</code></td></tr>
277
+ <tr><td>Optional RAG/chat</td><td>Adds handoff-first chat when you install AgentsKit peers.</td><td><code>ak-docs rag ingest && ak-docs chat</code></td></tr>
278
+ </tbody>
279
+ </table>
280
+ </div>
281
+ </section>
282
+
224
283
  <section id="loops">
225
284
  <div class="wrap">
226
285
  <h2>Four loops, one bridge</h2>
227
286
  <p class="section-lead">Act, bridge, learn, explain — each loop has a CLI command and real output, not a concept table.</p>
287
+ <img class="section-image" src="assets/doc-bridge-two-way.webp" alt="doc-bridge connects human docs to coding agents and agent memory back to draft docs" />
228
288
  <div class="loops">
229
289
  <div class="card">
230
290
  <div class="loop-tag">Act</div>
@@ -238,8 +298,8 @@
238
298
  </div>
239
299
  <div class="card">
240
300
  <div class="loop-tag">Learn</div>
241
- <h3>Memory → docs</h3>
242
- <p><code>memory promote --pr</code> · HITL draft PR</p>
301
+ <h3>Agent memory → docs</h3>
302
+ <p><code>memory classify</code> · <code>promote --pr</code></p>
243
303
  </div>
244
304
  <div class="card">
245
305
  <div class="loop-tag">Explain</div>
@@ -277,7 +337,7 @@
277
337
  <div class="terminal-bar"><span class="dot dot-r"></span><span class="dot dot-y"></span><span class="dot dot-g"></span></div>
278
338
  <div class="terminal-body">
279
339
  <div class="t-dim"># .github/workflows/pr.yml</div>
280
- <div>- uses: <span class="t-hi">AgentsKit-io/doc-bridge@v1.0.0</span></div>
340
+ <div>- uses: <span class="t-hi">AgentsKit-io/doc-bridge@v1.1.1</span></div>
281
341
  <div>&nbsp;&nbsp;with:</div>
282
342
  <div>&nbsp;&nbsp;&nbsp;&nbsp;config-path: doc-bridge.config.json</div>
283
343
  </div>
@@ -296,4 +356,4 @@
296
356
  </div>
297
357
  </footer>
298
358
  </body>
299
- </html>
359
+ </html>
@@ -75,7 +75,7 @@ Agents call `handoff.resolve` before editing `packages/*`:
75
75
  ## CI gate
76
76
 
77
77
  ```yaml
78
- - uses: AgentsKit-io/doc-bridge@v1.0.0
78
+ - uses: AgentsKit-io/doc-bridge@v1.1.1
79
79
  ```
80
80
 
81
81
  Or: `ak-docs index && ak-docs gate run` — stale index fails the PR.
@@ -111,4 +111,4 @@ Teams track handoff % and human-bridge % daily.
111
111
  - npm: https://www.npmjs.com/package/@agentskit/doc-bridge
112
112
  - repo: https://github.com/AgentsKit-io/doc-bridge
113
113
  - skill: [doc-bridge skill](../skills/doc-bridge.md)
114
- - landing: https://agentskit-io.github.io/doc-bridge/
114
+ - landing: https://agentskit-io.github.io/doc-bridge/
@@ -66,7 +66,7 @@ Root `package.json`:
66
66
  ## CI (GitHub Action)
67
67
 
68
68
  ```yaml
69
- - uses: AgentsKit-io/doc-bridge@v1.0.0
69
+ - uses: AgentsKit-io/doc-bridge@v1.1.1
70
70
  ```
71
71
 
72
72
  Or manual:
@@ -86,4 +86,4 @@ ak-docs doctor --write-badge
86
86
  pnpm coverage:badge
87
87
  ```
88
88
 
89
- Paste the shields.io line from `.doc-bridge/coverage-badge.json` → `markdown` field.
89
+ Paste the shields.io line from `.doc-bridge/coverage-badge.json` → `markdown` field.
@@ -4,7 +4,16 @@ Zod schema: `MemoryCandidateV1Schema` in `@agentskit/doc-bridge`.
4
4
 
5
5
  Portable JSON Schema export: `MemoryCandidateV1JsonSchema`.
6
6
 
7
- This is the normalized draft shape for memory ingestion. Layer 0 ships deterministic local ingest for Cursor rules and `.agent-memory/**/*.md`; classification and promotion are planned.
7
+ This is the normalized shape for memory ingestion. The core ships deterministic
8
+ local ingest for Cursor rules and `.agent-memory/**/*.md`, classification into
9
+ `agent | human | playbook | discard`, safety scanning, draft generation, and an
10
+ optional GitHub draft PR flow.
11
+
12
+ ```bash
13
+ ak-docs memory ingest
14
+ ak-docs memory classify
15
+ ak-docs memory promote --pr --dry-run
16
+ ```
8
17
 
9
18
  ## Shape
10
19
 
package/docs/spec/cli.md CHANGED
@@ -69,6 +69,7 @@ pnpm add -D @agentskit/doc-bridge
69
69
  | `ak-docs playbook pattern [--text]` | Export published Doc Bridge Playbook pattern (OKF markdown / JSON) |
70
70
  | `ak-docs list <kind> [--text]` | List packages, apps, intents, … |
71
71
  | `ak-docs gate run [index-freshness]` | Check generated index freshness |
72
+ | `ak-docs conformance run documentation-standard-v1 [--text\|--json]` | Run the stable ecosystem documentation profile with evidence and remediation |
72
73
  | `ak-docs mcp` | Start MCP server (stdio default) |
73
74
  | `ak-docs mcp install --cursor \| --claude` | Write MCP server config for Cursor or Claude Desktop |
74
75
 
@@ -63,6 +63,9 @@ export default {
63
63
 
64
64
  /** Optional: Playbook / Registry / remote OKF bundles */
65
65
  federation?: FederationConfig
66
+
67
+ /** Optional deterministic documentation conformance profiles */
68
+ conformance?: ConformanceConfig
66
69
  } satisfies DocBridgeConfigV1
67
70
  ```
68
71
 
@@ -248,7 +251,7 @@ Plugins document their join convention; gates fail on orphan links.
248
251
 
249
252
  ```ts
250
253
  type GatesConfig = {
251
- preset?: 'minimal' | 'standard' | 'strict'
254
+ preset?: 'minimal' | 'standard' | 'strict' | 'playbook'
252
255
  /** Enabled gate ids; merged with preset */
253
256
  include?: GateId[]
254
257
  exclude?: GateId[]
@@ -269,18 +272,18 @@ type GatesConfig = {
269
272
  | 'no-stale-wording'
270
273
  >
271
274
  }
272
- 'link-rot'?: { scanDirs?: string[] }
273
275
  }
274
276
  }
275
277
 
276
278
  type GateId =
277
279
  | 'index-freshness'
278
280
  | 'human-guide-links'
279
- | 'link-rot'
281
+ | 'link-rot' // reserved; emits a diagnostic and is not executed
280
282
  | 'okf-type'
281
283
  | 'docs-style'
282
- | 'routing-currency' // every workspace package appears in routing
283
- | 'bootstrap-size' // AGENTS.md / CLAUDE.md line budgets
284
+ | 'routing-currency' // reserved; emits a diagnostic and is not executed
285
+ | 'bootstrap-size' // reserved; emits a diagnostic and is not executed
286
+ | 'documentation-standard-v1' // opt-in ecosystem documentation profile
284
287
  ```
285
288
 
286
289
  | Preset | Gates |
@@ -289,7 +292,7 @@ type GateId =
289
292
  | `standard` | + `human-guide-links` in v0.1 alpha |
290
293
  | `strict` | + `okf-type` in v0.1 alpha |
291
294
 
292
- Implemented alpha gates: `index-freshness`, `human-guide-links`, `okf-type`, `docs-style`. `include` / `exclude` are applied to implemented gates only.
295
+ Implemented gates include `index-freshness`, `human-guide-links`, `okf-type`, `docs-style`, and the opt-in `documentation-standard-v1`. For v1 compatibility, `link-rot`, `routing-currency`, and `bootstrap-size` remain accepted as reserved IDs; including one emits `AK_DOCS_RESERVED_GATE` and does not claim that the gate ran. Unknown IDs are rejected.
293
296
 
294
297
  ### Structural vs style validation
295
298
 
@@ -306,6 +309,47 @@ Alpha gates are deterministic lint checks, not editorial grading:
306
309
 
307
310
  ---
308
311
 
312
+ ## `conformance` (optional)
313
+
314
+ Documentation Standard v1 is an opt-in, deterministic ecosystem profile. It validates
315
+ repository evidence without executing configured commands or making network/model calls.
316
+
317
+ ```ts
318
+ type ConformanceConfig = {
319
+ documentationStandardV1?: {
320
+ rawSources?: string[]
321
+ contributionPaths?: string[]
322
+ metadata?: Array<{ path: string; contains: string[] }>
323
+ links?: Array<{ url: string; paths: string[] }>
324
+ quickstarts?: Array<{
325
+ id: string
326
+ doc: string
327
+ test: string
328
+ command: string
329
+ testContains: string[]
330
+ }>
331
+ visuals?: string[]
332
+ diagrams?: Array<{ path: string; contains: string[] }>
333
+ ecosystemContract?: {
334
+ manifest: string
335
+ claims: string
336
+ productId: string
337
+ }
338
+ exceptions?: Array<{
339
+ ruleId: DocumentationStandardRuleId
340
+ reason: string
341
+ approvedBy: string
342
+ trackingUrl: string
343
+ }>
344
+ }
345
+ }
346
+ ```
347
+
348
+ See [Documentation Standard v1](documentation-standard-v1.md) for rule semantics,
349
+ report status, commands, and the recorded stable-publication HITL decision.
350
+
351
+ ---
352
+
309
353
  ## `surfaces` (optional)
310
354
 
311
355
  ```ts
@@ -589,6 +633,7 @@ export default defineConfig({
589
633
  | `ak-docs search <q>` | `index` |
590
634
  | `ak-docs retrieve <q>` | `index` + `federation` |
591
635
  | `ak-docs gate run` | `gates` |
636
+ | `ak-docs conformance run documentation-standard-v1` | `corpus`, `routing`, `index`, `conformance` |
592
637
  | `ak-docs mcp` | `surfaces.mcp` |
593
638
  | `ak-docs chat` | planned; `intelligence.*` |
594
639
  | `ak-docs memory ingest` | deterministic local ingest; `MemoryCandidate[]` |
@@ -0,0 +1,131 @@
1
+ # Documentation Standard v1
2
+
3
+ Status: **stable — HITL-approved on 2026-07-13**
4
+
5
+ Profile ID: `documentation-standard-v1`
6
+
7
+ Schema version: `1`
8
+
9
+ Documentation Standard v1 is a deterministic Doc Bridge conformance profile for
10
+ documentation properties in the AgentsKit ecosystem. It turns the shared quality
11
+ expectations into local evidence that humans, CI, and agents can inspect without a model,
12
+ API key, or network request.
13
+
14
+ ```mermaid
15
+ flowchart LR
16
+ A[Human docs] --> P[Documentation Standard v1]
17
+ L[llms.txt and raw sources] --> P
18
+ H[AgentHandoff index] --> P
19
+ C[Contribution and metadata] --> P
20
+ Q[Quickstart test evidence] --> P
21
+ P --> R[Versioned conformance report]
22
+ R --> CI[CI exit code]
23
+ R --> HITL[Human approval]
24
+ ```
25
+
26
+ ## Rule set
27
+
28
+ | Rule | Level | Passing evidence |
29
+ |---|---|---|
30
+ | `human-docs` | Required | A configured human adapter discovers at least one non-agent document |
31
+ | `llms-and-raw-source` | Required | `llms.txt` exactly matches the current deterministic Doc Bridge output and every declared raw source is non-empty |
32
+ | `agent-handoffs` | Required | Every emitted handoff has `startHere`, edit roots, checks, and a linked/external human bridge |
33
+ | `contribution` | Required | At least one declared contribution guide exists and is non-empty |
34
+ | `metadata` | Required | Declared metadata files exist and contain every configured marker |
35
+ | `cross-links` | Required | Vendored canonical manifest/claims snapshots agree, include this product, and every declared URL is canonical and occurs in source |
36
+ | `tested-quickstarts` | Required | Each quickstart maps a doc to a test file, identifying test markers, and a CI command |
37
+ | `visual-explanations` | Recommended | Every declared image or animation asset exists |
38
+ | `structured-diagrams` | Recommended | Declared diagram source exists and contains its configured marker |
39
+
40
+ Recommended failures remain visible but do not fail the command. Required failures return
41
+ exit code 1 unless an approved exception applies.
42
+
43
+ ## Approved exceptions
44
+
45
+ Exceptions are explicit audit records, not hidden exclusions. A valid exception requires
46
+ the rule ID, a substantive reason, the approver, and a tracking URL:
47
+
48
+ ```json
49
+ {
50
+ "ruleId": "structured-diagrams",
51
+ "reason": "The interactive visual already expresses this relationship more clearly.",
52
+ "approvedBy": "Documentation Working Group",
53
+ "trackingUrl": "https://github.com/AgentsKit-io/example/issues/123"
54
+ }
55
+ ```
56
+
57
+ The report uses status `excepted`; it never rewrites an exception as an ordinary pass.
58
+
59
+ ## Configuration
60
+
61
+ ```json
62
+ {
63
+ "conformance": {
64
+ "documentationStandardV1": {
65
+ "rawSources": ["README.md", "docs/getting-started.md"],
66
+ "contributionPaths": ["CONTRIBUTING.md"],
67
+ "metadata": [
68
+ { "path": "docs/index.html", "contains": ["<title>", "name=\"description\""] }
69
+ ],
70
+ "links": [
71
+ { "url": "https://www.agentskit.io", "paths": ["README.md"] }
72
+ ],
73
+ "ecosystemContract": {
74
+ "manifest": "ecosystem.json",
75
+ "claims": "ecosystem-claims.json",
76
+ "productId": "example"
77
+ },
78
+ "quickstarts": [
79
+ {
80
+ "id": "demo",
81
+ "doc": "README.md",
82
+ "test": "tests/demo.test.ts",
83
+ "command": "pnpm vitest run tests/demo.test.ts",
84
+ "testContains": ["runs the demo"]
85
+ }
86
+ ],
87
+ "visuals": ["docs/assets/overview.webp"],
88
+ "diagrams": [
89
+ { "path": "docs/architecture.md", "contains": ["```mermaid"] }
90
+ ],
91
+ "exceptions": []
92
+ }
93
+ }
94
+ }
95
+ ```
96
+
97
+ The profile does not execute the declared quickstart command. The test-evidence file and
98
+ identifying markers prove that the quickstart has a repository test; the normal CI suite
99
+ executes that test. This avoids turning documentation configuration into an arbitrary
100
+ command-execution surface.
101
+
102
+ The ecosystem contract files are committed, network-free consumer snapshots of the canonical
103
+ AgentsKit `ecosystem.json` v2 manifest and `ecosystem-claims.json` ledger. The gate verifies
104
+ their schema relationship, product identity parity, the adopting product ID, and that declared
105
+ cross-links occur both in the manifest's public surfaces and in repository documentation.
106
+ Doc Bridge also records the upstream ref and SHA-256 digests in `ecosystem-upstream.json`;
107
+ `pnpm check:ecosystem-upstream` compares the local snapshots with AgentsKit `main` in CI.
108
+ This network parity check is deliberately separate from the runtime conformance profile, which
109
+ remains deterministic and offline.
110
+
111
+ ## Run the profile
112
+
113
+ ```bash
114
+ ak-docs conformance run documentation-standard-v1 --text
115
+ ak-docs conformance run documentation-standard-v1 --json
116
+ ak-docs gate run documentation-standard-v1
117
+ ```
118
+
119
+ JSON output is the stable automation surface. Text output sends the same evidence in a
120
+ human-scannable form. Both return 0 when required rules pass or are explicitly excepted,
121
+ and 1 when a required rule fails.
122
+
123
+ ## Adoption and stability
124
+
125
+ The Doc Bridge repository is the first real fixture and dogfoods the profile in its normal
126
+ `ak-docs gate run`. Other ecosystem repositories adopt it in their documentation slices.
127
+ The required/recommended rule split received product-owner HITL approval in
128
+ [issue #27](https://github.com/AgentsKit-io/doc-bridge/issues/27), and the canonical ecosystem
129
+ contract was delivered by
130
+ [AgentsKit #1208](https://github.com/AgentsKit-io/agentskit/pull/1208). The profile is stable;
131
+ future breaking rule changes require a new version.