@documentation-robotics/cli 0.1.0 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +466 -693
- package/dist/analysis/data-model-analyzer.js +189 -0
- package/dist/analysis/data-model-analyzer.js.map +7 -0
- package/dist/analysis/index.js +3 -0
- package/dist/analysis/index.js.map +7 -0
- package/dist/analysis/relationship-classifier.js +181 -0
- package/dist/analysis/relationship-classifier.js.map +7 -0
- package/dist/analyzers/base-analyzer.js +1 -0
- package/dist/analyzers/base-analyzer.js.map +7 -0
- package/dist/analyzers/call-graph-utils.js +39 -0
- package/dist/analyzers/call-graph-utils.js.map +7 -0
- package/dist/analyzers/cbm-analyzer.js +1205 -0
- package/dist/analyzers/cbm-analyzer.js.map +7 -0
- package/dist/analyzers/heuristic-utils.js +55 -0
- package/dist/analyzers/heuristic-utils.js.map +7 -0
- package/dist/analyzers/mapping-loader.js +146 -0
- package/dist/analyzers/mapping-loader.js.map +7 -0
- package/dist/analyzers/registry.js +124 -0
- package/dist/analyzers/registry.js.map +7 -0
- package/dist/analyzers/session-state.js +176 -0
- package/dist/analyzers/session-state.js.map +7 -0
- package/dist/analyzers/stdio-client.js +208 -0
- package/dist/analyzers/stdio-client.js.map +7 -0
- package/dist/analyzers/types.js +15 -0
- package/dist/analyzers/types.js.map +7 -0
- package/dist/analyzers/verify-engine.js +209 -0
- package/dist/analyzers/verify-engine.js.map +7 -0
- package/dist/analyzers/verify-ignore.js +130 -0
- package/dist/analyzers/verify-ignore.js.map +7 -0
- package/dist/analyzers/version.js +8 -0
- package/dist/analyzers/version.js.map +7 -0
- package/dist/audit/ai/runner.js +41 -0
- package/dist/audit/ai/runner.js.map +7 -0
- package/dist/audit/differential-analyzer.js +183 -0
- package/dist/audit/differential-analyzer.js.map +7 -0
- package/dist/audit/index.js +32 -0
- package/dist/audit/index.js.map +7 -0
- package/dist/audit/nodes/ai/evaluator.js +49 -0
- package/dist/audit/nodes/ai/evaluator.js.map +7 -0
- package/dist/audit/nodes/ai/parser.js +55 -0
- package/dist/audit/nodes/ai/parser.js.map +7 -0
- package/dist/audit/nodes/ai/prompts.js +103 -0
- package/dist/audit/nodes/ai/prompts.js.map +7 -0
- package/dist/audit/nodes/analysis/node-completeness-checker.js +32 -0
- package/dist/audit/nodes/analysis/node-completeness-checker.js.map +7 -0
- package/dist/audit/nodes/analysis/node-definition-analyzer.js +47 -0
- package/dist/audit/nodes/analysis/node-definition-analyzer.js.map +7 -0
- package/dist/audit/nodes/analysis/node-overlap-detector.js +79 -0
- package/dist/audit/nodes/analysis/node-overlap-detector.js.map +7 -0
- package/dist/audit/nodes/model/orchestrator.js +82 -0
- package/dist/audit/nodes/model/orchestrator.js.map +7 -0
- package/dist/audit/nodes/spec/loader.js +116 -0
- package/dist/audit/nodes/spec/loader.js.map +7 -0
- package/dist/audit/nodes/spec/orchestrator.js +68 -0
- package/dist/audit/nodes/spec/orchestrator.js.map +7 -0
- package/dist/audit/nodes/types.js +1 -0
- package/dist/audit/nodes/types.js.map +7 -0
- package/dist/audit/pipeline/index.js +5 -0
- package/dist/audit/pipeline/index.js.map +7 -0
- package/dist/audit/pipeline/pipeline-orchestrator.js +218 -0
- package/dist/audit/pipeline/pipeline-orchestrator.js.map +7 -0
- package/dist/audit/relationships/ai/evaluator.js +235 -0
- package/dist/audit/relationships/ai/evaluator.js.map +7 -0
- package/dist/audit/relationships/ai/parser.js +197 -0
- package/dist/audit/relationships/ai/parser.js.map +7 -0
- package/dist/audit/relationships/ai/prompts.js +274 -0
- package/dist/audit/relationships/ai/prompts.js.map +7 -0
- package/dist/audit/relationships/analysis/balance-assessor.js +115 -0
- package/dist/audit/relationships/analysis/balance-assessor.js.map +7 -0
- package/dist/audit/relationships/analysis/coverage-analyzer.js +99 -0
- package/dist/audit/relationships/analysis/coverage-analyzer.js.map +7 -0
- package/dist/audit/relationships/analysis/duplicate-detector.js +95 -0
- package/dist/audit/relationships/analysis/duplicate-detector.js.map +7 -0
- package/dist/audit/relationships/analysis/gap-analyzer.js +99 -0
- package/dist/audit/relationships/analysis/gap-analyzer.js.map +7 -0
- package/dist/audit/relationships/analysis/layer-templates.js +294 -0
- package/dist/audit/relationships/analysis/layer-templates.js.map +7 -0
- package/dist/audit/relationships/graph/connectivity.js +129 -0
- package/dist/audit/relationships/graph/connectivity.js.map +7 -0
- package/dist/audit/relationships/graph/relationship-graph.js +179 -0
- package/dist/audit/relationships/graph/relationship-graph.js.map +7 -0
- package/dist/audit/relationships/model/balance-assessor.js +49 -0
- package/dist/audit/relationships/model/balance-assessor.js.map +7 -0
- package/dist/audit/relationships/model/coverage-analyzer.js +34 -0
- package/dist/audit/relationships/model/coverage-analyzer.js.map +7 -0
- package/dist/audit/relationships/model/duplicate-detector.js +68 -0
- package/dist/audit/relationships/model/duplicate-detector.js.map +7 -0
- package/dist/audit/relationships/model/gap-analyzer.js +41 -0
- package/dist/audit/relationships/model/gap-analyzer.js.map +7 -0
- package/dist/audit/relationships/model/orchestrator.js +126 -0
- package/dist/audit/relationships/model/orchestrator.js.map +7 -0
- package/dist/audit/relationships/spec/orchestrator.js +157 -0
- package/dist/audit/relationships/spec/orchestrator.js.map +7 -0
- package/dist/audit/reports/index.js +5 -0
- package/dist/audit/reports/index.js.map +7 -0
- package/dist/audit/reports/report-generator.js +118 -0
- package/dist/audit/reports/report-generator.js.map +7 -0
- package/dist/audit/snapshot-storage.js +163 -0
- package/dist/audit/snapshot-storage.js.map +7 -0
- package/dist/audit/types.js +21 -0
- package/dist/audit/types.js.map +7 -0
- package/dist/cli.js +223 -92
- package/dist/cli.js.map +3 -3
- package/dist/coding-agents/agents/claude-code.js +147 -0
- package/dist/coding-agents/agents/claude-code.js.map +7 -0
- package/dist/coding-agents/agents/index.js +5 -0
- package/dist/coding-agents/agents/index.js.map +7 -0
- package/dist/coding-agents/agents/types.js +1 -0
- package/dist/coding-agents/agents/types.js.map +7 -0
- package/dist/coding-agents/base-chat-client.js +45 -0
- package/dist/coding-agents/base-chat-client.js.map +7 -0
- package/dist/coding-agents/chat-utils.js +23 -0
- package/dist/coding-agents/chat-utils.js.map +7 -0
- package/dist/coding-agents/claude-code-client.js +246 -0
- package/dist/coding-agents/claude-code-client.js.map +7 -0
- package/dist/coding-agents/copilot-client.js +209 -0
- package/dist/coding-agents/copilot-client.js.map +7 -0
- package/dist/commands/add.js +95 -33
- package/dist/commands/add.js.map +2 -2
- package/dist/commands/analyzer.js +511 -0
- package/dist/commands/analyzer.js.map +7 -0
- package/dist/commands/audit-diff.js +49 -0
- package/dist/commands/audit-diff.js.map +7 -0
- package/dist/commands/audit-snapshots.js +62 -0
- package/dist/commands/audit-snapshots.js.map +7 -0
- package/dist/commands/audit.js +81 -0
- package/dist/commands/audit.js.map +7 -0
- package/dist/commands/catalog.js +248 -0
- package/dist/commands/catalog.js.map +7 -0
- package/dist/commands/changeset.js +577 -66
- package/dist/commands/changeset.js.map +2 -2
- package/dist/commands/chat.js +106 -83
- package/dist/commands/chat.js.map +2 -2
- package/dist/commands/claude.js +74 -0
- package/dist/commands/claude.js.map +7 -0
- package/dist/commands/conformance.js +71 -68
- package/dist/commands/conformance.js.map +2 -2
- package/dist/commands/copilot.js +75 -0
- package/dist/commands/copilot.js.map +7 -0
- package/dist/commands/delete.js +125 -11
- package/dist/commands/delete.js.map +3 -3
- package/dist/commands/discover-logic.js +44 -0
- package/dist/commands/discover-logic.js.map +7 -0
- package/dist/commands/docs.js +87 -0
- package/dist/commands/docs.js.map +7 -0
- package/dist/commands/element.js +14 -20
- package/dist/commands/element.js.map +2 -2
- package/dist/commands/export.js +13 -3
- package/dist/commands/export.js.map +2 -2
- package/dist/commands/import.js +51 -0
- package/dist/commands/import.js.map +7 -0
- package/dist/commands/info.js +30 -24
- package/dist/commands/info.js.map +2 -2
- package/dist/commands/init.js +27 -11
- package/dist/commands/init.js.map +2 -2
- package/dist/commands/list.js +63 -13
- package/dist/commands/list.js.map +3 -3
- package/dist/commands/relationship.js +225 -37
- package/dist/commands/relationship.js.map +2 -2
- package/dist/commands/report.js +54 -0
- package/dist/commands/report.js.map +7 -0
- package/dist/commands/reports.js +45 -0
- package/dist/commands/reports.js.map +7 -0
- package/dist/commands/schema.js +135 -0
- package/dist/commands/schema.js.map +7 -0
- package/dist/commands/search.js +40 -12
- package/dist/commands/search.js.map +2 -2
- package/dist/commands/show.js +58 -27
- package/dist/commands/show.js.map +2 -2
- package/dist/commands/stats.js +35 -0
- package/dist/commands/stats.js.map +7 -0
- package/dist/commands/trace.js +39 -16
- package/dist/commands/trace.js.map +2 -2
- package/dist/commands/update.js +141 -14
- package/dist/commands/update.js.map +2 -2
- package/dist/commands/upgrade.js +210 -46
- package/dist/commands/upgrade.js.map +3 -3
- package/dist/commands/validate.js +142 -23
- package/dist/commands/validate.js.map +3 -3
- package/dist/commands/version.js +8 -12
- package/dist/commands/version.js.map +2 -2
- package/dist/commands/visualize.js +162 -25
- package/dist/commands/visualize.js.map +2 -2
- package/dist/core/base-snapshot-manager.js +84 -0
- package/dist/core/base-snapshot-manager.js.map +7 -0
- package/dist/core/changeset-exporter.js +305 -0
- package/dist/core/changeset-exporter.js.map +7 -0
- package/dist/core/changeset-validator.js +41 -0
- package/dist/core/changeset-validator.js.map +7 -0
- package/dist/core/changeset.js +88 -173
- package/dist/core/changeset.js.map +2 -2
- package/dist/core/dependency-tracker.js +4 -2
- package/dist/core/dependency-tracker.js.map +2 -2
- package/dist/core/element.js +98 -27
- package/dist/core/element.js.map +2 -2
- package/dist/core/golden-copy-cache.js +290 -0
- package/dist/core/golden-copy-cache.js.map +7 -0
- package/dist/core/graph-model.js +266 -0
- package/dist/core/graph-model.js.map +7 -0
- package/dist/core/layer.js +159 -16
- package/dist/core/layer.js.map +2 -2
- package/dist/core/layers.js +32 -0
- package/dist/core/layers.js.map +7 -0
- package/dist/core/manifest.js +32 -11
- package/dist/core/manifest.js.map +2 -2
- package/dist/core/migration-registry.js +56 -1
- package/dist/core/migration-registry.js.map +2 -2
- package/dist/core/model.js +424 -217
- package/dist/core/model.js.map +3 -3
- package/dist/core/mutation-handler.js +179 -0
- package/dist/core/mutation-handler.js.map +7 -0
- package/dist/core/reference-registry.js +29 -21
- package/dist/core/reference-registry.js.map +2 -2
- package/dist/core/relationship-catalog.js +189 -0
- package/dist/core/relationship-catalog.js.map +7 -0
- package/dist/core/relationship-registry.js.map +2 -2
- package/dist/core/relationships.js.map +1 -1
- package/dist/core/report-data-model.js +285 -0
- package/dist/core/report-data-model.js.map +7 -0
- package/dist/core/spec-data-service.js +185 -0
- package/dist/core/spec-data-service.js.map +7 -0
- package/dist/core/spec-loader-types.js +1 -0
- package/dist/core/spec-loader-types.js.map +7 -0
- package/dist/core/spec-loader.js +234 -0
- package/dist/core/spec-loader.js.map +7 -0
- package/dist/core/staged-changeset-storage.js +282 -0
- package/dist/core/staged-changeset-storage.js.map +7 -0
- package/dist/core/staging-area.js +1002 -0
- package/dist/core/staging-area.js.map +7 -0
- package/dist/core/stats-collector.js +169 -0
- package/dist/core/stats-collector.js.map +7 -0
- package/dist/core/virtual-projection.js +443 -0
- package/dist/core/virtual-projection.js.map +7 -0
- package/dist/export/archimate-exporter.js +99 -60
- package/dist/export/archimate-exporter.js.map +2 -2
- package/dist/export/audit-formatters.js +479 -0
- package/dist/export/audit-formatters.js.map +7 -0
- package/dist/export/diff-formatters.js +99 -0
- package/dist/export/diff-formatters.js.map +7 -0
- package/dist/export/export-manager.js.map +2 -2
- package/dist/export/graphml-exporter.js +44 -27
- package/dist/export/graphml-exporter.js.map +2 -2
- package/dist/export/index.js +4 -0
- package/dist/export/index.js.map +2 -2
- package/dist/export/json-schema-exporter.js +55 -42
- package/dist/export/json-schema-exporter.js.map +2 -2
- package/dist/export/markdown-exporter.js +92 -70
- package/dist/export/markdown-exporter.js.map +2 -2
- package/dist/export/markdown-generator.js +248 -0
- package/dist/export/markdown-generator.js.map +7 -0
- package/dist/export/markdown-utils.js +30 -0
- package/dist/export/markdown-utils.js.map +7 -0
- package/dist/export/mermaid-markdown-exporter.js +37 -0
- package/dist/export/mermaid-markdown-exporter.js.map +7 -0
- package/dist/export/openapi-exporter.js +119 -71
- package/dist/export/openapi-exporter.js.map +2 -2
- package/dist/export/plantuml-exporter.js +104 -39
- package/dist/export/plantuml-exporter.js.map +2 -2
- package/dist/export/report-formatters.js +111 -0
- package/dist/export/report-formatters.js.map +7 -0
- package/dist/export/stats-formatters.js +98 -0
- package/dist/export/stats-formatters.js.map +7 -0
- package/dist/export/types.js +2 -14
- package/dist/export/types.js.map +2 -2
- package/dist/export/verify-formatters.js +153 -0
- package/dist/export/verify-formatters.js.map +7 -0
- package/dist/generated/compiled-validators.js +17 -0
- package/dist/generated/compiled-validators.js.map +7 -0
- package/dist/generated/index.js +31 -0
- package/dist/generated/index.js.map +7 -0
- package/dist/generated/layer-registry.js +190 -0
- package/dist/generated/layer-registry.js.map +7 -0
- package/dist/generated/layer-types.js +7 -0
- package/dist/generated/layer-types.js.map +7 -0
- package/dist/generated/node-types.js +1719 -0
- package/dist/generated/node-types.js.map +7 -0
- package/dist/generated/relationship-index.js +14552 -0
- package/dist/generated/relationship-index.js.map +7 -0
- package/dist/import/archimate-importer.js +166 -0
- package/dist/import/archimate-importer.js.map +7 -0
- package/dist/import/index.js +47 -0
- package/dist/import/index.js.map +7 -0
- package/dist/import/openapi-importer.js +143 -0
- package/dist/import/openapi-importer.js.map +7 -0
- package/dist/import/types.js +1 -0
- package/dist/import/types.js.map +7 -0
- package/dist/integrations/base-manager.js +311 -0
- package/dist/integrations/base-manager.js.map +7 -0
- package/dist/integrations/claude-manager.js +360 -0
- package/dist/integrations/claude-manager.js.map +7 -0
- package/dist/integrations/claude_code/agents/dr-advisor.md +253 -0
- package/dist/integrations/claude_code/agents/dr-architect.md +278 -0
- package/dist/integrations/claude_code/agents/dr-extractor.md +286 -0
- package/dist/integrations/claude_code/commands/dr-changeset.md +657 -0
- package/dist/integrations/claude_code/commands/dr-design.md +373 -0
- package/dist/integrations/claude_code/commands/dr-info.md +132 -0
- package/dist/integrations/claude_code/commands/dr-init.md +251 -0
- package/dist/integrations/claude_code/commands/dr-map.md +936 -0
- package/dist/integrations/claude_code/commands/dr-model.md +493 -0
- package/dist/integrations/claude_code/commands/dr-relate.md +814 -0
- package/dist/integrations/claude_code/commands/dr-sync.md +279 -0
- package/dist/integrations/claude_code/commands/dr-validate.md +654 -0
- package/dist/integrations/claude_code/commands/dr-verify.md +559 -0
- package/dist/integrations/claude_code/docs/END_TO_END_WALKTHROUGH.md +903 -0
- package/dist/integrations/claude_code/docs/QUICK_START.md +271 -0
- package/dist/integrations/claude_code/docs/README.md +347 -0
- package/dist/integrations/claude_code/skills/dr_01_motivation_layer/SKILL.md +550 -0
- package/dist/integrations/claude_code/skills/dr_02_business_layer/SKILL.md +620 -0
- package/dist/integrations/claude_code/skills/dr_03_security_layer/SKILL.md +642 -0
- package/dist/integrations/claude_code/skills/dr_04_application_layer/SKILL.md +911 -0
- package/dist/integrations/claude_code/skills/dr_05_technology_layer/SKILL.md +836 -0
- package/dist/integrations/claude_code/skills/dr_06_api_layer/SKILL.md +933 -0
- package/dist/integrations/claude_code/skills/dr_07_data_model_layer/SKILL.md +210 -0
- package/dist/integrations/claude_code/skills/dr_08_dataset_layer/SKILL.md +319 -0
- package/dist/integrations/claude_code/skills/dr_09_ux_layer/SKILL.md +319 -0
- package/dist/integrations/claude_code/skills/dr_10_navigation_layer/SKILL.md +318 -0
- package/dist/integrations/claude_code/skills/dr_11_apm_layer/SKILL.md +273 -0
- package/dist/integrations/claude_code/skills/dr_12_testing_layer/SKILL.md +273 -0
- package/dist/integrations/claude_code/skills/dr_changeset_reviewer/SKILL.md +187 -0
- package/dist/integrations/claude_code/skills/dr_codebase_memory/SKILL.md +590 -0
- package/dist/integrations/claude_code/skills/dr_engineering_guide/SKILL.md +295 -0
- package/dist/integrations/copilot-manager.js +328 -0
- package/dist/integrations/copilot-manager.js.map +7 -0
- package/dist/integrations/github_copilot/agents/dr-advisor.md +243 -0
- package/dist/integrations/github_copilot/agents/dr-architect.md +1567 -0
- package/dist/integrations/github_copilot/skills/dr_01_motivation_layer/SKILL.md +491 -0
- package/dist/integrations/github_copilot/skills/dr_02_business_layer/SKILL.md +539 -0
- package/dist/integrations/github_copilot/skills/dr_03_security_layer/SKILL.md +667 -0
- package/dist/integrations/github_copilot/skills/dr_04_application_layer/SKILL.md +670 -0
- package/dist/integrations/github_copilot/skills/dr_05_technology_layer/SKILL.md +660 -0
- package/dist/integrations/github_copilot/skills/dr_06_api_layer/SKILL.md +855 -0
- package/dist/integrations/github_copilot/skills/dr_07_data_model_layer/SKILL.md +171 -0
- package/dist/integrations/github_copilot/skills/dr_08_dataset_layer/SKILL.md +216 -0
- package/dist/integrations/github_copilot/skills/dr_09_ux_layer/SKILL.md +230 -0
- package/dist/integrations/github_copilot/skills/dr_10_navigation_layer/SKILL.md +228 -0
- package/dist/integrations/github_copilot/skills/dr_11_apm_layer/SKILL.md +234 -0
- package/dist/integrations/github_copilot/skills/dr_12_testing_layer/SKILL.md +230 -0
- package/dist/integrations/github_copilot/skills/dr_changeset_reviewer/SKILL.md +187 -0
- package/dist/integrations/hash-utils.js +51 -0
- package/dist/integrations/hash-utils.js.map +7 -0
- package/dist/integrations/types.js +16 -0
- package/dist/integrations/types.js.map +7 -0
- package/dist/reports/model-layer-report-generator.js +278 -0
- package/dist/reports/model-layer-report-generator.js.map +7 -0
- package/dist/reports/model-report-data.js +57 -0
- package/dist/reports/model-report-data.js.map +7 -0
- package/dist/reports/model-report-orchestrator.js +103 -0
- package/dist/reports/model-report-orchestrator.js.map +7 -0
- package/dist/schemas/bundled/analyzers/cbm.json +595 -0
- package/dist/schemas/bundled/analyzers/manifest.json +9 -0
- package/dist/schemas/bundled/api.json +3411 -0
- package/dist/schemas/bundled/apm.json +2371 -0
- package/dist/schemas/bundled/application.json +1253 -0
- package/dist/schemas/bundled/base.json +1622 -0
- package/dist/schemas/bundled/business.json +1279 -0
- package/dist/schemas/bundled/data-model.json +1298 -0
- package/dist/schemas/bundled/data-store.json +2025 -0
- package/dist/schemas/bundled/manifest.json +93 -0
- package/dist/schemas/bundled/motivation.json +1360 -0
- package/dist/schemas/bundled/navigation.json +1874 -0
- package/dist/schemas/bundled/security.json +3488 -0
- package/dist/schemas/bundled/technology.json +2067 -0
- package/dist/schemas/bundled/testing.json +3120 -0
- package/dist/schemas/bundled/ux.json +3592 -0
- package/dist/server/schemas.js +202 -0
- package/dist/server/schemas.js.map +7 -0
- package/dist/server/server.js +1336 -252
- package/dist/server/server.js.map +3 -3
- package/dist/server/telemetry-middleware.js +22 -15
- package/dist/server/telemetry-middleware.js.map +2 -2
- package/dist/server-entry.js +65 -0
- package/dist/server-entry.js.map +7 -0
- package/dist/telemetry/config.js +89 -0
- package/dist/telemetry/config.js.map +7 -0
- package/dist/telemetry/console-interceptor.js.map +1 -1
- package/dist/telemetry/detect.js +24 -0
- package/dist/telemetry/detect.js.map +7 -0
- package/dist/telemetry/fetch-otlp-exporter.js +112 -0
- package/dist/telemetry/fetch-otlp-exporter.js.map +7 -0
- package/dist/telemetry/index.js +153 -3
- package/dist/telemetry/index.js.map +2 -2
- package/dist/telemetry/resilient-exporter.js +22 -8
- package/dist/telemetry/resilient-exporter.js.map +2 -2
- package/dist/telemetry/resilient-log-exporter.js +17 -8
- package/dist/telemetry/resilient-log-exporter.js.map +2 -2
- package/dist/telemetry/test-instrumentation.js.map +2 -2
- package/dist/types/index.js +84 -0
- package/dist/types/index.js.map +3 -3
- package/dist/types/source-reference.js +1 -0
- package/dist/types/source-reference.js.map +7 -0
- package/dist/utils/chat-logger.js +292 -0
- package/dist/utils/chat-logger.js.map +7 -0
- package/dist/utils/claude-stream.js +8 -0
- package/dist/utils/claude-stream.js.map +7 -0
- package/dist/utils/date-utils.js +7 -0
- package/dist/utils/date-utils.js.map +7 -0
- package/dist/utils/element-utils.js.map +1 -1
- package/dist/utils/errors.js +88 -15
- package/dist/utils/errors.js.map +3 -3
- package/dist/utils/export-python-annotations.js +82 -0
- package/dist/utils/export-python-annotations.js.map +7 -0
- package/dist/utils/file-io.js +7 -2
- package/dist/utils/file-io.js.map +2 -2
- package/dist/utils/file-lock.js +156 -0
- package/dist/utils/file-lock.js.map +7 -0
- package/dist/utils/id-generator.js +18 -0
- package/dist/utils/id-generator.js.map +7 -0
- package/dist/utils/layer-name-formatter.js +16 -0
- package/dist/utils/layer-name-formatter.js.map +7 -0
- package/dist/utils/markdown-anchor.js +7 -0
- package/dist/utils/markdown-anchor.js.map +7 -0
- package/dist/utils/markdown-link.js +12 -0
- package/dist/utils/markdown-link.js.map +7 -0
- package/dist/utils/markdown-table.js +17 -0
- package/dist/utils/markdown-table.js.map +7 -0
- package/dist/utils/mermaid-utils.js +11 -0
- package/dist/utils/mermaid-utils.js.map +7 -0
- package/dist/utils/project-paths.js.map +2 -2
- package/dist/utils/source-reference.js +52 -0
- package/dist/utils/source-reference.js.map +7 -0
- package/dist/utils/spec-installer.js +40 -53
- package/dist/utils/spec-installer.js.map +2 -2
- package/dist/utils/spec-version.js +5 -1
- package/dist/utils/spec-version.js.map +2 -2
- package/dist/utils/string-utils.js +12 -0
- package/dist/utils/string-utils.js.map +7 -0
- package/dist/utils/table-formatting.js +19 -0
- package/dist/utils/table-formatting.js.map +7 -0
- package/dist/validators/index.js +4 -0
- package/dist/validators/index.js.map +2 -2
- package/dist/validators/naming-validator.js +20 -23
- package/dist/validators/naming-validator.js.map +2 -2
- package/dist/validators/reference-validator.js +23 -38
- package/dist/validators/reference-validator.js.map +2 -2
- package/dist/validators/relationship-schema-validator.js +243 -0
- package/dist/validators/relationship-schema-validator.js.map +7 -0
- package/dist/validators/schema-validator.js +168 -68
- package/dist/validators/schema-validator.js.map +2 -2
- package/dist/validators/semantic-validator.js +36 -60
- package/dist/validators/semantic-validator.js.map +2 -2
- package/dist/validators/types.js.map +2 -2
- package/dist/validators/validation-formatter.js +159 -0
- package/dist/validators/validation-formatter.js.map +7 -0
- package/dist/validators/validator.js +24 -38
- package/dist/validators/validator.js.map +2 -2
- package/dist/viewer/README.md +139 -0
- package/dist/viewer/assets/main-CY0Xufuj.css +1 -0
- package/dist/viewer/assets/main-DtgErnwF.js +81 -0
- package/dist/viewer/assets/vendor-CxKvDp2x.js +17 -0
- package/dist/viewer/favicon.svg +11 -0
- package/dist/viewer/fonts/inter/Inter-Black.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-Bold.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-ExtraBold.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-Light.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-Medium.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-Regular.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-SemiBold.woff2 +0 -0
- package/dist/viewer/fonts/jetbrains-mono/JetBrainsMono-Medium.woff2 +0 -0
- package/dist/viewer/fonts/jetbrains-mono/JetBrainsMono-Regular.woff2 +0 -0
- package/dist/viewer/fonts/jetbrains-mono/JetBrainsMono-SemiBold.woff2 +0 -0
- package/dist/viewer/index.html +15 -0
- package/dist/viewer/manifest.json +99 -0
- package/dist/viewer/version.json +1 -0
- package/package.json +42 -16
- package/PYTHON_CLI_PARITY.md +0 -265
- package/PYTHON_CLI_STRUCTURE_UPDATE.md +0 -246
- package/biome.json +0 -42
- package/bunfig.toml +0 -3
- package/dist/ai/claude-client.js +0 -71
- package/dist/ai/claude-client.js.map +0 -7
- package/dist/ai/context-provider.js +0 -129
- package/dist/ai/context-provider.js.map +0 -7
- package/dist/ai/tools.js +0 -231
- package/dist/ai/tools.js.map +0 -7
- package/dist/commands/migrate.js +0 -36
- package/dist/commands/migrate.js.map +0 -7
- package/dist/commands/project.js +0 -74
- package/dist/commands/project.js.map +0 -7
- package/dist/core/active-changeset.js +0 -52
- package/dist/core/active-changeset.js.map +0 -7
- package/dist/core/projection-engine.js +0 -288
- package/dist/core/projection-engine.js.map +0 -7
- package/dist/schemas/bundled/01-motivation-layer.schema.json +0 -942
- package/dist/schemas/bundled/02-business-layer.schema.json +0 -1293
- package/dist/schemas/bundled/03-security-layer.schema.json +0 -2177
- package/dist/schemas/bundled/04-application-layer.schema.json +0 -1328
- package/dist/schemas/bundled/05-technology-layer.schema.json +0 -1465
- package/dist/schemas/bundled/06-api-layer.schema.json +0 -1743
- package/dist/schemas/bundled/07-data-model-layer.schema.json +0 -1253
- package/dist/schemas/bundled/08-datastore-layer.schema.json +0 -892
- package/dist/schemas/bundled/09-ux-layer.schema.json +0 -1506
- package/dist/schemas/bundled/10-navigation-layer.schema.json +0 -843
- package/dist/schemas/bundled/11-apm-observability-layer.schema.json +0 -1430
- package/dist/schemas/bundled/12-testing-layer.schema.json +0 -1091
- package/dist/schemas/bundled/common/layer-extensions.schema.json +0 -266
- package/dist/schemas/bundled/common/predicates.schema.json +0 -493
- package/dist/schemas/bundled/common/relationships.schema.json +0 -791
- package/dist/schemas/bundled/common/source-references.schema.json +0 -71
- package/dist/schemas/bundled/link-registry.json +0 -1839
- package/dist/schemas/bundled/link-registry.schema.json +0 -339
- package/dist/schemas/bundled/relationship-catalog.json +0 -1302
- package/dist/schemas/bundled/relationship-type.schema.json +0 -221
- package/dist/utils/model-path.js +0 -22
- package/dist/utils/model-path.js.map +0 -7
- package/docs/TEST-INSTRUMENTATION.md +0 -405
- package/docs/telemetry.md +0 -427
- package/test-debug.js +0 -33
- package/test-special.mjs +0 -46
- package/test_runner.ts +0 -7
package/README.md
CHANGED
|
@@ -1,926 +1,699 @@
|
|
|
1
1
|
# Documentation Robotics CLI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
This is the Documentation Robotics CLI - a production-ready command-line tool for creating, managing, and exporting comprehensive architecture models that span business requirements through technical implementation.
|
|
8
|
-
|
|
9
|
-
## Foundation
|
|
10
|
-
|
|
11
|
-
- ✅ Project structure initialized
|
|
12
|
-
- ✅ TypeScript configuration (strict mode)
|
|
13
|
-
- ✅ Core domain models (Element, Layer, Model, Manifest)
|
|
14
|
-
- ✅ Reference and Relationship registries for tracking dependencies
|
|
15
|
-
- ✅ File I/O utilities with atomic writes
|
|
16
|
-
- ✅ JSON schemas bundled (all 12 layers)
|
|
17
|
-
- ✅ Comprehensive unit tests
|
|
18
|
-
- ✅ Code formatted and configured for linting
|
|
19
|
-
|
|
20
|
-
## Directory Structure
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
cli/
|
|
24
|
-
├── src/
|
|
25
|
-
│ ├── cli.ts # Entry point
|
|
26
|
-
│ ├── core/ # Domain models
|
|
27
|
-
│ │ ├── element.ts # Individual architecture items
|
|
28
|
-
│ │ ├── layer.ts # Layer containers
|
|
29
|
-
│ │ ├── model.ts # Complete model orchestration
|
|
30
|
-
│ │ ├── manifest.ts # Model metadata (JSON)
|
|
31
|
-
│ │ ├── reference-registry.ts # Cross-layer reference tracking
|
|
32
|
-
│ │ └── relationship-registry.ts # Intra-layer relationship management
|
|
33
|
-
│ ├── types/
|
|
34
|
-
│ │ └── index.ts # TypeScript type definitions
|
|
35
|
-
│ ├── utils/
|
|
36
|
-
│ │ └── file-io.ts # File operations (atomic writes)
|
|
37
|
-
│ └── schemas/
|
|
38
|
-
│ └── bundled/ # All JSON schemas from spec/
|
|
39
|
-
│ ├── 01-motivation-layer.schema.json
|
|
40
|
-
│ ├── 02-business-layer.schema.json
|
|
41
|
-
│ ├── ... (all 12 layer schemas)
|
|
42
|
-
│ ├── relationship-catalog.json
|
|
43
|
-
│ ├── link-registry.json
|
|
44
|
-
│ └── common/
|
|
45
|
-
│ ├── relationships.schema.json
|
|
46
|
-
│ ├── predicates.schema.json
|
|
47
|
-
│ └── ...
|
|
48
|
-
├── tests/
|
|
49
|
-
│ └── unit/
|
|
50
|
-
│ ├── core/
|
|
51
|
-
│ │ ├── element.test.ts
|
|
52
|
-
│ │ ├── layer.test.ts
|
|
53
|
-
│ │ ├── manifest.test.ts
|
|
54
|
-
│ │ ├── model.test.ts
|
|
55
|
-
│ │ ├── reference-registry.test.ts
|
|
56
|
-
│ │ ├── relationship-registry.test.ts
|
|
57
|
-
│ │ └── element.integration.test.js
|
|
58
|
-
│ └── utils/
|
|
59
|
-
│ └── file-io.test.ts
|
|
60
|
-
├── dist/ # Compiled JavaScript
|
|
61
|
-
├── package.json
|
|
62
|
-
├── tsconfig.json
|
|
63
|
-
├── biome.json
|
|
64
|
-
└── README.md
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Installation & Setup
|
|
68
|
-
|
|
69
|
-
### Prerequisites
|
|
70
|
-
|
|
71
|
-
- **Node.js 18+** (npm included)
|
|
72
|
-
- **Bun 1.3+** (optional, recommended for best performance)
|
|
73
|
-
- A Documentation Robotics model directory (`.dr/`)
|
|
74
|
-
|
|
75
|
-
### Quick Start
|
|
3
|
+
A command-line tool for managing comprehensive architecture models that span from business requirements through technical implementation.
|
|
76
4
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
npm install -g @documentation-robotics/cli
|
|
5
|
+
[](https://www.npmjs.com/package/@documentation-robotics/cli)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
80
7
|
|
|
81
|
-
|
|
82
|
-
npm install @documentation-robotics/cli
|
|
83
|
-
|
|
84
|
-
# Run CLI
|
|
85
|
-
dr --version
|
|
86
|
-
dr --help
|
|
87
|
-
```
|
|
8
|
+
## What is Documentation Robotics?
|
|
88
9
|
|
|
89
|
-
|
|
10
|
+
Documentation Robotics helps you build and maintain a **federated architecture model** across 12 interconnected layers:
|
|
90
11
|
|
|
91
|
-
|
|
12
|
+
1. **Motivation** - Goals, requirements, stakeholders
|
|
13
|
+
2. **Business** - Business processes and services
|
|
14
|
+
3. **Security** - Authentication, authorization, threats
|
|
15
|
+
4. **Application** - Application services and components
|
|
16
|
+
5. **Technology** - Infrastructure and platforms
|
|
17
|
+
6. **API** - REST APIs and operations
|
|
18
|
+
7. **Data Model** - Entities and relationships
|
|
19
|
+
8. **Data Store** - Database schemas
|
|
20
|
+
9. **UX** - User interface components
|
|
21
|
+
10. **Navigation** - Application routing
|
|
22
|
+
11. **APM** - Observability and monitoring
|
|
23
|
+
12. **Testing** - Test strategies and cases
|
|
92
24
|
|
|
93
|
-
|
|
94
|
-
# Clone the repository
|
|
95
|
-
git clone https://github.com/tinkermonkey/documentation_robotics.git
|
|
96
|
-
cd documentation_robotics/cli
|
|
25
|
+
**Key Benefits:**
|
|
97
26
|
|
|
98
|
-
|
|
99
|
-
|
|
27
|
+
- Trace dependencies from business goals to implementation
|
|
28
|
+
- Export to industry standards (ArchiMate, OpenAPI, JSON Schema)
|
|
29
|
+
- Visualize your architecture in an interactive web interface
|
|
30
|
+
- Chat with AI (Claude Code or GitHub Copilot) about your architecture model
|
|
31
|
+
- Validate model integrity automatically
|
|
100
32
|
|
|
101
|
-
|
|
102
|
-
npm run build
|
|
33
|
+
## Installation
|
|
103
34
|
|
|
104
|
-
|
|
105
|
-
bun test
|
|
35
|
+
### Global Installation (Recommended)
|
|
106
36
|
|
|
107
|
-
|
|
108
|
-
npm
|
|
109
|
-
|
|
110
|
-
# Format code
|
|
111
|
-
npm run format
|
|
112
|
-
|
|
113
|
-
# Run CLI locally during development
|
|
114
|
-
node dist/cli.js --help
|
|
37
|
+
```bash
|
|
38
|
+
npm install -g @documentation-robotics/cli
|
|
115
39
|
```
|
|
116
40
|
|
|
117
|
-
### Installation
|
|
118
|
-
|
|
119
|
-
#### Option 1: Global Installation (Recommended)
|
|
41
|
+
### Local Installation (Project-Specific)
|
|
120
42
|
|
|
121
43
|
```bash
|
|
122
|
-
|
|
123
|
-
|
|
44
|
+
npm install @documentation-robotics/cli
|
|
45
|
+
```
|
|
124
46
|
|
|
125
|
-
|
|
126
|
-
bun add -g @documentation-robotics/cli
|
|
47
|
+
### Verify Installation
|
|
127
48
|
|
|
128
|
-
|
|
49
|
+
```bash
|
|
129
50
|
dr --version
|
|
51
|
+
dr --help
|
|
130
52
|
```
|
|
131
53
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
# Install as a dev dependency
|
|
136
|
-
npm install --save-dev @documentation-robotics/cli
|
|
54
|
+
### System Requirements
|
|
137
55
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
56
|
+
| Feature | Requirement | Notes |
|
|
57
|
+
| ------------- | --------------------------------- | ----------------------------------- |
|
|
58
|
+
| Basic CLI | Node.js 18+ | All commands work |
|
|
59
|
+
| Visualization | Node.js 18+ | Interactive web interface |
|
|
60
|
+
| Chat | Claude Code CLI or GitHub Copilot | AI-powered architecture discussions |
|
|
144
61
|
|
|
145
|
-
|
|
146
|
-
npx dr --help
|
|
147
|
-
```
|
|
62
|
+
## Quick Start
|
|
148
63
|
|
|
149
|
-
|
|
64
|
+
### 1. Create Your First Model
|
|
150
65
|
|
|
151
66
|
```bash
|
|
152
|
-
#
|
|
153
|
-
|
|
154
|
-
cd documentation_robotics/cli
|
|
155
|
-
npm install
|
|
156
|
-
npm run build
|
|
67
|
+
# Initialize a new model
|
|
68
|
+
dr init --name "My Architecture" --author "Your Name"
|
|
157
69
|
|
|
158
|
-
#
|
|
159
|
-
|
|
70
|
+
# Add some elements (format: dr add <layer> <type> <name>)
|
|
71
|
+
dr add motivation goal customer-satisfaction \
|
|
72
|
+
--name "Ensure customer satisfaction"
|
|
160
73
|
|
|
161
|
-
|
|
162
|
-
|
|
74
|
+
dr add business service order-management \
|
|
75
|
+
--name "Order Management Service"
|
|
76
|
+
|
|
77
|
+
dr add api endpoint create-order \
|
|
78
|
+
--name "Create Order" \
|
|
79
|
+
--properties '{"method":"POST","path":"/api/orders"}'
|
|
163
80
|
```
|
|
164
81
|
|
|
165
|
-
###
|
|
82
|
+
### 2. View Your Model
|
|
166
83
|
|
|
167
|
-
|
|
84
|
+
```bash
|
|
85
|
+
# Show model summary
|
|
86
|
+
dr info
|
|
168
87
|
|
|
169
|
-
|
|
88
|
+
# List elements in a layer
|
|
89
|
+
dr list api
|
|
170
90
|
|
|
171
|
-
|
|
91
|
+
# Search for elements
|
|
92
|
+
dr search order
|
|
172
93
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
94
|
+
# Show element details
|
|
95
|
+
dr show api-endpoint-create-order
|
|
96
|
+
```
|
|
176
97
|
|
|
177
|
-
|
|
98
|
+
### 3. Visualize Your Architecture
|
|
178
99
|
|
|
179
100
|
```bash
|
|
180
|
-
#
|
|
181
|
-
|
|
101
|
+
# Launch interactive visualization
|
|
102
|
+
dr visualize
|
|
182
103
|
|
|
183
|
-
#
|
|
184
|
-
|
|
104
|
+
# Opens in your browser at http://localhost:8080
|
|
105
|
+
# - Explore layers and relationships
|
|
106
|
+
# - Search and filter elements
|
|
107
|
+
# - Chat with Claude about your model
|
|
185
108
|
```
|
|
186
109
|
|
|
187
|
-
|
|
110
|
+
### 4. Export Your Model
|
|
188
111
|
|
|
189
112
|
```bash
|
|
190
|
-
#
|
|
191
|
-
dr
|
|
113
|
+
# Export to ArchiMate (enterprise architecture standard)
|
|
114
|
+
dr export archimate --output model.xml
|
|
192
115
|
|
|
193
|
-
#
|
|
194
|
-
dr
|
|
116
|
+
# Export API layer to OpenAPI spec
|
|
117
|
+
dr export openapi --layers api --output api-spec.yaml
|
|
118
|
+
|
|
119
|
+
# Export to Markdown documentation
|
|
120
|
+
dr export markdown --output docs/architecture.md
|
|
195
121
|
```
|
|
196
122
|
|
|
197
|
-
|
|
123
|
+
## Common Commands
|
|
198
124
|
|
|
199
|
-
|
|
125
|
+
### Model Management
|
|
200
126
|
|
|
201
|
-
|
|
127
|
+
```bash
|
|
128
|
+
dr init # Initialize new model
|
|
129
|
+
dr info # Show model information
|
|
130
|
+
dr validate # Validate model integrity
|
|
131
|
+
dr upgrade # Check for spec upgrades
|
|
132
|
+
```
|
|
202
133
|
|
|
203
|
-
|
|
204
|
-
- **Validator Instrumentation**: Schema, naming, reference, and semantic validation stages produce nested spans
|
|
205
|
-
- **Console Logging**: Console output (`console.log`, `console.error`, etc.) is automatically captured and correlated with traces
|
|
206
|
-
- **Test Instrumentation**: Tests can emit spans with test file names, test case names, pass/fail status, and error details
|
|
207
|
-
- **Project Context**: All telemetry includes your project name from the manifest for easy filtering
|
|
208
|
-
- **Circuit-Breaker Protection**: Graceful degradation if the telemetry collector is unavailable—no user-facing errors or blocking
|
|
209
|
-
- **Compile-Time Configuration**: Telemetry code is completely eliminated from production builds via dead-code elimination
|
|
134
|
+
### Working with Elements
|
|
210
135
|
|
|
211
|
-
|
|
136
|
+
```bash
|
|
137
|
+
dr add <layer> <type> <id> # Add element
|
|
138
|
+
dr update <element-id> # Update element
|
|
139
|
+
dr delete <element-id> # Delete element
|
|
140
|
+
dr show <element-id> # Show element details
|
|
141
|
+
dr list <layer> # List layer elements
|
|
142
|
+
dr search <query> # Search elements
|
|
143
|
+
```
|
|
212
144
|
|
|
213
|
-
|
|
145
|
+
**Element ID Format**: `{layer}.{ElementType}.{kebab-case-name}`
|
|
214
146
|
|
|
215
|
-
|
|
216
|
-
- An OpenTelemetry collector (optional, for viewing traces/logs)
|
|
147
|
+
Examples:
|
|
217
148
|
|
|
218
|
-
|
|
149
|
+
- `motivation.goal.customer-satisfaction`
|
|
150
|
+
- `business.service.order-management`
|
|
151
|
+
- `api.endpoint.create-order`
|
|
152
|
+
- `data-model.entity.user-profile`
|
|
219
153
|
|
|
220
|
-
**
|
|
154
|
+
**Important**: In CLI commands, element types use **lowercase** (e.g., `goal`, `service`, `endpoint`), while element names use **kebab-case** (e.g., `customer-satisfaction`). In generated element IDs, the type segment matches the CLI format (e.g., `motivation.goal.customer-satisfaction`).
|
|
221
155
|
|
|
222
|
-
|
|
156
|
+
See [Element Type Reference](../docs/ELEMENT_TYPE_REFERENCE.md) for comprehensive documentation of all element types by layer.
|
|
223
157
|
|
|
224
|
-
|
|
158
|
+
### Source File Tracking
|
|
225
159
|
|
|
226
|
-
|
|
160
|
+
Link architecture elements to their implementation source code:
|
|
227
161
|
|
|
228
162
|
```bash
|
|
229
|
-
#
|
|
230
|
-
|
|
163
|
+
# Add element with source reference
|
|
164
|
+
dr add api endpoint create-user \
|
|
165
|
+
--name "Create User Endpoint" \
|
|
166
|
+
--source-file "src/api/endpoints/users.ts" \
|
|
167
|
+
--source-symbol "createUser" \
|
|
168
|
+
--source-provenance "extracted"
|
|
231
169
|
|
|
232
|
-
#
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
170
|
+
# Update element to add source reference
|
|
171
|
+
dr update api-endpoint-create-user \
|
|
172
|
+
--source-file "src/api/endpoints/users.ts" \
|
|
173
|
+
--source-symbol "createUser" \
|
|
174
|
+
--source-provenance "extracted" \
|
|
175
|
+
--source-repo-remote "https://github.com/example/repo.git" \
|
|
176
|
+
--source-repo-commit "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b"
|
|
236
177
|
|
|
237
|
-
|
|
178
|
+
# Show element with source reference details
|
|
179
|
+
dr show api-endpoint-create-user
|
|
238
180
|
|
|
239
|
-
|
|
181
|
+
# Search elements by source file
|
|
182
|
+
dr search --source-file "src/api/endpoints/users.ts"
|
|
240
183
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
184
|
+
# Clear source reference from element
|
|
185
|
+
dr update api-endpoint-create-user --clear-source-reference
|
|
186
|
+
```
|
|
244
187
|
|
|
245
|
-
|
|
246
|
-
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
|
|
188
|
+
**Source Reference Options:**
|
|
247
189
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
190
|
+
| Option | Required | Description | Example |
|
|
191
|
+
| ---------------------- | ------------------------------- | ------------------------------------------------------------------------- | ------------------------------------- |
|
|
192
|
+
| `--source-file` | When using source options | Path to source file (relative to repo root) | `src/api/routes.ts` |
|
|
193
|
+
| `--source-symbol` | Optional | Symbol name (function, class, variable) | `createUser` |
|
|
194
|
+
| `--source-provenance` | When using source options | How reference was created: `extracted`, `manual`, `inferred`, `generated` | `extracted` |
|
|
195
|
+
| `--source-repo-remote` | Requires `--source-repo-commit` | Git remote URL | `https://github.com/example/repo.git` |
|
|
196
|
+
| `--source-repo-commit` | Requires `--source-repo-remote` | Full 40-character commit SHA | `a1b2c3d4...` |
|
|
252
197
|
|
|
253
|
-
|
|
254
|
-
# http://localhost:3301
|
|
255
|
-
```
|
|
198
|
+
**Examples:**
|
|
256
199
|
|
|
257
|
-
|
|
200
|
+
```bash
|
|
201
|
+
# Source reference with minimal information
|
|
202
|
+
dr add security policy auth-validate \
|
|
203
|
+
--name "Auth Validation" \
|
|
204
|
+
--source-file "src/security/auth.ts" \
|
|
205
|
+
--source-provenance "manual"
|
|
258
206
|
|
|
259
|
-
|
|
207
|
+
# Source reference with symbol and repository context
|
|
208
|
+
dr add data-model entity user-entity \
|
|
209
|
+
--name "User Entity" \
|
|
210
|
+
--source-file "src/models/user.ts" \
|
|
211
|
+
--source-symbol "User" \
|
|
212
|
+
--source-provenance "extracted" \
|
|
213
|
+
--source-repo-remote "https://github.com/myorg/myapp.git" \
|
|
214
|
+
--source-repo-commit "5a7b3c9d1e2f4a6b8c0d2e4f6a8b0c2d4e6f8a0b"
|
|
260
215
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
- Look for spans named `cli.execute`
|
|
264
|
-
- Expand to see nested validator spans (`validation.stage.schema`, `validation.stage.naming`, etc.)
|
|
265
|
-
- Each span shows command name, arguments, working directory, and project name
|
|
216
|
+
# Search for all elements in a source file
|
|
217
|
+
dr search --source-file "src/services/auth.ts"
|
|
266
218
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
- Logs include severity level (INFO, WARN, ERROR) and trace context (traceId, spanId)
|
|
219
|
+
# Search by file with additional filters
|
|
220
|
+
dr search --source-file "src/api/endpoints.ts" --layer "06-api" --type "endpoint"
|
|
221
|
+
```
|
|
271
222
|
|
|
272
|
-
|
|
273
|
-
- Use the filter `dr.project.name = "YourProjectName"` to isolate telemetry for a specific project
|
|
274
|
-
- Useful when multiple projects share the same collector
|
|
223
|
+
**Provenance Types:**
|
|
275
224
|
|
|
276
|
-
|
|
225
|
+
- **`extracted`**: Automatically detected from source code via parsing/analysis tools
|
|
226
|
+
- **`manual`**: Manually linked by a person reviewing source code
|
|
227
|
+
- **`inferred`**: Determined through pattern matching and heuristics
|
|
228
|
+
- **`generated`**: Created automatically from code generation or model transformation
|
|
277
229
|
|
|
278
|
-
|
|
230
|
+
### Relationships & Dependencies
|
|
279
231
|
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
instrumentTest,
|
|
286
|
-
} from '../../src/telemetry/test-instrumentation.js';
|
|
232
|
+
```bash
|
|
233
|
+
# Add relationships between elements
|
|
234
|
+
dr relationship add motivation.goal.customer-satisfaction \
|
|
235
|
+
business.service.customer-support \
|
|
236
|
+
--predicate "supports"
|
|
287
237
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
});
|
|
238
|
+
# List relationships for an element
|
|
239
|
+
dr relationship list business.service.order-management
|
|
291
240
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
});
|
|
241
|
+
# Trace dependencies (see which elements depend on this one)
|
|
242
|
+
dr trace api.endpoint.create-order
|
|
295
243
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
'should validate input',
|
|
299
|
-
instrumentTest(
|
|
300
|
-
'should validate input',
|
|
301
|
-
async () => {
|
|
302
|
-
// Test logic here
|
|
303
|
-
expect(result).toBe(expected);
|
|
304
|
-
},
|
|
305
|
-
'MyFeature' // Suite name for organization
|
|
306
|
-
)
|
|
307
|
-
);
|
|
308
|
-
});
|
|
244
|
+
# Project dependencies to another layer
|
|
245
|
+
dr project api.endpoint.create-order business
|
|
309
246
|
```
|
|
310
247
|
|
|
311
|
-
|
|
248
|
+
### Visualization & Export
|
|
312
249
|
|
|
313
250
|
```bash
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
# View test spans in SigNoz UI with attributes:
|
|
318
|
-
# - test.file: Path to test file
|
|
319
|
-
# - test.name: Test case name
|
|
320
|
-
# - test.suite: Describe block name
|
|
321
|
-
# - test.status: 'pass', 'fail', or 'skip'
|
|
322
|
-
# - test.error.message and test.error.stack (for failed tests)
|
|
251
|
+
dr visualize # Interactive web UI
|
|
252
|
+
dr export <format> # Export model
|
|
253
|
+
# Formats: archimate, openapi, jsonschema, plantuml, markdown, graphml
|
|
323
254
|
```
|
|
324
255
|
|
|
325
|
-
|
|
256
|
+
### AI-Powered Features
|
|
326
257
|
|
|
327
258
|
```bash
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
#
|
|
331
|
-
./docs/otel_example/signoz-stack.sh clean
|
|
259
|
+
dr chat # Auto-detect or use saved preference
|
|
260
|
+
dr chat claude-code # Use Claude Code, save as preference
|
|
261
|
+
dr chat github-copilot # Use GitHub Copilot, save as preference
|
|
332
262
|
```
|
|
333
263
|
|
|
334
|
-
|
|
264
|
+
**Note**: Chat requires either [Claude Code CLI](https://claude.ai/download) or [GitHub Copilot CLI](https://github.com/github/gh-copilot) to be installed and authenticated. The CLI will auto-detect available clients and prompt you to choose if both are installed. You can also explicitly specify which client to use.
|
|
335
265
|
|
|
336
|
-
|
|
337
|
-
|----------|---------|---------|
|
|
338
|
-
| `OTEL_EXPORTER_OTLP_ENDPOINT` | `http://localhost:4318` | OTLP collector endpoint (applies to both traces and logs) |
|
|
339
|
-
| `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` | Derived from OTLP_ENDPOINT | Override for logs endpoint specifically |
|
|
340
|
-
| `DR_TELEMETRY` | Determined by build | Build-time flag (set via `npm run build:debug`) |
|
|
266
|
+
## Configuration
|
|
341
267
|
|
|
342
|
-
|
|
268
|
+
### Model Structure
|
|
343
269
|
|
|
344
|
-
|
|
270
|
+
Model data and changesets are stored in the `documentation-robotics/` directory:
|
|
345
271
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
272
|
+
```
|
|
273
|
+
your-project/
|
|
274
|
+
├── documentation-robotics/
|
|
275
|
+
│ ├── model/
|
|
276
|
+
│ │ ├── manifest.yaml # Model metadata
|
|
277
|
+
│ │ ├── 01_motivation/
|
|
278
|
+
│ │ │ ├── goals.yaml
|
|
279
|
+
│ │ │ └── ...
|
|
280
|
+
│ │ ├── 02_business/
|
|
281
|
+
│ │ │ ├── services.yaml
|
|
282
|
+
│ │ │ └── ...
|
|
283
|
+
│ │ └── ...
|
|
284
|
+
│ └── changesets/
|
|
285
|
+
│ ├── feature-x/
|
|
286
|
+
│ │ ├── metadata.yaml # Changeset metadata
|
|
287
|
+
│ │ └── changes.yaml # Staged changes
|
|
288
|
+
│ └── ...
|
|
289
|
+
```
|
|
354
290
|
|
|
355
|
-
|
|
291
|
+
**Legacy models**: Old projects using `.dr/` directory will auto-migrate changesets to `documentation-robotics/changesets/` on first use.
|
|
356
292
|
|
|
357
|
-
|
|
293
|
+
### Specification Reference
|
|
358
294
|
|
|
359
|
-
|
|
360
|
-
```bash
|
|
361
|
-
curl http://localhost:13133 # OTEL Collector health check
|
|
362
|
-
curl http://localhost:3301 # SigNoz UI
|
|
363
|
-
```
|
|
295
|
+
When you run `dr init`, the CLI installs a complete copy of the Documentation Robotics specification to `.dr/spec/`:
|
|
364
296
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
297
|
+
```
|
|
298
|
+
your-project/
|
|
299
|
+
├── .dr/
|
|
300
|
+
│ ├── spec/
|
|
301
|
+
│ │ ├── layers/ # 12 layer definitions
|
|
302
|
+
│ │ └── schemas/
|
|
303
|
+
│ │ ├── base/ # 8 base schemas
|
|
304
|
+
│ │ ├── nodes/ # 354 node type schemas
|
|
305
|
+
│ │ └── relationships/ # 252 relationship schemas
|
|
306
|
+
│ ├── manifest.json # Spec version info
|
|
307
|
+
│ └── README.md
|
|
308
|
+
```
|
|
370
309
|
|
|
371
|
-
|
|
372
|
-
```bash
|
|
373
|
-
node dist/cli.js validate
|
|
374
|
-
# If SigNoz is unavailable, circuit-breaker activates silently after 500ms timeout
|
|
375
|
-
```
|
|
310
|
+
**What this enables:**
|
|
376
311
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
312
|
+
- `dr schema layers` - List all architecture layers
|
|
313
|
+
- `dr schema types <layer>` - Show valid element types for a layer
|
|
314
|
+
- `dr schema node <spec_node_id>` - View detailed node type schema
|
|
315
|
+
- `dr schema relationship <type>` - Show valid relationships for a type
|
|
316
|
+
- `dr conformance` - Validate model against layer specifications
|
|
380
317
|
|
|
381
|
-
|
|
318
|
+
**Important:**
|
|
382
319
|
|
|
383
|
-
|
|
384
|
-
-
|
|
385
|
-
-
|
|
320
|
+
- The `.dr/` directory is ephemeral and should be git-ignored
|
|
321
|
+
- It will be recreated automatically by the CLI when needed
|
|
322
|
+
- Run `dr upgrade` to update the spec reference after CLI updates
|
|
386
323
|
|
|
387
|
-
|
|
324
|
+
### AI Chat Setup (for Chat Features)
|
|
388
325
|
|
|
389
|
-
|
|
326
|
+
The chat functionality supports two AI CLI tools. You need at least one installed:
|
|
390
327
|
|
|
391
|
-
|
|
392
|
-
- **Production builds** (`npm run build`): Zero telemetry overhead via dead-code elimination
|
|
393
|
-
- Telemetry code is completely removed from production bundles at compile time
|
|
328
|
+
#### Option 1: Claude Code CLI
|
|
394
329
|
|
|
395
|
-
|
|
330
|
+
1. Visit https://claude.ai/download
|
|
331
|
+
2. Follow installation instructions for your platform
|
|
332
|
+
3. Authenticate with your Anthropic account
|
|
333
|
+
4. Verify: `claude --version`
|
|
396
334
|
|
|
397
|
-
|
|
398
|
-
- The CLI gracefully handles missing SigNoz (no blocking, no user-visible errors)
|
|
399
|
-
- Traces and logs are sent asynchronously without blocking CLI commands
|
|
400
|
-
- Default OTLP collection endpoint: `http://localhost:4318` (standard OpenTelemetry receiver)
|
|
401
|
-
- Supported log severity levels: DEBUG, INFO, WARN, ERROR
|
|
402
|
-
- Automatic trace-log correlation via traceId and spanId
|
|
335
|
+
#### Option 2: GitHub Copilot CLI
|
|
403
336
|
|
|
404
|
-
|
|
337
|
+
1. Install GitHub CLI: https://cli.github.com/
|
|
338
|
+
2. Install Copilot extension: `gh extension install github/gh-copilot`
|
|
339
|
+
3. Authenticate: `gh auth login`
|
|
340
|
+
4. Verify: `gh copilot --version`
|
|
405
341
|
|
|
406
|
-
|
|
407
|
-
| ------------- | ----------------- | ---------------------------------- |
|
|
408
|
-
| Basic CLI | Node.js 18+ | All commands work |
|
|
409
|
-
| Visualization | Node.js 18+ | WebSocket support required |
|
|
410
|
-
| Chat | Claude Code CLI | OAuth authentication via Claude Code |
|
|
411
|
-
| Telemetry | Docker Compose | Optional, for local SigNoz/OTLP tracing |
|
|
412
|
-
| Performance | Bun 1.3+ | Optional but recommended |
|
|
342
|
+
**Client Selection**:
|
|
413
343
|
|
|
414
|
-
|
|
344
|
+
- **Auto-detection**: The first time you use `dr chat`, if both clients are available, you'll be prompted to choose one.
|
|
345
|
+
- **Explicit selection**: You can specify a client directly (e.g., `dr chat github-copilot` or `dr chat claude-code`).
|
|
346
|
+
- **Preference storage**: Your client choice is saved in the model manifest for future sessions. You can change it anytime by explicitly specifying a different client.
|
|
415
347
|
|
|
416
|
-
|
|
348
|
+
### Visualization Server
|
|
417
349
|
|
|
418
350
|
```bash
|
|
419
|
-
#
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
# Check npm global location
|
|
423
|
-
npm config get prefix
|
|
424
|
-
|
|
425
|
-
# Add to PATH if needed (macOS/Linux)
|
|
426
|
-
export PATH="$(npm config get prefix)/bin:$PATH"
|
|
351
|
+
# Launch with default embedded viewer
|
|
352
|
+
dr visualize
|
|
427
353
|
|
|
428
|
-
#
|
|
429
|
-
|
|
430
|
-
source ~/.bashrc
|
|
431
|
-
```
|
|
354
|
+
# Custom port
|
|
355
|
+
dr visualize --port 3000
|
|
432
356
|
|
|
433
|
-
|
|
357
|
+
# Don't auto-open browser
|
|
358
|
+
dr visualize --no-browser
|
|
434
359
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
rm -rf node_modules package-lock.json
|
|
438
|
-
npm install
|
|
360
|
+
# Load custom viewer build (useful for development or custom distributions)
|
|
361
|
+
dr visualize --viewer-path ./dist/embedded/dr-viewer-bundle
|
|
439
362
|
|
|
440
|
-
#
|
|
441
|
-
|
|
363
|
+
# Combined example: custom viewer on custom port without browser
|
|
364
|
+
dr visualize --viewer-path ./my-viewer --port 3000 --no-browser
|
|
442
365
|
```
|
|
443
366
|
|
|
444
|
-
|
|
367
|
+
**Custom Viewer Path**:
|
|
445
368
|
|
|
446
|
-
|
|
447
|
-
# Check that all dependencies are installed
|
|
448
|
-
npm list
|
|
369
|
+
The `--viewer-path` option allows you to serve a custom web UI instead of the default embedded viewer:
|
|
449
370
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
371
|
+
- Point to a directory containing `index.html` and supporting files (CSS, JS, assets)
|
|
372
|
+
- Useful for developing custom viewers or using bundled distributions
|
|
373
|
+
- The server will serve static files from the specified path with proper MIME types
|
|
374
|
+
- Path traversal protection is enforced for security
|
|
375
|
+
|
|
376
|
+
**Example custom viewer structure**:
|
|
453
377
|
|
|
454
|
-
|
|
455
|
-
|
|
378
|
+
```
|
|
379
|
+
my-viewer/
|
|
380
|
+
├── index.html # Entry point
|
|
381
|
+
├── assets/
|
|
382
|
+
│ ├── style.css # Stylesheets
|
|
383
|
+
│ ├── script.js # JavaScript
|
|
384
|
+
│ └── logo.png # Images
|
|
385
|
+
└── ... # Other static files
|
|
456
386
|
```
|
|
457
387
|
|
|
458
|
-
##
|
|
388
|
+
## Generating Layer Reports
|
|
459
389
|
|
|
460
|
-
|
|
390
|
+
To generate comprehensive markdown reports for all 12 architecture layers:
|
|
461
391
|
|
|
462
392
|
```bash
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
dr element add --help # Show element add help
|
|
466
|
-
```
|
|
467
|
-
|
|
468
|
-
### Quick Command Summary
|
|
469
|
-
|
|
470
|
-
| Category | Command | Purpose |
|
|
471
|
-
| ----------------- | --------------------- | ---------------------------------------------------- |
|
|
472
|
-
| **Model** | `init` | Initialize a new architecture model |
|
|
473
|
-
| | `info` | Show model information and statistics |
|
|
474
|
-
| | `validate` | Validate the complete model |
|
|
475
|
-
| **Elements** | `add` | Add an element to a layer |
|
|
476
|
-
| | `update` | Update an element |
|
|
477
|
-
| | `delete` | Delete an element |
|
|
478
|
-
| | `show` | Display element details |
|
|
479
|
-
| | `list` | List elements in a layer |
|
|
480
|
-
| | `search` | Search for elements by name/ID |
|
|
481
|
-
| **Relationships** | `relationship add` | Add intra-layer relationship |
|
|
482
|
-
| | `relationship delete` | Delete a relationship |
|
|
483
|
-
| | `relationship list` | List relationships for an element |
|
|
484
|
-
| **Dependencies** | `trace` | Trace element dependencies |
|
|
485
|
-
| | `project` | Project dependencies to a target layer |
|
|
486
|
-
| **Export** | `export` | Export to various formats (ArchiMate, OpenAPI, etc.) |
|
|
487
|
-
| **Visualization** | `visualize` | Launch interactive visualization server |
|
|
488
|
-
| **AI** | `chat` | Interactive Claude AI chat about model |
|
|
489
|
-
| **Advanced** | `migrate` | Migrate model to new spec version |
|
|
490
|
-
| | `upgrade` | Check for version upgrades |
|
|
491
|
-
| | `conformance` | Check spec conformance |
|
|
492
|
-
| | `changeset` | Manage model change tracking |
|
|
493
|
-
|
|
494
|
-
### Common Workflows
|
|
495
|
-
|
|
496
|
-
#### Create a New Model
|
|
393
|
+
npm run generate:layer-reports
|
|
394
|
+
```
|
|
497
395
|
|
|
498
|
-
|
|
499
|
-
# Initialize model
|
|
500
|
-
dr init --name "My Architecture" --author "Team A"
|
|
396
|
+
This command:
|
|
501
397
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
398
|
+
- Loads 354 node schemas, 252 relationship schemas, 12 layer definitions, and 47 predicates
|
|
399
|
+
- Computes per-layer statistics and relationship classifications
|
|
400
|
+
- Generates 12 markdown reports in `spec/browser/` with Mermaid diagrams
|
|
401
|
+
- Generates `spec/browser/README.md` with overview and dependency matrix
|
|
506
402
|
|
|
507
|
-
|
|
508
|
-
dr info
|
|
509
|
-
dr list api
|
|
510
|
-
```
|
|
403
|
+
**Output Location**: `spec/browser/{NN}-{layer-name}-layer-report.md`
|
|
511
404
|
|
|
512
|
-
|
|
405
|
+
**When to Regenerate**:
|
|
513
406
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
407
|
+
- After modifying layer definitions in `spec/layers/*.layer.json`
|
|
408
|
+
- After adding/modifying node schemas in `spec/schemas/nodes/`
|
|
409
|
+
- After adding/modifying relationship schemas in `spec/schemas/relationships/`
|
|
410
|
+
- Before creating a new spec version release
|
|
517
411
|
|
|
518
|
-
|
|
519
|
-
dr show api-endpoint-create-order
|
|
412
|
+
**Git Integration**: The generated reports in `spec/browser/` are committed to git for easy browsing on GitHub. Regenerate them before spec releases to keep documentation in sync with specification changes.
|
|
520
413
|
|
|
521
|
-
|
|
522
|
-
dr update api-endpoint-create-order --name "Create Order API (v2)"
|
|
414
|
+
## Example Workflows
|
|
523
415
|
|
|
524
|
-
|
|
525
|
-
dr delete api-endpoint-old-endpoint --force
|
|
526
|
-
```
|
|
527
|
-
|
|
528
|
-
#### Analyze Dependencies
|
|
416
|
+
### Analyzing Dependencies
|
|
529
417
|
|
|
530
418
|
```bash
|
|
531
|
-
#
|
|
419
|
+
# Find all dependencies for an API endpoint
|
|
532
420
|
dr trace api-endpoint-create-order
|
|
533
421
|
|
|
534
|
-
# Show dependencies
|
|
422
|
+
# Show only dependencies from higher layers
|
|
535
423
|
dr trace api-endpoint-create-order --direction up
|
|
536
424
|
|
|
537
|
-
# Show
|
|
425
|
+
# Show dependency metrics
|
|
538
426
|
dr trace api-endpoint-create-order --metrics
|
|
539
427
|
|
|
540
|
-
# Project to
|
|
428
|
+
# Project dependencies to business layer
|
|
541
429
|
dr project api-endpoint-create-order business
|
|
542
430
|
```
|
|
543
431
|
|
|
544
|
-
|
|
432
|
+
### Managing Relationships
|
|
545
433
|
|
|
546
434
|
```bash
|
|
547
|
-
# Add a relationship
|
|
548
|
-
dr relationship add business-process-
|
|
549
|
-
|
|
550
|
-
# List relationships
|
|
551
|
-
dr relationship list business-process-1
|
|
435
|
+
# Add a relationship between business processes
|
|
436
|
+
dr relationship add business-process-order business-process-payment \
|
|
437
|
+
--predicate triggers
|
|
552
438
|
|
|
553
|
-
#
|
|
554
|
-
dr relationship list business-process-
|
|
439
|
+
# List all relationships for an element
|
|
440
|
+
dr relationship list business-process-order
|
|
555
441
|
|
|
556
442
|
# Delete a relationship
|
|
557
|
-
dr relationship delete business-process-
|
|
443
|
+
dr relationship delete business-process-order business-process-payment
|
|
558
444
|
```
|
|
559
445
|
|
|
560
|
-
|
|
446
|
+
### Staging Workflow
|
|
447
|
+
|
|
448
|
+
The staging feature allows you to safely prepare and review changes before committing them to the base model:
|
|
561
449
|
|
|
562
450
|
```bash
|
|
563
|
-
#
|
|
564
|
-
dr
|
|
565
|
-
|
|
566
|
-
|
|
451
|
+
# Create a changeset for your changes
|
|
452
|
+
dr changeset create user-mgmt-v2 \
|
|
453
|
+
--name "User Management v2" \
|
|
454
|
+
--description "Redesign user management system"
|
|
567
455
|
|
|
568
|
-
#
|
|
569
|
-
dr
|
|
570
|
-
dr visualize --port 3000 --no-browser
|
|
571
|
-
```
|
|
456
|
+
# Activate the changeset to track changes
|
|
457
|
+
dr changeset activate user-mgmt-v2
|
|
572
458
|
|
|
573
|
-
|
|
459
|
+
# Now make your changes - they will be tracked automatically
|
|
460
|
+
dr add api endpoint create-user \
|
|
461
|
+
--properties '{"method":"POST","path":"/users"}'
|
|
574
462
|
|
|
575
|
-
|
|
463
|
+
dr add data-model entity user \
|
|
464
|
+
--name "User Entity"
|
|
576
465
|
|
|
577
|
-
|
|
466
|
+
# Preview how staged changes will merge with the base model
|
|
467
|
+
dr changeset preview
|
|
578
468
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
2. Follow installation instructions for your platform
|
|
582
|
-
3. Authenticate with your Anthropic account
|
|
469
|
+
# View changeset details
|
|
470
|
+
dr changeset show
|
|
583
471
|
|
|
584
|
-
|
|
472
|
+
# Commit when satisfied (checks for drift and validates changes)
|
|
473
|
+
dr changeset commit
|
|
585
474
|
|
|
586
|
-
|
|
587
|
-
dr
|
|
475
|
+
# Or discard if you change your mind
|
|
476
|
+
dr changeset discard
|
|
588
477
|
```
|
|
589
478
|
|
|
590
|
-
|
|
591
|
-
- Launches an interactive conversation loop
|
|
592
|
-
- Uses Claude Code CLI with restricted tools (Bash, Read)
|
|
593
|
-
- Provides context about your model (manifest, layer statistics)
|
|
594
|
-
- Streams responses in real-time
|
|
595
|
-
- Exit with "exit", "quit", or "q"
|
|
479
|
+
**Key Features:**
|
|
596
480
|
|
|
597
|
-
**
|
|
481
|
+
- **Activate for tracking**: Activate a changeset to automatically track all changes
|
|
482
|
+
- **Virtual preview**: See merged view before committing
|
|
483
|
+
- **Drift detection**: Alerts if base model changed since changeset creation
|
|
484
|
+
- **Export/Import**: Share changesets across team or save for backup
|
|
598
485
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
**WebSocket Chat** (via `dr visualize`):
|
|
617
|
-
|
|
618
|
-
The visualization server provides WebSocket-based chat using JSON-RPC 2.0:
|
|
619
|
-
|
|
620
|
-
**Request** (send message):
|
|
621
|
-
```json
|
|
622
|
-
{
|
|
623
|
-
"jsonrpc": "2.0",
|
|
624
|
-
"method": "chat.send",
|
|
625
|
-
"params": {
|
|
626
|
-
"message": "What layers are in this model?"
|
|
627
|
-
},
|
|
628
|
-
"id": 1
|
|
629
|
-
}
|
|
630
|
-
```
|
|
631
|
-
|
|
632
|
-
**Notifications** (streaming response):
|
|
633
|
-
|
|
634
|
-
Text content chunk:
|
|
635
|
-
```json
|
|
636
|
-
{
|
|
637
|
-
"jsonrpc": "2.0",
|
|
638
|
-
"method": "chat.response.chunk",
|
|
639
|
-
"params": {
|
|
640
|
-
"conversation_id": "conv-1-12345",
|
|
641
|
-
"content": "This model has 12 layers...",
|
|
642
|
-
"is_final": false,
|
|
643
|
-
"timestamp": "2025-01-02T12:00:00.000Z"
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
```
|
|
647
|
-
|
|
648
|
-
Tool invocation notification:
|
|
649
|
-
```json
|
|
650
|
-
{
|
|
651
|
-
"jsonrpc": "2.0",
|
|
652
|
-
"method": "chat.tool.invoke",
|
|
653
|
-
"params": {
|
|
654
|
-
"conversation_id": "conv-1-12345",
|
|
655
|
-
"tool_name": "Bash",
|
|
656
|
-
"tool_input": { "command": "dr list api" },
|
|
657
|
-
"timestamp": "2025-01-02T12:00:00.000Z"
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
```
|
|
661
|
-
|
|
662
|
-
Tool result notification:
|
|
663
|
-
```json
|
|
664
|
-
{
|
|
665
|
-
"jsonrpc": "2.0",
|
|
666
|
-
"method": "chat.tool.result",
|
|
667
|
-
"params": {
|
|
668
|
-
"conversation_id": "conv-1-12345",
|
|
669
|
-
"result": "output from tool execution",
|
|
670
|
-
"timestamp": "2025-01-02T12:00:00.000Z"
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
```
|
|
674
|
-
|
|
675
|
-
**Completion response**:
|
|
676
|
-
```json
|
|
677
|
-
{
|
|
678
|
-
"jsonrpc": "2.0",
|
|
679
|
-
"result": {
|
|
680
|
-
"conversation_id": "conv-1-12345",
|
|
681
|
-
"status": "complete",
|
|
682
|
-
"exit_code": 0,
|
|
683
|
-
"full_response": "Complete response text...",
|
|
684
|
-
"timestamp": "2025-01-02T12:00:00.000Z"
|
|
685
|
-
},
|
|
686
|
-
"id": 1
|
|
687
|
-
}
|
|
688
|
-
```
|
|
689
|
-
|
|
690
|
-
**Error response**:
|
|
691
|
-
```json
|
|
692
|
-
{
|
|
693
|
-
"jsonrpc": "2.0",
|
|
694
|
-
"error": {
|
|
695
|
-
"code": -32001,
|
|
696
|
-
"message": "Claude Code CLI not available"
|
|
697
|
-
},
|
|
698
|
-
"id": 1
|
|
699
|
-
}
|
|
700
|
-
```
|
|
701
|
-
|
|
702
|
-
**Error Codes**:
|
|
703
|
-
- `-32001`: Claude Code CLI not available (install Claude Code)
|
|
704
|
-
- `-32002`: Invalid parameters
|
|
705
|
-
- `-32603`: Internal error (process failure, timeout)
|
|
706
|
-
|
|
707
|
-
#### Manage Changesets
|
|
486
|
+
**Changeset Status:**
|
|
487
|
+
|
|
488
|
+
- `staged`: Changes are prepared but not applied (default)
|
|
489
|
+
- `committed`: Changes have been applied to base model
|
|
490
|
+
- `discarded`: Changes were abandoned
|
|
491
|
+
|
|
492
|
+
For comprehensive guide, see [STAGING_GUIDE.md](../../docs/STAGING_GUIDE.md).
|
|
493
|
+
|
|
494
|
+
### Tracking Changes
|
|
495
|
+
|
|
496
|
+
> ⚠️ **IMPORTANT**: Changesets must be **ACTIVATED** to track changes.
|
|
497
|
+
>
|
|
498
|
+
> After creating a changeset:
|
|
499
|
+
>
|
|
500
|
+
> 1. `dr changeset create "my-changes"`
|
|
501
|
+
> 2. `dr changeset activate "my-changes"` ← **DON'T FORGET THIS**
|
|
502
|
+
> 3. Make your changes (add/update/delete)
|
|
708
503
|
|
|
709
504
|
```bash
|
|
710
505
|
# Create a changeset
|
|
711
|
-
dr changeset create "
|
|
506
|
+
dr changeset create "v2.0 API migration" \
|
|
507
|
+
--description "Update to new API structure"
|
|
508
|
+
|
|
509
|
+
# Activate the changeset to track changes
|
|
510
|
+
dr changeset activate "v2.0 API migration"
|
|
511
|
+
|
|
512
|
+
# Now make your changes - they will be tracked
|
|
513
|
+
dr update api-endpoint-users --name "Users API v2"
|
|
514
|
+
dr add api endpoint users-list
|
|
712
515
|
|
|
713
516
|
# List changesets
|
|
714
517
|
dr changeset list
|
|
715
518
|
|
|
519
|
+
# Review changes
|
|
520
|
+
dr changeset show "v2.0 API migration"
|
|
521
|
+
|
|
716
522
|
# Apply a changeset
|
|
717
|
-
dr changeset apply "
|
|
523
|
+
dr changeset apply "v2.0 API migration"
|
|
718
524
|
|
|
719
|
-
# Revert
|
|
720
|
-
dr changeset revert "
|
|
525
|
+
# Revert if needed
|
|
526
|
+
dr changeset revert "v2.0 API migration"
|
|
527
|
+
|
|
528
|
+
# Deactivate when done
|
|
529
|
+
dr changeset deactivate
|
|
721
530
|
```
|
|
722
531
|
|
|
723
|
-
##
|
|
532
|
+
## Getting Help
|
|
533
|
+
|
|
534
|
+
### Command-Line Help
|
|
724
535
|
|
|
725
|
-
|
|
536
|
+
Every command includes detailed help:
|
|
726
537
|
|
|
727
|
-
|
|
538
|
+
```bash
|
|
539
|
+
dr --help # Show all commands
|
|
540
|
+
dr <command> --help # Command-specific help
|
|
541
|
+
dr add --help # Show element add help
|
|
542
|
+
dr relationship --help # Relationship commands
|
|
543
|
+
```
|
|
728
544
|
|
|
729
|
-
|
|
730
|
-
- Array properties with add/get operations
|
|
731
|
-
- References to other elements (cross-layer)
|
|
732
|
-
- Relationships with other elements (intra-layer)
|
|
545
|
+
### Documentation
|
|
733
546
|
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
type: "Goal",
|
|
738
|
-
name: "Test Goal",
|
|
739
|
-
description: "A test goal",
|
|
740
|
-
properties: { priority: "high" },
|
|
741
|
-
});
|
|
547
|
+
- 📚 [Full Specification](https://github.com/tinkermonkey/documentation_robotics/tree/main/spec) - The 12-layer model in detail
|
|
548
|
+
- 🛠️ [Contributing Guide](./CONTRIBUTING.md) - For developers working on the CLI
|
|
549
|
+
- 📦 [npm Package](https://www.npmjs.com/package/@documentation-robotics/cli)
|
|
742
550
|
|
|
743
|
-
|
|
744
|
-
element.addToArrayProperty("tags", "important");
|
|
745
|
-
```
|
|
551
|
+
### Community
|
|
746
552
|
|
|
747
|
-
|
|
553
|
+
- 🐛 [Report Issues](https://github.com/tinkermonkey/documentation_robotics/issues)
|
|
554
|
+
- 💬 [Discussions](https://github.com/tinkermonkey/documentation_robotics/discussions)
|
|
555
|
+
- 🌟 [GitHub Repository](https://github.com/tinkermonkey/documentation_robotics)
|
|
748
556
|
|
|
749
|
-
|
|
557
|
+
## Utilities
|
|
750
558
|
|
|
751
|
-
|
|
752
|
-
- Dirty tracking (unsaved changes)
|
|
753
|
-
- JSON serialization/deserialization
|
|
559
|
+
### Export Python Annotations
|
|
754
560
|
|
|
755
|
-
|
|
756
|
-
const layer = new Layer("motivation");
|
|
757
|
-
layer.addElement(element);
|
|
561
|
+
For migrating Python CLI annotation metadata, a utility script is available:
|
|
758
562
|
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
layer.markClean();
|
|
762
|
-
}
|
|
563
|
+
```bash
|
|
564
|
+
bun run src/utils/export-python-annotations.ts
|
|
763
565
|
```
|
|
764
566
|
|
|
765
|
-
|
|
567
|
+
This utility exports Python CLI annotations to a processable format, used during migrations between CLI versions.
|
|
766
568
|
|
|
767
|
-
|
|
569
|
+
## Relationship Audit
|
|
768
570
|
|
|
769
|
-
|
|
770
|
-
- JSON serialization/deserialization
|
|
771
|
-
- Version tracking
|
|
571
|
+
The relationship audit system provides comprehensive analysis of intra-layer relationships:
|
|
772
572
|
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
specVersion: "0.6.0",
|
|
779
|
-
});
|
|
573
|
+
- **Coverage Analysis**: Measures isolation, density, and predicate utilization
|
|
574
|
+
- **Duplicate Detection**: Identifies semantic overlaps using predicate semantics
|
|
575
|
+
- **Gap Analysis**: Detects missing relationships based on layer standards
|
|
576
|
+
- **Balance Assessment**: Evaluates relationship density against node type targets
|
|
577
|
+
- **AI Assistance**: Optional Claude Code CLI integration for recommendations
|
|
780
578
|
|
|
781
|
-
|
|
782
|
-
const deserialized = Manifest.fromJSON(json);
|
|
783
|
-
```
|
|
579
|
+
See CLAUDE.md for detailed usage instructions.
|
|
784
580
|
|
|
785
|
-
|
|
581
|
+
## Validation
|
|
786
582
|
|
|
787
|
-
|
|
583
|
+
### Local Validation
|
|
788
584
|
|
|
789
|
-
-
|
|
790
|
-
- Manifest management
|
|
791
|
-
- Atomic persistence to `.dr/` directory structure
|
|
585
|
+
Since pre-commit hooks for validation were removed in favor of CI-based validation, developers who want local feedback before committing can use the following commands to validate their changes:
|
|
792
586
|
|
|
793
|
-
|
|
794
|
-
// Initialize a new model
|
|
795
|
-
const model = await Model.init(".", {
|
|
796
|
-
name: "My Model",
|
|
797
|
-
version: "1.0.0",
|
|
798
|
-
});
|
|
587
|
+
#### Validate Model Conformance
|
|
799
588
|
|
|
800
|
-
|
|
801
|
-
const loaded = await Model.load(".");
|
|
589
|
+
Validate your architecture model against the layer specifications:
|
|
802
590
|
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
```
|
|
591
|
+
```bash
|
|
592
|
+
# Validate entire model
|
|
593
|
+
dr conformance
|
|
807
594
|
|
|
808
|
-
|
|
595
|
+
# Validate specific layers
|
|
596
|
+
dr conformance --layers motivation,business,api
|
|
809
597
|
|
|
810
|
-
|
|
598
|
+
# Check model statistics and summary
|
|
599
|
+
dr info
|
|
600
|
+
```
|
|
811
601
|
|
|
812
|
-
|
|
813
|
-
- Reference validation and integrity checking
|
|
814
|
-
- Impact analysis (find all references to/from an element)
|
|
815
|
-
- Statistics on reference usage
|
|
602
|
+
#### Validate Specifications (During Development)
|
|
816
603
|
|
|
817
|
-
|
|
818
|
-
const refRegistry = new ReferenceRegistry();
|
|
604
|
+
If you're developing locally and modifying the specification files:
|
|
819
605
|
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
type: "realizes",
|
|
824
|
-
});
|
|
606
|
+
```bash
|
|
607
|
+
# Validate spec schemas are correct
|
|
608
|
+
dr validate --schemas
|
|
825
609
|
|
|
826
|
-
|
|
827
|
-
|
|
610
|
+
# List schema information for debugging
|
|
611
|
+
dr schema layers # List all layers
|
|
612
|
+
dr schema types <layer> # List valid types for a layer
|
|
613
|
+
dr schema node <id> # Show node schema details
|
|
828
614
|
```
|
|
829
615
|
|
|
830
|
-
|
|
616
|
+
#### Schema Synchronization
|
|
831
617
|
|
|
832
|
-
|
|
618
|
+
After modifying specification files in `spec/`, ensure the CLI has the latest schemas:
|
|
833
619
|
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
- Layer-specific relationship rules
|
|
838
|
-
|
|
839
|
-
```typescript
|
|
840
|
-
const relRegistry = new RelationshipRegistry();
|
|
841
|
-
|
|
842
|
-
relRegistry.registerType({
|
|
843
|
-
id: "depends-on",
|
|
844
|
-
predicate: "depends-on",
|
|
845
|
-
category: "dependency",
|
|
846
|
-
});
|
|
620
|
+
```bash
|
|
621
|
+
# Sync spec schemas to CLI bundled schemas
|
|
622
|
+
npm run sync-schemas
|
|
847
623
|
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
target: "02-process-validate-order",
|
|
851
|
-
predicate: "depends-on",
|
|
852
|
-
});
|
|
624
|
+
# Build CLI with updated schemas
|
|
625
|
+
npm run build
|
|
853
626
|
```
|
|
854
627
|
|
|
855
|
-
|
|
628
|
+
These commands provide immediate feedback during development, allowing you to catch validation errors locally before pushing to CI.
|
|
856
629
|
|
|
857
|
-
|
|
630
|
+
## Troubleshooting
|
|
858
631
|
|
|
859
|
-
|
|
860
|
-
import { ensureDir, writeFile, readFile, writeJSON, readJSON, atomicWrite } from "@/utils/file-io";
|
|
632
|
+
### "dr: command not found"
|
|
861
633
|
|
|
862
|
-
|
|
863
|
-
|
|
634
|
+
```bash
|
|
635
|
+
# Check if npm global bin is in PATH
|
|
636
|
+
npm config get prefix
|
|
864
637
|
|
|
865
|
-
|
|
866
|
-
|
|
638
|
+
# Add to PATH (macOS/Linux)
|
|
639
|
+
export PATH="$(npm config get prefix)/bin:$PATH"
|
|
867
640
|
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
641
|
+
# Make permanent (add to ~/.bashrc or ~/.zshrc)
|
|
642
|
+
echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.bashrc
|
|
643
|
+
source ~/.bashrc
|
|
871
644
|
```
|
|
872
645
|
|
|
873
|
-
|
|
646
|
+
### Module or Build Errors
|
|
874
647
|
|
|
875
|
-
|
|
648
|
+
```bash
|
|
649
|
+
# Clear and reinstall
|
|
650
|
+
rm -rf node_modules package-lock.json
|
|
651
|
+
npm install
|
|
652
|
+
```
|
|
876
653
|
|
|
877
|
-
|
|
878
|
-
- `LayerData` - Layer serialization format
|
|
879
|
-
- `ManifestData` - Manifest metadata
|
|
880
|
-
- `Reference` - Cross-layer references
|
|
881
|
-
- `Relationship` - Intra-layer relationships
|
|
882
|
-
- `ModelOptions` - Model configuration
|
|
654
|
+
### Chat Not Working
|
|
883
655
|
|
|
884
|
-
|
|
656
|
+
Ensure at least one AI CLI tool is installed and authenticated:
|
|
885
657
|
|
|
886
|
-
|
|
658
|
+
#### For Claude Code
|
|
887
659
|
|
|
888
660
|
```bash
|
|
889
|
-
#
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
# Run specific test file
|
|
893
|
-
bun test tests/unit/core/element.test.ts
|
|
894
|
-
|
|
895
|
-
# With coverage
|
|
896
|
-
bun test --coverage
|
|
661
|
+
# Check installation
|
|
662
|
+
which claude
|
|
897
663
|
|
|
898
|
-
#
|
|
899
|
-
|
|
664
|
+
# Verify authentication
|
|
665
|
+
claude --version
|
|
900
666
|
```
|
|
901
667
|
|
|
902
|
-
|
|
668
|
+
If not installed, visit https://claude.ai/download
|
|
903
669
|
|
|
904
|
-
|
|
670
|
+
#### For GitHub Copilot
|
|
905
671
|
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
672
|
+
```bash
|
|
673
|
+
# Check installation
|
|
674
|
+
gh copilot --version
|
|
909
675
|
|
|
910
|
-
|
|
676
|
+
# Or check for standalone copilot
|
|
677
|
+
which copilot
|
|
911
678
|
|
|
912
|
-
|
|
679
|
+
# Authenticate GitHub CLI
|
|
680
|
+
gh auth login
|
|
681
|
+
```
|
|
913
682
|
|
|
914
|
-
|
|
915
|
-
- **Linting**: Biome configured for code quality checks
|
|
916
|
-
- **Formatting**: Code formatted to project standards
|
|
683
|
+
If not installed, see instructions above in the "AI Chat Setup" section.
|
|
917
684
|
|
|
918
|
-
##
|
|
685
|
+
## What's Next?
|
|
919
686
|
|
|
920
|
-
-
|
|
921
|
-
-
|
|
922
|
-
-
|
|
687
|
+
- ⭐ **Star the project** on [GitHub](https://github.com/tinkermonkey/documentation_robotics)
|
|
688
|
+
- 📖 **Read the spec** to understand the 12-layer model
|
|
689
|
+
- 🎨 **Try visualization** with `dr visualize`
|
|
690
|
+
- 🤖 **Chat with AI** about your architecture (Claude Code or GitHub Copilot)
|
|
691
|
+
- 🚀 **Export to standards** (ArchiMate, OpenAPI)
|
|
923
692
|
|
|
924
693
|
## License
|
|
925
694
|
|
|
926
|
-
MIT
|
|
695
|
+
MIT © Documentation Robotics Contributors
|
|
696
|
+
|
|
697
|
+
---
|
|
698
|
+
|
|
699
|
+
**Made with ❤️ by the Documentation Robotics community**
|