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.
- package/CHANGELOG.md +132 -1
- package/README.md +78 -42
- package/dist/bin/darwin-arm64/SHA256SUMS +3 -2
- package/dist/bin/darwin-arm64/docbridge-rust-scanner +0 -0
- package/dist/bin/darwin-arm64/docbridge-swift-scanner +0 -0
- package/dist/bin/darwin-arm64/docbridge_dart_scanner +0 -0
- package/dist/bin/linux-x64/SHA256SUMS +3 -2
- package/dist/bin/linux-x64/docbridge-rust-scanner +0 -0
- package/dist/bin/linux-x64/docbridge-swift-scanner +0 -0
- package/dist/bin/linux-x64/docbridge_dart_scanner +0 -0
- package/dist/index.js +8599 -987
- package/docs/user/agent-integration.md +96 -0
- package/docs/user/annotations.md +173 -0
- package/docs/user/commands.md +64 -0
- package/docs/user/configuration.md +77 -0
- package/docs/user/getting-started.md +75 -0
- package/docs/user/link-review.md +53 -0
- package/docs/user/linking-workflow.md +70 -0
- package/docs/user/troubleshooting.md +61 -0
- package/package.json +4 -2
- package/schemas/common-output.schema.json +56 -0
- package/schemas/context-output.schema.json +2 -32
- package/schemas/docbridge.schema.json +77 -7
- package/schemas/graph-output.schema.json +6 -52
- package/schemas/scanner-worker.schema.json +122 -0
- package/templates/skills/README.md +17 -25
- package/templates/skills/docbridge/SKILL.md +126 -0
- package/templates/skills/docbridge-adopt/SKILL.md +0 -96
- package/templates/skills/docbridge-annotate/SKILL.md +0 -99
- package/templates/skills/docbridge-link/SKILL.md +0 -80
- package/templates/skills/docbridge-review/SKILL.md +0 -62
- package/templates/skills/docbridge-sync/SKILL.md +0 -68
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docbridge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "A CLI that links Markdown specifications and code declarations. Runs on Node.js and Bun.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bun",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
27
|
"dist",
|
|
28
|
+
"docs/user",
|
|
28
29
|
"schemas",
|
|
29
30
|
"templates/skills",
|
|
30
31
|
"README.md",
|
|
@@ -37,10 +38,11 @@
|
|
|
37
38
|
"check": "bun run src/cli/index.ts check",
|
|
38
39
|
"check:example": "bun run src/cli/index.ts check --root examples/typescript",
|
|
39
40
|
"test": "bun test",
|
|
40
|
-
"build": "bun build src/cli/index.ts --outdir dist --target
|
|
41
|
+
"build": "bun build src/cli/index.ts --outdir dist --target node"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@types/bun": "^1.3.14",
|
|
45
|
+
"ajv": "^8.20.0",
|
|
44
46
|
"oxfmt": "0.57.0",
|
|
45
47
|
"oxlint": "1.73.0",
|
|
46
48
|
"typescript": "^5.9.0"
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "common-output.schema.json",
|
|
4
|
+
"title": "DocBridge Common Output Definitions",
|
|
5
|
+
"$defs": {
|
|
6
|
+
"location": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"required": ["filePath", "line", "column"],
|
|
10
|
+
"properties": {
|
|
11
|
+
"filePath": { "type": "string" },
|
|
12
|
+
"line": { "type": "integer", "minimum": 1 },
|
|
13
|
+
"column": { "type": "integer", "minimum": 1 }
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"position": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"additionalProperties": false,
|
|
19
|
+
"required": ["line", "column"],
|
|
20
|
+
"properties": {
|
|
21
|
+
"line": { "type": "integer", "minimum": 1 },
|
|
22
|
+
"column": { "type": "integer", "minimum": 1 }
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"range": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"additionalProperties": false,
|
|
28
|
+
"required": ["start", "end"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"start": { "$ref": "#/$defs/position" },
|
|
31
|
+
"end": { "$ref": "#/$defs/position" }
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"diagnostic": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": false,
|
|
37
|
+
"required": ["severity", "code", "target", "message"],
|
|
38
|
+
"properties": {
|
|
39
|
+
"severity": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"enum": ["error", "warning"]
|
|
42
|
+
},
|
|
43
|
+
"code": { "type": "string" },
|
|
44
|
+
"target": { "type": "string" },
|
|
45
|
+
"language": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"enum": ["typescript", "swift", "dart", "rust"]
|
|
48
|
+
},
|
|
49
|
+
"source": { "type": "string" },
|
|
50
|
+
"message": { "type": "string" },
|
|
51
|
+
"location": { "$ref": "#/$defs/location" },
|
|
52
|
+
"range": { "$ref": "#/$defs/range" }
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"language": {
|
|
37
37
|
"type": "string",
|
|
38
|
-
"enum": ["typescript", "swift", "dart"],
|
|
38
|
+
"enum": ["typescript", "swift", "dart", "rust"],
|
|
39
39
|
"description": "Code language for code context blocks."
|
|
40
40
|
},
|
|
41
41
|
"startLine": {
|
|
@@ -66,37 +66,7 @@
|
|
|
66
66
|
"diagnostics": {
|
|
67
67
|
"type": "array",
|
|
68
68
|
"description": "Check diagnostics located in the input files, in check order.",
|
|
69
|
-
"items": {
|
|
70
|
-
"type": "object",
|
|
71
|
-
"required": ["severity", "code", "target", "message"],
|
|
72
|
-
"properties": {
|
|
73
|
-
"severity": {
|
|
74
|
-
"type": "string",
|
|
75
|
-
"enum": ["error", "warning"]
|
|
76
|
-
},
|
|
77
|
-
"code": {
|
|
78
|
-
"type": "string"
|
|
79
|
-
},
|
|
80
|
-
"target": {
|
|
81
|
-
"type": "string"
|
|
82
|
-
},
|
|
83
|
-
"source": {
|
|
84
|
-
"type": "string"
|
|
85
|
-
},
|
|
86
|
-
"message": {
|
|
87
|
-
"type": "string"
|
|
88
|
-
},
|
|
89
|
-
"location": {
|
|
90
|
-
"type": "object",
|
|
91
|
-
"required": ["filePath", "line", "column"],
|
|
92
|
-
"properties": {
|
|
93
|
-
"filePath": { "type": "string" },
|
|
94
|
-
"line": { "type": "integer", "minimum": 1 },
|
|
95
|
-
"column": { "type": "integer", "minimum": 1 }
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
69
|
+
"items": { "$ref": "common-output.schema.json#/$defs/diagnostic" }
|
|
100
70
|
},
|
|
101
71
|
"summary": {
|
|
102
72
|
"type": "object",
|
|
@@ -18,23 +18,25 @@
|
|
|
18
18
|
"additionalProperties": false,
|
|
19
19
|
"minProperties": 1,
|
|
20
20
|
"properties": {
|
|
21
|
-
"typescript": { "$ref": "#/$defs/
|
|
22
|
-
"swift": { "$ref": "#/$defs/
|
|
23
|
-
"dart": { "$ref": "#/$defs/
|
|
21
|
+
"typescript": { "$ref": "#/$defs/typescriptEntry" },
|
|
22
|
+
"swift": { "$ref": "#/$defs/swiftEntry" },
|
|
23
|
+
"dart": { "$ref": "#/$defs/dartEntry" },
|
|
24
|
+
"rust": { "$ref": "#/$defs/rustEntry" }
|
|
24
25
|
}
|
|
25
26
|
},
|
|
26
27
|
"docs": {
|
|
27
28
|
"type": "array",
|
|
28
29
|
"minItems": 1,
|
|
29
30
|
"items": {
|
|
30
|
-
"type": "string"
|
|
31
|
+
"type": "string",
|
|
32
|
+
"pattern": "\\.md$"
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
},
|
|
36
38
|
"$defs": {
|
|
37
|
-
"
|
|
39
|
+
"typescriptEntry": {
|
|
38
40
|
"type": "object",
|
|
39
41
|
"additionalProperties": false,
|
|
40
42
|
"required": ["patterns"],
|
|
@@ -43,13 +45,81 @@
|
|
|
43
45
|
"type": "array",
|
|
44
46
|
"minItems": 1,
|
|
45
47
|
"items": {
|
|
46
|
-
"type": "string"
|
|
48
|
+
"type": "string",
|
|
49
|
+
"pattern": "^(?!.*\\.d\\.ts$).*\\.ts$"
|
|
47
50
|
}
|
|
48
51
|
},
|
|
49
52
|
"visibility": {
|
|
50
53
|
"type": "array",
|
|
51
54
|
"items": {
|
|
52
|
-
"type": "string"
|
|
55
|
+
"type": "string",
|
|
56
|
+
"enum": ["public", "protected", "private"]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"swiftEntry": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"additionalProperties": false,
|
|
64
|
+
"required": ["patterns"],
|
|
65
|
+
"properties": {
|
|
66
|
+
"patterns": {
|
|
67
|
+
"type": "array",
|
|
68
|
+
"minItems": 1,
|
|
69
|
+
"items": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"pattern": "\\.swift$"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"visibility": {
|
|
75
|
+
"type": "array",
|
|
76
|
+
"items": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"enum": ["public", "open", "internal"]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"dartEntry": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"required": ["patterns"],
|
|
87
|
+
"properties": {
|
|
88
|
+
"patterns": {
|
|
89
|
+
"type": "array",
|
|
90
|
+
"minItems": 1,
|
|
91
|
+
"items": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"pattern": "\\.dart$"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"visibility": {
|
|
97
|
+
"type": "array",
|
|
98
|
+
"items": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"enum": ["public"]
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"rustEntry": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"additionalProperties": false,
|
|
108
|
+
"required": ["patterns"],
|
|
109
|
+
"properties": {
|
|
110
|
+
"patterns": {
|
|
111
|
+
"type": "array",
|
|
112
|
+
"minItems": 1,
|
|
113
|
+
"items": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"pattern": "\\.rs$"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"visibility": {
|
|
119
|
+
"type": "array",
|
|
120
|
+
"items": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"enum": ["pub", "private"]
|
|
53
123
|
}
|
|
54
124
|
}
|
|
55
125
|
}
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
},
|
|
32
32
|
"language": {
|
|
33
33
|
"type": "string",
|
|
34
|
-
"enum": ["typescript", "swift", "dart"],
|
|
34
|
+
"enum": ["typescript", "swift", "dart", "rust"],
|
|
35
35
|
"description": "Code language for code nodes."
|
|
36
36
|
},
|
|
37
|
-
"location": { "$ref": "#/$defs/location" },
|
|
38
|
-
"range": { "$ref": "#/$defs/range" },
|
|
37
|
+
"location": { "$ref": "common-output.schema.json#/$defs/location" },
|
|
38
|
+
"range": { "$ref": "common-output.schema.json#/$defs/range" },
|
|
39
39
|
"content": {
|
|
40
40
|
"oneOf": [
|
|
41
41
|
{
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"type": "string",
|
|
86
86
|
"description": "Resolved target endpoint of the annotation edge."
|
|
87
87
|
},
|
|
88
|
-
"location": { "$ref": "#/$defs/location" },
|
|
89
|
-
"range": { "$ref": "#/$defs/range" }
|
|
88
|
+
"location": { "$ref": "common-output.schema.json#/$defs/location" },
|
|
89
|
+
"range": { "$ref": "common-output.schema.json#/$defs/range" }
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
},
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
},
|
|
113
113
|
"diagnostics": {
|
|
114
114
|
"type": "array",
|
|
115
|
-
"items": { "$ref": "#/$defs/diagnostic" }
|
|
115
|
+
"items": { "$ref": "common-output.schema.json#/$defs/diagnostic" }
|
|
116
116
|
},
|
|
117
117
|
"summary": {
|
|
118
118
|
"type": "object",
|
|
@@ -136,51 +136,5 @@
|
|
|
136
136
|
"diagnostics": { "type": "integer", "minimum": 0 }
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
},
|
|
140
|
-
"$defs": {
|
|
141
|
-
"location": {
|
|
142
|
-
"type": "object",
|
|
143
|
-
"additionalProperties": false,
|
|
144
|
-
"required": ["filePath", "line", "column"],
|
|
145
|
-
"properties": {
|
|
146
|
-
"filePath": { "type": "string" },
|
|
147
|
-
"line": { "type": "integer", "minimum": 1 },
|
|
148
|
-
"column": { "type": "integer", "minimum": 1 }
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
"position": {
|
|
152
|
-
"type": "object",
|
|
153
|
-
"additionalProperties": false,
|
|
154
|
-
"required": ["line", "column"],
|
|
155
|
-
"properties": {
|
|
156
|
-
"line": { "type": "integer", "minimum": 1 },
|
|
157
|
-
"column": { "type": "integer", "minimum": 1 }
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
"range": {
|
|
161
|
-
"type": "object",
|
|
162
|
-
"additionalProperties": false,
|
|
163
|
-
"required": ["start", "end"],
|
|
164
|
-
"properties": {
|
|
165
|
-
"start": { "$ref": "#/$defs/position" },
|
|
166
|
-
"end": { "$ref": "#/$defs/position" }
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
"diagnostic": {
|
|
170
|
-
"type": "object",
|
|
171
|
-
"required": ["severity", "code", "target", "message"],
|
|
172
|
-
"properties": {
|
|
173
|
-
"severity": {
|
|
174
|
-
"type": "string",
|
|
175
|
-
"enum": ["error", "warning"]
|
|
176
|
-
},
|
|
177
|
-
"code": { "type": "string" },
|
|
178
|
-
"target": { "type": "string" },
|
|
179
|
-
"source": { "type": "string" },
|
|
180
|
-
"message": { "type": "string" },
|
|
181
|
-
"location": { "$ref": "#/$defs/location" },
|
|
182
|
-
"range": { "$ref": "#/$defs/range" }
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
139
|
}
|
|
186
140
|
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "scanner-worker.schema.json",
|
|
4
|
+
"title": "DocBridge Scanner Worker Protocol",
|
|
5
|
+
"description": "Request and response payloads exchanged with scanner workers.",
|
|
6
|
+
"oneOf": [{ "$ref": "#/$defs/request" }, { "$ref": "#/$defs/response" }],
|
|
7
|
+
"$defs": {
|
|
8
|
+
"language": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"enum": ["typescript", "swift", "dart", "rust"]
|
|
11
|
+
},
|
|
12
|
+
"codeSymbol": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"required": [
|
|
16
|
+
"kind",
|
|
17
|
+
"language",
|
|
18
|
+
"filePath",
|
|
19
|
+
"symbolName",
|
|
20
|
+
"canonicalId",
|
|
21
|
+
"endpoint",
|
|
22
|
+
"location"
|
|
23
|
+
],
|
|
24
|
+
"properties": {
|
|
25
|
+
"kind": { "const": "code" },
|
|
26
|
+
"language": { "$ref": "#/$defs/language" },
|
|
27
|
+
"filePath": { "type": "string" },
|
|
28
|
+
"symbolName": { "type": "string" },
|
|
29
|
+
"canonicalId": { "type": "string" },
|
|
30
|
+
"endpoint": { "type": "string" },
|
|
31
|
+
"location": { "$ref": "common-output.schema.json#/$defs/location" },
|
|
32
|
+
"nameRange": { "$ref": "common-output.schema.json#/$defs/range" },
|
|
33
|
+
"declarationRange": { "$ref": "common-output.schema.json#/$defs/range" },
|
|
34
|
+
"signatureRange": { "$ref": "common-output.schema.json#/$defs/range" }
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"link": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"additionalProperties": false,
|
|
40
|
+
"required": ["source", "target", "location"],
|
|
41
|
+
"properties": {
|
|
42
|
+
"source": { "type": "string" },
|
|
43
|
+
"target": { "type": "string" },
|
|
44
|
+
"location": { "$ref": "common-output.schema.json#/$defs/location" },
|
|
45
|
+
"targetRange": { "$ref": "common-output.schema.json#/$defs/range" }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"requestFile": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"required": ["filePath", "content"],
|
|
52
|
+
"properties": {
|
|
53
|
+
"filePath": { "type": "string" },
|
|
54
|
+
"content": { "type": "string" }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"options": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"additionalProperties": false,
|
|
60
|
+
"properties": {
|
|
61
|
+
"visibility": {
|
|
62
|
+
"type": "array",
|
|
63
|
+
"items": { "type": "string" }
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"request": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"required": ["schemaVersion", "requestId", "language", "projectRoot", "files", "options"],
|
|
71
|
+
"properties": {
|
|
72
|
+
"schemaVersion": { "const": 1 },
|
|
73
|
+
"requestId": { "type": "string" },
|
|
74
|
+
"language": { "$ref": "#/$defs/language" },
|
|
75
|
+
"projectRoot": { "type": "string" },
|
|
76
|
+
"files": {
|
|
77
|
+
"type": "array",
|
|
78
|
+
"items": { "$ref": "#/$defs/requestFile" }
|
|
79
|
+
},
|
|
80
|
+
"options": { "$ref": "#/$defs/options" }
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"responseFile": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"required": ["filePath", "symbols", "undocumentedSymbols", "links", "diagnostics"],
|
|
87
|
+
"properties": {
|
|
88
|
+
"filePath": { "type": "string" },
|
|
89
|
+
"symbols": {
|
|
90
|
+
"type": "array",
|
|
91
|
+
"items": { "$ref": "#/$defs/codeSymbol" }
|
|
92
|
+
},
|
|
93
|
+
"undocumentedSymbols": {
|
|
94
|
+
"type": "array",
|
|
95
|
+
"items": { "$ref": "#/$defs/codeSymbol" }
|
|
96
|
+
},
|
|
97
|
+
"links": {
|
|
98
|
+
"type": "array",
|
|
99
|
+
"items": { "$ref": "#/$defs/link" }
|
|
100
|
+
},
|
|
101
|
+
"diagnostics": {
|
|
102
|
+
"type": "array",
|
|
103
|
+
"items": { "$ref": "common-output.schema.json#/$defs/diagnostic" }
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"response": {
|
|
108
|
+
"type": "object",
|
|
109
|
+
"additionalProperties": false,
|
|
110
|
+
"required": ["schemaVersion", "requestId", "language", "files"],
|
|
111
|
+
"properties": {
|
|
112
|
+
"schemaVersion": { "const": 1 },
|
|
113
|
+
"requestId": { "type": "string" },
|
|
114
|
+
"language": { "$ref": "#/$defs/language" },
|
|
115
|
+
"files": {
|
|
116
|
+
"type": "array",
|
|
117
|
+
"items": { "$ref": "#/$defs/responseFile" }
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -1,35 +1,27 @@
|
|
|
1
1
|
# DocBridge skill templates
|
|
2
2
|
|
|
3
|
-
Distributable agent
|
|
3
|
+
Distributable agent skill for projects that use DocBridge. Prefer
|
|
4
4
|
`docbridge init` for CLI-driven setup or `docbridge init-with-agent` for
|
|
5
|
-
agent-guided adoption.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Claude Code or `.agents/skills/` for Codex-style project skills) and adjust
|
|
10
|
-
nothing unless your DocBridge invocation differs from the examples inside.
|
|
5
|
+
agent-guided adoption. Both commands install the same `docbridge` skill.
|
|
6
|
+
Manual copy-based installation remains available: copy the skill directory
|
|
7
|
+
into your repository's skill location (`.claude/skills/` for Claude Code or
|
|
8
|
+
`.agents/skills/` for Codex-style project skills).
|
|
11
9
|
|
|
12
|
-
- [`docbridge
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
findings: fetch the flagged counterpart content with `docbridge context`,
|
|
16
|
-
then update the counterpart or justify leaving it unchanged.
|
|
17
|
-
- [`docbridge-adopt`](docbridge-adopt/SKILL.md) — adopt DocBridge in an existing
|
|
18
|
-
TypeScript, Swift, or Dart project by confirming docs/code scope, creating
|
|
19
|
-
or improving config, installing companion skills, and handling simple CI/hook
|
|
20
|
-
setup.
|
|
21
|
-
- [`docbridge-link`](docbridge-link/SKILL.md) — link existing docs sections to
|
|
22
|
-
existing supported code declarations through docs-first candidate discovery
|
|
23
|
-
and section-level confirmation.
|
|
24
|
-
- [`docbridge-review`](docbridge-review/SKILL.md) — review the whole DocBridge
|
|
25
|
-
graph for semantic validity using `docbridge graph --json --include-content`.
|
|
10
|
+
- [`docbridge`](docbridge/SKILL.md) — route adopt, discover-and-link, annotate,
|
|
11
|
+
review, and sync work. Facts about the binary live in
|
|
12
|
+
`docbridge docs show`, not in this file.
|
|
26
13
|
|
|
27
|
-
This repository dogfoods the distributable DocBridge
|
|
14
|
+
This repository dogfoods the distributable DocBridge skill from both
|
|
28
15
|
`.claude/skills/` and `.agents/skills/` as skill-level symlinks to this
|
|
29
16
|
directory. The template is the source of truth; do not edit the symlinked
|
|
30
17
|
copies in place. In-repository dogfood links require symlink-capable checkouts;
|
|
31
18
|
external projects should use the copy-based installation above.
|
|
32
19
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
Existing installs may still have the five legacy skill directories
|
|
21
|
+
(`docbridge-adopt`, `docbridge-annotate`, `docbridge-link`,
|
|
22
|
+
`docbridge-review`, `docbridge-sync`). `docbridge init --force` removes those
|
|
23
|
+
copied directories after you review local edits. Symlinked skill directories
|
|
24
|
+
are reported and left untouched.
|
|
25
|
+
|
|
26
|
+
The Git-hook and CI integration that complements this skill is described
|
|
27
|
+
under [`docs/integrations/`](../../docs/integrations/).
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docbridge
|
|
3
|
+
description: Adopt or introduce DocBridge, choose docs and code scope, create or improve docbridge.config.json, add @doc and @code annotations, fix link diagnostics, triage related --gate findings, and review existing links for stale docs or semantic validity.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# docbridge
|
|
7
|
+
|
|
8
|
+
Route DocBridge work, then apply the matching judgment. Facts about the binary
|
|
9
|
+
— annotation syntax, supported declarations, the anchor algorithm, diagnostic
|
|
10
|
+
codes — live in packaged docs, not in this skill. Read them with
|
|
11
|
+
`docbridge docs show`. Invocation is documented in
|
|
12
|
+
`docbridge docs show agent-integration`.
|
|
13
|
+
|
|
14
|
+
An agent with no DocBridge skill can still finish the job from
|
|
15
|
+
`docbridge --help` plus `docbridge docs list` / `docbridge docs show`.
|
|
16
|
+
|
|
17
|
+
## Task router
|
|
18
|
+
|
|
19
|
+
Pick **one** job before editing. The first matching question wins:
|
|
20
|
+
|
|
21
|
+
| Job | Ask this | Not this |
|
|
22
|
+
| ----------------- | ------------------------------------------------------------------------------ | --------------------------------------------- |
|
|
23
|
+
| Adopt | Introduce DocBridge, choose docs/code scope, or write `docbridge.config.json`? | Linking existing files |
|
|
24
|
+
| Discover and link | Choose what to link in existing docs, docs-first? | A known pair already confirmed |
|
|
25
|
+
| Annotate | Add or fix a `@doc` / `@code` pair, or clear link diagnostics? | Deciding _whether_ a section should be linked |
|
|
26
|
+
| Review | Check whether the docs still match the code, with no change set? | Gate findings on a diff |
|
|
27
|
+
| Sync | A Git hook, CI comment, or `related --gate` flagged unchanged counterparts? | Auditing the whole graph |
|
|
28
|
+
|
|
29
|
+
**Review versus sync.** Whole graph, no change set → **review**. A change set's
|
|
30
|
+
flagged counterparts → **sync**. "Check whether the docs still match the code"
|
|
31
|
+
is review. "These counterparts were not updated in this diff" is sync.
|
|
32
|
+
|
|
33
|
+
## Adopt
|
|
34
|
+
|
|
35
|
+
Survey the repo: existing config, likely specification directories, public API
|
|
36
|
+
locations, existing annotations, scripts, CI, and Git hooks.
|
|
37
|
+
|
|
38
|
+
Recommend docs scope, code scope, and whether to wire simple CI or hooks now.
|
|
39
|
+
Show the tradeoff, then wait for confirmation. Create or improve
|
|
40
|
+
`docbridge.config.json` only after that. Use the language-keyed `include.code`
|
|
41
|
+
object, never the old array form. Never replace a user-authored config blindly.
|
|
42
|
+
|
|
43
|
+
Handle CI and Git hooks conservatively: implement a simple confirmed setup;
|
|
44
|
+
otherwise provide a patch plan. Prefer a non-blocking gate early in adoption.
|
|
45
|
+
|
|
46
|
+
Verify with `docbridge check`. A clean zero-link result is acceptable. Then
|
|
47
|
+
continue into discover-and-link.
|
|
48
|
+
|
|
49
|
+
Read `docbridge docs show getting-started` and `configuration`.
|
|
50
|
+
|
|
51
|
+
## Discover and link
|
|
52
|
+
|
|
53
|
+
Work docs-first. Confirm docs scope, then follow
|
|
54
|
+
`docbridge docs show linking-workflow`: prioritize unlinked specification
|
|
55
|
+
sections, propose at most three symbols per section with why/uncertain, present
|
|
56
|
+
5–10 sections per round, collect adopt/exclude/hold, and classify no-matches
|
|
57
|
+
instead of forcing a link.
|
|
58
|
+
|
|
59
|
+
Add annotations only after section-level confirmation. Then follow Annotate.
|
|
60
|
+
|
|
61
|
+
## Annotate
|
|
62
|
+
|
|
63
|
+
Create both sides of a pair, or add the missing backlink. Read
|
|
64
|
+
`docbridge docs show annotations` for syntax, supported declarations, anchors,
|
|
65
|
+
and target grammar. Read `docbridge docs show troubleshooting` for diagnostic
|
|
66
|
+
codes and fixes.
|
|
67
|
+
|
|
68
|
+
Procedure: identify the declaration and the heading; add `@doc` on the
|
|
69
|
+
declaration (create a minimal doc comment if missing); add `@code` directly
|
|
70
|
+
above the heading; verify with `docbridge check`. The pair is correct only when
|
|
71
|
+
no diagnostic mentions either endpoint.
|
|
72
|
+
|
|
73
|
+
Do not split or rename headings in this job. Preserve existing annotations
|
|
74
|
+
unless the user asked to fix a wrong link.
|
|
75
|
+
|
|
76
|
+
## Sync
|
|
77
|
+
|
|
78
|
+
A `related --gate` violation means nobody has decided yet, not that the
|
|
79
|
+
counterpart must change. Read `docbridge docs show agent-integration` for the
|
|
80
|
+
three-way judgment.
|
|
81
|
+
|
|
82
|
+
1. Collect violations from the hook, CI comment, or
|
|
83
|
+
`git diff --name-only HEAD | docbridge related --stdin --gate`.
|
|
84
|
+
2. Fetch counterpart content with `docbridge context` over the changed files.
|
|
85
|
+
3. Per counterpart: update it when the documented contract diverged; leave it
|
|
86
|
+
unchanged with a written justification that cites the counterpart content;
|
|
87
|
+
or fix the annotation pair when the link itself is wrong.
|
|
88
|
+
4. Re-run the gate. Report every decision.
|
|
89
|
+
|
|
90
|
+
Never detach a link to silence the gate. Do not rubber-stamp: unread
|
|
91
|
+
counterpart content is not a judgment. When a code change contradicts an
|
|
92
|
+
explicit documented promise, surface that instead of quietly rewriting the
|
|
93
|
+
promise.
|
|
94
|
+
|
|
95
|
+
## Review
|
|
96
|
+
|
|
97
|
+
Audit meaning across the whole graph, not a diff. Follow
|
|
98
|
+
`docbridge docs show link-review`.
|
|
99
|
+
|
|
100
|
+
Requires `docbridge graph --json --include-content`. Read `diagnostics` first.
|
|
101
|
+
Batch by docs file. Read both sides. Classify High / Medium / Low. Report
|
|
102
|
+
severity, endpoints, evidence, and a recommended fix. Do not edit annotations
|
|
103
|
+
automatically.
|
|
104
|
+
|
|
105
|
+
`check` proves mechanics; this job reviews meaning. Do not rubber-stamp a
|
|
106
|
+
resolving link. Prefer fewer, clearer links. Do not delete annotations to
|
|
107
|
+
silence uncertainty.
|
|
108
|
+
|
|
109
|
+
## Shared guardrails
|
|
110
|
+
|
|
111
|
+
- Confirm scope and section-level decisions with the user before writing links.
|
|
112
|
+
- Do not decide branch or pull-request policy.
|
|
113
|
+
- Prefer public API declarations as link targets.
|
|
114
|
+
- After edits, re-run `docbridge check` (and `related --gate` for sync).
|
|
115
|
+
|
|
116
|
+
## Read more
|
|
117
|
+
|
|
118
|
+
- `docbridge docs list` — the full menu
|
|
119
|
+
- `docbridge docs show agent-integration` — invocation, gate judgment, hooks, CI
|
|
120
|
+
- `docbridge docs show annotations` — `@doc` / `@code` rules
|
|
121
|
+
- `docbridge docs show linking-workflow` — docs-first candidate discovery
|
|
122
|
+
- `docbridge docs show link-review` — semantic audit
|
|
123
|
+
- `docbridge docs show troubleshooting` — diagnostic codes and fixes
|
|
124
|
+
- `docbridge docs show getting-started` — first-time setup
|
|
125
|
+
- `docbridge docs show configuration` — `docbridge.config.json`
|
|
126
|
+
- `docbridge docs show commands` — check, related, context, graph
|