@agentskit/doc-bridge 0.1.0-alpha.2 → 1.0.0

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 (57) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +139 -57
  3. package/action.yml +78 -0
  4. package/dist/cli/program.js +1122 -114
  5. package/dist/cli/program.js.map +1 -1
  6. package/dist/index.d.ts +258 -28
  7. package/dist/index.js +824 -54
  8. package/dist/index.js.map +1 -1
  9. package/docs/DOGFOOD-ROUND2.md +142 -0
  10. package/docs/DOGFOOD-ROUND3.md +74 -0
  11. package/docs/POSITIONING.md +2 -0
  12. package/docs/RELEASE.md +5 -3
  13. package/docs/chat-and-rag.md +2 -0
  14. package/docs/getting-started.md +14 -1
  15. package/docs/landing/index.html +299 -0
  16. package/docs/mcp.md +10 -1
  17. package/docs/ollama-demo.md +64 -0
  18. package/docs/playbook/doc-bridge-pattern.md +114 -0
  19. package/docs/recipes/index-pipeline.md +89 -0
  20. package/docs/skills/doc-bridge.md +64 -0
  21. package/docs/spec/cli.md +6 -0
  22. package/docs/spec/playbook-feedback.md +12 -4
  23. package/examples/demo-example/doc-bridge.config.json +23 -0
  24. package/examples/demo-example/docs/for-agents/INDEX.md +3 -0
  25. package/examples/demo-example/docs/for-agents/packages/example.md +14 -0
  26. package/examples/demo-example/package.json +7 -0
  27. package/examples/demo-example/src/.gitkeep +0 -0
  28. package/examples/demo-monorepo/doc-bridge.config.json +37 -0
  29. package/examples/demo-monorepo/docs/for-agents/INDEX.md +4 -0
  30. package/examples/demo-monorepo/docs/for-agents/packages/auth.md +22 -0
  31. package/examples/demo-monorepo/docs/for-agents/packages/billing.md +19 -0
  32. package/examples/demo-monorepo/docs/human/guides/auth.md +7 -0
  33. package/examples/demo-monorepo/package.json +7 -0
  34. package/examples/demo-monorepo/packages/auth/package.json +8 -0
  35. package/examples/demo-monorepo/packages/billing/package.json +7 -0
  36. package/examples/demo-monorepo/pnpm-workspace.yaml +2 -0
  37. package/examples/ollama-chat.config.ts +42 -0
  38. package/package.json +12 -9
  39. package/src/cli/demo.ts +143 -0
  40. package/src/cli/program.ts +220 -26
  41. package/src/doctor/badge.ts +53 -0
  42. package/src/doctor/run-doctor.ts +286 -0
  43. package/src/federation/llms.ts +20 -11
  44. package/src/index-builder/build-handoffs.ts +35 -2
  45. package/src/index-builder/scan-corpus.ts +5 -1
  46. package/src/index-builder/watch-index.ts +94 -0
  47. package/src/index.ts +24 -0
  48. package/src/lib/markdown.ts +31 -4
  49. package/src/mcp/install.ts +84 -0
  50. package/src/memory/github-pr.ts +190 -0
  51. package/src/playbook/doc-bridge-pattern.ts +121 -0
  52. package/src/query/query.ts +19 -1
  53. package/src/query/search.ts +85 -17
  54. package/src/schemas/agent-handoff.ts +11 -0
  55. package/src/schemas/doc-bridge-index.ts +3 -1
  56. package/src/schemas/json-schemas.ts +2 -1
  57. package/src/version.ts +1 -1
@@ -0,0 +1,142 @@
1
+ # Dogfood round 2 — published `@agentskit/doc-bridge@0.1.0-alpha.2`
2
+
3
+ **Date:** 2026-07-09
4
+ **Install:** npm registry tag `alpha` → `0.1.0-alpha.2`
5
+ **Consumers:** agentskit · agentskit-os · agents-playbook · agentskit-registry
6
+
7
+ ## Scoreboard
8
+
9
+ | Repo | Install | Version | Knowledge | Handoffs | Gate | Sample handoff quality |
10
+ |------|---------|---------|-----------|----------|------|------------------------|
11
+ | **agentskit** | `pnpm add -Dw @0.1.0-alpha.2` ✅ | 0.1.0-alpha.2 | 25 | 24 | ✅ freshness + 23 humanDoc | Excellent: pnpm filter checks + humanDoc `/docs/reference/packages/core` |
12
+ | **agentskit-os** | pnpm store conflict; used **`npx`** ✅ | 0.1.0-alpha.2 | 170 | 92 | ✅ freshness + 9 humanDoc | Good act path; weak human bridge (9/92) |
13
+ | **agents-playbook** | `pnpm add -D` ✅ | 0.1.0-alpha.2 | 127 | 81 | ✅ freshness + okf-type | Pattern ownership + `check:okf-type` ✅ |
14
+ | **agentskit-registry** | needs `--legacy-peer-deps` ⚠️ | 0.1.0-alpha.2 | 36 | 36 | ✅ freshness | Full agent ownership + humanDoc ✅ |
15
+
16
+ ### npm dist-tags (observed)
17
+
18
+ | Tag | Version |
19
+ |-----|---------|
20
+ | `latest` | `0.1.0-alpha.1` |
21
+ | `alpha` | `0.1.0-alpha.2` |
22
+
23
+ **Recommendation:** keep prereleases only on `alpha` until stable; document `npm i -D @agentskit/doc-bridge@alpha`.
24
+
25
+ ---
26
+
27
+ ## What works well (validated)
28
+
29
+ 1. **Published binary works** — `ak-docs 0.1.0-alpha.2` from registry / npx.
30
+ 2. **Monorepo handoffs** — `editRoots` + `pnpm --filter @agentskit/<pkg> test|lint` on agentskit and AKOS.
31
+ 3. **Playbook preset** — gates green without crushing large OKF corpus.
32
+ 4. **Registry ownership** — all 36 agents resolve; checks use `npm run validate`.
33
+ 5. **Fumadocs humanDoc** on agentskit points at **reference** docs, not nested for-agents.
34
+ 6. **Pattern checks** — playbook patterns emit `pnpm run check:okf-type`.
35
+
36
+ ---
37
+
38
+ ## Issues found (prioritized)
39
+
40
+ ### P0 — correctness / ranking (agents will take wrong action)
41
+
42
+ | ID | Issue | Evidence | Suggested fix |
43
+ |----|--------|----------|----------------|
44
+ | **R2-1** | **Search/ask ranking ignores exact package id** | `search core --agent` bestMatch = **angular** (score 8) tied with **core** (score 8) because summary contains `@agentskit/core` | Boost exact `id` / path segment matches; prefer ownership id === term before body mentions |
45
+ | **R2-2** | **`ask` suggests wrong handoff** | “where do I change the **core** package?” → best match **angular**, next `query ownership angular` | Same ranking fix; optional: prefer ownership over knowledge for “package/module” language |
46
+ | **R2-3** | **Purpose/notes truncated mid-sentence** | core notes: `"Stable TypeScript contracts (Adapter, Tool, Memory, Retriever, Skill,"` | Raise firstParagraph budget; strip trailing incomplete commas; prefer frontmatter `purpose` full line |
47
+
48
+ ### P1 — install / peer DX
49
+
50
+ | ID | Issue | Evidence | Suggested fix |
51
+ |----|--------|----------|----------------|
52
+ | **R2-4** | **Optional peers still break npm install** | registry: `ERESOLVE` with optional peers vs `@agentskit/adapters@0.12.x` | Peer ranges more permissive (`>=0.12` / `>=1.0`); document `--legacy-peer-deps`; ensure optional peers never hard-fail Layer 0 |
53
+ | **R2-5** | **Peer `@agentskit/core@^1.10.0` vs monorepo 1.9.0** | pnpm warning on agentskit install | Align peer to `^1.9.0 \|\| ^1.10.0` or `>=1.9.0 <2` for dogfood until monorepo bumps |
54
+ | **R2-6** | **`latest` still points at alpha.1** | `npm view` latest=alpha.1, alpha=alpha.2 | Publish hygiene: don’t put prereleases on `latest`, or retag after publish |
55
+ | **R2-7** | **AKOS cannot `pnpm add` (store v10 vs v11)** | `ERR_PNPM_UNEXPECTED_STORE` | Docs: use npx / align store; not a doc-bridge bug but dogfood friction |
56
+
57
+ ### P2 — search / retrieval quality
58
+
59
+ | ID | Issue | Evidence | Suggested fix |
60
+ |----|--------|----------|----------------|
61
+ | **R2-8** | **Search miss on common English** | agentskit `search documentation` → **0 matches** | Index more body text / titles; lower threshold; BM25 over full file not only description |
62
+ | **R2-9** | **Playbook `search handoff` → 0** | term may only appear deep in body | Same as R2-8; chunk full markdown into search corpus |
63
+ | **R2-10** | **Federation hard-fail noise** | `retrieve` → `Failed to fetch https://registry.agentskit.io/llms.txt: 404` | Soft-fail federation sources; warn once; don’t fail command |
64
+ | **R2-11** | **Text search UX** | tab-separated dense lines | Columnar/TTY formatting (`type id path summary`) |
65
+
66
+ ### P3 — bridge coverage & product polish
67
+
68
+ | ID | Issue | Evidence | Suggested fix |
69
+ |----|--------|----------|----------------|
70
+ | **R2-12** | **AKOS humanDoc still sparse** | 9/92 handoffs with humanDoc | Map for-agents frontmatter `humanDoc`; product Fumadocs catalog; optional plain-markdown `docs/errors` etc. |
71
+ | **R2-13** | **Duplicate knowledge+ownership rows in search** | same path appears as ownership + knowledge | Deduplicate by path; show ownership preferred |
72
+ | **R2-14** | **Default checks for patterns without okf script** | N/A playbook ok | Fine; document convention |
73
+ | **R2-15** | **MCP not re-smoked this round** | — | Keep in CI smoke; optional round 3 |
74
+
75
+ ---
76
+
77
+ ## Sample outputs (good)
78
+
79
+ ### agentskit — `query package core --agent`
80
+
81
+ ```json
82
+ {
83
+ "startHere": "apps/docs-next/content/docs/for-agents/core.mdx",
84
+ "editRoots": ["packages/core"],
85
+ "checks": [
86
+ "pnpm --filter @agentskit/core test",
87
+ "pnpm --filter @agentskit/core lint"
88
+ ],
89
+ "humanDoc": "/docs/reference/packages/core"
90
+ }
91
+ ```
92
+
93
+ ### playbook — pattern handoff
94
+
95
+ ```json
96
+ {
97
+ "startHere": "content/docs/pillars/ai-collaboration/open-knowledge-format-pattern.md",
98
+ "checks": ["pnpm run check:okf-type"],
99
+ "humanDoc": "/docs/pillars/ai-collaboration/open-knowledge-format-pattern"
100
+ }
101
+ ```
102
+
103
+ ### registry — `docs-chat`
104
+
105
+ ```json
106
+ {
107
+ "startHere": "registry/docs-chat/README.md",
108
+ "editRoots": ["registry/docs-chat"],
109
+ "checks": ["npm run validate", "npm test"],
110
+ "humanDoc": "/agents/docs-chat"
111
+ }
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Recommended next alpha (0.1.0-alpha.3) scope
117
+
118
+ 1. **Ranking:** exact id / basename boost; package-intent heuristics for `ask`
119
+ 2. **Search corpus:** full-text over body (not only description); dedupe paths
120
+ 3. **Descriptions:** full purpose from frontmatter or first complete paragraph
121
+ 4. **Peers:** widen optional peer ranges; Layer 0 install never requires AgentsKit packages
122
+ 5. **Federation:** soft-fail missing `llms.txt` sources
123
+ 6. **Publish:** keep `latest` free of broken prereleases; doc install as `@alpha`
124
+
125
+ ---
126
+
127
+ ## Consumer follow-ups (not doc-bridge code)
128
+
129
+ | Repo | Action |
130
+ |------|--------|
131
+ | agentskit | Bump `@agentskit/core` to 1.10+ or live with peer warning |
132
+ | agentskit-os | Align pnpm store / commit lock with published dep; add CI `docs:bridge:gate` |
133
+ | agents-playbook | Optional CI workflow for gate |
134
+ | agentskit-registry | Publish `public/llms.txt` at site root (404 today); use `--legacy-peer-deps` until peer ranges loosen |
135
+ | all | After alpha.3: switch dep to `@agentskit/doc-bridge@alpha` only |
136
+
137
+ ---
138
+
139
+ ## Conclusion
140
+
141
+ **Round 2 proves Layer 0 is useful on real monorepos and OKF/registry corpora with the published package.**
142
+ The biggest remaining gap for “agents do the right thing” is **discovery ranking (R2-1/R2-2)** and **search body coverage (R2-8/R2-9)** — not indexing or handoff structure.
@@ -0,0 +1,74 @@
1
+ # Dogfood round 3 — `@agentskit/doc-bridge@0.1.0-alpha.3`
2
+
3
+ **Date:** 2026-07-09
4
+ **npm:** `alpha` → `0.1.0-alpha.3` · `latest` still `0.1.0-alpha.1`
5
+
6
+ ## Scoreboard
7
+
8
+ | Repo | Install | Ver | K | Handoffs | Gate | Ranking | Ask | Retrieve |
9
+ |------|---------|-----|---|----------|------|---------|-----|----------|
10
+ | **agentskit** | `pnpm add -Dw` ✅ | 0.1.0-alpha.3 | 25 | 24 | ✅ 24 humanDoc | `core` #1 (683) ✅ | ownership core ✅ | ✅ soft, 8 chunks |
11
+ | **agentskit-os** | `npx` (store issue) ✅ | 0.1.0-alpha.3 | 170 | 92 | ✅ | `os-core` #1 (689) ✅ | ownership os-core ✅ | ✅ 8 chunks |
12
+ | **playbook** | `pnpm add -D` ✅ | 0.1.0-alpha.3 | 127 | 81 | ✅ okf | OKF pattern #1 ✅ | pattern ownership ✅ | ✅ |
13
+ | **registry** | `--legacy-peer-deps` ⚠️ | 0.1.0-alpha.3 | 36 | 36 | ✅ | `docs-chat` #1 (593) ✅ | docs-chat ✅ | ✅ |
14
+
15
+ ## Round-2 issues — validation
16
+
17
+ | Item (R2) | Status | Evidence |
18
+ |-----------|--------|----------|
19
+ | Exact id ranking | **Fixed** | agentskit `search core` → best=`core` not angular |
20
+ | ask wrong package | **Fixed** | “change the core package?” → ownership core |
21
+ | Notes truncated | **Fixed** | full purpose sentences on core / os-core |
22
+ | Full-text search | **Improved** | `search documentation` → 20 matches (was 0) |
23
+ | Federation 404 hard-fail | **Fixed** | retrieve exit 0, no error, local chunks only |
24
+ | Peer install friction | **Improved** | no peer warning on agentskit; registry still needs legacy-peer-deps |
25
+ | Text UX | **Fixed** | multi-line `[ownership] id score=` format |
26
+ | Path dedupe | **OK** | top lists are unique ownership rows |
27
+ | AKOS humanDoc sparse | **Still open** | os-core handoff has no `humanDoc` (product docs thin) |
28
+ | pnpm store AKOS | **Still open** | environment; npx works |
29
+ | `latest` on old alpha | **Still open** | publish hygiene |
30
+
31
+ ## Sample outputs (alpha.3)
32
+
33
+ ### agentskit — ranking
34
+
35
+ ```json
36
+ { "term": "core", "best": "core", "top": ["core:683", "angular:27", "ink:27"] }
37
+ ```
38
+
39
+ ### agentskit — handoff
40
+
41
+ ```json
42
+ {
43
+ "startHere": "apps/docs-next/content/docs/for-agents/core.mdx",
44
+ "editRoots": ["packages/core"],
45
+ "checks": ["pnpm --filter @agentskit/core test", "pnpm --filter @agentskit/core lint"],
46
+ "humanDoc": "/docs/reference/packages/core",
47
+ "notes": ["Stable TypeScript contracts (Adapter, Tool, Memory, Retriever, Skill, Runtime) + `createChatController` + primitives. Target: <10 KB gzipped, zero runtime deps."]
48
+ }
49
+ ```
50
+
51
+ ### agentskit-os — ranking
52
+
53
+ ```json
54
+ { "best": "os-core", "top": ["os-core:689", "command-palette:36", "os-blob:36"] }
55
+ ```
56
+
57
+ ### registry — ranking
58
+
59
+ ```json
60
+ { "best": "docs-chat", "top": ["docs-chat:593", "agency-brief-generator:15"] }
61
+ ```
62
+
63
+ ## Remaining improvements (lower urgency)
64
+
65
+ 1. **AKOS humanDoc coverage** — enrich for-agents frontmatter `humanDoc` or map product Fumadocs more densely (content work more than code).
66
+ 2. **npm install without legacy-peer-deps** on registry — may still need peerOptional tuning vs npm ERESOLVE; document install flags.
67
+ 3. **HTML entities in notes** — `&lt;10 KB` from source MD; optional decode on index.
68
+ 4. **AKOS lockfile install path** — fix local pnpm store / commit published dep version.
69
+ 5. **CI wire-up** — `docs:bridge:gate` on each consumer after merge of dogfood branches.
70
+ 6. **Publish tags** — keep `latest` free of prereleases or retag intentionally.
71
+
72
+ ## Verdict
73
+
74
+ **alpha.3 is a successful dogfood pass.** P0/P1 product issues from round 2 are validated fixed on published package across monorepo + playbook + registry. Remaining items are polish, content, or consumer-side install/CI.
@@ -49,6 +49,8 @@ Engineering teams with real ownership (monorepos first). Secondary: solo libs, i
49
49
  - [AgentsKit for-agents](https://www.agentskit.io/docs/for-agents) — agent-first package corpus
50
50
  - [Registry](https://registry.agentskit.io/) — agent discovery / onboarding companion
51
51
  - [Playbook llms.txt](https://playbook.agentskit.io/llms.txt) — patterns + federation source
52
+ - [doc-bridge landing](https://agentskit-io.github.io/doc-bridge/) — conversion page + used-by
53
+ - [Doc Bridge Playbook pattern](../playbook/doc-bridge-pattern.md) — `ak-docs playbook pattern`
52
54
 
53
55
  ## Comparison
54
56
 
package/docs/RELEASE.md CHANGED
@@ -21,7 +21,7 @@ pnpm changeset # if new entry needed
21
21
  pnpm version-packages # bumps package.json + CHANGELOG from .changeset/*
22
22
  ```
23
23
 
24
- Current track: `0.1.0-alpha.x`.
24
+ Current track: **`1.0.0` stable** (alpha series ended at `0.1.0-alpha.5`).
25
25
 
26
26
  ## Publish (npm)
27
27
 
@@ -49,11 +49,13 @@ npx ak-docs@0.1.0-alpha.x --version
49
49
  ## GitHub
50
50
 
51
51
  ```bash
52
- git tag v0.1.0-alpha.x
52
+ git tag v1.0.0
53
53
  git push origin master --tags
54
- gh release create v0.1.0-alpha.x --title "v0.1.0-alpha.x" --notes-file CHANGELOG.md
54
+ gh release create v1.0.0 --title "v1.0.0 — AgentHandoff stable" --notes-file CHANGELOG.md
55
55
  ```
56
56
 
57
+ Enable GitHub Pages (Settings → Pages → GitHub Actions) for landing deploy from `.github/workflows/pages.yml`.
58
+
57
59
  ## Post-publish smoke (fresh machine)
58
60
 
59
61
  ```bash
@@ -29,6 +29,8 @@ ak-docs ask "<question>" --chat
29
29
 
30
30
  Missing peers produce an install hint instead of a silent no-op.
31
31
 
32
+ **Ollama walkthrough:** [ollama-demo.md](./ollama-demo.md) · `pnpm smoke:ollama`
33
+
32
34
  ## Providers
33
35
 
34
36
  | provider | Notes |
@@ -10,15 +10,28 @@ pnpm add -D @agentskit/doc-bridge
10
10
 
11
11
  CLI binary: **`ak-docs`**.
12
12
 
13
+ ## 60-second demo (zero setup)
14
+
15
+ ```bash
16
+ npx ak-docs demo --text
17
+ npx ak-docs demo --fixture monorepo --text # auth + billing monorepo
18
+ ```
19
+
20
+ Prints before/after, a real handoff, gate red→green, and the MCP snippet.
21
+
13
22
  ## Two-minute path (no API key)
14
23
 
15
24
  ```bash
16
25
  ak-docs init # config + demo ownership + AGENTS.md snippet
17
26
  ak-docs index
18
27
  ak-docs query package example --agent
28
+ ak-docs doctor --text
29
+ ak-docs doctor --badge
30
+ ak-docs mcp install --cursor
31
+ ak-docs index --watch # optional — dev loop
19
32
  ```
20
33
 
21
- You should see an **AgentHandoff** with `startHere`, `editRoots`, and `checks`.
34
+ You should see an **AgentHandoff** with `startHere`, `editRoots`, `checks`, and optional `bridge`.
22
35
 
23
36
  Useful follow-ups:
24
37
 
@@ -0,0 +1,299 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
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." />
8
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
9
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
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" />
11
+ <style>
12
+ :root {
13
+ --bg: #0b0f14;
14
+ --surface: #121820;
15
+ --border: #1e2a38;
16
+ --text: #e8eef6;
17
+ --muted: #8fa3b8;
18
+ --accent: #3d9cf5;
19
+ --accent-dim: #2563a8;
20
+ --green: #3ecf8e;
21
+ --red: #f07178;
22
+ --amber: #e6c07b;
23
+ --mono: "IBM Plex Mono", ui-monospace, monospace;
24
+ --sans: "IBM Plex Sans", system-ui, sans-serif;
25
+ --radius: 12px;
26
+ --max: 1080px;
27
+ }
28
+ * { box-sizing: border-box; margin: 0; padding: 0; }
29
+ body {
30
+ font-family: var(--sans);
31
+ background: var(--bg);
32
+ color: var(--text);
33
+ line-height: 1.55;
34
+ -webkit-font-smoothing: antialiased;
35
+ }
36
+ a { color: var(--accent); text-decoration: none; }
37
+ a:hover { text-decoration: underline; }
38
+ .wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
39
+ header {
40
+ padding: 1.25rem 0;
41
+ border-bottom: 1px solid var(--border);
42
+ position: sticky; top: 0; z-index: 10;
43
+ background: rgba(11, 15, 20, 0.92);
44
+ backdrop-filter: blur(8px);
45
+ }
46
+ .nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
47
+ .logo { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; }
48
+ .logo span { color: var(--muted); font-weight: 500; }
49
+ .nav-links { display: flex; gap: 1.25rem; font-size: 0.9rem; }
50
+ .nav-links a { color: var(--muted); }
51
+ .nav-links a:hover { color: var(--text); text-decoration: none; }
52
+ .hero { padding: 4.5rem 0 3rem; }
53
+ .eyebrow {
54
+ display: inline-block;
55
+ font-size: 0.75rem;
56
+ font-weight: 600;
57
+ letter-spacing: 0.08em;
58
+ text-transform: uppercase;
59
+ color: var(--accent);
60
+ margin-bottom: 1rem;
61
+ }
62
+ h1 {
63
+ font-size: clamp(2rem, 5vw, 3.25rem);
64
+ line-height: 1.1;
65
+ letter-spacing: -0.03em;
66
+ max-width: 16ch;
67
+ margin-bottom: 1.25rem;
68
+ }
69
+ .lead {
70
+ font-size: 1.15rem;
71
+ color: var(--muted);
72
+ max-width: 52ch;
73
+ margin-bottom: 2rem;
74
+ }
75
+ .cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 3rem; }
76
+ .btn {
77
+ display: inline-flex; align-items: center; gap: 0.4rem;
78
+ padding: 0.7rem 1.15rem;
79
+ border-radius: 8px;
80
+ font-weight: 600; font-size: 0.95rem;
81
+ border: 1px solid transparent;
82
+ cursor: pointer;
83
+ text-decoration: none !important;
84
+ }
85
+ .btn-primary { background: var(--accent); color: #041018; }
86
+ .btn-primary:hover { background: #5aadf7; }
87
+ .btn-ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
88
+ .btn-ghost:hover { border-color: var(--muted); }
89
+ .terminal {
90
+ background: var(--surface);
91
+ border: 1px solid var(--border);
92
+ border-radius: var(--radius);
93
+ overflow: hidden;
94
+ font-family: var(--mono);
95
+ font-size: 0.82rem;
96
+ line-height: 1.65;
97
+ }
98
+ .terminal-bar {
99
+ display: flex; gap: 6px; padding: 0.65rem 1rem;
100
+ border-bottom: 1px solid var(--border);
101
+ background: #0d1219;
102
+ }
103
+ .dot { width: 10px; height: 10px; border-radius: 50%; }
104
+ .dot-r { background: var(--red); }
105
+ .dot-y { background: var(--amber); }
106
+ .dot-g { background: var(--green); }
107
+ .terminal-body { padding: 1.25rem 1.5rem; overflow-x: auto; }
108
+ .t-dim { color: var(--muted); }
109
+ .t-ok { color: var(--green); }
110
+ .t-bad { color: var(--red); }
111
+ .t-hi { color: var(--accent); }
112
+ section { padding: 3.5rem 0; border-top: 1px solid var(--border); }
113
+ h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
114
+ .section-lead { color: var(--muted); margin-bottom: 2rem; max-width: 60ch; }
115
+ .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
116
+ @media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } .nav-links { display: none; } }
117
+ .card {
118
+ background: var(--surface);
119
+ border: 1px solid var(--border);
120
+ border-radius: var(--radius);
121
+ padding: 1.25rem 1.35rem;
122
+ }
123
+ .card h3 { font-size: 1rem; margin-bottom: 0.35rem; }
124
+ .card p { color: var(--muted); font-size: 0.92rem; }
125
+ .card code { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); }
126
+ .loops { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
127
+ @media (max-width: 900px) { .loops { grid-template-columns: repeat(2, 1fr); } }
128
+ @media (max-width: 480px) { .loops { grid-template-columns: 1fr; } }
129
+ .loop-tag {
130
+ font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
131
+ text-transform: uppercase; color: var(--accent); margin-bottom: 0.4rem;
132
+ }
133
+ .used-by {
134
+ display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
135
+ }
136
+ .used-by a {
137
+ display: flex; align-items: center; gap: 0.5rem;
138
+ padding: 0.65rem 1rem;
139
+ background: var(--surface);
140
+ border: 1px solid var(--border);
141
+ border-radius: 8px;
142
+ color: var(--text);
143
+ font-weight: 500;
144
+ font-size: 0.9rem;
145
+ text-decoration: none;
146
+ }
147
+ .used-by a:hover { border-color: var(--accent-dim); }
148
+ .badge-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
149
+ .badge-row img { height: 22px; }
150
+ footer {
151
+ padding: 2.5rem 0 3rem;
152
+ border-top: 1px solid var(--border);
153
+ color: var(--muted);
154
+ font-size: 0.85rem;
155
+ }
156
+ footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
157
+ </style>
158
+ </head>
159
+ <body>
160
+ <header>
161
+ <div class="wrap nav">
162
+ <div class="logo">doc-bridge <span>/ ak-docs</span></div>
163
+ <nav class="nav-links">
164
+ <a href="#demo">Demo</a>
165
+ <a href="#loops">Loops</a>
166
+ <a href="#used-by">Used by</a>
167
+ <a href="https://github.com/AgentsKit-io/doc-bridge">GitHub</a>
168
+ </nav>
169
+ <a class="btn btn-primary" href="https://www.npmjs.com/package/@agentskit/doc-bridge">npm install</a>
170
+ </div>
171
+ </header>
172
+
173
+ <main>
174
+ <section class="hero">
175
+ <div class="wrap">
176
+ <div class="eyebrow">AgentHandoff for your monorepo</div>
177
+ <h1>Your agent never edits the wrong package again.</h1>
178
+ <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.
181
+ </p>
182
+ <div class="cta-row">
183
+ <a class="btn btn-primary" href="#demo">See 60s demo</a>
184
+ <a class="btn btn-ghost" href="https://github.com/AgentsKit-io/doc-bridge#readme">Read README</a>
185
+ </div>
186
+ <div class="grid-2" id="demo">
187
+ <div class="terminal">
188
+ <div class="terminal-bar"><span class="dot dot-r"></span><span class="dot dot-y"></span><span class="dot dot-g"></span></div>
189
+ <div class="terminal-body">
190
+ <div class="t-dim"># Before — agent guesses</div>
191
+ <div class="t-bad">✗ edits packages/billing when task says "auth"</div>
192
+ <div class="t-bad">✗ runs repo-wide test instead of package checks</div>
193
+ <br />
194
+ <div class="t-dim">$ npx ak-docs demo --text</div>
195
+ <br />
196
+ <div class="t-dim"># After — handoff.resolve</div>
197
+ <div class="t-ok">✓ target: auth (packages/auth)</div>
198
+ <div class="t-ok">✓ edit: packages/auth</div>
199
+ <div class="t-ok">✓ checks: pnpm --filter @demo/auth test</div>
200
+ <div class="t-ok">✓ human guide: /docs/guides/auth</div>
201
+ <div class="t-hi">Gate: red → green</div>
202
+ </div>
203
+ </div>
204
+ <div class="terminal">
205
+ <div class="terminal-bar"><span class="dot dot-r"></span><span class="dot dot-y"></span><span class="dot dot-g"></span></div>
206
+ <div class="terminal-body">
207
+ <div class="t-dim">$ npm i -D @agentskit/doc-bridge</div>
208
+ <div class="t-dim">$ npx ak-docs init && npx ak-docs index</div>
209
+ <div class="t-dim">$ ak-docs mcp install --cursor</div>
210
+ <div class="t-dim">$ ak-docs doctor --text</div>
211
+ <br />
212
+ <div>Score: <span class="t-ok">82/100 (B)</span></div>
213
+ <div>Agent docs: 8/10 <span class="t-dim">(80% handoff-ready)</span></div>
214
+ <div>Human guides: 6/10 <span class="t-dim">(60% bridged)</span></div>
215
+ <div>Gates: <span class="t-ok">3/3 passing</span></div>
216
+ <br />
217
+ <div class="t-dim">→ ak-docs query package auth --agent</div>
218
+ </div>
219
+ </div>
220
+ </div>
221
+ </div>
222
+ </section>
223
+
224
+ <section id="loops">
225
+ <div class="wrap">
226
+ <h2>Four loops, one bridge</h2>
227
+ <p class="section-lead">Act, bridge, learn, explain — each loop has a CLI command and real output, not a concept table.</p>
228
+ <div class="loops">
229
+ <div class="card">
230
+ <div class="loop-tag">Act</div>
231
+ <h3>Handoff routing</h3>
232
+ <p><code>query --agent</code> · MCP <code>handoff.resolve</code></p>
233
+ </div>
234
+ <div class="card">
235
+ <div class="loop-tag">Bridge</div>
236
+ <h3>Human ↔ agent</h3>
237
+ <p><code>bootstrap agent-docs</code> · <code>bridge.humanDoc</code></p>
238
+ </div>
239
+ <div class="card">
240
+ <div class="loop-tag">Learn</div>
241
+ <h3>Memory → docs</h3>
242
+ <p><code>memory promote --pr</code> · HITL draft PR</p>
243
+ </div>
244
+ <div class="card">
245
+ <div class="loop-tag">Explain</div>
246
+ <h3>Local consult</h3>
247
+ <p><code>ask</code> · optional Ollama chat</p>
248
+ </div>
249
+ </div>
250
+ </div>
251
+ </section>
252
+
253
+ <section id="used-by">
254
+ <div class="wrap">
255
+ <h2>Used by AgentsKit (public)</h2>
256
+ <p class="section-lead">Dogfooded on open surfaces — not private monorepo claims.</p>
257
+ <div class="used-by">
258
+ <a href="https://www.agentskit.io/docs/for-agents">AgentsKit for-agents</a>
259
+ <a href="https://registry.agentskit.io/">AgentsKit Registry</a>
260
+ <a href="https://playbook.agentskit.io/llms.txt">Agents Playbook</a>
261
+ <a href="https://github.com/AgentsKit-io/doc-bridge">doc-bridge (this repo)</a>
262
+ </div>
263
+ <div class="badge-row">
264
+ <img src="https://img.shields.io/npm/v/@agentskit/doc-bridge?style=flat-square&color=3d9cf5" alt="npm version" />
265
+ <img src="https://img.shields.io/badge/Layer%200-no%20API%20key-3ecf8e?style=flat-square" alt="no api key" />
266
+ <img src="https://img.shields.io/badge/handoff_coverage-ready-2ea44f?style=flat-square" alt="handoff coverage" />
267
+ <img src="https://img.shields.io/github/actions/workflow/status/AgentsKit-io/doc-bridge/ci.yml?branch=master&style=flat-square&label=CI" alt="CI" />
268
+ </div>
269
+ </div>
270
+ </section>
271
+
272
+ <section>
273
+ <div class="wrap">
274
+ <h2>CI on every PR</h2>
275
+ <p class="section-lead">Stale handoffs fail the build — same gate locally and in GitHub Actions.</p>
276
+ <div class="terminal">
277
+ <div class="terminal-bar"><span class="dot dot-r"></span><span class="dot dot-y"></span><span class="dot dot-g"></span></div>
278
+ <div class="terminal-body">
279
+ <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>
281
+ <div>&nbsp;&nbsp;with:</div>
282
+ <div>&nbsp;&nbsp;&nbsp;&nbsp;config-path: doc-bridge.config.json</div>
283
+ </div>
284
+ </div>
285
+ </div>
286
+ </section>
287
+ </main>
288
+
289
+ <footer>
290
+ <div class="wrap">
291
+ <div>MIT · <a href="https://github.com/AgentsKit-io/doc-bridge">AgentsKit-io/doc-bridge</a></div>
292
+ <div>
293
+ <a href="https://github.com/AgentsKit-io/doc-bridge/blob/master/docs/playbook/doc-bridge-pattern.md">Playbook pattern</a>
294
+ · <a href="https://github.com/AgentsKit-io/doc-bridge/blob/master/docs/skills/doc-bridge.md">Agent skill</a>
295
+ </div>
296
+ </div>
297
+ </footer>
298
+ </body>
299
+ </html>
package/docs/mcp.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # MCP setup
2
2
 
3
- ## Cursor / Claude Desktop / Codex-style
3
+ ## One command (recommended)
4
+
5
+ ```bash
6
+ ak-docs mcp install --cursor # writes .cursor/mcp.json in repo root
7
+ ak-docs mcp install --claude # merges into Claude Desktop config (macOS)
8
+ ```
9
+
10
+ Then add the agent skill: [skills/doc-bridge.md](./skills/doc-bridge.md)
11
+
12
+ ## Manual — Cursor / Claude Desktop / Codex-style
4
13
 
5
14
  ```json
6
15
  {
@@ -0,0 +1,64 @@
1
+ # Ollama chat demo (Layer 1)
2
+
3
+ Zero-cloud path for grounded `ak-docs chat` and `ak-docs ask --chat`.
4
+
5
+ ## Prerequisites
6
+
7
+ ```bash
8
+ # Terminal 1 — model server
9
+ ollama serve
10
+
11
+ # Terminal 2 — models
12
+ ollama pull llama3.2
13
+ ollama pull nomic-embed-text
14
+
15
+ # Layer 1 peers (once per repo)
16
+ npm i -D @agentskit/doc-bridge \
17
+ @agentskit/rag @agentskit/ink @agentskit/adapters @agentskit/memory react
18
+ ```
19
+
20
+ ## Config
21
+
22
+ Copy [`examples/ollama-chat.config.ts`](../examples/ollama-chat.config.ts) or merge into your `doc-bridge.config.ts`:
23
+
24
+ ```ts
25
+ intelligence: {
26
+ enabled: true,
27
+ adapter: {
28
+ provider: 'ollama',
29
+ model: 'llama3.2',
30
+ baseUrl: 'http://127.0.0.1:11434',
31
+ options: { embedModel: 'nomic-embed-text' },
32
+ },
33
+ chat: { enabled: true, handoffFirst: true },
34
+ retriever: { enabled: true, mode: 'agentskit-rag' },
35
+ }
36
+ ```
37
+
38
+ ## Run
39
+
40
+ ```bash
41
+ ak-docs index
42
+ ak-docs rag ingest
43
+ ak-docs ask "who owns auth?" --chat # one-shot; handoffFirst when package id matches
44
+ ak-docs chat # Ink terminal UI
45
+ ```
46
+
47
+ `handoffFirst` (default) prepends deterministic AgentHandoff JSON when the question mentions a known package id — visible in the chat transcript before the model answer.
48
+
49
+ ## Smoke test
50
+
51
+ ```bash
52
+ pnpm smoke:ollama
53
+ ```
54
+
55
+ Skips gracefully if Ollama is down or peers are missing (safe for CI as optional job).
56
+
57
+ ## Troubleshooting
58
+
59
+ | Error | Fix |
60
+ |-------|-----|
61
+ | `Intelligence provider request failed` | `ollama serve` not running |
62
+ | `Optional peer "@agentskit/rag" is not installed` | Install Layer 1 peers (see above) |
63
+ | Empty chat response | Pull models: `ollama pull llama3.2` |
64
+ | Slow first `rag ingest` | Normal — embeds entire corpus locally |