@documentation-robotics/cli 0.2.0 → 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 (269) hide show
  1. package/README.md +36 -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/audit/relationships/ai/prompts.js +10 -10
  34. package/dist/audit/relationships/ai/prompts.js.map +2 -2
  35. package/dist/audit/relationships/analysis/layer-templates.js +52 -52
  36. package/dist/audit/relationships/analysis/layer-templates.js.map +1 -1
  37. package/dist/cli.js +12 -2
  38. package/dist/cli.js.map +2 -2
  39. package/dist/coding-agents/default-permissions.js +31 -1
  40. package/dist/coding-agents/default-permissions.js.map +2 -2
  41. package/dist/coding-agents/drbot-mcp.js +167 -0
  42. package/dist/coding-agents/drbot-mcp.js.map +7 -0
  43. package/dist/commands/add.js +3 -2
  44. package/dist/commands/add.js.map +2 -2
  45. package/dist/commands/analyzer.js +117 -14
  46. package/dist/commands/analyzer.js.map +2 -2
  47. package/dist/commands/changeset-verify.js +55 -0
  48. package/dist/commands/changeset-verify.js.map +7 -0
  49. package/dist/commands/changeset.js +43 -22
  50. package/dist/commands/changeset.js.map +2 -2
  51. package/dist/commands/delete.js +10 -4
  52. package/dist/commands/delete.js.map +2 -2
  53. package/dist/commands/farm.js +176 -60
  54. package/dist/commands/farm.js.map +2 -2
  55. package/dist/commands/mcp.js +19 -4
  56. package/dist/commands/mcp.js.map +2 -2
  57. package/dist/commands/relationship.js +207 -26
  58. package/dist/commands/relationship.js.map +2 -2
  59. package/dist/commands/update.js +42 -23
  60. package/dist/commands/update.js.map +2 -2
  61. package/dist/commands/upgrade.js +99 -11
  62. package/dist/commands/upgrade.js.map +3 -3
  63. package/dist/commands/version.js +1 -1
  64. package/dist/commands/visualize.js +4 -3
  65. package/dist/commands/visualize.js.map +2 -2
  66. package/dist/core/catalog-migration.js +33 -0
  67. package/dist/core/catalog-migration.js.map +7 -0
  68. package/dist/core/changeset-analysis.js +421 -0
  69. package/dist/core/changeset-analysis.js.map +7 -0
  70. package/dist/core/changeset-base-index.js +153 -0
  71. package/dist/core/changeset-base-index.js.map +7 -0
  72. package/dist/core/changeset-brief-delta.js +102 -0
  73. package/dist/core/changeset-brief-delta.js.map +7 -0
  74. package/dist/core/changeset-graph.js +281 -0
  75. package/dist/core/changeset-graph.js.map +7 -0
  76. package/dist/core/changeset-only-guard.js +32 -0
  77. package/dist/core/changeset-only-guard.js.map +7 -0
  78. package/dist/core/changeset-summary.js +68 -0
  79. package/dist/core/changeset-summary.js.map +7 -0
  80. package/dist/core/changeset-validator.js +66 -20
  81. package/dist/core/changeset-validator.js.map +2 -2
  82. package/dist/core/changeset-verify.js +518 -0
  83. package/dist/core/changeset-verify.js.map +7 -0
  84. package/dist/core/changeset.js +56 -9
  85. package/dist/core/changeset.js.map +2 -2
  86. package/dist/core/element-type-migration.js +145 -0
  87. package/dist/core/element-type-migration.js.map +7 -0
  88. package/dist/core/farm-manifest.js +12 -6
  89. package/dist/core/farm-manifest.js.map +2 -2
  90. package/dist/core/farm-sync-engine.js +1 -1
  91. package/dist/core/farm-sync-engine.js.map +2 -2
  92. package/dist/core/farm-sync-state.js +10 -2
  93. package/dist/core/farm-sync-state.js.map +2 -2
  94. package/dist/core/migration-registry.js +75 -46
  95. package/dist/core/migration-registry.js.map +2 -2
  96. package/dist/core/model-upgrade.js +102 -0
  97. package/dist/core/model-upgrade.js.map +7 -0
  98. package/dist/core/model.js +82 -30
  99. package/dist/core/model.js.map +2 -2
  100. package/dist/core/mutation-handler.js +71 -6
  101. package/dist/core/mutation-handler.js.map +2 -2
  102. package/dist/core/relationship-migration-table.js +6639 -0
  103. package/dist/core/relationship-migration-table.js.map +7 -0
  104. package/dist/core/relationship-migration.js +272 -0
  105. package/dist/core/relationship-migration.js.map +7 -0
  106. package/dist/core/relationship-prune.js +49 -0
  107. package/dist/core/relationship-prune.js.map +7 -0
  108. package/dist/core/relationship-staging.js +68 -0
  109. package/dist/core/relationship-staging.js.map +7 -0
  110. package/dist/core/relationships.js +26 -4
  111. package/dist/core/relationships.js.map +2 -2
  112. package/dist/core/report-data-model.js +7 -13
  113. package/dist/core/report-data-model.js.map +2 -2
  114. package/dist/core/staged-changeset-storage.js +64 -17
  115. package/dist/core/staged-changeset-storage.js.map +2 -2
  116. package/dist/core/staged-source-reference.js +28 -0
  117. package/dist/core/staged-source-reference.js.map +7 -0
  118. package/dist/core/staging-area.js +83 -18
  119. package/dist/core/staging-area.js.map +2 -2
  120. package/dist/core/virtual-projection.js +13 -5
  121. package/dist/core/virtual-projection.js.map +2 -2
  122. package/dist/export/archimate-exporter.js +1 -0
  123. package/dist/export/archimate-exporter.js.map +2 -2
  124. package/dist/generated/compiled-validators.js +2 -2
  125. package/dist/generated/compiled-validators.js.map +2 -2
  126. package/dist/generated/layer-registry.js +16 -16
  127. package/dist/generated/layer-registry.js.map +2 -2
  128. package/dist/generated/node-types.js +186 -168
  129. package/dist/generated/node-types.js.map +2 -2
  130. package/dist/generated/relationship-index.js +2236 -7790
  131. package/dist/generated/relationship-index.js.map +2 -2
  132. package/dist/integrations/claude_code/agents/dr-architect.md +16 -3
  133. package/dist/integrations/claude_code/agents/dr-extractor.md +1 -1
  134. package/dist/integrations/claude_code/commands/dr-analyzer.md +565 -0
  135. package/dist/integrations/claude_code/commands/dr-map.md +13 -0
  136. package/dist/integrations/claude_code/commands/dr-plan.md +40 -0
  137. package/dist/integrations/claude_code/commands/dr-relate.md +106 -96
  138. package/dist/integrations/claude_code/commands/dr-verify.md +45 -2
  139. package/dist/integrations/claude_code/docs/END_TO_END_WALKTHROUGH.md +14 -0
  140. package/dist/integrations/claude_code/docs/MCP_SERVER.md +26 -2
  141. package/dist/integrations/claude_code/docs/QUICK_START.md +37 -8
  142. package/dist/integrations/claude_code/docs/README.md +48 -1
  143. package/dist/integrations/claude_code/skills/dr_01_motivation_layer/SKILL.md +93 -72
  144. package/dist/integrations/claude_code/skills/dr_02_business_layer/SKILL.md +163 -126
  145. package/dist/integrations/claude_code/skills/dr_03_product_layer/SKILL.md +161 -126
  146. package/dist/integrations/claude_code/skills/dr_04_security_layer/SKILL.md +153 -133
  147. package/dist/integrations/claude_code/skills/dr_05_application_layer/SKILL.md +129 -100
  148. package/dist/integrations/claude_code/skills/dr_06_technology_layer/SKILL.md +111 -94
  149. package/dist/integrations/claude_code/skills/dr_07_api_layer/SKILL.md +143 -157
  150. package/dist/integrations/claude_code/skills/dr_08_data_model_layer/SKILL.md +117 -33
  151. package/dist/integrations/claude_code/skills/dr_09_dataset_layer/SKILL.md +74 -25
  152. package/dist/integrations/claude_code/skills/dr_10_ux_layer/SKILL.md +88 -12
  153. package/dist/integrations/claude_code/skills/dr_11_navigation_layer/SKILL.md +83 -24
  154. package/dist/integrations/claude_code/skills/dr_12_apm_layer/SKILL.md +57 -12
  155. package/dist/integrations/claude_code/skills/dr_13_testing_layer/SKILL.md +92 -15
  156. package/dist/integrations/claude_code/skills/dr_change_planning/SKILL.md +119 -0
  157. package/dist/integrations/claude_code/skills/dr_changeset_reviewer/SKILL.md +3 -0
  158. package/dist/integrations/claude_code/skills/dr_engineering_guide/SKILL.md +1 -1
  159. package/dist/integrations/github_copilot/agents/dr-architect.md +1 -1
  160. package/dist/integrations/github_copilot/skills/dr_01_motivation_layer/SKILL.md +182 -102
  161. package/dist/integrations/github_copilot/skills/dr_02_business_layer/SKILL.md +266 -148
  162. package/dist/integrations/github_copilot/skills/dr_03_product_layer/SKILL.md +547 -86
  163. package/dist/integrations/github_copilot/skills/dr_04_security_layer/SKILL.md +164 -169
  164. package/dist/integrations/github_copilot/skills/dr_05_application_layer/SKILL.md +420 -150
  165. package/dist/integrations/github_copilot/skills/dr_06_technology_layer/SKILL.md +331 -138
  166. package/dist/integrations/github_copilot/skills/dr_07_api_layer/SKILL.md +265 -201
  167. package/dist/integrations/github_copilot/skills/dr_08_data_model_layer/SKILL.md +181 -58
  168. package/dist/integrations/github_copilot/skills/dr_09_dataset_layer/SKILL.md +209 -57
  169. package/dist/integrations/github_copilot/skills/dr_10_ux_layer/SKILL.md +277 -112
  170. package/dist/integrations/github_copilot/skills/dr_11_navigation_layer/SKILL.md +219 -70
  171. package/dist/integrations/github_copilot/skills/dr_12_apm_layer/SKILL.md +189 -105
  172. package/dist/integrations/github_copilot/skills/dr_13_testing_layer/SKILL.md +222 -102
  173. package/dist/integrations/github_copilot/skills/dr_change_planning/SKILL.md +119 -0
  174. package/dist/integrations/github_copilot/skills/dr_changeset_reviewer/SKILL.md +3 -0
  175. package/dist/integrations/hash-utils.js.map +2 -2
  176. package/dist/mcp/api-key-manager.js +14 -1
  177. package/dist/mcp/api-key-manager.js.map +2 -2
  178. package/dist/mcp/changeset-only.js +34 -0
  179. package/dist/mcp/changeset-only.js.map +7 -0
  180. package/dist/mcp/tool-registry.js +19 -3
  181. package/dist/mcp/tool-registry.js.map +2 -2
  182. package/dist/mcp/tools/changeset-analysis-tools.js +78 -0
  183. package/dist/mcp/tools/changeset-analysis-tools.js.map +7 -0
  184. package/dist/mcp/tools/changeset-editing.js +184 -0
  185. package/dist/mcp/tools/changeset-editing.js.map +7 -0
  186. package/dist/mcp/tools/changeset-lifecycle.js +83 -0
  187. package/dist/mcp/tools/changeset-lifecycle.js.map +7 -0
  188. package/dist/mcp/tools/changeset-shared.js +31 -0
  189. package/dist/mcp/tools/changeset-shared.js.map +7 -0
  190. package/dist/mcp/tools/changeset-show.js +17 -1
  191. package/dist/mcp/tools/changeset-show.js.map +2 -2
  192. package/dist/mcp/tools/changeset-verify.js +43 -0
  193. package/dist/mcp/tools/changeset-verify.js.map +7 -0
  194. package/dist/mcp/tools/index.js +19 -1
  195. package/dist/mcp/tools/index.js.map +2 -2
  196. package/dist/mcp/tools/model-add.js +6 -5
  197. package/dist/mcp/tools/model-add.js.map +2 -2
  198. package/dist/mcp/tools/model-delete.js +2 -2
  199. package/dist/mcp/tools/model-delete.js.map +2 -2
  200. package/dist/mcp/tools/model-search.js +14 -0
  201. package/dist/mcp/tools/model-search.js.map +2 -2
  202. package/dist/mcp/tools/model-show.js +29 -2
  203. package/dist/mcp/tools/model-show.js.map +2 -2
  204. package/dist/mcp/tools/model-trace.js +93 -30
  205. package/dist/mcp/tools/model-trace.js.map +2 -2
  206. package/dist/mcp/tools/model-update.js +35 -19
  207. package/dist/mcp/tools/model-update.js.map +2 -2
  208. package/dist/mcp/tools/relationship-tools.js +98 -0
  209. package/dist/mcp/tools/relationship-tools.js.map +7 -0
  210. package/dist/mcp/tools/shared.js +25 -2
  211. package/dist/mcp/tools/shared.js.map +2 -2
  212. package/dist/mcp/tools/spec-type.js +90 -0
  213. package/dist/mcp/tools/spec-type.js.map +7 -0
  214. package/dist/schemas/bundled/analyzers/cbm.json +1186 -68
  215. package/dist/schemas/bundled/analyzers/manifest.json +2 -2
  216. package/dist/schemas/bundled/api.json +1029 -1658
  217. package/dist/schemas/bundled/apm.json +499 -734
  218. package/dist/schemas/bundled/application.json +735 -371
  219. package/dist/schemas/bundled/base.json +3 -220
  220. package/dist/schemas/bundled/business.json +452 -366
  221. package/dist/schemas/bundled/data-model.json +395 -411
  222. package/dist/schemas/bundled/data-store.json +334 -558
  223. package/dist/schemas/bundled/manifest.json +18 -18
  224. package/dist/schemas/bundled/motivation.json +349 -368
  225. package/dist/schemas/bundled/navigation.json +415 -731
  226. package/dist/schemas/bundled/product.json +325 -159
  227. package/dist/schemas/bundled/security.json +864 -1232
  228. package/dist/schemas/bundled/technology.json +574 -703
  229. package/dist/schemas/bundled/testing.json +718 -1643
  230. package/dist/schemas/bundled/ux.json +739 -1352
  231. package/dist/server/schemas.js +8 -0
  232. package/dist/server/schemas.js.map +2 -2
  233. package/dist/server/server.js +218 -34
  234. package/dist/server/server.js.map +2 -2
  235. package/dist/server-entry.js +2 -1
  236. package/dist/server-entry.js.map +2 -2
  237. package/dist/telemetry/index.js +1 -1
  238. package/dist/utils/ansi-suppressor.js +6 -8
  239. package/dist/utils/ansi-suppressor.js.map +2 -2
  240. package/dist/utils/attribute-patch.js +41 -0
  241. package/dist/utils/attribute-patch.js.map +7 -0
  242. package/dist/utils/error-hints.js +29 -0
  243. package/dist/utils/error-hints.js.map +7 -0
  244. package/dist/utils/errors.js +9 -3
  245. package/dist/utils/errors.js.map +2 -2
  246. package/dist/utils/project-paths.js +26 -1
  247. package/dist/utils/project-paths.js.map +2 -2
  248. package/dist/utils/source-reference.js +14 -12
  249. package/dist/utils/source-reference.js.map +2 -2
  250. package/dist/utils/spec-version.js +2 -2
  251. package/dist/utils/spec-version.js.map +1 -1
  252. package/dist/validators/composed-reference-validator.js +5 -27
  253. package/dist/validators/composed-reference-validator.js.map +2 -2
  254. package/dist/validators/reference-validator.js +0 -7
  255. package/dist/validators/reference-validator.js.map +2 -2
  256. package/dist/validators/relationship-schema-validator.js +3 -3
  257. package/dist/validators/relationship-schema-validator.js.map +2 -2
  258. package/dist/validators/schema-validator.js +27 -9
  259. package/dist/validators/schema-validator.js.map +2 -2
  260. package/dist/validators/types.js.map +1 -1
  261. package/dist/viewer/README.md +6 -6
  262. package/dist/viewer/assets/main-CxzcuU_o.js +84 -0
  263. package/dist/viewer/assets/main-j-7ULYpm.css +1 -0
  264. package/dist/viewer/index.html +2 -2
  265. package/dist/viewer/manifest.json +10 -10
  266. package/dist/viewer/version.json +1 -1
  267. package/package.json +2 -1
  268. package/dist/viewer/assets/main-B7AOQXXX.js +0 -81
  269. package/dist/viewer/assets/main-vdrFrG7q.css +0 -1
@@ -11,13 +11,13 @@ triggers:
11
11
  "redirect",
12
12
  "navigation flow"
13
13
  ]
14
- version: 0.8.1
14
+ version: 0.8.3
15
15
  ---
16
16
 
17
17
  # Navigation Layer Skill
18
18
 
19
19
  **Layer Number:** 10
20
- **Specification:** Metadata Model Spec v0.8.1
20
+ **Specification:** Metadata Model Spec v0.8.3
21
21
  **Purpose:** Defines multi-modal navigation flows, routes, guards, and transitions between views.
22
22
 
23
23
  ---
@@ -26,13 +26,17 @@ version: 0.8.1
26
26
 
27
27
  The Navigation Layer captures **navigation and routing**:
28
28
 
29
- - **ROUTES** - URL paths to views
30
- - **GUARDS** - Authorization checks before navigation
31
- - **FLOWS** - Multi-step navigation flows
32
- - **TRANSITIONS** - Navigation between routes
33
- - **REDIRECTS** - Conditional redirects
34
- - **CONTEXT** - Navigation context variables
35
- - **TRACKING** - Analytics and process tracking
29
+ - **GRAPH** - Top-level container for the entire navigation model (`navigationgraph`)
30
+ - **ROUTES** - URL paths to views; types include `public`, `protected`, `redirect`, `alias`, `lazy` (`route`)
31
+ - **ROUTE METADATA** - Auth requirements, layout, keepAlive metadata per route (`routemeta`)
32
+ - **BREADCRUMBS** - Breadcrumb trail configuration per route (`breadcrumbconfig`)
33
+ - **GUARDS** - Pre-navigation authorization/validation checks (`navigationguard`)
34
+ - **GUARD CONDITIONS** - Boolean expressions evaluated by guards (`guardcondition`)
35
+ - **GUARD ACTIONS** - Actions on guard failure: redirect, block, notify, prompt (`guardaction`)
36
+ - **FLOWS** - Multi-step navigation sequences (`navigationflow`)
37
+ - **FLOW STEPS** - Individual steps within a flow (`flowstep`)
38
+ - **TRANSITIONS** - Directed transitions between routes with triggers (`navigationtransition`)
39
+ - **CONTEXT** - Navigation-scoped context variables (`contextvariable`)
36
40
 
37
41
  This layer uses **Multi-Modal Navigation** supporting web, mobile, voice, and other modalities.
38
42
 
@@ -45,20 +49,62 @@ This layer uses **Multi-Modal Navigation** supporting web, mobile, voice, and ot
45
49
  > **CLI Introspection:** Run `dr schema types navigation` for the authoritative, always-current list of node types.
46
50
  > Run `dr schema node <type-id>` for full attribute details on any type.
47
51
 
48
- ### Core Navigation Entities (10 entities)
49
-
50
- | Entity Type | Description |
51
- | ------------------------ | ------------------------------------------ |
52
- | **Route** | URL path mapped to view |
53
- | **NavigationGuard** | Authorization/validation before navigation |
54
- | **NavigationFlow** | Multi-step navigation sequence |
55
- | **NavigationTransition** | Transition between routes |
56
- | **FlowStep** | Step in navigation flow |
57
- | **ContextVariable** | Navigation context data |
58
- | **DataMapping** | Data passing between routes |
59
- | **NotificationAction** | Navigation-triggered notifications |
60
- | **ProcessTracking** | Business process tracking |
61
- | **FlowAnalytics** | Navigation analytics |
52
+ ### Core Navigation Entities (11 entities)
53
+
54
+ | Entity Type | Description |
55
+ | ------------------------ | ----------------------------------------------------------------- |
56
+ | **NavigationGraph** | Top-level container representing the complete navigation model |
57
+ | **Route** | URL path mapped to a view; the core modeling unit |
58
+ | **RouteMeta** | Auth, layout, and lifecycle metadata attached to a route |
59
+ | **NavigationGuard** | Authorization/validation check executed before navigation |
60
+ | **GuardCondition** | Boolean expression evaluated by a navigation guard |
61
+ | **GuardAction** | Action taken when a guard fails (redirect, block, notify, prompt) |
62
+ | **NavigationFlow** | Multi-step navigation sequence |
63
+ | **FlowStep** | A single step within a navigation flow |
64
+ | **NavigationTransition** | Directed transition between two routes |
65
+ | **ContextVariable** | Navigation-scoped context data passed between routes |
66
+ | **BreadcrumbConfig** | Breadcrumb trail configuration for a route |
67
+
68
+ ---
69
+
70
+ ## Type Decision Tree
71
+
72
+ Use this decision tree **before assigning a type** to any navigation element.
73
+
74
+ ```
75
+ Is this the top-level navigation model for an application?
76
+ → navigation.navigationgraph.*
77
+
78
+ Is this a URL path/route that maps to a view?
79
+ → navigation.route.*
80
+
81
+ Is this metadata about a route (auth requirements, layout, keepAlive)?
82
+ → navigation.routemeta.*
83
+
84
+ Is this a breadcrumb configuration for a route?
85
+ → navigation.breadcrumbconfig.*
86
+
87
+ Is this a guard that checks conditions before allowing navigation?
88
+ → navigation.navigationguard.*
89
+
90
+ Is this a boolean expression/predicate evaluated inside a guard?
91
+ → navigation.guardcondition.*
92
+
93
+ Is this the action to take when a guard fails (redirect, block, notify, prompt)?
94
+ → navigation.guardaction.*
95
+
96
+ Is this a named multi-step navigation sequence (wizard, checkout, onboarding)?
97
+ → navigation.navigationflow.*
98
+
99
+ Is this a single step within a navigation flow?
100
+ → navigation.flowstep.*
101
+
102
+ Is this a directed transition between two specific routes with a trigger?
103
+ → navigation.navigationtransition.*
104
+
105
+ Is this a context variable scoped to the navigation session?
106
+ → navigation.contextvariable.*
107
+ ```
62
108
 
63
109
  ---
64
110
 
@@ -74,19 +120,75 @@ Activate when the user:
74
120
 
75
121
  ---
76
122
 
77
- ## Cross-Layer Relationships
78
-
79
- **Outgoing (Navigation → Other Layers):**
80
-
81
- - `view-ref` → UX Layer (which view does this route show?)
82
- - `business.realizes-process` → Business Layer (what process does this flow realize?)
83
- - `security.required-roles` → Security Layer (authorization requirements)
84
- - `apm.flow-metrics` → APM Layer (navigation analytics)
123
+ ## Intra-Layer Relationships
124
+
125
+ A guard `evaluates` its condition, `triggers` its action on denial and `protects` what it guards. A
126
+ transition leaves its source route (`flows-to`) and `navigates-to` its destination. Context variables
127
+ are passive state that steps, guards, conditions, actions and transitions `accesses`. Navigation
128
+ never reaches the data store directly, and reaches the business through the product workflows that
129
+ flows and steps realize.
130
+
131
+ | Source Type | Predicate | Target Type | Example |
132
+ | -------------------- | ------------ | -------------------- | ------------------------------------------------------------- |
133
+ | NavigationGraph | composes | Route | "Web App Navigation" composes "User Profile Route" |
134
+ | NavigationGraph | composes | NavigationTransition | "Web App Navigation" composes "Cart To Shipping" |
135
+ | NavigationGraph | aggregates | NavigationFlow | "Web App Navigation" aggregates "Checkout Flow" |
136
+ | NavigationGraph | aggregates | NavigationGuard | "Web App Navigation" aggregates "Auth Guard" |
137
+ | NavigationGraph | aggregates | BreadcrumbConfig | "Web App Navigation" aggregates "Profile Breadcrumb" |
138
+ | Route | composes | RouteMeta | "User Profile Route" composes "Profile Route Meta" |
139
+ | Route | aggregates | Route | "Settings Route" aggregates "Settings Security Route" |
140
+ | Route | navigates-to | Route | "Legacy Account Route" navigates-to "Account Settings Route" |
141
+ | Route | flows-to | NavigationTransition | "Cart Route" flows-to "Cart To Shipping" (its source route) |
142
+ | BreadcrumbConfig | references | RouteMeta | "Profile Breadcrumb" references "Profile Route Meta" (labels) |
143
+ | BreadcrumbConfig | references | Route | "Profile Breadcrumb" references "Dashboard Route" |
144
+ | NavigationGuard | protects | Route | "Auth Guard" protects "User Profile Route" |
145
+ | NavigationGuard | evaluates | GuardCondition | "Auth Guard" evaluates "Is Authenticated" |
146
+ | NavigationGuard | triggers | GuardAction | "Auth Guard" triggers "Redirect To Login" |
147
+ | GuardCondition | accesses | ContextVariable | "Is Authenticated" accesses "Session Token" |
148
+ | GuardAction | navigates-to | Route | "Redirect To Login" navigates-to "Login Route" |
149
+ | NavigationFlow | composes | FlowStep | "Checkout Flow" composes "Cart Review Step" |
150
+ | NavigationFlow | aggregates | ContextVariable | "Checkout Flow" aggregates "Cart ID" |
151
+ | NavigationGuard | protects | NavigationFlow | "Cart Not Empty Guard" protects "Checkout Flow" |
152
+ | FlowStep | navigates-to | Route | "Cart Review Step" navigates-to "Cart Route" |
153
+ | FlowStep | accesses | ContextVariable | "Payment Step" accesses "Cart ID" |
154
+ | NavigationTransition | navigates-to | Route | "Cart To Shipping" navigates-to "Shipping Route" |
155
+ | NavigationGuard | protects | NavigationTransition | "Valid Address Guard" protects "Shipping To Payment" |
85
156
 
86
- **Incoming (Other Layers → Navigation):**
157
+ ---
87
158
 
88
- - UX Layer → Navigation (views reference routes)
89
- - Business Layer → Navigation (processes trigger flows)
159
+ ## Cross-Layer References
160
+
161
+ ### Outgoing References (Navigation → Other Layers)
162
+
163
+ | Source Type | Predicate | Target Type | Example |
164
+ | -------------------- | ---------- | ---------------------------------- | ---------------------------------------------------------------- |
165
+ | Route | maps-to | `ux.view` | "User Profile Route" maps-to "User Profile View" |
166
+ | RouteMeta | uses | `ux.layoutconfig` | "Profile Route Meta" uses "Authenticated Shell Layout" |
167
+ | NavigationTransition | triggers | `ux.statetransition` | "Cart To Shipping" triggers "Cart Submitted Transition" |
168
+ | Route | requires | `security.permission` | "Admin Users Route" requires "users:read" |
169
+ | NavigationGuard | requires | `security.role` | "Auth Guard" requires "Authenticated User" |
170
+ | NavigationGuard | realizes | `security.securitypolicy` | "Admin Guard" realizes "Admin Access Policy" |
171
+ | ContextVariable | maps-to | `api.parameter` | "User ID" maps-to "userId path parameter" |
172
+ | Route | lazy-loads | `application.applicationcomponent` | "Reports Route" lazy-loads "Reports Module" |
173
+ | Route | uses | `application.applicationservice` | "Order Detail Route" uses "Order Service" (resolver) |
174
+ | NavigationFlow | realizes | `product.userworkflow` | "Onboarding Flow" realizes "New User Onboarding" |
175
+ | FlowStep | realizes | `product.workflowstep` | "Payment Step" realizes "Enter Payment Details" |
176
+ | Route | satisfies | `motivation.requirement` | "Order History Route" satisfies "Customers Can View Past Orders" |
177
+
178
+ ### Incoming References (Other Layers → Navigation)
179
+
180
+ | Source Type | Predicate | Target Type | Example |
181
+ | ---------------------------- | --------- | -------------------- | ------------------------------------------------------------------- |
182
+ | `api.operation` | serves | Route | "GET /users/{id}" serves "User Profile Route" (its loader calls it) |
183
+ | `api.operation` | serves | NavigationGuard | "GET /auth/session" serves "Auth Guard" |
184
+ | `apm.span` | monitors | Route | "Route Change Span" monitors "User Profile Route" |
185
+ | `apm.span` | monitors | NavigationFlow | "Checkout Journey Span" monitors "Checkout Flow" |
186
+ | `apm.metricinstrument` | monitors | Route | "route_load_time" monitors "User Profile Route" |
187
+ | `apm.metricinstrument` | monitors | NavigationTransition | "checkout_step_dropoff" monitors "Shipping To Payment" |
188
+ | `testing.testcasesketch` | tests | Route | "Deep Link To Profile" tests "User Profile Route" |
189
+ | `testing.testcasesketch` | tests | NavigationGuard | "Anonymous User Redirected" tests "Auth Guard" |
190
+ | `testing.testcasesketch` | tests | NavigationFlow | "Complete Checkout" tests "Checkout Flow" |
191
+ | `testing.testcoveragetarget` | covers | Route | "User Profile" target covers "User Profile Route" |
90
192
 
91
193
  ---
92
194
 
@@ -105,23 +207,48 @@ Activate when the user:
105
207
  ## Common Commands
106
208
 
107
209
  ```bash
108
- # Add route
109
- dr add navigation route --name "User Profile Route" --property path=/profile/:id
210
+ # Add navigation graph (one per application)
211
+ dr add navigation navigationgraph "My App Navigation"
212
+
213
+ # Add route (types: public | protected | redirect | alias | lazy)
214
+ dr add navigation route "User Profile Route" --description "User profile page route"
215
+
216
+ # Add route metadata
217
+ dr add navigation routemeta "Profile Route Meta"
218
+
219
+ # Add breadcrumb configuration
220
+ dr add navigation breadcrumbconfig "Profile Breadcrumb"
110
221
 
111
222
  # Add navigation guard
112
- dr add navigation navigation-guard --name "Auth Guard"
223
+ dr add navigation navigationguard "Auth Guard"
224
+
225
+ # Add guard condition
226
+ dr add navigation guardcondition "Is Authenticated"
227
+
228
+ # Add guard action (on failure)
229
+ dr add navigation guardaction "Redirect To Login"
113
230
 
114
231
  # Add navigation flow
115
- dr add navigation navigation-flow --name "Checkout Flow"
232
+ dr add navigation navigationflow "Checkout Flow"
233
+
234
+ # Add flow step
235
+ dr add navigation flowstep "Cart Review Step"
116
236
 
117
- # List routes
118
- dr list navigation route
237
+ # Add transition between routes
238
+ dr add navigation navigationtransition "Cart To Shipping"
239
+
240
+ # Add context variable
241
+ dr add navigation contextvariable "Cart ID"
242
+
243
+ # List by type
244
+ dr list navigation --type route
245
+ dr list navigation --type navigationguard
119
246
 
120
247
  # Validate navigation layer
121
- dr validate --layer navigation
248
+ dr validate --layers navigation
122
249
 
123
250
  # Export navigation map
124
- dr export --layer navigation --format mermaid
251
+ dr export plantuml --layers navigation
125
252
  ```
126
253
 
127
254
  ---
@@ -134,10 +261,9 @@ name: "User Profile Route"
134
261
  type: route
135
262
  properties:
136
263
  path: /profile/:userId
137
- view-ref: ux.view.user-profile
138
264
  guards:
139
- - navigation.guard.authentication
140
- - navigation.guard.profile-ownership
265
+ - navigation.navigationguard.authentication
266
+ - navigation.navigationguard.profile-ownership
141
267
  parameters:
142
268
  - name: userId
143
269
  type: string
@@ -155,15 +281,15 @@ properties:
155
281
  dataMapping:
156
282
  - source: route.params.userId
157
283
  target: view.data.userId
158
- security:
159
- required-roles:
160
- - security.role.authenticated-user
161
- business:
162
- realizes-process: business.process.profile-management
163
- apm:
164
- flow-metrics:
165
- - apm.metric.profile-view-count
166
- - apm.metric.profile-load-time
284
+ ```
285
+
286
+ Record the cross-layer links as relationships, not as properties:
287
+
288
+ ```bash
289
+ dr relationship add navigation.route.user-profile ux.view.user-profile --predicate maps-to
290
+ dr relationship add navigation.navigationguard.authentication security.role.authenticated-user --predicate requires
291
+ dr relationship add api.operation.get-user navigation.route.user-profile --predicate serves
292
+ dr relationship add apm.metricinstrument.profile-load-time navigation.route.user-profile --predicate monitors
167
293
  ```
168
294
 
169
295
  ---
@@ -171,9 +297,9 @@ properties:
171
297
  ## Example: Multi-Step Checkout Flow
172
298
 
173
299
  ```yaml
174
- id: navigation.flow.checkout
300
+ id: navigation.navigationflow.checkout
175
301
  name: "Checkout Flow"
176
- type: navigation-flow
302
+ type: navigationflow
177
303
  properties:
178
304
  steps:
179
305
  - id: cart-review
@@ -196,33 +322,56 @@ properties:
196
322
  - from: cart-review
197
323
  to: shipping-address
198
324
  trigger: next-button
199
- guard: cart-not-empty
325
+ guard: navigation.navigationguard.cart-not-empty
200
326
  - from: shipping-address
201
327
  to: payment
202
328
  trigger: next-button
203
- guard: valid-address
329
+ guard: navigation.navigationguard.valid-address
204
330
  - from: payment
205
331
  to: confirmation
206
332
  trigger: submit
207
- guard: payment-successful
333
+ guard: navigation.navigationguard.payment-successful
208
334
  context:
209
335
  - cartId
210
336
  - selectedAddress
211
337
  - paymentMethod
212
- analytics:
213
- trackStepCompletion: true
214
- trackAbandonmentRate: true
215
- business:
216
- realizes-process: business.process.checkout
217
338
  ```
218
339
 
340
+ ```bash
341
+ dr relationship add navigation.navigationflow.checkout product.userworkflow.checkout --predicate realizes
342
+ dr relationship add navigation.navigationflow.checkout navigation.flowstep.cart-review --predicate composes
343
+ dr relationship add navigation.flowstep.cart-review navigation.route.cart --predicate navigates-to
344
+ ```
345
+
346
+ ---
347
+
348
+ ## Coverage Completeness Checklist
349
+
350
+ Before declaring navigation layer extraction complete, verify each type was considered:
351
+
352
+ - [ ] `navigation.navigationgraph.*` — Top-level navigation model container
353
+ - [ ] `navigation.route.*` — URL path to view mappings (core unit)
354
+ - [ ] `navigation.routemeta.*` — Auth, layout, keepAlive metadata per route
355
+ - [ ] `navigation.breadcrumbconfig.*` — Breadcrumb trail configuration
356
+ - [ ] `navigation.navigationguard.*` — Pre-navigation authorization/validation checks
357
+ - [ ] `navigation.guardcondition.*` — Boolean expressions evaluated by guards
358
+ - [ ] `navigation.guardaction.*` — Actions taken on guard failure
359
+ - [ ] `navigation.navigationflow.*` — Multi-step navigation sequences
360
+ - [ ] `navigation.flowstep.*` — Individual steps within flows
361
+ - [ ] `navigation.navigationtransition.*` — Directed transitions between routes
362
+ - [ ] `navigation.contextvariable.*` — Navigation-scoped context data
363
+
364
+ If any type has ZERO elements, explicitly decide:
365
+ "This type doesn't apply to this codebase" with reasoning.
366
+
219
367
  ---
220
368
 
221
369
  ## Pitfalls to Avoid
222
370
 
223
- - ❌ Missing authentication guards on protected routes
224
- - ❌ Not validating route parameters
225
- - ❌ Complex flows without clear step definitions
226
- - ❌ Not tracking navigation analytics
227
- - ❌ Missing cross-layer links to UX views
228
- - ❌ No error/fallback routes defined
371
+ - ❌ Missing authentication guards on protected routes — use `navigationguard` + `guardcondition` + `guardaction` together
372
+ - ❌ Using `navigation.guard.*` or `navigation.flow.*` as element IDs — correct types are `navigationguard` and `navigationflow`
373
+ - ❌ Not decomposing guards into conditions (`guardcondition`) and actions (`guardaction`) — model these as separate elements
374
+ - ❌ Complex flows without explicit `flowstep` elements — each step in a flow should be a distinct `flowstep`
375
+ - ❌ Missing `routemeta` for protected routes — auth requirements belong in `routemeta`, not embedded in route properties
376
+ - ❌ Missing cross-layer links — each route should `maps-to` a `ux.view`, and flows should `realizes` a `business.businessprocess` or `product.userworkflow`
377
+ - ❌ No error/fallback routes defined — model these as `route` with `type: redirect`