@agentskit/doc-bridge 1.2.1 → 1.2.4
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/CHANGELOG.md +19 -1
- package/CONTRIBUTING.md +1 -1
- package/README.md +3 -3
- package/action.yml +9 -2
- package/dist/cli/program.js +18 -5
- package/dist/cli/program.js.map +1 -1
- package/dist/index.d.ts +39 -2
- package/dist/index.js +46 -5
- package/dist/index.js.map +1 -1
- package/docs/MARKETPLACE.md +6 -0
- package/docs/POSITIONING.md +12 -1
- package/docs/chat-and-rag.md +1 -1
- package/docs/examples.md +9 -1
- package/docs/for-agents.md +12 -4
- package/docs/getting-started.md +10 -0
- package/docs/guides/cli-map.md +153 -0
- package/docs/guides/gate-ci.md +64 -0
- package/docs/guides/index-and-query.md +75 -0
- package/docs/guides/install-and-run.md +84 -0
- package/docs/guides/mcp-agents.md +63 -0
- package/docs/guides/memory-pipeline.md +105 -0
- package/docs/guides/meta.json +11 -0
- package/docs/index.md +48 -13
- package/docs/mcp.md +9 -0
- package/docs/meta.json +8 -2
- package/docs/playbook/doc-bridge-pattern.md +1 -1
- package/docs/query.md +47 -23
- package/ecosystem-claims.json +4 -4
- package/ecosystem-upstream.json +2 -2
- package/ecosystem.json +253 -36
- package/package.json +8 -5
- package/src/conformance/ecosystem-contract.ts +22 -3
- package/src/federation/ecosystem-llms.ts +67 -0
- package/src/index.ts +6 -0
- package/src/playbook/doc-bridge-pattern.ts +1 -1
- package/src/version.ts +1 -1
package/docs/MARKETPLACE.md
CHANGED
|
@@ -37,3 +37,9 @@ If the index is stale, run `ak-docs index`, review the generated diff, and commi
|
|
|
37
37
|
5. Publish the release, then verify the listing and execute the exact consumer workflow above in a clean fixture repository.
|
|
38
38
|
|
|
39
39
|
Marketplace publication is a deliberate owner action; the workflow never moves tags and does not publish the GitHub Release before the Marketplace fields are complete.
|
|
40
|
+
|
|
41
|
+
## Related
|
|
42
|
+
|
|
43
|
+
- [Gate and CI guide](./guides/gate-ci.md)
|
|
44
|
+
- [Getting started](./getting-started.md)
|
|
45
|
+
- [CLI](./spec/cli.md)
|
package/docs/POSITIONING.md
CHANGED
|
@@ -54,7 +54,7 @@ Engineering teams with real ownership (monorepos first). Secondary: solo libs, i
|
|
|
54
54
|
- [AgentsKit for-agents](https://www.agentskit.io/docs/for-agents) — agent-first package corpus
|
|
55
55
|
- [Registry](https://registry.agentskit.io/) — agent discovery / onboarding companion
|
|
56
56
|
- [Playbook llms.txt](https://playbook.agentskit.io/llms.txt) — patterns + federation source
|
|
57
|
-
- [doc-bridge landing](https://
|
|
57
|
+
- [doc-bridge landing](https://doc-bridge.agentskit.io/) — conversion page + used-by
|
|
58
58
|
- [Doc Bridge Playbook pattern](../playbook/doc-bridge-pattern.md) — `ak-docs playbook pattern`
|
|
59
59
|
|
|
60
60
|
## Comparison
|
|
@@ -83,3 +83,14 @@ optional: Playbook / Registry federation
|
|
|
83
83
|
- Human guide links gate green on fixture adapters
|
|
84
84
|
- Chat/RAG path documented with optional peers
|
|
85
85
|
- Public consumers cited (for-agents, Registry, Playbook)
|
|
86
|
+
|
|
87
|
+
## Canonical ecosystem role
|
|
88
|
+
|
|
89
|
+
| Field | Value |
|
|
90
|
+
|-------|--------|
|
|
91
|
+
| **Product id** | `doc-bridge` |
|
|
92
|
+
| **Role** | `understanding` |
|
|
93
|
+
| **Kind** | developer-tool |
|
|
94
|
+
| **Promise** | Human↔agent documentation bridge — deterministic handoffs for any repo |
|
|
95
|
+
|
|
96
|
+
AgentsKit is the **foundation library** (not a “JavaScript framework” in marketing cards). Chat is the **experience** layer. Doc Bridge stays the **understanding** product.
|
package/docs/chat-and-rag.md
CHANGED
|
@@ -20,7 +20,7 @@ Layer 1 is **opt-in** and dogfoods public AgentsKit packages:
|
|
|
20
20
|
## Public docs chat: deterministic before backend
|
|
21
21
|
|
|
22
22
|
The documentation portal uses `@agentskit/chat` (root), `@agentskit/chat/react`,
|
|
23
|
-
and `@agentskit/chat/protocol` directly — the consolidated AgentsKit Chat 0.
|
|
23
|
+
and `@agentskit/chat/protocol` directly — the consolidated AgentsKit Chat 0.4.x
|
|
24
24
|
surface. It does not recreate chat lifecycle or session state.
|
|
25
25
|
|
|
26
26
|
At build time, `scripts/build-docs-artifacts.mjs` reads the fresh
|
package/docs/examples.md
CHANGED
|
@@ -48,8 +48,16 @@ checks: [npm test -- auth]
|
|
|
48
48
|
|
|
49
49
|
## Public ecosystem surfaces
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
Doc Bridge is designed to be consumed by:
|
|
52
52
|
|
|
53
53
|
- https://www.agentskit.io/docs/for-agents
|
|
54
54
|
- https://registry.agentskit.io/
|
|
55
55
|
- https://playbook.agentskit.io/llms.txt
|
|
56
|
+
- https://chat.agentskit.io/docs
|
|
57
|
+
- https://doc-bridge.agentskit.io/
|
|
58
|
+
|
|
59
|
+
## Related
|
|
60
|
+
|
|
61
|
+
- [Install and run](./guides/install-and-run.md)
|
|
62
|
+
- [Config reference](./spec/config-v1.md)
|
|
63
|
+
- [Getting started](./getting-started.md)
|
package/docs/for-agents.md
CHANGED
|
@@ -23,9 +23,17 @@ flowchart LR
|
|
|
23
23
|
|
|
24
24
|
## Machine entry points
|
|
25
25
|
|
|
26
|
-
- [`llms.txt`](https://
|
|
27
|
-
- [`llms-full.txt`](https://
|
|
28
|
-
- [`deterministic/knowledge.json`](https://
|
|
29
|
-
- [`raw/for-agents.md`](https://
|
|
26
|
+
- [`llms.txt`](https://doc-bridge.agentskit.io/llms.txt) — concise discovery and canonical routes
|
|
27
|
+
- [`llms-full.txt`](https://doc-bridge.agentskit.io/llms-full.txt) — complete source corpus
|
|
28
|
+
- [`deterministic/knowledge.json`](https://doc-bridge.agentskit.io/deterministic/knowledge.json) — local chat/discovery artifact
|
|
29
|
+
- [`raw/for-agents.md`](https://doc-bridge.agentskit.io/raw/for-agents.md) — this guide as raw Markdown
|
|
30
|
+
- Site route: [`/for-agents`](https://doc-bridge.agentskit.io/for-agents/) — human-readable agent entry
|
|
31
|
+
|
|
32
|
+
## Related
|
|
33
|
+
|
|
34
|
+
- [MCP for agents](./guides/mcp-agents.md)
|
|
35
|
+
- [Index and query](./guides/index-and-query.md)
|
|
36
|
+
- [AgentHandoff schema](./schemas/agent-handoff-v1.md)
|
|
37
|
+
- [Skill text](./skills/doc-bridge.md)
|
|
30
38
|
|
|
31
39
|
If the task is conversational UI, continue with [AgentsKit Chat](https://chat.agentskit.io). For verification before merge, use [AgentsKit Code Review](https://github.com/AgentsKit-io/code-review-cli). For enterprise orchestration, governance, and audit, continue with [AKOS](https://akos.agentskit.io).
|
package/docs/getting-started.md
CHANGED
|
@@ -152,3 +152,13 @@ ak-docs ask "how does auth work?" --chat
|
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
Details: [chat-and-rag.md](./chat-and-rag.md).
|
|
155
|
+
|
|
156
|
+
## Related
|
|
157
|
+
|
|
158
|
+
- [Install and run](./guides/install-and-run.md) — guided path with tables
|
|
159
|
+
- [CLI map](./guides/cli-map.md) — every command with copy-paste examples
|
|
160
|
+
- [Memory pipeline](./guides/memory-pipeline.md) — digest · classify · promote
|
|
161
|
+
- [Index and query](./guides/index-and-query.md) · [MCP for agents](./guides/mcp-agents.md)
|
|
162
|
+
- [Gate and CI](./guides/gate-ci.md) · [Marketplace](./MARKETPLACE.md)
|
|
163
|
+
- [CLI reference](./spec/cli.md) · [Config](./spec/config-v1.md)
|
|
164
|
+
- [Positioning](./POSITIONING.md)
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: CLI map
|
|
3
|
+
description: Every ak-docs command with copy-paste examples — Layer 0 core and optional Layer 1 intelligence.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CLI map
|
|
7
|
+
|
|
8
|
+
Binary: **`ak-docs`** · Package: **`@agentskit/doc-bridge`**
|
|
9
|
+
|
|
10
|
+
Full flags: [CLI reference](../spec/cli.md)
|
|
11
|
+
|
|
12
|
+
## Global flags
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
ak-docs --help
|
|
16
|
+
ak-docs --version
|
|
17
|
+
ak-docs --config path/to/doc-bridge.config.json <command>
|
|
18
|
+
ak-docs <command> --agent # machine JSON (handoffs)
|
|
19
|
+
ak-docs <command> --text # human text
|
|
20
|
+
ak-docs <command> --json # JSON where supported
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Layer 0 — no API key
|
|
26
|
+
|
|
27
|
+
### Bootstrap
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
ak-docs init
|
|
31
|
+
ak-docs init --demo
|
|
32
|
+
ak-docs init --no-demo
|
|
33
|
+
ak-docs init --scaffold-workspaces
|
|
34
|
+
ak-docs bootstrap agent-docs
|
|
35
|
+
ak-docs validate-config
|
|
36
|
+
ak-docs validate-handoff path/to/handoff.json
|
|
37
|
+
ak-docs demo --text
|
|
38
|
+
ak-docs demo --fixture monorepo --text
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Index & doctor
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
ak-docs index
|
|
45
|
+
ak-docs index --watch
|
|
46
|
+
ak-docs doctor --text
|
|
47
|
+
ak-docs doctor --badge
|
|
48
|
+
ak-docs doctor --write-badge
|
|
49
|
+
ak-docs gate run
|
|
50
|
+
ak-docs gate run index-freshness
|
|
51
|
+
ak-docs conformance run documentation-standard-v1 --text
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Query & search
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
ak-docs query package auth --agent
|
|
58
|
+
ak-docs query ownership auth --text
|
|
59
|
+
ak-docs query intent onboard --agent
|
|
60
|
+
ak-docs search "abort signal" --agent
|
|
61
|
+
ak-docs list packages --text
|
|
62
|
+
ak-docs list intents --text
|
|
63
|
+
ak-docs ask "where do I change billing?"
|
|
64
|
+
ak-docs retrieve "authentication boundaries"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### MCP
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
ak-docs mcp
|
|
71
|
+
ak-docs mcp install --cursor
|
|
72
|
+
ak-docs mcp install --claude
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Memory pipeline
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
ak-docs memory ingest
|
|
79
|
+
ak-docs memory classify
|
|
80
|
+
ak-docs memory promote
|
|
81
|
+
ak-docs memory promote --pr --dry-run
|
|
82
|
+
ak-docs memory promote --pr
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Deep dive: [Memory pipeline](./memory-pipeline.md)
|
|
86
|
+
|
|
87
|
+
### Ecosystem / playbook
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
ak-docs registry topology
|
|
91
|
+
ak-docs playbook draft
|
|
92
|
+
ak-docs playbook pattern --text
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Layer 1 — optional AgentsKit peers
|
|
98
|
+
|
|
99
|
+
Requires `intelligence.enabled` + peers (`@agentskit/rag`, `@agentskit/ink`, …).
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
ak-docs rag ingest
|
|
103
|
+
ak-docs rag search "how does auth work?"
|
|
104
|
+
ak-docs chat
|
|
105
|
+
ak-docs ask "how does auth work?" --chat
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Walkthrough: [Chat and RAG](../chat-and-rag.md) · [Ollama demo](../ollama-demo.md)
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Suggested sequences
|
|
113
|
+
|
|
114
|
+
### New repo in 2 minutes
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
pnpm add -D @agentskit/doc-bridge
|
|
118
|
+
ak-docs init
|
|
119
|
+
ak-docs index
|
|
120
|
+
ak-docs query package example --agent
|
|
121
|
+
ak-docs doctor --text
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Agent about to edit
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
ak-docs query ownership <id> --agent
|
|
128
|
+
# read startHere → edit editRoots → run checks
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Turn session notes into docs
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
ak-docs memory ingest
|
|
135
|
+
ak-docs memory classify
|
|
136
|
+
ak-docs memory promote --pr --dry-run
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### PR gate
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
ak-docs index
|
|
143
|
+
ak-docs gate run
|
|
144
|
+
# commit generated index if your repo treats it as source-of-truth
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Related
|
|
148
|
+
|
|
149
|
+
- [Install and run](./install-and-run.md)
|
|
150
|
+
- [Index and query](./index-and-query.md)
|
|
151
|
+
- [MCP for agents](./mcp-agents.md)
|
|
152
|
+
- [Memory pipeline](./memory-pipeline.md)
|
|
153
|
+
- [CLI reference](../spec/cli.md)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Gate and CI
|
|
3
|
+
description: Fail stale documentation context in pull requests with Doc Bridge gates and the Marketplace Action.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Gate and CI
|
|
7
|
+
|
|
8
|
+
Gates keep incomplete or stale documentation context from reaching coding agents.
|
|
9
|
+
|
|
10
|
+
## Local gate
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
ak-docs index
|
|
14
|
+
ak-docs gate run
|
|
15
|
+
ak-docs doctor --text
|
|
16
|
+
ak-docs doctor --badge
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Typical failures:
|
|
20
|
+
|
|
21
|
+
| Symptom | Fix |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| Stale index | `ak-docs index`, review + commit generated files |
|
|
24
|
+
| Missing ownership | Add config ownership, frontmatter, or monorepo plugin |
|
|
25
|
+
| Documentation Standard gaps | Follow doctor remediations / evidence paths |
|
|
26
|
+
|
|
27
|
+
## Pull request workflow
|
|
28
|
+
|
|
29
|
+
```yaml
|
|
30
|
+
name: Documentation gate
|
|
31
|
+
on: [pull_request]
|
|
32
|
+
|
|
33
|
+
permissions:
|
|
34
|
+
contents: read
|
|
35
|
+
|
|
36
|
+
jobs:
|
|
37
|
+
docs:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v4
|
|
41
|
+
- uses: AgentsKit-io/doc-bridge@v1.2.1
|
|
42
|
+
with:
|
|
43
|
+
config-path: doc-bridge.config.json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The composite Action verifies the **committed** index and configured gates — it does **not** silently rebuild and hide drift.
|
|
47
|
+
|
|
48
|
+
If the Action fails:
|
|
49
|
+
|
|
50
|
+
1. Run `ak-docs index` locally
|
|
51
|
+
2. Review the diff under `.doc-bridge/` / `llms.txt`
|
|
52
|
+
3. Commit intentional updates
|
|
53
|
+
4. Re-run the PR check
|
|
54
|
+
|
|
55
|
+
## What to commit
|
|
56
|
+
|
|
57
|
+
Commit generated index artifacts your repo treats as source-of-truth (common: `.doc-bridge/index.json`, root `llms.txt`). Keep CI fail-closed when those drift from the docs corpus.
|
|
58
|
+
|
|
59
|
+
## Related
|
|
60
|
+
|
|
61
|
+
- [Marketplace details](../MARKETPLACE.md)
|
|
62
|
+
- [Install and run](./install-and-run.md)
|
|
63
|
+
- [Documentation Standard](../spec/documentation-standard-v1.md)
|
|
64
|
+
- [Doctor / CLI](../spec/cli.md)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Index and query
|
|
3
|
+
description: Build a deterministic index and resolve ownership handoffs without calling a model.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Index and query
|
|
7
|
+
|
|
8
|
+
Layer 0 is **offline and deterministic**. Indexing scans your corpus; querying never re-scans and never calls a model.
|
|
9
|
+
|
|
10
|
+
## Index
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
ak-docs index
|
|
14
|
+
ak-docs index --watch # rebuild on doc changes
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Outputs (defaults):
|
|
18
|
+
|
|
19
|
+
| Path | Role |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| `.doc-bridge/index.json` | Machine index (DocBridgeIndex v1) |
|
|
22
|
+
| `llms.txt` | Concise agent discovery surface |
|
|
23
|
+
| `.doc-bridge/capabilities.json` | Capability map for MCP / tools |
|
|
24
|
+
|
|
25
|
+
After ownership or corpus changes, **always re-index** (or gate in CI will fail).
|
|
26
|
+
|
|
27
|
+
## Query ownership
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
ak-docs query package <id> --agent
|
|
31
|
+
ak-docs query ownership <id> --agent
|
|
32
|
+
ak-docs query package <id> --text # human-readable
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`--agent` returns validated **AgentHandoff** JSON:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"startHere": "docs/for-agents/packages/auth.md",
|
|
40
|
+
"editRoots": ["packages/auth"],
|
|
41
|
+
"checks": ["pnpm test --filter auth"],
|
|
42
|
+
"humanDoc": "docs/guides/auth.md"
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Use this **before** an agent edits code. The model should not invent ownership from the full monorepo dump.
|
|
47
|
+
|
|
48
|
+
## Search and ask (local)
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
ak-docs list packages --text
|
|
52
|
+
ak-docs ask "where is authentication?"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`ask` stays on the deterministic plane when a known match exists. Only unresolved questions should escalate to optional backend/RAG (see [Chat and RAG](../chat-and-rag.md)).
|
|
56
|
+
|
|
57
|
+
## Agent workflow
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
resolve ownership → read startHere → edit only editRoots → run checks
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
1. `ak-docs query ownership <module> --agent`
|
|
64
|
+
2. Open `startHere` / `readBeforeEditing`
|
|
65
|
+
3. Edit paths under `editRoots` only
|
|
66
|
+
4. Run every command in `checks`
|
|
67
|
+
5. Promote durable learnings via memory pipeline when ready
|
|
68
|
+
|
|
69
|
+
## Related
|
|
70
|
+
|
|
71
|
+
- [Install and run](./install-and-run.md)
|
|
72
|
+
- [For agents](../for-agents.md)
|
|
73
|
+
- [MCP](./mcp-agents.md)
|
|
74
|
+
- [AgentHandoff schema](../schemas/agent-handoff-v1.md)
|
|
75
|
+
- [CLI reference](../spec/cli.md)
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Install and run
|
|
3
|
+
description: Install Doc Bridge, run the demo, and index your repository in minutes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Install and run
|
|
7
|
+
|
|
8
|
+
Get a deterministic AgentHandoff from your own docs — no API key required for Layer 0.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pnpm add -D @agentskit/doc-bridge
|
|
14
|
+
# or
|
|
15
|
+
npm i -D @agentskit/doc-bridge
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
CLI binary: **`ak-docs`**.
|
|
19
|
+
|
|
20
|
+
## Prove it in 60 seconds (no project setup)
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx ak-docs demo --text
|
|
24
|
+
npx ak-docs demo --fixture monorepo --text
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
You should see handoffs, a gate red→green path, and an MCP install snippet.
|
|
28
|
+
|
|
29
|
+
## Two-minute path on your repo
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
cd your-repo
|
|
33
|
+
ak-docs init # config + optional demo ownership + AGENTS.md tip
|
|
34
|
+
ak-docs index # build .doc-bridge/index.json
|
|
35
|
+
ak-docs query package example --agent
|
|
36
|
+
ak-docs doctor --text
|
|
37
|
+
ak-docs gate run
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Expected handoff fields:
|
|
41
|
+
|
|
42
|
+
| Field | Meaning |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| `startHere` | What the agent reads first |
|
|
45
|
+
| `editRoots` | Where edits are allowed |
|
|
46
|
+
| `checks` | Commands that prove the change |
|
|
47
|
+
| `humanDoc` | Human guide for the same ownership |
|
|
48
|
+
|
|
49
|
+
## Minimal config
|
|
50
|
+
|
|
51
|
+
`doc-bridge.config.json`:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"schemaVersion": 1,
|
|
56
|
+
"corpus": {
|
|
57
|
+
"agent": { "root": "docs/for-agents" }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Required:** `schemaVersion: 1` and `corpus.agent.root`.
|
|
63
|
+
|
|
64
|
+
Ownership comes from (first match wins):
|
|
65
|
+
|
|
66
|
+
1. `routing.options.ownership` in config
|
|
67
|
+
2. Frontmatter on agent docs (`package`, `editRoot`, `checks`)
|
|
68
|
+
3. Monorepo plugin discovery (`pnpm-monorepo`)
|
|
69
|
+
|
|
70
|
+
## Dev loop
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
ak-docs index --watch
|
|
74
|
+
ak-docs list packages --text
|
|
75
|
+
ak-docs ask "where do I change auth?"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Related
|
|
79
|
+
|
|
80
|
+
- [Index and query](./index-and-query.md) — resolve ownership deterministically
|
|
81
|
+
- [Gate and CI](./gate-ci.md) — fail stale context in PRs
|
|
82
|
+
- [MCP for agents](./mcp-agents.md) — wire Cursor / Claude / Codex
|
|
83
|
+
- [Config reference](../spec/config-v1.md)
|
|
84
|
+
- [Examples](../examples.md)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: MCP for agents
|
|
3
|
+
description: Expose Doc Bridge handoffs to Cursor, Claude Desktop, and other MCP clients.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# MCP for agents
|
|
7
|
+
|
|
8
|
+
Doc Bridge MCP tools return the **same deterministic handoffs** as the CLI — ownership, start files, edit roots, and checks.
|
|
9
|
+
|
|
10
|
+
## One-command install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
ak-docs mcp install --cursor # writes .cursor/mcp.json
|
|
14
|
+
ak-docs mcp install --claude # merges Claude Desktop config (macOS)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Then index your repo:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
ak-docs index
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Optional skill text: [skills/doc-bridge.md](../skills/doc-bridge.md)
|
|
24
|
+
|
|
25
|
+
## Manual config
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"mcpServers": {
|
|
30
|
+
"ak-docs": {
|
|
31
|
+
"command": "npx",
|
|
32
|
+
"args": ["ak-docs", "mcp"],
|
|
33
|
+
"cwd": "/absolute/path/to/your/repo"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Run MCP from the **repository root** (or ensure config discovery resolves there).
|
|
40
|
+
|
|
41
|
+
## Tools
|
|
42
|
+
|
|
43
|
+
| Tool | Purpose |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| `handoff.resolve` | Package / ownership → AgentHandoff |
|
|
46
|
+
| Search / list tools | Discover modules and docs without dumping the tree |
|
|
47
|
+
|
|
48
|
+
Prefer `handoff.resolve` **before** any multi-file edit.
|
|
49
|
+
|
|
50
|
+
## Agent loop
|
|
51
|
+
|
|
52
|
+
1. Resolve ownership via MCP or `ak-docs query … --agent`
|
|
53
|
+
2. Read `startHere`
|
|
54
|
+
3. Edit only `editRoots`
|
|
55
|
+
4. Run `checks`
|
|
56
|
+
5. Re-index when docs change
|
|
57
|
+
|
|
58
|
+
## Related
|
|
59
|
+
|
|
60
|
+
- [For agents](../for-agents.md)
|
|
61
|
+
- [Index and query](./index-and-query.md)
|
|
62
|
+
- [MCP deep dive](../mcp.md)
|
|
63
|
+
- [Chat and RAG](../chat-and-rag.md) — optional intelligence plane
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Memory pipeline
|
|
3
|
+
description: Digest agent notes, classify them, and promote reviewable documentation drafts — never silent auto-merge.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Memory pipeline
|
|
7
|
+
|
|
8
|
+
Agent sessions leave durable learnings in local files. Doc Bridge **ingests**, **classifies**, and **promotes** them into draft documentation that humans review. Nothing lands in the corpus without a PR.
|
|
9
|
+
|
|
10
|
+
## Sources (Layer 0)
|
|
11
|
+
|
|
12
|
+
| Source | Path pattern |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| Agent memory notes | `.agent-memory/**/*.md` |
|
|
15
|
+
| Cursor rules | `.cursor/rules/*.mdc` |
|
|
16
|
+
|
|
17
|
+
No API key. Classification is deterministic.
|
|
18
|
+
|
|
19
|
+
## End-to-end commands
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# 1) Normalize raw notes → MemoryCandidate[]
|
|
23
|
+
ak-docs memory ingest
|
|
24
|
+
|
|
25
|
+
# 2) Route each candidate: agent | human | playbook | discard
|
|
26
|
+
ak-docs memory classify
|
|
27
|
+
|
|
28
|
+
# 3) Build a safe draft body (safety scan; never auto-merges)
|
|
29
|
+
ak-docs memory promote
|
|
30
|
+
|
|
31
|
+
# 4) Optional: open a GitHub draft PR via `gh`
|
|
32
|
+
ak-docs memory promote --pr --dry-run
|
|
33
|
+
ak-docs memory promote --pr
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## What a candidate looks like
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"schemaVersion": 1,
|
|
41
|
+
"id": "auth-abort-signal",
|
|
42
|
+
"source": "agent-memory",
|
|
43
|
+
"rawPath": ".agent-memory/auth.md",
|
|
44
|
+
"fact": "Auth handlers must forward AbortSignal.",
|
|
45
|
+
"why": "Run cancellation must stop network work.",
|
|
46
|
+
"howToApply": "Use AbortSignal.any([caller, AbortSignal.timeout(ms)]).",
|
|
47
|
+
"suggestedType": "project",
|
|
48
|
+
"confidence": 0.8,
|
|
49
|
+
"references": ["docs/for-agents/auth.md"]
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Schema: [MemoryCandidate v1](../schemas/memory-candidate-v1.md)
|
|
54
|
+
|
|
55
|
+
## Digest mental model
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
.agent-memory / .cursor/rules
|
|
59
|
+
│
|
|
60
|
+
▼
|
|
61
|
+
memory ingest → normalized candidates
|
|
62
|
+
│
|
|
63
|
+
▼
|
|
64
|
+
memory classify → agent | human | playbook | discard
|
|
65
|
+
│
|
|
66
|
+
▼
|
|
67
|
+
memory promote → draft markdown (+ optional draft PR)
|
|
68
|
+
│
|
|
69
|
+
▼
|
|
70
|
+
Human review / merge (never silent)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Safety guarantees
|
|
74
|
+
|
|
75
|
+
| Guarantee | Behavior |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| Draft-only | Promotion never writes the canonical corpus directly |
|
|
78
|
+
| Safety scan | Risky content is flagged before draft output |
|
|
79
|
+
| HITL | `--pr` opens a **draft** GitHub PR via `gh` |
|
|
80
|
+
| Deterministic | Same inputs → same classify/promote routing |
|
|
81
|
+
|
|
82
|
+
## MCP tools
|
|
83
|
+
|
|
84
|
+
When MCP is running (`ak-docs mcp`):
|
|
85
|
+
|
|
86
|
+
| Tool | Role |
|
|
87
|
+
| --- | --- |
|
|
88
|
+
| `memory.classify` | Classify candidates |
|
|
89
|
+
| `memory.promoteDraft` | Produce a draft promotion body |
|
|
90
|
+
|
|
91
|
+
See [MCP for agents](./mcp-agents.md).
|
|
92
|
+
|
|
93
|
+
## Playbook feedback
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
ak-docs playbook draft # payload from classified memory
|
|
97
|
+
ak-docs playbook pattern # published Doc Bridge pattern (OKF)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Related
|
|
101
|
+
|
|
102
|
+
- [CLI map](./cli-map.md) — every command
|
|
103
|
+
- [MemoryCandidate schema](../schemas/memory-candidate-v1.md)
|
|
104
|
+
- [Chat and RAG](../chat-and-rag.md) — optional Layer 1 after handoffs
|
|
105
|
+
- [Getting started](../getting-started.md)
|