@documentation-robotics/cli 0.2.0 → 0.4.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 (335) hide show
  1. package/README.md +46 -16
  2. package/dist/analysis/relationship-classifier.js +2 -9
  3. package/dist/analysis/relationship-classifier.js.map +2 -2
  4. package/dist/analyzers/active-analyzer.js +62 -0
  5. package/dist/analyzers/active-analyzer.js.map +7 -0
  6. package/dist/analyzers/call-graph-utils.js +2 -2
  7. package/dist/analyzers/call-graph-utils.js.map +2 -2
  8. package/dist/analyzers/cards/build.js +191 -0
  9. package/dist/analyzers/cards/build.js.map +7 -0
  10. package/dist/analyzers/cards/classify.js +42 -0
  11. package/dist/analyzers/cards/classify.js.map +7 -0
  12. package/dist/analyzers/cards/edge-index.js +44 -0
  13. package/dist/analyzers/cards/edge-index.js.map +7 -0
  14. package/dist/analyzers/cards/extract.js +138 -0
  15. package/dist/analyzers/cards/extract.js.map +7 -0
  16. package/dist/analyzers/cards/facts.js +46 -0
  17. package/dist/analyzers/cards/facts.js.map +7 -0
  18. package/dist/analyzers/cards/graph.js +42 -0
  19. package/dist/analyzers/cards/graph.js.map +7 -0
  20. package/dist/analyzers/cards/index.js +8 -0
  21. package/dist/analyzers/cards/index.js.map +7 -0
  22. package/dist/analyzers/cards/routes.js +96 -0
  23. package/dist/analyzers/cards/routes.js.map +7 -0
  24. package/dist/analyzers/cards/tier0.js +18 -0
  25. package/dist/analyzers/cards/tier0.js.map +7 -0
  26. package/dist/analyzers/cards/types.js +1 -0
  27. package/dist/analyzers/cards/types.js.map +7 -0
  28. package/dist/analyzers/cbm-analyzer.js +270 -174
  29. package/dist/analyzers/cbm-analyzer.js.map +2 -2
  30. package/dist/analyzers/cbm-responses.js +342 -0
  31. package/dist/analyzers/cbm-responses.js.map +7 -0
  32. package/dist/analyzers/code-changes.js +159 -0
  33. package/dist/analyzers/code-changes.js.map +7 -0
  34. package/dist/analyzers/edge-relationships.js +49 -0
  35. package/dist/analyzers/edge-relationships.js.map +7 -0
  36. package/dist/analyzers/extraction-plan.js +541 -0
  37. package/dist/analyzers/extraction-plan.js.map +7 -0
  38. package/dist/analyzers/index-job.js +229 -0
  39. package/dist/analyzers/index-job.js.map +7 -0
  40. package/dist/analyzers/mapping-loader.js +9 -0
  41. package/dist/analyzers/mapping-loader.js.map +2 -2
  42. package/dist/analyzers/tier0-rules.js +153 -0
  43. package/dist/analyzers/tier0-rules.js.map +7 -0
  44. package/dist/analyzers/types.js.map +1 -1
  45. package/dist/audit/relationships/ai/prompts.js +10 -10
  46. package/dist/audit/relationships/ai/prompts.js.map +2 -2
  47. package/dist/audit/relationships/analysis/layer-templates.js +52 -52
  48. package/dist/audit/relationships/analysis/layer-templates.js.map +1 -1
  49. package/dist/cli.js +23 -11
  50. package/dist/cli.js.map +2 -2
  51. package/dist/coding-agents/default-permissions.js +31 -1
  52. package/dist/coding-agents/default-permissions.js.map +2 -2
  53. package/dist/coding-agents/drbot-mcp.js +269 -0
  54. package/dist/coding-agents/drbot-mcp.js.map +7 -0
  55. package/dist/commands/add.js +7 -4
  56. package/dist/commands/add.js.map +2 -2
  57. package/dist/commands/analyzer.js +143 -40
  58. package/dist/commands/analyzer.js.map +2 -2
  59. package/dist/commands/changeset-verify.js +63 -0
  60. package/dist/commands/changeset-verify.js.map +7 -0
  61. package/dist/commands/changeset.js +80 -29
  62. package/dist/commands/changeset.js.map +2 -2
  63. package/dist/commands/delete.js +10 -4
  64. package/dist/commands/delete.js.map +2 -2
  65. package/dist/commands/farm.js +176 -60
  66. package/dist/commands/farm.js.map +2 -2
  67. package/dist/commands/init.js +9 -26
  68. package/dist/commands/init.js.map +2 -2
  69. package/dist/commands/mcp.js +40 -21
  70. package/dist/commands/mcp.js.map +3 -3
  71. package/dist/commands/relationship.js +208 -37
  72. package/dist/commands/relationship.js.map +2 -2
  73. package/dist/commands/reports.js +3 -3
  74. package/dist/commands/reports.js.map +2 -2
  75. package/dist/commands/update.js +52 -32
  76. package/dist/commands/update.js.map +2 -2
  77. package/dist/commands/upgrade.js +99 -103
  78. package/dist/commands/upgrade.js.map +3 -3
  79. package/dist/commands/validate.js +19 -3
  80. package/dist/commands/validate.js.map +2 -2
  81. package/dist/commands/version.js +1 -1
  82. package/dist/commands/visualize.js +34 -15
  83. package/dist/commands/visualize.js.map +2 -2
  84. package/dist/core/annotation-store.js +15 -5
  85. package/dist/core/annotation-store.js.map +2 -2
  86. package/dist/core/catalog-migration.js +34 -0
  87. package/dist/core/catalog-migration.js.map +7 -0
  88. package/dist/core/changeset-analysis.js +421 -0
  89. package/dist/core/changeset-analysis.js.map +7 -0
  90. package/dist/core/changeset-base-index.js +160 -0
  91. package/dist/core/changeset-base-index.js.map +7 -0
  92. package/dist/core/changeset-brief-compact.js +256 -0
  93. package/dist/core/changeset-brief-compact.js.map +7 -0
  94. package/dist/core/changeset-brief-delta.js +102 -0
  95. package/dist/core/changeset-brief-delta.js.map +7 -0
  96. package/dist/core/changeset-graph.js +281 -0
  97. package/dist/core/changeset-graph.js.map +7 -0
  98. package/dist/core/changeset-only-guard.js +32 -0
  99. package/dist/core/changeset-only-guard.js.map +7 -0
  100. package/dist/core/changeset-summary.js +68 -0
  101. package/dist/core/changeset-summary.js.map +7 -0
  102. package/dist/core/changeset-validator.js +66 -20
  103. package/dist/core/changeset-validator.js.map +2 -2
  104. package/dist/core/changeset-verify.js +848 -0
  105. package/dist/core/changeset-verify.js.map +7 -0
  106. package/dist/core/changeset.js +56 -9
  107. package/dist/core/changeset.js.map +2 -2
  108. package/dist/core/element-type-migration.js +145 -0
  109. package/dist/core/element-type-migration.js.map +7 -0
  110. package/dist/core/extraction-observability.js +161 -0
  111. package/dist/core/extraction-observability.js.map +7 -0
  112. package/dist/core/farm-manifest.js +12 -6
  113. package/dist/core/farm-manifest.js.map +2 -2
  114. package/dist/core/farm-sync-engine.js +1 -1
  115. package/dist/core/farm-sync-engine.js.map +2 -2
  116. package/dist/core/farm-sync-state.js +10 -2
  117. package/dist/core/farm-sync-state.js.map +2 -2
  118. package/dist/core/migration-registry.js +88 -47
  119. package/dist/core/migration-registry.js.map +2 -2
  120. package/dist/core/model-upgrade.js +102 -0
  121. package/dist/core/model-upgrade.js.map +7 -0
  122. package/dist/core/model.js +82 -30
  123. package/dist/core/model.js.map +2 -2
  124. package/dist/core/mutation-handler.js +71 -6
  125. package/dist/core/mutation-handler.js.map +2 -2
  126. package/dist/core/project-init.js +53 -0
  127. package/dist/core/project-init.js.map +7 -0
  128. package/dist/core/relationship-migration-table.js +6639 -0
  129. package/dist/core/relationship-migration-table.js.map +7 -0
  130. package/dist/core/relationship-migration.js +272 -0
  131. package/dist/core/relationship-migration.js.map +7 -0
  132. package/dist/core/relationship-prune.js +49 -0
  133. package/dist/core/relationship-prune.js.map +7 -0
  134. package/dist/core/relationship-staging.js +161 -0
  135. package/dist/core/relationship-staging.js.map +7 -0
  136. package/dist/core/relationships.js +26 -4
  137. package/dist/core/relationships.js.map +2 -2
  138. package/dist/core/report-data-model.js +7 -13
  139. package/dist/core/report-data-model.js.map +2 -2
  140. package/dist/core/staged-changeset-storage.js +145 -18
  141. package/dist/core/staged-changeset-storage.js.map +2 -2
  142. package/dist/core/staged-source-reference.js +28 -0
  143. package/dist/core/staged-source-reference.js.map +7 -0
  144. package/dist/core/staging-area.js +166 -24
  145. package/dist/core/staging-area.js.map +2 -2
  146. package/dist/core/upgrade-plan.js +117 -0
  147. package/dist/core/upgrade-plan.js.map +7 -0
  148. package/dist/core/virtual-projection.js +13 -5
  149. package/dist/core/virtual-projection.js.map +2 -2
  150. package/dist/export/archimate-exporter.js +1 -0
  151. package/dist/export/archimate-exporter.js.map +2 -2
  152. package/dist/generated/compiled-validators.js +2 -2
  153. package/dist/generated/compiled-validators.js.map +2 -2
  154. package/dist/generated/layer-registry.js +16 -16
  155. package/dist/generated/layer-registry.js.map +2 -2
  156. package/dist/generated/node-types.js +186 -168
  157. package/dist/generated/node-types.js.map +2 -2
  158. package/dist/generated/relationship-index.js +2468 -7913
  159. package/dist/generated/relationship-index.js.map +2 -2
  160. package/dist/integrations/claude_code/.claude-plugin/plugin.json +24 -0
  161. package/dist/integrations/claude_code/agents/dr-architect.md +30 -3
  162. package/dist/integrations/claude_code/agents/dr-extractor.md +8 -2
  163. package/dist/integrations/claude_code/commands/dr-analyzer.md +565 -0
  164. package/dist/integrations/claude_code/commands/dr-changeset.md +2 -1
  165. package/dist/integrations/claude_code/commands/dr-map.md +20 -1
  166. package/dist/integrations/claude_code/commands/dr-plan.md +66 -0
  167. package/dist/integrations/claude_code/commands/dr-relate.md +106 -96
  168. package/dist/integrations/claude_code/commands/dr-verify.md +45 -2
  169. package/dist/integrations/claude_code/docs/END_TO_END_WALKTHROUGH.md +14 -0
  170. package/dist/integrations/claude_code/docs/MCP_SERVER.md +47 -26
  171. package/dist/integrations/claude_code/docs/QUICK_START.md +37 -8
  172. package/dist/integrations/claude_code/docs/README.md +68 -2
  173. package/dist/integrations/claude_code/plugin-agents/dr-advisor.md +255 -0
  174. package/dist/integrations/claude_code/plugin-agents/dr-architect.md +306 -0
  175. package/dist/integrations/claude_code/skills/dr_01_motivation_layer/SKILL.md +93 -72
  176. package/dist/integrations/claude_code/skills/dr_02_business_layer/SKILL.md +163 -126
  177. package/dist/integrations/claude_code/skills/dr_03_product_layer/SKILL.md +161 -126
  178. package/dist/integrations/claude_code/skills/dr_04_security_layer/SKILL.md +153 -133
  179. package/dist/integrations/claude_code/skills/dr_05_application_layer/SKILL.md +129 -100
  180. package/dist/integrations/claude_code/skills/dr_06_technology_layer/SKILL.md +111 -94
  181. package/dist/integrations/claude_code/skills/dr_07_api_layer/SKILL.md +143 -157
  182. package/dist/integrations/claude_code/skills/dr_08_data_model_layer/SKILL.md +117 -33
  183. package/dist/integrations/claude_code/skills/dr_09_dataset_layer/SKILL.md +74 -25
  184. package/dist/integrations/claude_code/skills/dr_10_ux_layer/SKILL.md +88 -12
  185. package/dist/integrations/claude_code/skills/dr_11_navigation_layer/SKILL.md +83 -24
  186. package/dist/integrations/claude_code/skills/dr_12_apm_layer/SKILL.md +57 -12
  187. package/dist/integrations/claude_code/skills/dr_13_testing_layer/SKILL.md +95 -15
  188. package/dist/integrations/claude_code/skills/dr_change_planning/SKILL.md +178 -0
  189. package/dist/integrations/claude_code/skills/dr_changeset_reviewer/SKILL.md +8 -0
  190. package/dist/integrations/claude_code/skills/dr_engineering_guide/SKILL.md +6 -1
  191. package/dist/integrations/github_copilot/agents/dr-architect.md +3 -1
  192. package/dist/integrations/github_copilot/skills/dr_01_motivation_layer/SKILL.md +182 -102
  193. package/dist/integrations/github_copilot/skills/dr_02_business_layer/SKILL.md +266 -148
  194. package/dist/integrations/github_copilot/skills/dr_03_product_layer/SKILL.md +547 -86
  195. package/dist/integrations/github_copilot/skills/dr_04_security_layer/SKILL.md +164 -169
  196. package/dist/integrations/github_copilot/skills/dr_05_application_layer/SKILL.md +420 -150
  197. package/dist/integrations/github_copilot/skills/dr_06_technology_layer/SKILL.md +331 -138
  198. package/dist/integrations/github_copilot/skills/dr_07_api_layer/SKILL.md +265 -201
  199. package/dist/integrations/github_copilot/skills/dr_08_data_model_layer/SKILL.md +181 -58
  200. package/dist/integrations/github_copilot/skills/dr_09_dataset_layer/SKILL.md +209 -57
  201. package/dist/integrations/github_copilot/skills/dr_10_ux_layer/SKILL.md +277 -112
  202. package/dist/integrations/github_copilot/skills/dr_11_navigation_layer/SKILL.md +219 -70
  203. package/dist/integrations/github_copilot/skills/dr_12_apm_layer/SKILL.md +189 -105
  204. package/dist/integrations/github_copilot/skills/dr_13_testing_layer/SKILL.md +225 -102
  205. package/dist/integrations/github_copilot/skills/dr_change_planning/SKILL.md +177 -0
  206. package/dist/integrations/github_copilot/skills/dr_changeset_reviewer/SKILL.md +3 -0
  207. package/dist/integrations/hash-utils.js.map +2 -2
  208. package/dist/mcp/api-key-manager.js +14 -1
  209. package/dist/mcp/api-key-manager.js.map +2 -2
  210. package/dist/mcp/changeset-only.js +45 -0
  211. package/dist/mcp/changeset-only.js.map +7 -0
  212. package/dist/mcp/project-root.js +85 -0
  213. package/dist/mcp/project-root.js.map +7 -0
  214. package/dist/mcp/server-instructions.js +27 -0
  215. package/dist/mcp/server-instructions.js.map +7 -0
  216. package/dist/mcp/strict-schema.js +52 -0
  217. package/dist/mcp/strict-schema.js.map +7 -0
  218. package/dist/mcp/tool-registry.js +55 -5
  219. package/dist/mcp/tool-registry.js.map +2 -2
  220. package/dist/mcp/tools/changeset-analysis-tools.js +98 -0
  221. package/dist/mcp/tools/changeset-analysis-tools.js.map +7 -0
  222. package/dist/mcp/tools/changeset-commit.js +224 -0
  223. package/dist/mcp/tools/changeset-commit.js.map +7 -0
  224. package/dist/mcp/tools/changeset-editing.js +260 -0
  225. package/dist/mcp/tools/changeset-editing.js.map +7 -0
  226. package/dist/mcp/tools/changeset-lifecycle.js +83 -0
  227. package/dist/mcp/tools/changeset-lifecycle.js.map +7 -0
  228. package/dist/mcp/tools/changeset-shared.js +31 -0
  229. package/dist/mcp/tools/changeset-shared.js.map +7 -0
  230. package/dist/mcp/tools/changeset-show.js +17 -1
  231. package/dist/mcp/tools/changeset-show.js.map +2 -2
  232. package/dist/mcp/tools/changeset-verify.js +49 -0
  233. package/dist/mcp/tools/changeset-verify.js.map +7 -0
  234. package/dist/mcp/tools/codebase-extract.js +836 -0
  235. package/dist/mcp/tools/codebase-extract.js.map +7 -0
  236. package/dist/mcp/tools/codebase-index.js +125 -0
  237. package/dist/mcp/tools/codebase-index.js.map +7 -0
  238. package/dist/mcp/tools/codebase-shared.js +265 -0
  239. package/dist/mcp/tools/codebase-shared.js.map +7 -0
  240. package/dist/mcp/tools/codebase-verify.js +48 -0
  241. package/dist/mcp/tools/codebase-verify.js.map +7 -0
  242. package/dist/mcp/tools/index.js +34 -1
  243. package/dist/mcp/tools/index.js.map +2 -2
  244. package/dist/mcp/tools/model-add.js +191 -74
  245. package/dist/mcp/tools/model-add.js.map +2 -2
  246. package/dist/mcp/tools/model-delete.js +2 -2
  247. package/dist/mcp/tools/model-delete.js.map +2 -2
  248. package/dist/mcp/tools/model-search.js +14 -0
  249. package/dist/mcp/tools/model-search.js.map +2 -2
  250. package/dist/mcp/tools/model-show.js +29 -2
  251. package/dist/mcp/tools/model-show.js.map +2 -2
  252. package/dist/mcp/tools/model-trace.js +93 -30
  253. package/dist/mcp/tools/model-trace.js.map +2 -2
  254. package/dist/mcp/tools/model-update.js +46 -26
  255. package/dist/mcp/tools/model-update.js.map +2 -2
  256. package/dist/mcp/tools/model-validate.js +46 -4
  257. package/dist/mcp/tools/model-validate.js.map +2 -2
  258. package/dist/mcp/tools/project-status-collectors.js +381 -0
  259. package/dist/mcp/tools/project-status-collectors.js.map +7 -0
  260. package/dist/mcp/tools/project-status.js +237 -0
  261. package/dist/mcp/tools/project-status.js.map +7 -0
  262. package/dist/mcp/tools/project-tools.js +505 -0
  263. package/dist/mcp/tools/project-tools.js.map +7 -0
  264. package/dist/mcp/tools/relationship-tools.js +167 -0
  265. package/dist/mcp/tools/relationship-tools.js.map +7 -0
  266. package/dist/mcp/tools/review-open.js +210 -0
  267. package/dist/mcp/tools/review-open.js.map +7 -0
  268. package/dist/mcp/tools/shared.js +35 -4
  269. package/dist/mcp/tools/shared.js.map +2 -2
  270. package/dist/mcp/tools/spec-type.js +90 -0
  271. package/dist/mcp/tools/spec-type.js.map +7 -0
  272. package/dist/reports/model-report-orchestrator.js +31 -2
  273. package/dist/reports/model-report-orchestrator.js.map +2 -2
  274. package/dist/schemas/bundled/analyzers/cbm.json +1200 -70
  275. package/dist/schemas/bundled/analyzers/manifest.json +2 -2
  276. package/dist/schemas/bundled/api.json +1029 -1658
  277. package/dist/schemas/bundled/apm.json +499 -734
  278. package/dist/schemas/bundled/application.json +735 -371
  279. package/dist/schemas/bundled/base.json +3 -220
  280. package/dist/schemas/bundled/business.json +452 -366
  281. package/dist/schemas/bundled/data-model.json +395 -411
  282. package/dist/schemas/bundled/data-store.json +334 -558
  283. package/dist/schemas/bundled/manifest.json +18 -18
  284. package/dist/schemas/bundled/motivation.json +349 -368
  285. package/dist/schemas/bundled/navigation.json +415 -731
  286. package/dist/schemas/bundled/product.json +325 -159
  287. package/dist/schemas/bundled/security.json +864 -1232
  288. package/dist/schemas/bundled/technology.json +574 -703
  289. package/dist/schemas/bundled/testing.json +865 -1646
  290. package/dist/schemas/bundled/ux.json +739 -1352
  291. package/dist/server/schemas.js +8 -0
  292. package/dist/server/schemas.js.map +2 -2
  293. package/dist/server/server.js +686 -231
  294. package/dist/server/server.js.map +3 -3
  295. package/dist/server/viewer-registry.js +264 -0
  296. package/dist/server/viewer-registry.js.map +7 -0
  297. package/dist/server-entry.js +2 -1
  298. package/dist/server-entry.js.map +2 -2
  299. package/dist/telemetry/index.js +1 -1
  300. package/dist/utils/ansi-suppressor.js +6 -8
  301. package/dist/utils/ansi-suppressor.js.map +2 -2
  302. package/dist/utils/attribute-patch.js +41 -0
  303. package/dist/utils/attribute-patch.js.map +7 -0
  304. package/dist/utils/error-hints.js +29 -0
  305. package/dist/utils/error-hints.js.map +7 -0
  306. package/dist/utils/errors.js +9 -3
  307. package/dist/utils/errors.js.map +2 -2
  308. package/dist/utils/id-generator.js +5 -2
  309. package/dist/utils/id-generator.js.map +2 -2
  310. package/dist/utils/project-paths.js +26 -1
  311. package/dist/utils/project-paths.js.map +2 -2
  312. package/dist/utils/source-reference.js +64 -31
  313. package/dist/utils/source-reference.js.map +2 -2
  314. package/dist/utils/spec-version.js +2 -2
  315. package/dist/utils/spec-version.js.map +1 -1
  316. package/dist/validators/composed-reference-validator.js +5 -27
  317. package/dist/validators/composed-reference-validator.js.map +2 -2
  318. package/dist/validators/model-warnings.js +28 -0
  319. package/dist/validators/model-warnings.js.map +7 -0
  320. package/dist/validators/reference-validator.js +0 -7
  321. package/dist/validators/reference-validator.js.map +2 -2
  322. package/dist/validators/relationship-schema-validator.js +3 -3
  323. package/dist/validators/relationship-schema-validator.js.map +2 -2
  324. package/dist/validators/schema-validator.js +27 -9
  325. package/dist/validators/schema-validator.js.map +2 -2
  326. package/dist/validators/types.js.map +1 -1
  327. package/dist/viewer/README.md +6 -6
  328. package/dist/viewer/assets/main-CUOQGGRA.css +1 -0
  329. package/dist/viewer/assets/main-DvH3gYrI.js +84 -0
  330. package/dist/viewer/index.html +2 -2
  331. package/dist/viewer/manifest.json +10 -10
  332. package/dist/viewer/version.json +1 -1
  333. package/package.json +2 -1
  334. package/dist/viewer/assets/main-B7AOQXXX.js +0 -81
  335. package/dist/viewer/assets/main-vdrFrG7q.css +0 -1
@@ -1,10 +1,16 @@
1
1
  ---
2
- description: Analyze an existing codebase and automatically generate a Documentation Robotics architecture model
2
+ description: "Deprecated: use the codebase_extract MCP tool. Analyze an existing codebase and generate a Documentation Robotics architecture model"
3
3
  argument-hint: "<path> [--layers <layers>] [--tech <technology>] [--recipe | --targeted]"
4
4
  ---
5
5
 
6
6
  # Extract Architecture Model from Codebase
7
7
 
8
+ > **Deprecated.** Use the `codebase_extract` tool on the `dr` MCP server instead. It runs the
9
+ > extraction cascade on the indexed code (`codebase_index` first): the Tier-0 rules stage what they
10
+ > decide, and the symbols they can't place come back to you as cards to stage with `model_add`.
11
+ > Everything lands in an as-built changeset, never the base model, for the user to review and
12
+ > commit. This command still works but is no longer maintained.
13
+
8
14
  Analyze an existing codebase and automatically generate a Documentation Robotics architecture model.
9
15
 
10
16
  ## What This Command Does
@@ -246,6 +252,19 @@ Proceed with extraction?
246
252
 
247
253
  The extraction workflow can consult the dr-analyzer if one is installed and active.
248
254
 
255
+ **Important: Dual-Root Configuration**
256
+
257
+ If your codebase root (source code location) differs from your model root (metadata location):
258
+
259
+ 1. Ensure `codebase_path` is configured in `documentation-robotics/model/manifest.yaml`
260
+ 2. If you recently changed `codebase_path`, re-index before extraction:
261
+
262
+ ```bash
263
+ dr analyzer index --force
264
+ ```
265
+
266
+ See [dr-analyzer.md](dr-analyzer.md) for complete dual-root setup instructions.
267
+
249
268
  **Check analyzer status:**
250
269
 
251
270
  Run the following command and save the result (it will guide the extraction agent):
@@ -0,0 +1,66 @@
1
+ ---
2
+ description: Plan a change as a staged DR changeset through the dr MCP server, pressure-test it, build from its brief, and verify the build. The human commits it in the PR.
3
+ argument-hint: "<the change to plan, in plain words>"
4
+ ---
5
+
6
+ # Plan a Change
7
+
8
+ Plan `$ARGUMENTS` as a staged DR changeset instead of a prose plan.
9
+
10
+ ## Instructions for Claude Code
11
+
12
+ Follow the `dr_change_planning` skill for this change.
13
+ In short:
14
+
15
+ 1. **Frame**: propose a kebab-case name and the change's intent, and confirm both with the human
16
+ before `changeset_create` uses them as the name and description (or `changeset_activate` an
17
+ existing one). Wait for their answer. Find or stage the goal, requirement or feature it serves.
18
+ With no model yet, confirm the model's name before `project_init`, and ask whether to bootstrap
19
+ it from the code or let it grow with each change.
20
+ 2. **Orient**: `model_search`, `model_show`, `model_trace` for what exists; `spec_type` for each
21
+ type you will add. Within reason, every connection the spec models for a type is expected,
22
+ though not every one will exist.
23
+ 3. **Draft**: `model_add` / `model_update` / `model_delete` / `relationship_add` /
24
+ `relationship_delete` across every layer the change reaches. Wire several at once with the
25
+ lists: `model_add` `elements: [...]` (with `relationships` among them) and `relationship_add`
26
+ `relationships: [...]`; invalid items are skipped and reported. A planned element with no code
27
+ yet gets no source fields. `model_update` with
28
+ `attributePatch` to change one attribute; `changeset_unstage` to back out (`source` or `target`
29
+ alone drops every staged connection at that end; `changes: [...]` drops several in one call).
30
+ 4. **Pressure-test**: `changeset_brief` (compact; `detail: "full"` only when you need everything)
31
+ and `changeset_impact`. Answer each gap by staging what is
32
+ missing, or accept it and say why in an annotation or the description. Steps 3 and 4 repeat:
33
+ stage a little, then pass the brief's `revisionToken` back as `since` to see what changed, work
34
+ through `unwired` (list it with `sections: ["unwired"], unwiredLayers: [...]`, naming the layers
35
+ the change reaches; always pass a filter), and walk `changeset_impact` with `from` set to what
36
+ you just added.
37
+ 5. **Review**: show the human the brief, then call `review_open` and give them its `url`, which
38
+ opens the plan on the graph in the viewer. The human comments there; read the comments with
39
+ `annotation_list`, answer with `annotation_reply`, revise. Wait for agreement before building.
40
+ 6. **Build** from the brief: `changeset_brief` with `sections: ["changes"]` for each changed
41
+ element's attributes and connections (for a large plan, one layer at a time with
42
+ `layers: ["<layer>"]`, from the default brief's `byLayer`). Commit only the plan's own changeset directory
43
+ (`documentation-robotics/changesets/<id>/`) on the branch with the code; keep `.active` and the
44
+ as-built changeset out of the commit. Don't verify during the build: no `codebase_extract`, no
45
+ as-built changeset and no `changeset_verify` until the build is committed.
46
+ 7. **Verify**, as its own step after the build is committed: `codebase_index` with `wait: 30`
47
+ (then `status: true`, `wait: 30` until it is done; if it reports `ignoreFile`, tell the developer
48
+ to commit that file), then `codebase_extract`
49
+ with `since` (the branch the work started from) and `changeset: "<name>-as-built"`. Stage the
50
+ cards it returns that are elements with `model_add` (`sourceProvenance: "extracted"`), call it again for their relationships, then
51
+ `changeset_verify` the plan against `<name>-as-built`. The as-built comes from `codebase_extract`,
52
+ never by hand: never copy plan elements into it, and name each element after its card, not the
53
+ plan. Ask the developer about the cards you can't place with confidence, batched in one short
54
+ list, instead of guessing. Fix what diverges, in the code or in the plan, and `changeset_activate`
55
+ the plan again. `unverifiable` items (what extraction can't see) and `notes` (description-only
56
+ differences) need no plan edit; never edit the plan to match extracted placeholder text. Then the
57
+ plan is what lands; ask the human whether to discard the as-built changeset or keep it as a
58
+ record. Landing the as-built first drifts the plan's base, so the plan would need `force`.
59
+ 8. **Land**: the human commits the plan in the PR, not the as-built changeset. When they ask you to land it, call
60
+ `changeset_commit`; they confirm it in a dialog, and it commits only then. If it is refused, they
61
+ land it in the viewer (`review_open`, then Apply), or you call it again from an interactive
62
+ session; never point them to the `dr` CLI. Never commit unasked, and never apply
63
+ or discard the plan yourself.
64
+
65
+ If the `dr` MCP tools are not available, say so and point the user to
66
+ `integrations/claude_code/docs/MCP_SERVER.md`.
@@ -29,9 +29,9 @@ full set of spec-defined schemas — intra-layer and cross-layer alike.
29
29
 
30
30
  Relationships require the full model to be visible before wiring can begin:
31
31
 
32
- - A `ux.librarycomponent.renders.ux.view` relationship can't be created until both
32
+ - A `ux.view.composes.ux.componentinstance` relationship can't be created until both
33
33
  the source and target UX elements exist
34
- - Cross-layer relationships (e.g., `business.businessservice --[delivers-value]--> motivation.value`)
34
+ - Cross-layer relationships (e.g., `business.businessservice --[delivers]--> motivation.value`)
35
35
  can't be wired until both layers are populated
36
36
  - Re-running `/dr-relate` after adding more layers is cheap — no nodes are re-created
37
37
 
@@ -303,16 +303,16 @@ Build a relationship map that includes both intra-layer and cross-layer schemas:
303
303
 
304
304
  ```
305
305
  ux layer relationship map (intra-layer):
306
- ux.librarycomponent →[renders]→ ux.view
307
- ux.librarycomponent →[extends]→ ux.librarycomponent
308
- ux.view →[contains]→ ux.widget
306
+ ux.view →[composes]→ ux.componentinstance
307
+ ux.componentinstance →[realizes]→ ux.librarycomponent
308
+ ux.librarycomponent →[specializes]→ ux.librarycomponent
309
309
  ux.view →[handles]→ ux.event
310
310
  ux.widget →[triggers]→ ux.event
311
311
  ... (123 total intra-layer schemas in ux)
312
312
 
313
313
  application layer cross-layer schemas:
314
314
  application.applicationprocess →[realizes]→ business.businessprocess
315
- application.applicationservice →[delivers-value]→ motivation.value
315
+ application.applicationservice →[delivers]→ motivation.value
316
316
  application.applicationservice →[references]→ apm.traceconfiguration
317
317
  ...
318
318
  ```
@@ -343,8 +343,8 @@ For each populated layer (in the order they appear in the model):
343
343
  - Element names and descriptions
344
344
  - Source provenance files (if elements share the same source file, a relationship
345
345
  is likely)
346
- - Domain semantics of the predicate (e.g., `renders` implies a parent component
347
- rendering a child view)
346
+ - Domain semantics of the predicate (e.g., `composes` implies a parent view
347
+ placing a child component)
348
348
 
349
349
  3. For warranted pairs, create the relationship:
350
350
 
@@ -378,20 +378,20 @@ For each populated layer (in the order they appear in the model):
378
378
 
379
379
  **Intra-layer relationship priorities by layer:**
380
380
 
381
- | Layer | High-value predicates to look for |
382
- | ----------- | ----------------------------------------------------------- |
383
- | ux | renders, contains, handles, extends, triggers, navigates-to |
384
- | navigation | routes-to, contains, links-to, guards |
385
- | api | service-of, extends, depends-on, produces, consumes |
386
- | data-model | extends, references, contains |
387
- | data-store | stores, partitions, indexes |
388
- | application | depends-on, orchestrates, delegates-to |
389
- | technology | depends-on, runs-on, extends |
390
- | security | protects, requires, grants, scopes |
391
- | apm | monitors, aggregates, triggers |
392
- | testing | tests, covers, depends-on |
393
- | business | realizes, depends-on, triggers, supports |
394
- | motivation | supports, influences, realizes, fulfills |
381
+ | Layer | High-value predicates to look for |
382
+ | ----------- | ------------------------------------------------------------------------- |
383
+ | ux | composes, realizes, applies, binds-to, uses, triggers, navigates-to |
384
+ | navigation | navigates-to, flows-to, protects, evaluates, composes, accesses |
385
+ | api | composes, references, specializes, governs, realizes, serves |
386
+ | data-model | composes, references, specializes, maps-to |
387
+ | data-store | composes, accesses, references, triggers, derives-from |
388
+ | application | depends-on, orchestrates, delegates-to |
389
+ | technology | composes, assigned-to, realizes, serves, connects, depends-on |
390
+ | security | aggregates, composes, authorizes, mandates, mitigates, generates, governs |
391
+ | apm | aggregates, composes, flows-to, references, monitors |
392
+ | testing | composes, references, validates, aggregates, covers, tests |
393
+ | business | realizes, depends-on, triggers, supports |
394
+ | motivation | realizes, aggregates, specializes, influence, associated-with, constrains |
395
395
 
396
396
  ---
397
397
 
@@ -424,79 +424,89 @@ The table below lists every cross-layer layer pair and the predicates defined in
424
424
  Run `dr schema relationship <element-type>` for the exact source/destination node types
425
425
  within each pair — this table shows the predicate vocabulary, not individual type combinations.
426
426
 
427
- | Source Layer | Target Layer | Predicates |
428
- | ------------ | ------------ | ----------------------------------------------------------------------------------------------------------- |
429
- | api | apm | references |
430
- | api | application | realizes, references, serves, triggers, uses |
431
- | api | business | maps-to, realizes, references, serves, triggers |
432
- | api | data-store | maps-to |
433
- | api | motivation | realizes, satisfies, serves |
434
- | api | security | implements, maps-to, references, requires, satisfies |
435
- | api | technology | depends-on, uses |
436
- | apm | api | monitors, references |
437
- | apm | application | maps-to, monitors |
438
- | apm | business | maps-to, monitors, serves |
439
- | apm | data-model | monitors, references |
440
- | apm | data-store | accesses, depends-on, monitors, serves |
441
- | apm | motivation | maps-to, realizes, satisfies |
442
- | apm | navigation | monitors, references |
443
- | apm | security | monitors, references, satisfies |
444
- | apm | technology | depends-on, monitors |
445
- | apm | ux | monitors, references |
446
- | application | apm | references |
447
- | application | business | accesses, realizes, serves, triggers |
448
- | application | motivation | delivers-value, realizes, satisfies, serves |
449
- | application | security | accesses, constrained-by, exposes, implements, mitigates, requires |
450
- | business | application | aggregates, references |
451
- | business | motivation | delivers-value, realizes, satisfies, serves |
452
- | business | security | constrained-by |
453
- | data-model | api | maps-to, realizes, serves |
454
- | data-model | application | maps-to, realizes, references, serves |
455
- | data-model | business | realizes, references, serves |
456
- | data-model | data-store | maps-to |
457
- | data-model | motivation | realizes, satisfies |
458
- | data-model | security | references, requires, satisfies |
459
- | data-model | technology | depends-on, maps-to, uses |
460
- | data-store | api | maps-to, realizes, serves |
461
- | data-store | application | implements, serves, triggers |
462
- | data-store | business | realizes, satisfies, serves, triggers |
463
- | data-store | motivation | satisfies |
464
- | data-store | security | implements, requires, satisfies |
465
- | data-store | technology | depends-on, uses |
466
- | navigation | api | accesses, maps-to, references, requires, uses |
467
- | navigation | application | accesses, depends-on, lazy-loads, realizes, references, resolves-with, triggers, uses |
468
- | navigation | business | maps-to, realizes, references, serves, triggers |
469
- | navigation | data-model | accesses, maps-to, references, uses |
470
- | navigation | data-store | accesses, depends-on, uses |
471
- | navigation | motivation | realizes, satisfies |
472
- | navigation | security | accesses, implements, references, requires, satisfies |
473
- | navigation | technology | depends-on, uses |
474
- | navigation | ux | accesses, maps-to, triggers, uses |
475
- | security | business | constrains, governs, maps-to, protects, references, targets |
476
- | security | motivation | implements, maps-to, realizes, satisfies |
477
- | technology | application | realizes, serves |
478
- | technology | business | realizes, serves |
479
- | technology | motivation | implements, realizes, satisfies, serves |
480
- | technology | security | accesses, implements, mitigates, realizes, satisfies |
481
- | testing | api | accesses, covers, references, tests, validates |
482
- | testing | apm | references, tests |
483
- | testing | application | covers, tests |
484
- | testing | business | covers, references, tests |
485
- | testing | data-model | covers, references, tests |
486
- | testing | data-store | accesses, references, tests |
487
- | testing | motivation | constrained-by, fulfills-requirements, governed-by-principles, measures-outcome, references, supports-goals |
488
- | testing | navigation | covers, references, tests |
489
- | testing | security | covers, references, tests, validates |
490
- | testing | technology | references, requires, tests |
491
- | testing | ux | covers, maps-to, tests |
492
- | ux | api | accesses, maps-to, triggers, uses |
493
- | ux | application | accesses, realizes, serves, triggers, uses |
494
- | ux | business | maps-to, realizes, serves, triggers |
495
- | ux | data-model | maps-to, references |
496
- | ux | data-store | accesses, maps-to, triggers |
497
- | ux | motivation | maps-to, realizes, satisfies, serves |
498
- | ux | security | references, requires, satisfies |
499
- | ux | technology | depends-on, requires, uses |
427
+ | Source Layer | Target Layer | Predicates |
428
+ | ------------ | ------------ | ---------------------------------------------------------------------- |
429
+ | api | application | realizes, references, serves, triggers, uses |
430
+ | api | motivation | satisfies, supports |
431
+ | api | navigation | serves |
432
+ | api | product | exposes |
433
+ | api | security | realizes, references, requires, satisfies |
434
+ | api | technology | depends-on |
435
+ | apm | api | monitors, references |
436
+ | apm | application | maps-to, monitors |
437
+ | apm | business | monitors |
438
+ | apm | data-model | monitors, references |
439
+ | apm | data-store | accesses, monitors |
440
+ | apm | motivation | measures-outcome, satisfies |
441
+ | apm | navigation | monitors, references |
442
+ | apm | security | monitors, references, satisfies |
443
+ | apm | technology | monitors, references |
444
+ | apm | ux | monitors, references |
445
+ | application | apm | references |
446
+ | application | business | accesses, realizes, serves, triggers |
447
+ | application | data-model | accesses |
448
+ | application | data-store | accesses |
449
+ | application | motivation | delivers, realizes, satisfies |
450
+ | application | product | realizes |
451
+ | application | security | accesses, constrained-by, exposes, realizes, requires |
452
+ | business | application | references |
453
+ | business | motivation | delivers, realizes, references, satisfies, supports |
454
+ | business | security | constrained-by |
455
+ | data-model | api | maps-to |
456
+ | data-model | application | realizes |
457
+ | data-model | business | realizes |
458
+ | data-model | data-store | maps-to |
459
+ | data-model | motivation | satisfies |
460
+ | data-model | security | references, requires, satisfies |
461
+ | data-model | technology | maps-to |
462
+ | data-store | api | maps-to, serves |
463
+ | data-store | application | realizes, serves, triggers |
464
+ | data-store | business | realizes, satisfies |
465
+ | data-store | motivation | satisfies |
466
+ | data-store | security | realizes, references, requires, satisfies |
467
+ | data-store | technology | depends-on |
468
+ | navigation | api | maps-to, references, requires, uses |
469
+ | navigation | application | accesses, depends-on, lazy-loads, realizes, references, triggers, uses |
470
+ | navigation | business | references |
471
+ | navigation | data-model | accesses, maps-to, references |
472
+ | navigation | motivation | satisfies |
473
+ | navigation | product | realizes |
474
+ | navigation | security | accesses, realizes, references, requires, satisfies |
475
+ | navigation | technology | depends-on |
476
+ | navigation | ux | maps-to, triggers, uses |
477
+ | product | business | realizes, references |
478
+ | product | motivation | delivers, references, satisfies, supports |
479
+ | security | business | constrains, governs, protects, references, targets |
480
+ | security | motivation | realizes, references, satisfies |
481
+ | technology | api | serves |
482
+ | technology | apm | serves |
483
+ | technology | application | realizes, serves |
484
+ | technology | data-store | serves |
485
+ | technology | motivation | realizes, satisfies |
486
+ | technology | navigation | serves |
487
+ | technology | product | realizes |
488
+ | technology | security | accesses, realizes, satisfies |
489
+ | technology | ux | serves |
490
+ | testing | api | covers, references, tests |
491
+ | testing | apm | tests |
492
+ | testing | application | covers, tests |
493
+ | testing | business | covers, tests |
494
+ | testing | data-model | covers, references, tests |
495
+ | testing | data-store | accesses, covers, tests |
496
+ | testing | motivation | measures-outcome, satisfies, supports |
497
+ | testing | navigation | covers, tests |
498
+ | testing | product | covers, tests |
499
+ | testing | security | covers, tests |
500
+ | testing | technology | covers, references, requires |
501
+ | testing | ux | covers, references, tests |
502
+ | ux | api | maps-to, references, triggers |
503
+ | ux | application | realizes, triggers |
504
+ | ux | business | references, serves |
505
+ | ux | data-model | maps-to, references |
506
+ | ux | motivation | satisfies, supports |
507
+ | ux | product | realizes |
508
+ | ux | security | references, requires, satisfies |
509
+ | ux | technology | depends-on |
500
510
 
501
511
  > **API→Application traceability pattern**
502
512
  >
@@ -644,7 +654,7 @@ Log the failure and continue. At the end of the pass, surface skipped pairs:
644
654
  Skipped relationships (not in spec):
645
655
  ux.view.dashboard-view →[contains]→ ux.widget.sidebar
646
656
  Reason: ux.view.contains.ux.widget is not a defined relationship schema
647
- Suggestion: Valid predicates for ux.view: renders, handles, triggers
657
+ Suggestion: Valid predicates for ux.view: composes, applies, binds-to, uses
648
658
  ```
649
659
 
650
660
  ### Element not found
@@ -16,7 +16,19 @@ Cross-reference the Documentation Robotics model against an external code analyz
16
16
  - **Graph-only**: Routes discovered in the code but missing from the model (suspected gaps) ⚠
17
17
  - **Model-only**: Operations in the model but not discovered in the code (possible drift) ?
18
18
 
19
- 4. Offers actionable next steps: add missing routes, remove orphaned operations, or ignore entries
19
+ 4. Checks matched elements for connections the spec models but the model lacks, and looks for
20
+ evidence of each in the analyzer's graph and the code
21
+ 5. Offers actionable next steps: add missing routes and connections, remove orphaned operations, or
22
+ ignore entries
23
+
24
+ ## Important: Dual-Root Configuration
25
+
26
+ The verification process respects your project's dual-root configuration. If your codebase root (source code location) differs from your model root (metadata location), ensure:
27
+
28
+ 1. **Configure in manifest**: Set `codebase_path` in `documentation-robotics/model/manifest.yaml` if needed
29
+ 2. **Re-index if needed**: If you recently updated `codebase_path`, run `dr analyzer index --force` before verifying
30
+
31
+ See [dr-analyzer.md](dr-analyzer.md) for complete dual-root documentation.
20
32
 
21
33
  ## Usage
22
34
 
@@ -348,7 +360,38 @@ ignore:
348
360
  match: "model_only"
349
361
  ```
350
362
 
351
- ### Step 7: Status and Next Steps
363
+ ### Step 7: Check for Missing Connections
364
+
365
+ Matching elements is half the check. Within reason, every connection the spec models for a type is
366
+ expected, though not every one will exist. Look for the ones the model has not captured:
367
+
368
+ 1. **Pick the elements.** The matched elements, plus the ones you added in Step 5. With a changeset
369
+ active, the elements it adds or changes.
370
+ 2. **Ask the spec what each type can connect to:** `dr schema relationship <layer>.<type>` lists
371
+ the triples the catalog defines from that type (over MCP, `spec_type` lists both directions).
372
+ Incoming ones are covered when you check the element at the other end.
373
+ 3. **Compare with the model:** `dr show <element-id>` lists the relationships the element has.
374
+ Every triple the spec models that the element lacks is a candidate.
375
+ 4. **Look for evidence of each candidate, in this order:**
376
+ - the analyzer's graph: `dr analyzer callers <symbol>` / `dr analyzer callees <symbol>` for the
377
+ element's source symbol, or `dr analyzer query` for HTTP calls, imports and handlers between
378
+ the element's file and the other element's file
379
+ - the code at the element's source file and symbol
380
+ 5. **Act on what you find.**
381
+ - Evidence found: offer the relationship with the evidence, for example
382
+ `dr relationship add <source-id> <target-id> --predicate <predicate>`. Say what the evidence is
383
+ ("`createOrder` calls `OrderRepository.save`").
384
+ - No evidence: don't add it. The catalog says a connection can exist, not that it does here.
385
+
386
+ **Report the result in its own section:**
387
+
388
+ ```
389
+ Missing connections: N candidates checked, X with evidence (offered), Y without evidence (left out).
390
+ ```
391
+
392
+ List each one with evidence: the triple, the two elements, and where the evidence is.
393
+
394
+ ### Step 8: Status and Next Steps
352
395
 
353
396
  **After processing all buckets, summarize:**
354
397
 
@@ -168,6 +168,18 @@ If you select [y], the analyzer is installed and ready.
168
168
 
169
169
  **What this does:** Scans your codebase and builds an indexed code graph for later verification.
170
170
 
171
+ **Important: If Your Codebase is in a Different Directory**
172
+
173
+ If your source code lives in a different directory than your model (common in monorepos), configure it first:
174
+
175
+ **In `documentation-robotics/model/manifest.yaml`:**
176
+
177
+ ```yaml
178
+ codebase_path: src # Relative to the directory that contains documentation-robotics/
179
+ ```
180
+
181
+ Then proceed with indexing.
182
+
171
183
  **Command:**
172
184
 
173
185
  ```bash
@@ -206,6 +218,8 @@ Ready for extraction with /dr-map
206
218
 
207
219
  **Then proceed to Step 3** with the analyzer installed. This enables `/dr-verify` for gap and drift detection.
208
220
 
221
+ For complete analyzer documentation including dual-root configuration, see [dr-analyzer.md](../commands/dr-analyzer.md).
222
+
209
223
  ---
210
224
 
211
225
  ### Option B: Without Code Analyzer (Faster, Manual-First Approach)
@@ -9,47 +9,68 @@ description: Configure an MCP client to connect to the Documentation Robotics MC
9
9
 
10
10
  Annotation tools (`annotation_list`, `annotation_get`, `annotation_create`, `annotation_update`, `annotation_delete`, `annotation_reply`) mirror the capabilities of the REST server's `/api/annotations/*` endpoints. Unlike the REST server's in-memory, per-process annotation store, the MCP tools persist annotations to `documentation-robotics/annotations/` on disk, so they survive across MCP sessions.
11
11
 
12
- ## Configuring Claude Code
12
+ ## Tools
13
13
 
14
- Add an entry to your project's `.mcp.json` (or the equivalent global MCP config):
14
+ | Group | Tools |
15
+ | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
16
+ | Read the model | `model_list`, `model_show`, `model_search`, `model_trace`, `model_stats`, `model_info`, `model_validate`, `model_export`, `model_reload` |
17
+ | Change the model | `model_add`, `model_update`, `model_delete`, `relationship_add`, `relationship_delete` |
18
+ | Look up the spec | `spec_type` |
19
+ | Changesets | `changeset_list`, `changeset_show`, `changeset_create`, `changeset_activate`, `changeset_deactivate`, `changeset_update`, `changeset_unstage`, `changeset_discard` |
20
+ | Pressure-test and verify | `changeset_brief`, `changeset_impact`, `changeset_verify` |
21
+ | Annotations | `annotation_list`, `annotation_get`, `annotation_create`, `annotation_update`, `annotation_delete`, `annotation_reply` |
22
+ | Review | `review_open` (a link that opens a changeset in the viewer; reuses or starts `dr visualize`) |
23
+ | Chat | `chat_launch`, `chat_status` |
24
+
25
+ With a changeset active, the "change the model" tools stage into it, and the read tools show the model as the changeset leaves it. Committing or applying a changeset is not a tool: the human does that in the viewer or with `dr changeset commit`. `changeset_discard` deletes staged changes for good, so it needs the changeset named explicitly (id or name) and `confirm: true`.
26
+
27
+ To plan a change with these tools, use `/dr-plan` (or the `dr_change_planning` skill). The design is in [`docs/CHANGE_MODELING.md`](../../../docs/CHANGE_MODELING.md).
28
+
29
+ ## Installing in Claude Code
30
+
31
+ Install the `dr` plugin once per machine. It registers the MCP server for every project and adds `/dr-plan` and the DR skills. It needs the `dr` CLI on `PATH`:
32
+
33
+ ```bash
34
+ npm install -g @documentation-robotics/cli
35
+ claude plugin marketplace add tinkermonkey/documentation_robotics
36
+ claude plugin install dr@documentation-robotics
37
+ ```
38
+
39
+ Inside a session, `/plugin marketplace add tinkermonkey/documentation_robotics` and `/plugin install dr@documentation-robotics` do the same.
40
+
41
+ The server serves the project the session has open: it asks Claude Code for its MCP roots (the folder the session started in) and moves there, so one registration covers every project. Tool calls can still pass `rootPath` to work on another project. From the plugin, the tools are named `mcp__plugin_dr_dr__<tool>`.
42
+
43
+ The plugin also ships the `dr:dr-architect` and `dr:dr-advisor` agents, with tool lists that use those names. See [Agents in the plugin](README.md#agents-in-the-plugin).
44
+
45
+ ### Registering the server by hand
46
+
47
+ Without the plugin, add the server to a project's `.mcp.json` (or your user-scope MCP config). Name it `dr`, so its tools are `mcp__dr__<tool>`, which the `dr-architect` agent and DrBot expect:
15
48
 
16
49
  ```json
17
50
  {
18
51
  "mcpServers": {
19
- "documentation-robotics": {
52
+ "dr": {
20
53
  "command": "dr",
21
- "args": ["mcp"],
22
- "env": {
23
- "DR_MCP_API_KEY": "<key printed by dr mcp>"
24
- }
54
+ "args": ["mcp"]
25
55
  }
26
56
  }
27
57
  }
28
58
  ```
29
59
 
30
- Other MCP clients follow the same shape: a `command`/`args` pair that launches `dr mcp`, plus `DR_MCP_API_KEY` in `env`.
31
-
32
- ## Getting the API key
60
+ Other MCP clients follow the same shape: a `command`/`args` pair that launches `dr mcp`. Over stdio there is no API key: the client starts the server as your own user, and that user can already read the model files. An older config that still sets `DR_MCP_API_KEY` keeps working; the server ignores it.
33
61
 
34
- Run `dr mcp` once from a terminal — it generates an API key on first launch (prompting for a storage path interactively, defaulting to `~/.dr-mcp-key` otherwise) and prints it to stderr on every launch:
62
+ ## Environment
35
63
 
36
- ```
37
- $ dr mcp
38
- Generated new MCP API key, stored at /home/you/.dr-mcp-key
39
- MCP API key: dr-mcp-<random>
40
- Documentation Robotics MCP server ready (stdio)
41
- ```
64
+ | Variable | Effect |
65
+ | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
66
+ | `DR_MCP_ROOT_PATH` | Serve the model at this path instead of the client's roots or the working directory. An unusable path is reported on stderr and the server keeps its own directory. |
67
+ | `DR_CHANGESET_ONLY` | `true`/`1`/`yes`/`on` refuses model writes unless a staged changeset is active (an unrecognised value also turns it on, with a warning). DrBot sets it with `dr visualize --with-changesets`. |
68
+ | `DR_MCP_QUIET_KEY` | HTTP transport only: don't print the API key to stderr on start. |
42
69
 
43
- Copy that key into the client config's `DR_MCP_API_KEY`. The server rejects the connection if the key is missing or doesn't match.
70
+ ## HTTP transport and the API key
44
71
 
45
- ## Rotating the key
46
-
47
- If a key leaks or you just want a fresh one, run:
48
-
49
- ```bash
50
- dr mcp --regenerate-key
51
- ```
72
+ `dr mcp --transport http` serves MCP at `http://127.0.0.1:3100/mcp` for clients that connect over the network. HTTP clients authenticate with the API key as a bearer token (`Authorization: Bearer <key>`). The server generates the key on first launch (prompting for a storage path interactively, defaulting to `~/.dr-mcp-key` otherwise) and prints it to stderr on every launch.
52
73
 
53
- This overwrites the key at its existing storage path, updates `~/.dr-config.yaml`, and prints the new key — no manual deletion of files required. Update `DR_MCP_API_KEY` in every client config after rotating.
74
+ To rotate the key, run `dr mcp --regenerate-key`. It overwrites the key at its existing storage path, updates `~/.dr-config.yaml` and prints the new key. Update every HTTP client afterwards.
54
75
 
55
76
  See [cli/README.md](../../../cli/README.md#mcp-server) for the full command reference.