docbridge 0.6.1 → 0.8.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 (32) hide show
  1. package/CHANGELOG.md +132 -1
  2. package/README.md +78 -42
  3. package/dist/bin/darwin-arm64/SHA256SUMS +3 -2
  4. package/dist/bin/darwin-arm64/docbridge-rust-scanner +0 -0
  5. package/dist/bin/darwin-arm64/docbridge-swift-scanner +0 -0
  6. package/dist/bin/darwin-arm64/docbridge_dart_scanner +0 -0
  7. package/dist/bin/linux-x64/SHA256SUMS +3 -2
  8. package/dist/bin/linux-x64/docbridge-rust-scanner +0 -0
  9. package/dist/bin/linux-x64/docbridge-swift-scanner +0 -0
  10. package/dist/bin/linux-x64/docbridge_dart_scanner +0 -0
  11. package/dist/index.js +8599 -987
  12. package/docs/user/agent-integration.md +96 -0
  13. package/docs/user/annotations.md +173 -0
  14. package/docs/user/commands.md +64 -0
  15. package/docs/user/configuration.md +77 -0
  16. package/docs/user/getting-started.md +75 -0
  17. package/docs/user/link-review.md +53 -0
  18. package/docs/user/linking-workflow.md +70 -0
  19. package/docs/user/troubleshooting.md +61 -0
  20. package/package.json +4 -2
  21. package/schemas/common-output.schema.json +56 -0
  22. package/schemas/context-output.schema.json +2 -32
  23. package/schemas/docbridge.schema.json +77 -7
  24. package/schemas/graph-output.schema.json +6 -52
  25. package/schemas/scanner-worker.schema.json +122 -0
  26. package/templates/skills/README.md +17 -25
  27. package/templates/skills/docbridge/SKILL.md +126 -0
  28. package/templates/skills/docbridge-adopt/SKILL.md +0 -96
  29. package/templates/skills/docbridge-annotate/SKILL.md +0 -99
  30. package/templates/skills/docbridge-link/SKILL.md +0 -80
  31. package/templates/skills/docbridge-review/SKILL.md +0 -62
  32. package/templates/skills/docbridge-sync/SKILL.md +0 -68
package/CHANGELOG.md CHANGED
@@ -7,6 +7,135 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.8.0] - 2026-08-18
11
+
12
+ ### Added
13
+
14
+ - The VS Code-compatible extension `salan70.docbridge` is published on Visual
15
+ Studio Marketplace.
16
+ - Packaged user docs now cover linking workflow and semantic link review
17
+ (`docbridge docs show linking-workflow`, `docbridge docs show link-review`),
18
+ plus supported and unsupported `@doc` declaration forms, the heading-anchor
19
+ algorithm, and named link-authoring diagnostic codes.
20
+ - Human-readable `docbridge check` output ends with a pointer to
21
+ `docbridge docs show troubleshooting`. `check --json` is unchanged.
22
+
23
+ ### Changed
24
+
25
+ - `docbridge init` and `docbridge init-with-agent` install one skill,
26
+ `docbridge`, instead of the five companion skills. The skill routes adopt,
27
+ discover-and-link, annotate, review, and sync work; facts about the binary
28
+ come from `docbridge docs show`.
29
+
30
+ ### Fixed
31
+
32
+ - `just package-vsix` bundles `vscode-languageclient` into the editor client.
33
+ Packaging with `--no-dependencies` previously omitted the module, so the
34
+ installed VSIX failed to activate.
35
+ - `docs/user/annotations.md` no longer claims GitHub-style numeric suffixes for
36
+ duplicate headings. Duplicate anchors in one file are `duplicate_doc_anchor`.
37
+
38
+ ### Upgrading
39
+
40
+ - Existing installs keep the five legacy skill directories
41
+ (`docbridge-adopt`, `docbridge-annotate`, `docbridge-link`,
42
+ `docbridge-review`, `docbridge-sync`) until `docbridge init --force` is run.
43
+ Review locally edited copies first. Symlinked skill directories are reported
44
+ and left untouched.
45
+
46
+ ## [0.7.0] - 2026-08-16
47
+
48
+ ### Added
49
+
50
+ - Rust is a first-party code language. Configure `include.code.rust`, place
51
+ `@doc` in `///` / `//!` / `/** */` comments on modules, structs, enums, free
52
+ functions, and inherent `impl` methods, and check links with the bundled
53
+ `docbridge-rust-scanner` worker (same platforms as Swift/Dart). Default
54
+ visibility is `pub` only; set `visibility` to include `private` for
55
+ non-`pub` items. Canonical IDs use Rust path style (`Type::method`).
56
+ - `docbridge docs list [--json]` and `docbridge docs show <name>` provide six
57
+ task-oriented, version-matched guides from the installed npm package, with
58
+ packed-package smoke coverage under Node.js and Bun.
59
+ - CLI invocation errors now list valid commands, suggest close command names,
60
+ and include runnable command-specific recovery guidance. Missing check
61
+ configuration also points to `docbridge init` and `docbridge init-with-agent`.
62
+ - TypeScript type members can be link endpoints, closing the last functional
63
+ asymmetry with Swift and Dart. `@doc` on a class method, property, getter,
64
+ setter, constructor, or static member, on an interface member, or on a member
65
+ of a type alias written directly as an object type literal resolves to a
66
+ type-qualified endpoint such as `AuthService.login`. Canonical IDs carry no
67
+ parameter signatures: overload groups and getter/setter pairs each describe
68
+ one member and collapse to one endpoint, and a collision — including a static
69
+ and an instance member of the same name — reports `duplicate_code_symbol`.
70
+ Only identifier-named members qualify, because a link target is
71
+ `file#fragment` with one `#` and no whitespace.
72
+ - `include.code.typescript.visibility` accepts `public`, `protected`, and
73
+ `private`, defaulting to `public` and `protected`. It scopes type members
74
+ only; top-level declarations remain scoped by `export`.
75
+
76
+ ### Changed
77
+
78
+ - Scanner worker request and response payloads now have a published JSON Schema,
79
+ and malformed nested worker output fails explicitly instead of degrading into
80
+ incomplete scan data. Graph and context output schemas share their diagnostic
81
+ definitions and are checked against real CLI output. The configuration schema
82
+ now matches the CLI's per-language suffix and visibility rules.
83
+ - `docbridge context` and `docbridge graph --include-content` strip the common
84
+ leading indentation from an extracted declaration, so a type member reads at
85
+ its own level. Output for top-level declarations is unchanged.
86
+ - A `@doc` on a TypeScript type member was previously collected by nothing and
87
+ silently ignored. It is now a real annotation, so an existing one can surface
88
+ link diagnostics — `invalid_link_target`, `doc_file_not_found`,
89
+ `doc_anchor_not_found`, `doc_backlink_not_found` — that were always latent,
90
+ and an annotation on a `private` member becomes `unsupported_declaration`.
91
+ `check --audit` output is unchanged: members never count as
92
+ `undocumented_symbol`.
93
+ - `docbridge check --audit` reports `unlinked_doc_section`, a warning for
94
+ in-scope documentation sections that carry no `@code` annotation. It is the
95
+ documentation-side counterpart to `undocumented_symbol`, so the audit now
96
+ covers both directions of the link graph. Reporting is rolled up over the
97
+ heading tree: only the topmost heading of a fully unannotated subtree is
98
+ reported, and a heading is treated as annotated whenever a `@code` comment is
99
+ attached to it, even if that annotation fails to parse or resolve. Empty
100
+ headings create no anchor and are never reported, but they still close the
101
+ section before them, so a deeper heading following one is a separate region
102
+ rather than a suppressed descendant. Runs
103
+ without `--audit` are unaffected, and the diagnostic is a warning, so exit
104
+ codes do not change.
105
+
106
+ ### Fixed
107
+
108
+ - Swift and Dart scanners now report malformed and duplicate `@doc` targets as
109
+ `invalid_link_target` and `duplicate_link`, matching TypeScript instead of
110
+ silently accepting or discarding the annotations.
111
+ - `docbridge graph --include-content` no longer truncates a signature at an
112
+ object type. It cut the rendered text at the first `{`, which for
113
+ `login(options: { verbose: boolean })` produced `login(options: {}`. A
114
+ `signatureRange` already ends where the implementation body begins in every
115
+ language, so no body has to be cut out of it.
116
+ - The VS Code extension manifest is version-aligned with the npm package again
117
+ (`0.4.1` had drifted from `0.6.1`), so a checkout of `main` is a valid input
118
+ to `just package-vsix`. Release Prepare now bumps both manifests through
119
+ `scripts/set-release-version.ts` and stages both in the release commit, so a
120
+ CLI release can no longer leave the extension version behind.
121
+ - `just package-vsix` bundles the server the VSIX ships with `--target node`,
122
+ matching the npm build. The Bun-targeted bundle it built before still carried
123
+ a `#!/usr/bin/env node` shebang and crashed with `__require is not a function`
124
+ when the packaging flow's own `verify-dist` step executed it.
125
+
126
+ ### Removed
127
+
128
+ - The agent-hook integration is gone from the product surface: the copyable
129
+ scripts under `examples/hooks/` and the hook recipes in
130
+ `docs/integrations/claude-code.md` and `docs/integrations/codex.md` no longer
131
+ ship. Wiring DocBridge into an agent's `PostToolUse`/`Stop` hooks covered only
132
+ the agents that read those configuration files; the documented guardrail is
133
+ now a Git `pre-commit` hook, which applies to every contributor and every
134
+ tool. Both integration documents survive as skill-installation guides,
135
+ `docbridge context` and `docbridge related --gate` are unchanged, and
136
+ `docbridge docs show agent-integration` describes the Git-hook shape instead.
137
+ Copies already installed in adopters' repositories keep working.
138
+
10
139
  ## [0.6.1] - 2026-07-27
11
140
 
12
141
  ### Changed
@@ -222,7 +351,9 @@ Initial release of the SpecLink CLI.
222
351
  - `speclink check` command with `--root`, `--json`, and `--audit` options.
223
352
  - `speclink --version` (alias `-v`) and `speclink --help` (alias `-h`).
224
353
 
225
- [Unreleased]: https://github.com/salan70/docbridge/compare/v0.6.1...HEAD
354
+ [Unreleased]: https://github.com/salan70/docbridge/compare/v0.8.0...HEAD
355
+ [0.8.0]: https://github.com/salan70/docbridge/releases/tag/v0.8.0
356
+ [0.7.0]: https://github.com/salan70/docbridge/releases/tag/v0.7.0
226
357
  [0.6.1]: https://github.com/salan70/docbridge/releases/tag/v0.6.1
227
358
  [0.6.0]: https://github.com/salan70/docbridge/releases/tag/v0.6.0
228
359
  [0.5.2]: https://github.com/salan70/docbridge/releases/tag/v0.5.2
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Bring Markdown into the LSP world.
8
8
 
9
- DocBridge creates bidirectional links between TypeScript, Swift, or Dart code
9
+ DocBridge creates bidirectional links between TypeScript, Swift, Dart, or Rust code
10
10
  and Markdown documentation, enabling LSP-like experiences such as Hover,
11
11
  Definition, References, and Diagnostics across implementation and specification
12
12
  files.
@@ -22,13 +22,13 @@ npx docbridge check
22
22
  bunx docbridge check
23
23
  ```
24
24
 
25
- The current release is
26
- [v0.5.0](https://github.com/salan70/docbridge/releases/tag/v0.5.0), published
27
- as `docbridge@0.5.0` on npm.
25
+ See the npm badge above or
26
+ [Releases](https://github.com/salan70/docbridge/releases) for the current
27
+ version.
28
28
 
29
- The package includes prebuilt Swift and Dart scanner
29
+ The package includes prebuilt Swift, Dart, and Rust scanner
30
30
  binaries for `darwin-arm64` and `linux-x64`. TypeScript and Markdown checks run
31
- without scanner binaries. Configured Swift or Dart projects on unsupported
31
+ without scanner binaries. Configured Swift, Dart, or Rust projects on unsupported
32
32
  platforms report `code_scanner_unavailable` and name the supported platform
33
33
  keys.
34
34
 
@@ -40,9 +40,8 @@ Run first-time setup in the project root:
40
40
  bunx docbridge init
41
41
  ```
42
42
 
43
- For agent-guided adoption, install `docbridge-adopt` and print setup commands.
44
- The `docbridge-adopt` skill finishes adoption and installs the remaining
45
- DocBridge skills after scope is confirmed:
43
+ For agent-guided adoption, install the `docbridge` skill and print setup
44
+ commands. The skill routes adopt, link, review, and sync work:
46
45
 
47
46
  ```sh
48
47
  bunx docbridge init-with-agent
@@ -98,6 +97,16 @@ bunx docbridge check
98
97
 
99
98
  ## Usage
100
99
 
100
+ Discover a command:
101
+
102
+ ```sh
103
+ bunx docbridge --help
104
+ bunx docbridge context --help
105
+ ```
106
+
107
+ Every command accepts `--help` (alias `-h`) and prints its usage, when to use
108
+ it, and its options on stdout.
109
+
101
110
  Check links:
102
111
 
103
112
  ```sh
@@ -124,7 +133,8 @@ bunx docbridge check --audit
124
133
 
125
134
  Audit diagnostics include:
126
135
 
127
- - `undocumented_symbol`
136
+ - `undocumented_symbol` — in-scope code endpoints with no `@doc`
137
+ - `unlinked_doc_section` — in-scope documentation sections with no `@code`
128
138
 
129
139
  List the linked counterparts of changed files:
130
140
 
@@ -193,7 +203,7 @@ Code <-> Documentation
193
203
  ```
194
204
 
195
205
  DocBridge links supported code declarations to Markdown sections. TypeScript is
196
- scanned in-process; Swift and Dart are scanned through bundled first-party
206
+ scanned in-process; Swift, Dart, and Rust are scanned through bundled first-party
197
207
  worker packages.
198
208
 
199
209
  ## Supported Inputs
@@ -205,11 +215,15 @@ Supported code declarations:
205
215
  - TypeScript top-level exported declarations: `function`, `class`,
206
216
  `abstract class`, `interface`, `type`, `const`, `enum`, and supported
207
217
  `declare` / named default forms
218
+ - TypeScript type members: class methods, properties, accessors, constructors,
219
+ and static members, plus interface and object-type-alias signatures
208
220
  - Swift public/open declarations and configured internal declarations:
209
221
  top-level and member types, functions, variables, constants, initializers,
210
222
  and extension members
211
223
  - Dart public declarations: top-level functions/variables, classes, enums,
212
224
  mixins, constructors, fields, accessors, methods, and extension members
225
+ - Rust `pub` declarations (and configured non-`pub` with `visibility`):
226
+ modules, structs, enums, free functions, and inherent `impl` methods
213
227
 
214
228
  Supported Markdown elements:
215
229
 
@@ -217,8 +231,29 @@ Supported Markdown elements:
217
231
  - HTML comments
218
232
  - `@code` annotations attached to the next heading
219
233
 
220
- Swift and Dart use the same `@doc` and `@code` model. Their code fragments are
221
- the scanner-produced canonical IDs, so members are type-qualified:
234
+ All four languages use the same `@doc` and `@code` model. Code fragments are
235
+ the scanner-produced canonical IDs, so members are type-qualified.
236
+
237
+ TypeScript member IDs carry no parameter signature; overload signatures and a
238
+ getter/setter pair each collapse to one endpoint, and the constructor is
239
+ `<Type>.constructor`. By default `public` and `protected` members are scanned;
240
+ `private` members require `include.code.typescript.visibility`. Members are
241
+ linkable but are never reported by `check --audit`.
242
+
243
+ ```ts
244
+ export class AuthService {
245
+ /** @doc docs/auth.md#login-spec */
246
+ login(email: string, password: string): void {}
247
+ }
248
+ ```
249
+
250
+ ```md
251
+ <!-- @code src/auth/service.ts#AuthService.login -->
252
+
253
+ ## Login Spec
254
+ ```
255
+
256
+ Swift, Dart, and Rust canonical IDs follow their own conventions:
222
257
 
223
258
  ```swift
224
259
  /// @doc docs/auth.md#login-spec
@@ -268,27 +303,26 @@ shape is intentionally invalid; migrate it to a `typescript` entry:
268
303
  }
269
304
  ```
270
305
 
271
- Swift and Dart projects must build their scanner workers in source checkouts
272
- before checking those languages. Run `just build-swift-scanner` for Swift and
273
- `just build-dart-scanner` for Dart, or use the native test recipes below.
306
+ Swift, Dart, and Rust projects must build their scanner workers in source checkouts
307
+ before checking those languages. Run `just build-swift-scanner` for Swift,
308
+ `just build-dart-scanner` for Dart, and `just build-rust-scanner` for Rust, or
309
+ use the native test recipes below.
274
310
 
275
311
  ## AI agent integration
276
312
 
277
313
  DocBridge's link graph is built to be consumed by AI coding agents:
278
314
 
279
315
  - [docs/integrations](docs/integrations) — recipes for Claude Code, Codex,
280
- and CI: on-edit counterpart awareness with `docbridge context`, gate triage
281
- with `docbridge related --gate`, and PR reporting.
282
- - [examples/hooks](examples/hooks) — copyable agent hook scripts implementing
283
- those recipes.
284
- - [templates/skills](templates/skills) — distributable agent skills installed by
285
- `docbridge init`; `docbridge init-with-agent` installs `docbridge-adopt`
286
- first, then `docbridge-adopt` installs the companion skills:
287
- `docbridge-annotate`, `docbridge-sync`, `docbridge-adopt`, `docbridge-link`,
288
- and `docbridge-review`.
289
-
290
- This repository dogfoods the hooks and skills in its own guardrails under
291
- `.claude/`, `.codex/`, and `.agents/`.
316
+ and CI: gate triage with `docbridge related --gate`, counterpart content with
317
+ `docbridge context`, and PR reporting.
318
+ - [templates/skills](templates/skills) — the distributable `docbridge` skill
319
+ installed by `docbridge init` and `docbridge init-with-agent`. Facts about
320
+ the binary live in `docbridge docs show`. Existing five-skill installs remain
321
+ until `docbridge init --force`.
322
+
323
+ This repository dogfoods the skills under `.claude/` and `.agents/`, and keeps
324
+ its guardrail in the Git `pre-commit` hook under `.githooks/` rather than in
325
+ any agent's configuration.
292
326
 
293
327
  ## Editor support
294
328
 
@@ -304,24 +338,24 @@ options; the project root comes from the editor's `initialize` request.
304
338
  `docbridge check` is unchanged.
305
339
 
306
340
  A VS Code-compatible extension lives in [editors/vscode](editors/vscode). It
307
- packages the language server into a VSIX for VS Code and Cursor. The extension
308
- has not yet been published to VS Code Marketplace. Until the first Marketplace
309
- publication, stage the supported `dist/bin/darwin-arm64` and
310
- `dist/bin/linux-x64` scanner artifacts, then build and install the VSIX
311
- locally:
341
+ packages the language server into a VSIX for VS Code and Cursor. Install
342
+ [`salan70.docbridge`](https://marketplace.visualstudio.com/items?itemName=salan70.docbridge)
343
+ from VS Code Marketplace. Bun must be available to the editor; set
344
+ `docbridge.bunPath` if the GUI cannot find `bun` on `PATH`.
345
+
346
+ Contributors can still stage the supported `dist/bin/darwin-arm64` and
347
+ `dist/bin/linux-x64` scanner artifacts and build a local VSIX:
312
348
 
313
349
  ```sh
314
350
  just package-vsix
315
351
  just verify-vsix
316
352
  ```
317
353
 
318
- Install the generated file from `editors/vscode/.tmp/out/` with **Extensions:
319
- Install from VSIX...** in VS Code or Cursor. The first Marketplace publication
320
- is intentionally manual; the repository provides a publish command for that
321
- release process. Open VSX delivery is out of scope. Zed integration is tracked
322
- separately and is not yet implemented. MCP delivery is out of scope until a
323
- concrete consumer requires a long-lived tool server. Full LSP behavior is specified in
324
- [docs/specs/lsp.md](docs/specs/lsp.md).
354
+ Registry publication remains manual (`VSCE_PAT=<token> just
355
+ publish-vscode-extension`). Open VSX delivery is out of scope. Zed integration
356
+ is tracked separately and is not yet implemented. MCP delivery is out of scope
357
+ until a concrete consumer requires a long-lived tool server. Full LSP behavior
358
+ is specified in [docs/specs/lsp.md](docs/specs/lsp.md).
325
359
 
326
360
  ## Diagnostics
327
361
 
@@ -339,6 +373,8 @@ Errors:
339
373
  - `duplicate_doc_anchor`
340
374
  - `duplicate_code_symbol`
341
375
  - `code_parse_error`
376
+ - `code_scanner_unavailable`
377
+ - `code_scanner_failed`
342
378
  - `file_read_error`
343
379
 
344
380
  Warnings:
@@ -347,6 +383,7 @@ Warnings:
347
383
  - `dangling_code_annotation`
348
384
  - `unsupported_declaration`
349
385
  - `undocumented_symbol` when `--audit` is enabled
386
+ - `unlinked_doc_section` when `--audit` is enabled
350
387
 
351
388
  Exit code policy:
352
389
 
@@ -373,12 +410,11 @@ repository setup, testing matrix, commit convention, and pull request workflow.
373
410
 
374
411
  ## Roadmap
375
412
 
376
- Completed v0.1–v0.5 capabilities are documented above and in
413
+ Completed v0.1–v0.6 capabilities are documented above and in
377
414
  [CHANGELOG.md](CHANGELOG.md).
378
415
 
379
416
  Remaining editor delivery work:
380
417
 
381
- - Publish the first verified VSIX to VS Code Marketplace
382
418
  - Follow-up automation for GitHub Release VSIX attachment and registry
383
419
  publishing after the manual flow is proven
384
420
  - Add a separate Zed integration path
@@ -1,2 +1,3 @@
1
- e5dc0117b9afe4e617fac20f9a8cf9797fa307f66d5a3f12e8ea6554639adce3 docbridge-swift-scanner
2
- 8268ae8b1d3329a96ce30590c8f177b0c19ea1a887a458647e04d8d295c74a71 docbridge_dart_scanner
1
+ 4b0ab3efbe865e9fb0cc48a6a0d37146c72a4255479e1c78c27b6c20e7e62604 docbridge-swift-scanner
2
+ c764c46477f522c8a82b62e629ff69907c0511fbc58b005ee6eba04d0e08dbef docbridge_dart_scanner
3
+ a1b129d980c981a2d24f0c9682e614a9695d4e9f9b8174d61b0dacb3fc9e3c79 docbridge-rust-scanner
@@ -1,2 +1,3 @@
1
- 396d365794cb5c427817b358bb3d9f2280000cd33fe3fc7d6d5a772a29ebcae4 docbridge-swift-scanner
2
- b5de2b74d56c6d8c9f8edd859d4b0d8846ff32d8e1d50b6fa41683d9a310b9f5 docbridge_dart_scanner
1
+ 9b7f3eea8df6ec2a07bd243a46b149fe3468240c6e0293390dc58594140519de docbridge-swift-scanner
2
+ 095c4c172da615be155bee15dcce7b99faaf2a8bb26f3cad3e0b17881495ddf2 docbridge_dart_scanner
3
+ d89a1146ed10dcb01151ef5351a746862c3955286431c47f3cf91cf6639866ba docbridge-rust-scanner