@documentation-robotics/cli 0.1.13 → 0.3.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 (351) hide show
  1. package/README.md +74 -2
  2. package/dist/analysis/relationship-classifier.js +2 -9
  3. package/dist/analysis/relationship-classifier.js.map +2 -2
  4. package/dist/analyzers/call-graph-utils.js +2 -2
  5. package/dist/analyzers/call-graph-utils.js.map +2 -2
  6. package/dist/analyzers/cards/build.js +171 -0
  7. package/dist/analyzers/cards/build.js.map +7 -0
  8. package/dist/analyzers/cards/classify.js +42 -0
  9. package/dist/analyzers/cards/classify.js.map +7 -0
  10. package/dist/analyzers/cards/edge-index.js +44 -0
  11. package/dist/analyzers/cards/edge-index.js.map +7 -0
  12. package/dist/analyzers/cards/facts.js +46 -0
  13. package/dist/analyzers/cards/facts.js.map +7 -0
  14. package/dist/analyzers/cards/graph.js +42 -0
  15. package/dist/analyzers/cards/graph.js.map +7 -0
  16. package/dist/analyzers/cards/index.js +8 -0
  17. package/dist/analyzers/cards/index.js.map +7 -0
  18. package/dist/analyzers/cards/tier0.js +18 -0
  19. package/dist/analyzers/cards/tier0.js.map +7 -0
  20. package/dist/analyzers/cards/types.js +1 -0
  21. package/dist/analyzers/cards/types.js.map +7 -0
  22. package/dist/analyzers/cbm-analyzer.js +195 -171
  23. package/dist/analyzers/cbm-analyzer.js.map +2 -2
  24. package/dist/analyzers/cbm-responses.js +336 -0
  25. package/dist/analyzers/cbm-responses.js.map +7 -0
  26. package/dist/analyzers/edge-relationships.js +45 -0
  27. package/dist/analyzers/edge-relationships.js.map +7 -0
  28. package/dist/analyzers/mapping-loader.js +9 -0
  29. package/dist/analyzers/mapping-loader.js.map +2 -2
  30. package/dist/analyzers/tier0-rules.js +153 -0
  31. package/dist/analyzers/tier0-rules.js.map +7 -0
  32. package/dist/analyzers/types.js.map +1 -1
  33. package/dist/analyzers/verify-engine.js +22 -19
  34. package/dist/analyzers/verify-engine.js.map +2 -2
  35. package/dist/audit/relationships/ai/prompts.js +10 -10
  36. package/dist/audit/relationships/ai/prompts.js.map +2 -2
  37. package/dist/audit/relationships/analysis/layer-templates.js +52 -52
  38. package/dist/audit/relationships/analysis/layer-templates.js.map +1 -1
  39. package/dist/cli.js +112 -28
  40. package/dist/cli.js.map +3 -3
  41. package/dist/coding-agents/agents/claude-code.js +3 -1
  42. package/dist/coding-agents/agents/claude-code.js.map +2 -2
  43. package/dist/coding-agents/claude-code-client.js +2 -1
  44. package/dist/coding-agents/claude-code-client.js.map +2 -2
  45. package/dist/coding-agents/copilot-client.js +17 -12
  46. package/dist/coding-agents/copilot-client.js.map +2 -2
  47. package/dist/coding-agents/default-permissions.js +152 -0
  48. package/dist/coding-agents/default-permissions.js.map +7 -0
  49. package/dist/coding-agents/drbot-mcp.js +167 -0
  50. package/dist/coding-agents/drbot-mcp.js.map +7 -0
  51. package/dist/commands/add.js +12 -7
  52. package/dist/commands/add.js.map +2 -2
  53. package/dist/commands/analyzer.js +134 -23
  54. package/dist/commands/analyzer.js.map +2 -2
  55. package/dist/commands/audit.js +6 -6
  56. package/dist/commands/audit.js.map +2 -2
  57. package/dist/commands/changeset-verify.js +55 -0
  58. package/dist/commands/changeset-verify.js.map +7 -0
  59. package/dist/commands/changeset.js +261 -147
  60. package/dist/commands/changeset.js.map +2 -2
  61. package/dist/commands/delete.js +52 -19
  62. package/dist/commands/delete.js.map +3 -3
  63. package/dist/commands/element.js +3 -2
  64. package/dist/commands/element.js.map +2 -2
  65. package/dist/commands/farm.js +773 -0
  66. package/dist/commands/farm.js.map +7 -0
  67. package/dist/commands/init.js +11 -1
  68. package/dist/commands/init.js.map +2 -2
  69. package/dist/commands/mcp.js +122 -0
  70. package/dist/commands/mcp.js.map +7 -0
  71. package/dist/commands/relationship.js +251 -47
  72. package/dist/commands/relationship.js.map +2 -2
  73. package/dist/commands/reports.js +1 -1
  74. package/dist/commands/reports.js.map +2 -2
  75. package/dist/commands/update.js +56 -24
  76. package/dist/commands/update.js.map +2 -2
  77. package/dist/commands/upgrade.js +99 -11
  78. package/dist/commands/upgrade.js.map +3 -3
  79. package/dist/commands/validate.js +41 -3
  80. package/dist/commands/validate.js.map +2 -2
  81. package/dist/commands/version.js +2 -2
  82. package/dist/commands/version.js.map +2 -2
  83. package/dist/commands/visualize.js +4 -3
  84. package/dist/commands/visualize.js.map +2 -2
  85. package/dist/config.js +83 -0
  86. package/dist/config.js.map +7 -0
  87. package/dist/core/annotation-store.js +138 -0
  88. package/dist/core/annotation-store.js.map +7 -0
  89. package/dist/core/catalog-migration.js +33 -0
  90. package/dist/core/catalog-migration.js.map +7 -0
  91. package/dist/core/changeset-analysis.js +421 -0
  92. package/dist/core/changeset-analysis.js.map +7 -0
  93. package/dist/core/changeset-base-index.js +153 -0
  94. package/dist/core/changeset-base-index.js.map +7 -0
  95. package/dist/core/changeset-brief-delta.js +102 -0
  96. package/dist/core/changeset-brief-delta.js.map +7 -0
  97. package/dist/core/changeset-graph.js +281 -0
  98. package/dist/core/changeset-graph.js.map +7 -0
  99. package/dist/core/changeset-only-guard.js +32 -0
  100. package/dist/core/changeset-only-guard.js.map +7 -0
  101. package/dist/core/changeset-summary.js +68 -0
  102. package/dist/core/changeset-summary.js.map +7 -0
  103. package/dist/core/changeset-validator.js +66 -20
  104. package/dist/core/changeset-validator.js.map +2 -2
  105. package/dist/core/changeset-verify.js +518 -0
  106. package/dist/core/changeset-verify.js.map +7 -0
  107. package/dist/core/changeset.js +56 -9
  108. package/dist/core/changeset.js.map +2 -2
  109. package/dist/core/element-type-migration.js +145 -0
  110. package/dist/core/element-type-migration.js.map +7 -0
  111. package/dist/core/farm-manifest.js +140 -0
  112. package/dist/core/farm-manifest.js.map +7 -0
  113. package/dist/core/farm-sync-engine.js +346 -0
  114. package/dist/core/farm-sync-engine.js.map +7 -0
  115. package/dist/core/farm-sync-state.js +167 -0
  116. package/dist/core/farm-sync-state.js.map +7 -0
  117. package/dist/core/manifest.js +6 -3
  118. package/dist/core/manifest.js.map +2 -2
  119. package/dist/core/migration-registry.js +84 -1
  120. package/dist/core/migration-registry.js.map +2 -2
  121. package/dist/core/model-upgrade.js +102 -0
  122. package/dist/core/model-upgrade.js.map +7 -0
  123. package/dist/core/model.js +257 -44
  124. package/dist/core/model.js.map +3 -3
  125. package/dist/core/mutation-handler.js +71 -6
  126. package/dist/core/mutation-handler.js.map +2 -2
  127. package/dist/core/relationship-migration-table.js +6639 -0
  128. package/dist/core/relationship-migration-table.js.map +7 -0
  129. package/dist/core/relationship-migration.js +272 -0
  130. package/dist/core/relationship-migration.js.map +7 -0
  131. package/dist/core/relationship-prune.js +49 -0
  132. package/dist/core/relationship-prune.js.map +7 -0
  133. package/dist/core/relationship-staging.js +68 -0
  134. package/dist/core/relationship-staging.js.map +7 -0
  135. package/dist/core/relationships.js +26 -4
  136. package/dist/core/relationships.js.map +2 -2
  137. package/dist/core/report-data-model.js +7 -13
  138. package/dist/core/report-data-model.js.map +2 -2
  139. package/dist/core/staged-changeset-storage.js +64 -17
  140. package/dist/core/staged-changeset-storage.js.map +2 -2
  141. package/dist/core/staged-source-reference.js +28 -0
  142. package/dist/core/staged-source-reference.js.map +7 -0
  143. package/dist/core/staging-area.js +83 -18
  144. package/dist/core/staging-area.js.map +2 -2
  145. package/dist/core/virtual-projection.js +14 -5
  146. package/dist/core/virtual-projection.js.map +2 -2
  147. package/dist/export/archimate-exporter.js +1 -0
  148. package/dist/export/archimate-exporter.js.map +2 -2
  149. package/dist/generated/compiled-validators.js +2 -2
  150. package/dist/generated/compiled-validators.js.map +2 -2
  151. package/dist/generated/layer-registry.js +16 -16
  152. package/dist/generated/layer-registry.js.map +2 -2
  153. package/dist/generated/node-types.js +186 -168
  154. package/dist/generated/node-types.js.map +2 -2
  155. package/dist/generated/relationship-index.js +2209 -7727
  156. package/dist/generated/relationship-index.js.map +2 -2
  157. package/dist/integrations/claude_code/agents/dr-architect.md +16 -3
  158. package/dist/integrations/claude_code/agents/dr-extractor.md +1 -1
  159. package/dist/integrations/claude_code/commands/dr-analyzer.md +565 -0
  160. package/dist/integrations/claude_code/commands/dr-map.md +13 -0
  161. package/dist/integrations/claude_code/commands/dr-plan.md +40 -0
  162. package/dist/integrations/claude_code/commands/dr-relate.md +106 -96
  163. package/dist/integrations/claude_code/commands/dr-verify.md +45 -2
  164. package/dist/integrations/claude_code/docs/END_TO_END_WALKTHROUGH.md +14 -0
  165. package/dist/integrations/claude_code/docs/MCP_SERVER.md +79 -0
  166. package/dist/integrations/claude_code/docs/QUICK_START.md +37 -8
  167. package/dist/integrations/claude_code/docs/README.md +52 -1
  168. package/dist/integrations/claude_code/skills/dr_01_motivation_layer/SKILL.md +93 -72
  169. package/dist/integrations/claude_code/skills/dr_02_business_layer/SKILL.md +163 -126
  170. package/dist/integrations/claude_code/skills/dr_03_product_layer/SKILL.md +161 -126
  171. package/dist/integrations/claude_code/skills/dr_04_security_layer/SKILL.md +153 -133
  172. package/dist/integrations/claude_code/skills/dr_05_application_layer/SKILL.md +129 -100
  173. package/dist/integrations/claude_code/skills/dr_06_technology_layer/SKILL.md +111 -94
  174. package/dist/integrations/claude_code/skills/dr_07_api_layer/SKILL.md +143 -157
  175. package/dist/integrations/claude_code/skills/dr_08_data_model_layer/SKILL.md +117 -33
  176. package/dist/integrations/claude_code/skills/dr_09_dataset_layer/SKILL.md +74 -25
  177. package/dist/integrations/claude_code/skills/dr_10_ux_layer/SKILL.md +88 -12
  178. package/dist/integrations/claude_code/skills/dr_11_navigation_layer/SKILL.md +83 -24
  179. package/dist/integrations/claude_code/skills/dr_12_apm_layer/SKILL.md +57 -12
  180. package/dist/integrations/claude_code/skills/dr_13_testing_layer/SKILL.md +92 -15
  181. package/dist/integrations/claude_code/skills/dr_change_planning/SKILL.md +119 -0
  182. package/dist/integrations/claude_code/skills/dr_changeset_reviewer/SKILL.md +3 -0
  183. package/dist/integrations/claude_code/skills/dr_engineering_guide/SKILL.md +1 -1
  184. package/dist/integrations/github_copilot/agents/dr-architect.md +1 -1
  185. package/dist/integrations/github_copilot/skills/dr_01_motivation_layer/SKILL.md +182 -102
  186. package/dist/integrations/github_copilot/skills/dr_02_business_layer/SKILL.md +266 -148
  187. package/dist/integrations/github_copilot/skills/dr_03_product_layer/SKILL.md +547 -86
  188. package/dist/integrations/github_copilot/skills/dr_04_security_layer/SKILL.md +164 -169
  189. package/dist/integrations/github_copilot/skills/dr_05_application_layer/SKILL.md +420 -150
  190. package/dist/integrations/github_copilot/skills/dr_06_technology_layer/SKILL.md +331 -138
  191. package/dist/integrations/github_copilot/skills/dr_07_api_layer/SKILL.md +265 -201
  192. package/dist/integrations/github_copilot/skills/dr_08_data_model_layer/SKILL.md +181 -58
  193. package/dist/integrations/github_copilot/skills/dr_09_dataset_layer/SKILL.md +209 -57
  194. package/dist/integrations/github_copilot/skills/dr_10_ux_layer/SKILL.md +277 -112
  195. package/dist/integrations/github_copilot/skills/dr_11_navigation_layer/SKILL.md +219 -70
  196. package/dist/integrations/github_copilot/skills/dr_12_apm_layer/SKILL.md +189 -105
  197. package/dist/integrations/github_copilot/skills/dr_13_testing_layer/SKILL.md +222 -102
  198. package/dist/integrations/github_copilot/skills/dr_change_planning/SKILL.md +119 -0
  199. package/dist/integrations/github_copilot/skills/dr_changeset_reviewer/SKILL.md +3 -0
  200. package/dist/integrations/hash-utils.js.map +2 -2
  201. package/dist/mcp/api-key-manager.js +111 -0
  202. package/dist/mcp/api-key-manager.js.map +7 -0
  203. package/dist/mcp/changeset-only.js +34 -0
  204. package/dist/mcp/changeset-only.js.map +7 -0
  205. package/dist/mcp/http-transport.js +176 -0
  206. package/dist/mcp/http-transport.js.map +7 -0
  207. package/dist/mcp/resource-registry.js +97 -0
  208. package/dist/mcp/resource-registry.js.map +7 -0
  209. package/dist/mcp/tool-registry.js +60 -0
  210. package/dist/mcp/tool-registry.js.map +7 -0
  211. package/dist/mcp/tools/annotation-create.js +39 -0
  212. package/dist/mcp/tools/annotation-create.js.map +7 -0
  213. package/dist/mcp/tools/annotation-delete.js +29 -0
  214. package/dist/mcp/tools/annotation-delete.js.map +7 -0
  215. package/dist/mcp/tools/annotation-get.js +29 -0
  216. package/dist/mcp/tools/annotation-get.js.map +7 -0
  217. package/dist/mcp/tools/annotation-list.js +24 -0
  218. package/dist/mcp/tools/annotation-list.js.map +7 -0
  219. package/dist/mcp/tools/annotation-reply.js +34 -0
  220. package/dist/mcp/tools/annotation-reply.js.map +7 -0
  221. package/dist/mcp/tools/annotation-shared.js +10 -0
  222. package/dist/mcp/tools/annotation-shared.js.map +7 -0
  223. package/dist/mcp/tools/annotation-update.js +39 -0
  224. package/dist/mcp/tools/annotation-update.js.map +7 -0
  225. package/dist/mcp/tools/changeset-analysis-tools.js +78 -0
  226. package/dist/mcp/tools/changeset-analysis-tools.js.map +7 -0
  227. package/dist/mcp/tools/changeset-editing.js +184 -0
  228. package/dist/mcp/tools/changeset-editing.js.map +7 -0
  229. package/dist/mcp/tools/changeset-lifecycle.js +83 -0
  230. package/dist/mcp/tools/changeset-lifecycle.js.map +7 -0
  231. package/dist/mcp/tools/changeset-list.js +33 -0
  232. package/dist/mcp/tools/changeset-list.js.map +7 -0
  233. package/dist/mcp/tools/changeset-shared.js +31 -0
  234. package/dist/mcp/tools/changeset-shared.js.map +7 -0
  235. package/dist/mcp/tools/changeset-show.js +55 -0
  236. package/dist/mcp/tools/changeset-show.js.map +7 -0
  237. package/dist/mcp/tools/changeset-verify.js +43 -0
  238. package/dist/mcp/tools/changeset-verify.js.map +7 -0
  239. package/dist/mcp/tools/chat-launch.js +50 -0
  240. package/dist/mcp/tools/chat-launch.js.map +7 -0
  241. package/dist/mcp/tools/chat-status.js +26 -0
  242. package/dist/mcp/tools/chat-status.js.map +7 -0
  243. package/dist/mcp/tools/index.js +65 -0
  244. package/dist/mcp/tools/index.js.map +7 -0
  245. package/dist/mcp/tools/model-add.js +107 -0
  246. package/dist/mcp/tools/model-add.js.map +7 -0
  247. package/dist/mcp/tools/model-delete.js +99 -0
  248. package/dist/mcp/tools/model-delete.js.map +7 -0
  249. package/dist/mcp/tools/model-export.js +72 -0
  250. package/dist/mcp/tools/model-export.js.map +7 -0
  251. package/dist/mcp/tools/model-info.js +51 -0
  252. package/dist/mcp/tools/model-info.js.map +7 -0
  253. package/dist/mcp/tools/model-list.js +53 -0
  254. package/dist/mcp/tools/model-list.js.map +7 -0
  255. package/dist/mcp/tools/model-reload.js +34 -0
  256. package/dist/mcp/tools/model-reload.js.map +7 -0
  257. package/dist/mcp/tools/model-search.js +102 -0
  258. package/dist/mcp/tools/model-search.js.map +7 -0
  259. package/dist/mcp/tools/model-show.js +68 -0
  260. package/dist/mcp/tools/model-show.js.map +7 -0
  261. package/dist/mcp/tools/model-stats.js +22 -0
  262. package/dist/mcp/tools/model-stats.js.map +7 -0
  263. package/dist/mcp/tools/model-trace.js +118 -0
  264. package/dist/mcp/tools/model-trace.js.map +7 -0
  265. package/dist/mcp/tools/model-update.js +121 -0
  266. package/dist/mcp/tools/model-update.js.map +7 -0
  267. package/dist/mcp/tools/model-validate.js +78 -0
  268. package/dist/mcp/tools/model-validate.js.map +7 -0
  269. package/dist/mcp/tools/relationship-tools.js +98 -0
  270. package/dist/mcp/tools/relationship-tools.js.map +7 -0
  271. package/dist/mcp/tools/shared.js +126 -0
  272. package/dist/mcp/tools/shared.js.map +7 -0
  273. package/dist/mcp/tools/spec-type.js +90 -0
  274. package/dist/mcp/tools/spec-type.js.map +7 -0
  275. package/dist/reports/model-layer-report-generator.js +5 -3
  276. package/dist/reports/model-layer-report-generator.js.map +2 -2
  277. package/dist/reports/model-readme-generator.js +116 -0
  278. package/dist/reports/model-readme-generator.js.map +7 -0
  279. package/dist/reports/model-report-data.js +37 -1
  280. package/dist/reports/model-report-data.js.map +2 -2
  281. package/dist/reports/model-report-orchestrator.js +29 -6
  282. package/dist/reports/model-report-orchestrator.js.map +2 -2
  283. package/dist/reports/model-report-utils.js +9 -0
  284. package/dist/reports/model-report-utils.js.map +7 -0
  285. package/dist/schemas/bundled/analyzers/cbm.json +1186 -68
  286. package/dist/schemas/bundled/analyzers/manifest.json +2 -2
  287. package/dist/schemas/bundled/api.json +1029 -1658
  288. package/dist/schemas/bundled/apm.json +499 -734
  289. package/dist/schemas/bundled/application.json +745 -370
  290. package/dist/schemas/bundled/base.json +3 -220
  291. package/dist/schemas/bundled/business.json +452 -366
  292. package/dist/schemas/bundled/data-model.json +403 -383
  293. package/dist/schemas/bundled/data-store.json +334 -558
  294. package/dist/schemas/bundled/manifest.json +18 -18
  295. package/dist/schemas/bundled/motivation.json +349 -368
  296. package/dist/schemas/bundled/navigation.json +415 -731
  297. package/dist/schemas/bundled/product.json +325 -159
  298. package/dist/schemas/bundled/security.json +864 -1232
  299. package/dist/schemas/bundled/technology.json +574 -703
  300. package/dist/schemas/bundled/testing.json +718 -1643
  301. package/dist/schemas/bundled/ux.json +739 -1352
  302. package/dist/server/schemas.js +8 -0
  303. package/dist/server/schemas.js.map +2 -2
  304. package/dist/server/server.js +234 -31
  305. package/dist/server/server.js.map +2 -2
  306. package/dist/server-entry.js +2 -1
  307. package/dist/server-entry.js.map +2 -2
  308. package/dist/telemetry/config.js +2 -40
  309. package/dist/telemetry/config.js.map +2 -2
  310. package/dist/telemetry/index.js +1 -1
  311. package/dist/types/index.js.map +2 -2
  312. package/dist/utils/ansi-suppressor.js +23 -0
  313. package/dist/utils/ansi-suppressor.js.map +7 -0
  314. package/dist/utils/attribute-patch.js +41 -0
  315. package/dist/utils/attribute-patch.js.map +7 -0
  316. package/dist/utils/color-utils.js +34 -0
  317. package/dist/utils/color-utils.js.map +7 -0
  318. package/dist/utils/element-reference-shape.js +15 -1
  319. package/dist/utils/element-reference-shape.js.map +3 -3
  320. package/dist/utils/error-hints.js +29 -0
  321. package/dist/utils/error-hints.js.map +7 -0
  322. package/dist/utils/errors.js +75 -10
  323. package/dist/utils/errors.js.map +2 -2
  324. package/dist/utils/globals.js +17 -1
  325. package/dist/utils/globals.js.map +2 -2
  326. package/dist/utils/project-paths.js +50 -3
  327. package/dist/utils/project-paths.js.map +2 -2
  328. package/dist/utils/reference-path-parser.js +49 -0
  329. package/dist/utils/reference-path-parser.js.map +7 -0
  330. package/dist/utils/source-reference.js +17 -10
  331. package/dist/utils/source-reference.js.map +2 -2
  332. package/dist/utils/spec-version.js +10 -2
  333. package/dist/utils/spec-version.js.map +2 -2
  334. package/dist/validators/composed-reference-validator.js +240 -0
  335. package/dist/validators/composed-reference-validator.js.map +7 -0
  336. package/dist/validators/reference-validator.js +57 -13
  337. package/dist/validators/reference-validator.js.map +3 -3
  338. package/dist/validators/relationship-schema-validator.js +33 -5
  339. package/dist/validators/relationship-schema-validator.js.map +3 -3
  340. package/dist/validators/schema-validator.js +27 -9
  341. package/dist/validators/schema-validator.js.map +2 -2
  342. package/dist/validators/types.js.map +1 -1
  343. package/dist/viewer/README.md +6 -6
  344. package/dist/viewer/assets/main-CxzcuU_o.js +84 -0
  345. package/dist/viewer/assets/main-j-7ULYpm.css +1 -0
  346. package/dist/viewer/index.html +2 -2
  347. package/dist/viewer/manifest.json +10 -10
  348. package/dist/viewer/version.json +1 -1
  349. package/package.json +7 -3
  350. package/dist/viewer/assets/main-B7AOQXXX.js +0 -81
  351. package/dist/viewer/assets/main-vdrFrG7q.css +0 -1
@@ -144,125 +144,117 @@ Rate limiting policy (requests per window, key strategy)? → api.ratel
144
144
 
145
145
  ## Intra-Layer Relationships
146
146
 
147
- ### Composition Relationships (Part cannot exist without whole)
148
-
149
- | Source | Predicate | Target | Example |
150
- | --------------- | --------- | -------------- | --------------------------------- |
151
- | OpenAPIDocument | composes | Info | Document has metadata |
152
- | OpenAPIDocument | composes | Paths | Document defines endpoints |
153
- | OpenAPIDocument | composes | Components | Document has reusable components |
154
- | Paths | composes | PathItem | Paths contain path items |
155
- | PathItem | composes | Operation | Path has HTTP methods |
156
- | PathItem | composes | Parameter | Path-level parameters |
157
- | Operation | composes | Parameter | Operation-specific parameters |
158
- | Operation | composes | RequestBody | Request payload definition |
159
- | Operation | composes | Responses | Response definitions |
160
- | Responses | composes | Response | Individual status responses |
161
- | RequestBody | composes | MediaType | Request content types |
162
- | Response | composes | MediaType | Response content types |
163
- | Response | composes | Header | Response headers |
164
- | Response | composes | Link | HATEOAS links |
165
- | MediaType | composes | Schema | Data structure |
166
- | MediaType | composes | Example | Sample data |
167
- | MediaType | composes | Encoding | Serialization details |
168
- | Components | composes | Schema | Reusable schemas |
169
- | Components | composes | Response | Reusable responses |
170
- | Components | composes | Parameter | Reusable parameters |
171
- | Components | composes | Example | Reusable examples |
172
- | Components | composes | RequestBody | Reusable request bodies |
173
- | Components | composes | Header | Reusable headers |
174
- | Components | composes | SecurityScheme | Security definitions |
175
- | Components | composes | Link | Reusable links |
176
- | Components | composes | Callback | Reusable callbacks |
177
- | Info | composes | Contact | API owner contact |
178
- | Info | composes | License | API license |
179
- | SecurityScheme | composes | OAuthFlows | OAuth2 configuration |
180
- | OAuthFlows | composes | OAuthFlow | Individual OAuth2 flow definition |
181
-
182
- ### Aggregation Relationships (Part can exist independently)
183
-
184
- | Source | Predicate | Target | Example |
185
- | --------------- | ---------- | ------------------- | ------------------------ |
186
- | OpenAPIDocument | aggregates | Server | API deployment servers |
187
- | OpenAPIDocument | aggregates | Tag | Operation tags |
188
- | OpenAPIDocument | aggregates | SecurityRequirement | Global security |
189
- | Server | aggregates | ServerVariable | URL template variables |
190
- | PathItem | aggregates | Parameter | Shared parameters |
191
- | Operation | aggregates | Callback | Webhooks |
192
- | Operation | aggregates | SecurityRequirement | Operation-level security |
147
+ ### Composition Relationships (the OpenAPI document tree)
148
+
149
+ Every nesting in an OpenAPI document is `composes`; reuse through `$ref` is `references`, and
150
+ `allOf` inheritance is `specializes`. Link only what an OpenAPI field holds. The API reaches the
151
+ business layer through the application layer, a security scheme links only to security, and API
152
+ schemas reach data stores through data-model schemas.
153
+
154
+ | Source Type | Predicate | Target Type | Example |
155
+ | --------------- | --------- | -------------- | ----------------------------------------------------- |
156
+ | OpenAPIDocument | composes | Info | "Payment API" composes "Payment API Info" |
157
+ | OpenAPIDocument | composes | Paths | "Payment API" composes "Payment API Paths" |
158
+ | OpenAPIDocument | composes | Components | "Payment API" composes "Payment API Components" |
159
+ | Paths | composes | PathItem | "Payment API Paths" composes "/payments/{id}" |
160
+ | PathItem | composes | Operation | "/payments/{id}" composes "getPayment" |
161
+ | Operation | composes | Responses | "getPayment" composes "getPayment Responses" |
162
+ | Responses | composes | Response | "getPayment Responses" composes "200 Payment Found" |
163
+ | RequestBody | composes | MediaType | "Payment Request Body" composes "application/json" |
164
+ | Response | composes | MediaType | "200 Payment Found" composes "application/json" |
165
+ | Response | composes | Header | "201 Created" composes "Location" |
166
+ | Response | composes | Link | "201 Created" composes "GetCreatedPayment" |
167
+ | MediaType | composes | Schema | "application/json" composes "Payment" |
168
+ | MediaType | composes | Encoding | "multipart/form-data" composes "receipt encoding" |
169
+ | Components | composes | Schema | "Payment API Components" composes "Payment" |
170
+ | Components | composes | Parameter | "Payment API Components" composes "PageSize" |
171
+ | Components | composes | Response | "Payment API Components" composes "404 Not Found" |
172
+ | Components | composes | SecurityScheme | "Payment API Components" composes "oauth2-auth" |
173
+ | SecurityScheme | composes | OAuthFlows | "oauth2-auth" composes "oauth2-auth Flows" |
174
+ | OAuthFlows | composes | OAuthFlow | "oauth2-auth Flows" composes "Authorization Code" |
175
+ | OpenAPIDocument | composes | Server | "Payment API" composes "Production Server" |
176
+ | OpenAPIDocument | composes | Tag | "Payment API" composes "payments" |
177
+ | Server | composes | ServerVariable | "Regional Server" composes "region" |
178
+ | Info | composes | Contact | "Payment API Info" composes "Payments Team" |
179
+ | Info | composes | License | "Payment API Info" composes "Apache 2.0" |
180
+ | PathItem | composes | Parameter | "/payments/{id}" composes "paymentId" |
181
+ | Operation | composes | Parameter | "listPayments" composes "status" |
182
+ | Operation | composes | RequestBody | "processPayment" composes "Payment Request Body" |
183
+ | Components | composes | RequestBody | "Payment API Components" composes "Refund Request" |
184
+ | Components | composes | Callback | "Payment API Components" composes "paymentSettled" |
185
+ | Callback | composes | PathItem | "paymentSettled" composes "{$request.body#/callback}" |
186
+ | Operation | composes | Callback | "processPayment" composes "paymentSettled" |
193
187
 
194
188
  ### Reference Relationships
195
189
 
196
- | Source | Predicate | Target | Example |
197
- | --------------- | ---------- | --------------------- | -------------------------------------- |
198
- | Schema | references | Schema | Schema $ref to another schema |
199
- | Parameter | references | Schema | Parameter uses schema |
200
- | Header | references | Schema | Header uses schema |
201
- | Link | references | Operation | Link points to operation (operationId) |
202
- | Callback | references | PathItem | Callback references path definition |
203
- | Operation | references | Tag | Operation tagged for grouping |
204
- | Tag | references | ExternalDocumentation | Tag links to external docs |
205
- | OpenAPIDocument | references | ExternalDocumentation | Document links to external docs |
206
- | Encoding | references | Header | Encoding uses headers |
190
+ | Source Type | Predicate | Target Type | Example |
191
+ | ----------- | ---------- | --------------------- | ---------------------------------------------- |
192
+ | Schema | references | Schema | "Payment" references "Money" |
193
+ | Parameter | references | Schema | "status" references "PaymentStatus" |
194
+ | Header | references | Schema | "X-Request-Id" references "UUID" |
195
+ | MediaType | references | Schema | "application/json" references "PaymentRequest" |
196
+ | Link | references | Operation | "GetCreatedPayment" references "getPayment" |
197
+ | Operation | references | Tag | "processPayment" references "payments" |
198
+ | Tag | references | ExternalDocumentation | "payments" references "Payments Guide" |
207
199
 
208
200
  ### Specialization Relationships
209
201
 
210
- | Source | Predicate | Target | Example |
211
- | ------ | ----------- | ------ | ---------------------------------------- |
212
- | Schema | specializes | Schema | Schema inheritance (allOf, oneOf, anyOf) |
202
+ | Source Type | Predicate | Target Type | Example |
203
+ | ----------- | ----------- | ----------- | ------------------------------------------------------- |
204
+ | Schema | specializes | Schema | "CardPayment" specializes "Payment" (allOf) |
205
+ | Header | specializes | Parameter | "X-Request-Id" header specializes "requestId" parameter |
213
206
 
214
207
  ### Behavioral Relationships
215
208
 
216
- | Source | Predicate | Target | Example |
217
- | -------------- | --------- | --------- | ---------------------------------- |
218
- | Operation | triggers | Callback | Operation invokes webhook |
219
- | SecurityScheme | serves | Operation | Security scheme protects operation |
220
-
221
- ### Association Relationships
222
-
223
- | Source | Predicate | Target | Example |
224
- | ------- | --------------- | --------------- | -------------------- |
225
- | Contact | associated-with | OpenAPIDocument | Contact info for API |
226
- | License | associated-with | OpenAPIDocument | Legal license |
209
+ | Source Type | Predicate | Target Type | Example |
210
+ | --------------- | --------- | -------------- | ------------------------------------------------------ |
211
+ | Operation | uses | SecurityScheme | "processPayment" uses "oauth2-auth" |
212
+ | OpenAPIDocument | requires | SecurityScheme | "Payment API" requires "oauth2-auth" (global) |
213
+ | RateLimit | governs | Operation | "Standard Tier Limit" governs "processPayment" |
214
+ | RateLimit | triggers | Response | "Standard Tier Limit" triggers "429 Too Many Requests" |
227
215
 
228
216
  ---
229
217
 
230
218
  ## Cross-Layer References
231
219
 
232
- ### Outgoing References (API → Other Layers)
233
-
234
- OpenAPI specification includes **custom extensions** (x-\* properties) for cross-layer traceability:
235
-
236
- Cross-layer links to Business and Application layers use `dr relationship add`:
237
-
238
- ```bash
239
- dr relationship add api.<type>.<name> business.<type>.<name> --predicate realizes
240
- dr relationship add api.<type>.<name> application.<type>.<name> --predicate realizes
241
- ```
242
-
243
- Use `dr catalog types` to list all valid predicates.
220
+ Cross-layer links are recorded with `dr relationship add`, not with `x-*` extension properties. Value-only
221
+ extensions such as `x-apm-sla-target-latency` or `x-apm-criticality` are still recorded as element
222
+ attributes (see [Custom Extension Reference](#custom-extension-reference)).
244
223
 
245
- OpenAPI **x-\* properties** (set via `--properties`) are used for same-element metadata:
246
-
247
- | Target Layer | Extension Property | Example |
248
- | ------------------------ | ------------------------------- | --------------------------------------------------- |
249
- | **Layer 1 (Motivation)** | `x-supports-goals` | Operation supports business goals |
250
- | **Layer 1 (Motivation)** | `x-fulfills-requirements` | Operation fulfills functional requirements |
251
- | **Layer 1 (Motivation)** | `x-governed-by-principles` | Operation follows architectural principles |
252
- | **Layer 1 (Motivation)** | `x-constrained-by` | Operation subject to constraints (GDPR, HIPAA, SOX) |
253
- | **Layer 7 (Data Model)** | `schema.$ref` | Schema references JSON Schema definition |
254
- | **Layer 3 (Security)** | `x-security-resource` | Operation protected by SecureResource |
255
- | **Layer 3 (Security)** | `x-required-permissions` | Operation requires specific permissions |
256
- | **Layer 3 (Security)** | `x-rate-limit` | Rate limiting configuration |
257
- | **Layer 11 (APM)** | `x-apm-business-metrics` | Operation tracked by business metrics |
258
- | **Layer 11 (APM)** | `x-apm-sla-target-latency` | Expected response time (e.g., "100ms") |
259
- | **Layer 11 (APM)** | `x-apm-sla-target-availability` | Expected availability (e.g., "99.9%") |
260
- | **Layer 11 (APM)** | `x-apm-trace` | Distributed tracing enabled |
261
- | **Layer 11 (APM)** | `x-apm-criticality` | Business criticality (critical, high, medium, low) |
262
-
263
- ### Incoming References (Lower Layers → API)
224
+ ### Outgoing References (API → Other Layers)
264
225
 
265
- Lower layers reference API layer to show implementation and data structure.
226
+ | Source Type | Predicate | Target Type | Example |
227
+ | --------------- | ---------- | --------------------------------- | ---------------------------------------------------- |
228
+ | OpenAPIDocument | realizes | `application.applicationservice` | "Payment API" realizes "Payment Service" |
229
+ | Operation | realizes | `application.applicationfunction` | "processPayment" realizes "Authorize Payment" |
230
+ | Operation | references | `application.applicationservice` | "submitOrder" references "Order Service" |
231
+ | Operation | exposes | `product.feature` | "exportReport" exposes "CSV Export" |
232
+ | Operation | triggers | `application.applicationevent` | "createOrder" triggers "Order Created" |
233
+ | Server | depends-on | `technology.node` | "Production Server" depends on "EKS Cluster" |
234
+ | Operation | requires | `security.permission` | "refundPayment" requires "payments:refund" |
235
+ | Operation | references | `security.secureresource` | "getPayment" references "Payment Records" |
236
+ | SecurityScheme | realizes | `security.securitypolicy` | "oauth2-auth" realizes "Authenticated Access Policy" |
237
+ | RateLimit | realizes | `security.countermeasure` | "Login Rate Limit" realizes "Brute-force Throttling" |
238
+ | Operation | supports | `motivation.goal` | "processPayment" supports "Reduce Checkout Time" |
239
+ | Operation | satisfies | `motivation.requirement` | "refundPayment" satisfies "Self-service Refunds" |
240
+ | Operation | satisfies | `motivation.constraint` | "exportUserData" satisfies "GDPR Data Portability" |
241
+
242
+ ### Incoming References (Other Layers → API)
243
+
244
+ | Source Type | Predicate | Target Type | Example |
245
+ | ----------------------------- | --------- | -------------- | ------------------------------------------------------ |
246
+ | `data-model.schemadefinition` | maps-to | Schema | "PaymentRequest definition" maps to "PaymentRequest" |
247
+ | `data-model.objectschema` | maps-to | RequestBody | "PaymentRequest object" maps to "Payment Request Body" |
248
+ | `data-model.schemaproperty` | maps-to | Parameter | "payment.status" maps to "status" |
249
+ | `data-store.accesspattern` | maps-to | Operation | "Payments by Customer" maps to "listPayments" |
250
+ | `ux.actioncomponent` | triggers | Operation | "Pay Now Button" triggers "processPayment" |
251
+ | `ux.actioncomponent` | triggers | Operation | "Load More" button triggers `GET /orders` |
252
+ | `navigation.route` | maps-to | PathItem | "/payments/:id route" maps to "/payments/{id}" |
253
+ | `navigation.navigationguard` | uses | SecurityScheme | "Require Login Guard" uses "oauth2-auth" |
254
+ | `apm.metricinstrument` | monitors | Operation | "payment.latency" monitors "processPayment" |
255
+ | `apm.span` | monitors | Operation | "POST /payments span" monitors "processPayment" |
256
+ | `testing.testcasesketch` | tests | Operation | "Declined Card Sketch" tests "processPayment" |
257
+ | `testing.testcasesketch` | tests | Response | "Declined Card Sketch" tests "402 Payment Required" |
266
258
 
267
259
  ---
268
260
 
@@ -560,9 +552,6 @@ dr add api info "payment-api-info" \
560
552
  dr relationship add api.openapidocument.payment-api \
561
553
  api.info.payment-api-info --predicate composes
562
554
 
563
- # Link to motivation layer
564
- dr relationship add api.openapidocument.payment-api \
565
- motivation.principle.api-first-design --predicate governed-by
566
555
  ```
567
556
 
568
557
  ### Step 2: Define Servers
@@ -600,9 +589,9 @@ dr add api schema "payment-request" \
600
589
  dr add api schema "payment-response" \
601
590
  --description "Payment processing response"
602
591
 
603
- # Link to data model layer
604
- dr relationship add api.schema.payment-request \
605
- data-model.schema.payment-request --predicate references
592
+ # Link from the data model layer
593
+ dr relationship add data-model.schemadefinition.payment-request \
594
+ api.schema.payment-request --predicate maps-to
606
595
  ```
607
596
 
608
597
  ### Step 5: Define Operations (Core Entities)
@@ -612,11 +601,9 @@ dr relationship add api.schema.payment-request \
612
601
  dr add api operation "process-payment" \
613
602
  --description "Processes a payment transaction"
614
603
 
615
- # Add APM and security extensions
616
- dr add api operation "process-payment" \
617
-
618
- # Link to business layer via relationship
619
- dr relationship add api.operation.process-payment business.service.payment-processing --predicate realizes
604
+ # Link to the application layer, which carries the business link
605
+ dr relationship add api.operation.process-payment \
606
+ application.applicationfunction.authorize-payment --predicate realizes
620
607
 
621
608
  # GET operation
622
609
  dr add api operation "get-payment" \
@@ -636,7 +623,7 @@ dr add api parameter "status-filter" \
636
623
 
637
624
  # Link parameter to operation
638
625
  dr relationship add api.operation.get-payment \
639
- api.parameter.payment-id-param --predicate has-parameter
626
+ api.parameter.payment-id-param --predicate composes
640
627
  ```
641
628
 
642
629
  ### Step 7: Define Request/Response Bodies
@@ -646,17 +633,17 @@ dr relationship add api.operation.get-payment \
646
633
  dr add api requestbody "payment-request-body" \
647
634
  --description "Payment request payload"
648
635
 
649
- # Link request body to schema
650
- dr relationship add api.requestbody.payment-request-body \
651
- api.schema.payment-request --predicate uses-schema
636
+ # Link the request body's media type to its schema
637
+ dr relationship add api.mediatype.payment-request-json \
638
+ api.schema.payment-request --predicate references
652
639
 
653
640
  # Response
654
641
  dr add api response "payment-success-response" \
655
642
  --description "Successful payment response"
656
643
 
657
- # Link response to schema
658
- dr relationship add api.response.payment-success-response \
659
- api.schema.payment-response --predicate uses-schema
644
+ # Link the response's media type to its schema
645
+ dr relationship add api.mediatype.payment-success-json \
646
+ api.schema.payment-response --predicate references
660
647
  ```
661
648
 
662
649
  ### Step 8: Define Tags for Organization
@@ -671,31 +658,34 @@ dr add api tag "refunds" \
671
658
 
672
659
  # Tag operations
673
660
  dr relationship add api.operation.process-payment \
674
- api.tag.payments --predicate tagged-with
661
+ api.tag.payments --predicate references
675
662
  ```
676
663
 
677
664
  ### Step 9: Cross-Layer Integration
678
665
 
679
666
  ```bash
680
- # Link to business layer
681
- dr relationship add api.operation.process-payment \
682
- business.service.payment-processing --predicate realizes
667
+ # Link to the application layer
668
+ dr relationship add api.openapidocument.payment-api \
669
+ application.applicationservice.payment-service --predicate realizes
683
670
 
684
671
  # Link to application layer
685
672
  dr relationship add api.openapidocument.payment-api \
686
- application.service.payment-api --predicate realizes
673
+ application.applicationservice.payment-service --predicate realizes
687
674
 
688
675
  # Link to security layer
689
676
  dr relationship add api.operation.process-payment \
690
- security.secure-resource.payment-api --predicate protected-by
677
+ security.secureresource.payment-records --predicate references
678
+
679
+ dr relationship add api.operation.process-payment \
680
+ security.permission.payments-write --predicate requires
691
681
 
692
682
  # Link to motivation layer
693
683
  dr relationship add api.operation.process-payment \
694
684
  motivation.goal.reduce-checkout-time --predicate supports
695
685
 
696
- # Link to APM layer
697
- dr relationship add api.operation.process-payment \
698
- apm.metric.payment-processing-latency --predicate tracked-by
686
+ # Link from APM layer (APM monitors the operation)
687
+ dr relationship add apm.metricinstrument.payment-processing-latency \
688
+ api.operation.process-payment --predicate monitors
699
689
  ```
700
690
 
701
691
  ### Step 10: Validate and Export
@@ -750,7 +740,7 @@ x-apm-criticality: "low"
750
740
  5. **Document Examples** - Include request/response examples for testing and documentation
751
741
  6. **Security at Operation Level** - Different operations can have different security requirements
752
742
  7. **Link to Business Services** - Use `dr relationship add` to link API operations to business services for traceability
753
- 8. **Define SLA Targets** - Use x-apm-sla-target-\* for monitoring
743
+ 8. **Define SLA Targets** - Use x-apm-sla-target-\* attributes for monitoring
754
744
  9. **Version APIs Properly** - Use semantic versioning (major.minor.patch)
755
745
  10. **Generate from Code** - Use FastAPI, NestJS decorators, or Springdoc to auto-generate OpenAPI specs
756
746
 
@@ -816,20 +806,21 @@ dr add api tag <name>
816
806
  **Relationship Commands:**
817
807
 
818
808
  ```bash
819
- dr relationship add <operation> <schema> --predicate uses-schema
820
- dr relationship add <operation> <parameter> --predicate has-parameter
821
- dr relationship add <operation> <tag> --predicate tagged-with
809
+ dr relationship add <response> <schema> --predicate references
810
+ dr relationship add <operation> <parameter> --predicate aggregates
811
+ dr relationship add <operation> <tag> --predicate references
812
+ dr relationship add <operation> <response> --predicate delivers
822
813
  dr relationship add <schema> <schema> --predicate references
823
814
  ```
824
815
 
825
816
  **Cross-Layer Commands:**
826
817
 
827
818
  ```bash
828
- dr relationship add <api-operation> <business-service> --predicate realizes
819
+ dr relationship add <api-operation> <business-process> --predicate realizes
829
820
  dr relationship add <api-openapidocument> <application-service> --predicate realizes
830
- dr relationship add <api-schema> <data-model-schema> --predicate references
831
- dr relationship add <api-operation> <security-resource> --predicate protected-by
832
- dr relationship add <api-operation> <motivation-goal> --predicate supports
821
+ dr relationship add <data-model-schemadefinition> <api-schema> --predicate maps-to
822
+ dr relationship add <api-operation> <security-permission> --predicate requires
823
+ dr relationship add <api-operation> <motivation-goal> --predicate realizes
833
824
  ```
834
825
 
835
826
  **Export Commands:**
@@ -851,35 +842,30 @@ swagger-cli validate api-spec.yaml
851
842
 
852
843
  ## Custom Extension Reference
853
844
 
854
- Documentation Robotics defines custom OpenAPI extensions for cross-layer traceability:
845
+ Documentation Robotics keeps value-only OpenAPI extensions as element attributes:
855
846
 
856
847
  ```yaml
857
- # Motivation Layer Links
858
- x-supports-goals: [motivation/goal/id1, motivation/goal/id2]
859
- x-fulfills-requirements: [motivation/requirement/id1]
860
- x-governed-by-principles: [motivation/principle/id1]
861
- x-constrained-by: [motivation/constraint/id1]
862
-
863
- # Business and Application Layer Links — use dr relationship add (not x-* properties)
864
- # dr relationship add api.<type>.<name> business.<type>.<name> --predicate realizes
865
- # dr relationship add api.<type>.<name> application.<type>.<name> --predicate realizes
866
-
867
- # Security Layer Links
868
- x-security-resource: security/secure-resource/id
869
- x-required-permissions: [users.read, users.write]
870
848
  x-rate-limit:
871
849
  requests: 100
872
850
  window: 60s
873
-
874
- # APM Layer Links
875
- x-apm-business-metrics: [apm/metric/id1]
876
851
  x-apm-sla-target-latency: "100ms"
877
852
  x-apm-sla-target-availability: "99.9%"
878
853
  x-apm-trace: true
879
854
  x-apm-criticality: "high" # critical, high, medium, low
880
855
  ```
881
856
 
882
- These extensions enable full traceability from API operations to business goals, requirements, security controls, and monitoring metrics.
857
+ Extensions that point at elements in other layers are recorded as catalog relationships instead
858
+ (see [Cross-Layer References](#cross-layer-references)):
859
+
860
+ | Legacy extension | Record as |
861
+ | -------------------------- | ----------------------------------------------------------------------------- |
862
+ | `x-supports-goals` | `api.operation` `realizes` `motivation.goal` |
863
+ | `x-fulfills-requirements` | `api.operation` `satisfies` `motivation.requirement` |
864
+ | `x-constrained-by` | `api.operation` `satisfies` `motivation.constraint` |
865
+ | `x-governed-by-principles` | `api.securityscheme` `satisfies` `motivation.principle` (security principles) |
866
+ | `x-security-resource` | `api.operation` `references` `security.secureresource` |
867
+ | `x-required-permissions` | `api.operation` `requires` `security.permission` |
868
+ | `x-apm-business-metrics` | `apm.metricinstrument` `monitors` `api.operation` |
883
869
 
884
870
  ---
885
871
 
@@ -930,4 +916,4 @@ The API Layer is the **contract layer** - it defines HOW external consumers inte
930
916
  4. Specify SLA targets for monitoring
931
917
  5. Include examples for documentation and testing
932
918
 
933
- Use OpenAPI 3.0.3 as the foundation, leverage auto-generation tools from your framework, and extend with custom properties for full cross-layer integration.
919
+ Use OpenAPI 3.0.3 as the foundation, leverage auto-generation tools from your framework, and record cross-layer links as catalog relationships for full traceability.