musubi-sdd 5.0.0 → 5.6.1

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 (232) hide show
  1. package/README.ja.md +106 -48
  2. package/README.md +110 -32
  3. package/bin/musubi-analyze.js +74 -67
  4. package/bin/musubi-browser.js +27 -26
  5. package/bin/musubi-change.js +48 -47
  6. package/bin/musubi-checkpoint.js +10 -7
  7. package/bin/musubi-convert.js +25 -25
  8. package/bin/musubi-costs.js +27 -10
  9. package/bin/musubi-gui.js +52 -46
  10. package/bin/musubi-init.js +1952 -10
  11. package/bin/musubi-orchestrate.js +327 -239
  12. package/bin/musubi-remember.js +69 -56
  13. package/bin/musubi-resolve.js +53 -45
  14. package/bin/musubi-trace.js +51 -22
  15. package/bin/musubi-validate.js +39 -30
  16. package/bin/musubi-workflow.js +33 -34
  17. package/bin/musubi.js +39 -2
  18. package/package.json +1 -1
  19. package/src/agents/agent-loop.js +94 -95
  20. package/src/agents/agentic/code-generator.js +119 -109
  21. package/src/agents/agentic/code-reviewer.js +105 -108
  22. package/src/agents/agentic/index.js +4 -4
  23. package/src/agents/browser/action-executor.js +13 -13
  24. package/src/agents/browser/ai-comparator.js +11 -10
  25. package/src/agents/browser/context-manager.js +6 -6
  26. package/src/agents/browser/index.js +5 -5
  27. package/src/agents/browser/nl-parser.js +31 -46
  28. package/src/agents/browser/screenshot.js +2 -2
  29. package/src/agents/browser/test-generator.js +6 -4
  30. package/src/agents/function-tool.js +71 -65
  31. package/src/agents/index.js +7 -7
  32. package/src/agents/schema-generator.js +98 -94
  33. package/src/analyzers/ast-extractor.js +164 -145
  34. package/src/analyzers/codegraph-auto-update.js +858 -0
  35. package/src/analyzers/complexity-analyzer.js +536 -0
  36. package/src/analyzers/context-optimizer.js +247 -125
  37. package/src/analyzers/impact-analyzer.js +1 -1
  38. package/src/analyzers/large-project-analyzer.js +766 -0
  39. package/src/analyzers/repository-map.js +83 -80
  40. package/src/analyzers/security-analyzer.js +19 -11
  41. package/src/analyzers/stuck-detector.js +19 -17
  42. package/src/converters/index.js +78 -57
  43. package/src/converters/ir/types.js +12 -12
  44. package/src/converters/parsers/musubi-parser.js +134 -126
  45. package/src/converters/parsers/openapi-parser.js +70 -53
  46. package/src/converters/parsers/speckit-parser.js +239 -175
  47. package/src/converters/writers/musubi-writer.js +123 -118
  48. package/src/converters/writers/speckit-writer.js +124 -113
  49. package/src/generators/rust-migration-generator.js +512 -0
  50. package/src/gui/public/index.html +1365 -1211
  51. package/src/gui/server.js +41 -40
  52. package/src/gui/services/file-watcher.js +23 -8
  53. package/src/gui/services/project-scanner.js +26 -20
  54. package/src/gui/services/replanning-service.js +27 -23
  55. package/src/gui/services/traceability-service.js +8 -8
  56. package/src/gui/services/workflow-service.js +14 -7
  57. package/src/index.js +151 -0
  58. package/src/integrations/cicd.js +90 -104
  59. package/src/integrations/codegraph-mcp.js +643 -0
  60. package/src/integrations/documentation.js +142 -103
  61. package/src/integrations/examples.js +95 -80
  62. package/src/integrations/github-client.js +17 -17
  63. package/src/integrations/index.js +5 -5
  64. package/src/integrations/mcp/index.js +21 -21
  65. package/src/integrations/mcp/mcp-context-provider.js +76 -78
  66. package/src/integrations/mcp/mcp-discovery.js +74 -72
  67. package/src/integrations/mcp/mcp-tool-registry.js +99 -94
  68. package/src/integrations/mcp-connector.js +70 -66
  69. package/src/integrations/platforms.js +50 -49
  70. package/src/integrations/tool-discovery.js +37 -31
  71. package/src/llm-providers/anthropic-provider.js +11 -11
  72. package/src/llm-providers/base-provider.js +16 -18
  73. package/src/llm-providers/copilot-provider.js +22 -19
  74. package/src/llm-providers/index.js +26 -25
  75. package/src/llm-providers/ollama-provider.js +11 -11
  76. package/src/llm-providers/openai-provider.js +12 -12
  77. package/src/managers/agent-memory.js +36 -24
  78. package/src/managers/checkpoint-manager.js +4 -8
  79. package/src/managers/delta-spec.js +19 -19
  80. package/src/managers/index.js +13 -4
  81. package/src/managers/memory-condenser.js +35 -45
  82. package/src/managers/repo-skill-manager.js +57 -31
  83. package/src/managers/skill-loader.js +25 -22
  84. package/src/managers/skill-tools.js +36 -72
  85. package/src/managers/workflow.js +30 -22
  86. package/src/monitoring/cost-tracker.js +53 -44
  87. package/src/monitoring/incident-manager.js +123 -103
  88. package/src/monitoring/index.js +144 -134
  89. package/src/monitoring/observability.js +82 -59
  90. package/src/monitoring/quality-dashboard.js +51 -39
  91. package/src/monitoring/release-manager.js +70 -50
  92. package/src/orchestration/agent-skill-binding.js +39 -47
  93. package/src/orchestration/error-handler.js +65 -107
  94. package/src/orchestration/guardrails/base-guardrail.js +26 -24
  95. package/src/orchestration/guardrails/guardrail-rules.js +50 -64
  96. package/src/orchestration/guardrails/index.js +5 -5
  97. package/src/orchestration/guardrails/input-guardrail.js +58 -45
  98. package/src/orchestration/guardrails/output-guardrail.js +104 -81
  99. package/src/orchestration/guardrails/safety-check.js +79 -79
  100. package/src/orchestration/index.js +38 -55
  101. package/src/orchestration/mcp-tool-adapters.js +96 -99
  102. package/src/orchestration/orchestration-engine.js +21 -21
  103. package/src/orchestration/pattern-registry.js +60 -45
  104. package/src/orchestration/patterns/auto.js +34 -47
  105. package/src/orchestration/patterns/group-chat.js +59 -65
  106. package/src/orchestration/patterns/handoff.js +67 -65
  107. package/src/orchestration/patterns/human-in-loop.js +51 -72
  108. package/src/orchestration/patterns/nested.js +25 -40
  109. package/src/orchestration/patterns/sequential.js +35 -34
  110. package/src/orchestration/patterns/swarm.js +63 -56
  111. package/src/orchestration/patterns/triage.js +150 -109
  112. package/src/orchestration/reasoning/index.js +9 -9
  113. package/src/orchestration/reasoning/planning-engine.js +143 -140
  114. package/src/orchestration/reasoning/reasoning-engine.js +206 -144
  115. package/src/orchestration/reasoning/self-correction.js +121 -128
  116. package/src/orchestration/replanning/adaptive-goal-modifier.js +107 -112
  117. package/src/orchestration/replanning/alternative-generator.js +37 -42
  118. package/src/orchestration/replanning/config.js +63 -59
  119. package/src/orchestration/replanning/goal-progress-tracker.js +98 -100
  120. package/src/orchestration/replanning/index.js +24 -20
  121. package/src/orchestration/replanning/plan-evaluator.js +49 -50
  122. package/src/orchestration/replanning/plan-monitor.js +32 -28
  123. package/src/orchestration/replanning/proactive-path-optimizer.js +175 -178
  124. package/src/orchestration/replanning/replan-history.js +33 -26
  125. package/src/orchestration/replanning/replanning-engine.js +106 -108
  126. package/src/orchestration/skill-executor.js +107 -109
  127. package/src/orchestration/skill-registry.js +85 -89
  128. package/src/orchestration/workflow-examples.js +228 -231
  129. package/src/orchestration/workflow-executor.js +65 -68
  130. package/src/orchestration/workflow-orchestrator.js +72 -73
  131. package/src/phase4-integration.js +47 -40
  132. package/src/phase5-integration.js +89 -30
  133. package/src/reporters/coverage-report.js +82 -30
  134. package/src/reporters/hierarchical-reporter.js +498 -0
  135. package/src/reporters/traceability-matrix-report.js +29 -20
  136. package/src/resolvers/issue-resolver.js +43 -31
  137. package/src/steering/advanced-validation.js +133 -124
  138. package/src/steering/auto-updater.js +60 -73
  139. package/src/steering/index.js +6 -6
  140. package/src/steering/quality-metrics.js +41 -35
  141. package/src/steering/steering-auto-update.js +83 -86
  142. package/src/steering/steering-validator.js +98 -106
  143. package/src/steering/template-constraints.js +53 -54
  144. package/src/templates/agents/claude-code/CLAUDE.md +32 -32
  145. package/src/templates/agents/claude-code/skills/agent-assistant/SKILL.md +13 -5
  146. package/src/templates/agents/claude-code/skills/ai-ml-engineer/mlops-guide.md +23 -23
  147. package/src/templates/agents/claude-code/skills/ai-ml-engineer/model-card-template.md +60 -41
  148. package/src/templates/agents/claude-code/skills/api-designer/api-patterns.md +27 -19
  149. package/src/templates/agents/claude-code/skills/api-designer/openapi-template.md +11 -7
  150. package/src/templates/agents/claude-code/skills/bug-hunter/SKILL.md +4 -3
  151. package/src/templates/agents/claude-code/skills/bug-hunter/root-cause-analysis.md +37 -15
  152. package/src/templates/agents/claude-code/skills/change-impact-analyzer/dependency-graph-patterns.md +36 -42
  153. package/src/templates/agents/claude-code/skills/change-impact-analyzer/impact-analysis-template.md +69 -60
  154. package/src/templates/agents/claude-code/skills/cloud-architect/aws-patterns.md +31 -38
  155. package/src/templates/agents/claude-code/skills/cloud-architect/azure-patterns.md +28 -23
  156. package/src/templates/agents/claude-code/skills/code-reviewer/SKILL.md +61 -0
  157. package/src/templates/agents/claude-code/skills/code-reviewer/best-practices.md +27 -0
  158. package/src/templates/agents/claude-code/skills/code-reviewer/review-checklist.md +29 -10
  159. package/src/templates/agents/claude-code/skills/code-reviewer/review-standards.md +29 -24
  160. package/src/templates/agents/claude-code/skills/constitution-enforcer/SKILL.md +8 -6
  161. package/src/templates/agents/claude-code/skills/constitution-enforcer/constitutional-articles.md +62 -26
  162. package/src/templates/agents/claude-code/skills/constitution-enforcer/phase-minus-one-gates.md +35 -16
  163. package/src/templates/agents/claude-code/skills/database-administrator/backup-recovery.md +27 -17
  164. package/src/templates/agents/claude-code/skills/database-administrator/tuning-guide.md +25 -20
  165. package/src/templates/agents/claude-code/skills/database-schema-designer/schema-patterns.md +39 -22
  166. package/src/templates/agents/claude-code/skills/devops-engineer/ci-cd-templates.md +25 -22
  167. package/src/templates/agents/claude-code/skills/issue-resolver/SKILL.md +24 -21
  168. package/src/templates/agents/claude-code/skills/orchestrator/SKILL.md +148 -63
  169. package/src/templates/agents/claude-code/skills/orchestrator/patterns.md +35 -16
  170. package/src/templates/agents/claude-code/skills/orchestrator/selection-matrix.md +69 -64
  171. package/src/templates/agents/claude-code/skills/performance-engineer/optimization-playbook.md +47 -47
  172. package/src/templates/agents/claude-code/skills/performance-optimizer/SKILL.md +69 -0
  173. package/src/templates/agents/claude-code/skills/performance-optimizer/benchmark-template.md +63 -45
  174. package/src/templates/agents/claude-code/skills/performance-optimizer/optimization-patterns.md +33 -35
  175. package/src/templates/agents/claude-code/skills/project-manager/SKILL.md +7 -6
  176. package/src/templates/agents/claude-code/skills/project-manager/agile-ceremonies.md +47 -28
  177. package/src/templates/agents/claude-code/skills/project-manager/project-templates.md +94 -78
  178. package/src/templates/agents/claude-code/skills/quality-assurance/SKILL.md +20 -17
  179. package/src/templates/agents/claude-code/skills/quality-assurance/qa-plan-template.md +63 -49
  180. package/src/templates/agents/claude-code/skills/release-coordinator/SKILL.md +5 -5
  181. package/src/templates/agents/claude-code/skills/release-coordinator/feature-flag-guide.md +30 -26
  182. package/src/templates/agents/claude-code/skills/release-coordinator/release-plan-template.md +67 -35
  183. package/src/templates/agents/claude-code/skills/requirements-analyst/ears-format.md +54 -42
  184. package/src/templates/agents/claude-code/skills/requirements-analyst/validation-rules.md +36 -33
  185. package/src/templates/agents/claude-code/skills/security-auditor/SKILL.md +77 -19
  186. package/src/templates/agents/claude-code/skills/security-auditor/audit-checklists.md +24 -24
  187. package/src/templates/agents/claude-code/skills/security-auditor/owasp-top-10.md +61 -20
  188. package/src/templates/agents/claude-code/skills/security-auditor/vulnerability-patterns.md +43 -11
  189. package/src/templates/agents/claude-code/skills/site-reliability-engineer/SKILL.md +1 -0
  190. package/src/templates/agents/claude-code/skills/site-reliability-engineer/incident-response-template.md +55 -25
  191. package/src/templates/agents/claude-code/skills/site-reliability-engineer/observability-patterns.md +78 -68
  192. package/src/templates/agents/claude-code/skills/site-reliability-engineer/slo-sli-guide.md +73 -53
  193. package/src/templates/agents/claude-code/skills/software-developer/solid-principles.md +83 -37
  194. package/src/templates/agents/claude-code/skills/software-developer/test-first-workflow.md +38 -31
  195. package/src/templates/agents/claude-code/skills/steering/SKILL.md +1 -0
  196. package/src/templates/agents/claude-code/skills/steering/auto-update-rules.md +31 -0
  197. package/src/templates/agents/claude-code/skills/system-architect/adr-template.md +25 -7
  198. package/src/templates/agents/claude-code/skills/system-architect/c4-model-guide.md +74 -61
  199. package/src/templates/agents/claude-code/skills/technical-writer/doc-templates/documentation-templates.md +70 -52
  200. package/src/templates/agents/claude-code/skills/test-engineer/SKILL.md +2 -0
  201. package/src/templates/agents/claude-code/skills/test-engineer/ears-test-mapping.md +75 -71
  202. package/src/templates/agents/claude-code/skills/test-engineer/test-types.md +85 -63
  203. package/src/templates/agents/claude-code/skills/traceability-auditor/coverage-matrix-template.md +39 -36
  204. package/src/templates/agents/claude-code/skills/traceability-auditor/gap-detection-rules.md +22 -17
  205. package/src/templates/agents/claude-code/skills/ui-ux-designer/SKILL.md +1 -0
  206. package/src/templates/agents/claude-code/skills/ui-ux-designer/accessibility-guidelines.md +49 -75
  207. package/src/templates/agents/claude-code/skills/ui-ux-designer/design-system-components.md +71 -59
  208. package/src/templates/agents/codex/AGENTS.md +74 -42
  209. package/src/templates/agents/cursor/AGENTS.md +74 -42
  210. package/src/templates/agents/gemini-cli/GEMINI.md +74 -42
  211. package/src/templates/agents/github-copilot/AGENTS.md +83 -51
  212. package/src/templates/agents/qwen-code/QWEN.md +74 -42
  213. package/src/templates/agents/windsurf/AGENTS.md +74 -42
  214. package/src/templates/architectures/README.md +41 -0
  215. package/src/templates/architectures/clean-architecture/README.md +113 -0
  216. package/src/templates/architectures/event-driven/README.md +162 -0
  217. package/src/templates/architectures/hexagonal/README.md +130 -0
  218. package/src/templates/index.js +6 -1
  219. package/src/templates/locale-manager.js +16 -16
  220. package/src/templates/shared/delta-spec-template.md +20 -13
  221. package/src/templates/shared/github-actions/musubi-issue-resolver.yml +5 -5
  222. package/src/templates/shared/github-actions/musubi-security-check.yml +3 -3
  223. package/src/templates/shared/github-actions/musubi-validate.yml +4 -4
  224. package/src/templates/shared/steering/structure.md +95 -0
  225. package/src/templates/skills/browser-agent.md +21 -16
  226. package/src/templates/skills/web-gui.md +8 -0
  227. package/src/templates/template-constraints.js +50 -53
  228. package/src/validators/advanced-validation.js +30 -36
  229. package/src/validators/constitutional-validator.js +77 -73
  230. package/src/validators/critic-system.js +49 -59
  231. package/src/validators/delta-format.js +59 -55
  232. package/src/validators/traceability-validator.js +7 -11
@@ -96,32 +96,32 @@ The Orchestrator can leverage all MUSUBI CLI commands to execute tasks efficient
96
96
 
97
97
  ### Advanced Commands (v3.5.0 NEW)
98
98
 
99
- | Command | Purpose | Example |
100
- | ------------------- | --------------------------------- | ------------------------------------------ |
101
- | `musubi-orchestrate`| Multi-skill workflow orchestration| `musubi-orchestrate auto <task>` |
102
- | `musubi-browser` | Browser automation & E2E testing | `musubi-browser run "click login button"` |
103
- | `musubi-gui` | Web GUI dashboard | `musubi-gui start` |
104
- | `musubi-remember` | Agent memory management | `musubi-remember extract` |
105
- | `musubi-resolve` | GitHub Issue auto-resolution | `musubi-resolve <issue-number>` |
106
- | `musubi-convert` | Format conversion (Spec Kit) | `musubi-convert to-speckit` |
99
+ | Command | Purpose | Example |
100
+ | -------------------- | ---------------------------------- | ----------------------------------------- |
101
+ | `musubi-orchestrate` | Multi-skill workflow orchestration | `musubi-orchestrate auto <task>` |
102
+ | `musubi-browser` | Browser automation & E2E testing | `musubi-browser run "click login button"` |
103
+ | `musubi-gui` | Web GUI dashboard | `musubi-gui start` |
104
+ | `musubi-remember` | Agent memory management | `musubi-remember extract` |
105
+ | `musubi-resolve` | GitHub Issue auto-resolution | `musubi-resolve <issue-number>` |
106
+ | `musubi-convert` | Format conversion (Spec Kit) | `musubi-convert to-speckit` |
107
107
 
108
108
  ### Replanning Commands (v3.6.0 NEW)
109
109
 
110
- | Command | Purpose | Example |
111
- | ------------------------------ | ---------------------------- | ------------------------------------------------- |
112
- | `musubi-orchestrate replan` | Execute dynamic replanning | `musubi-orchestrate replan <context-id>` |
113
- | `musubi-orchestrate goal` | Goal management | `musubi-orchestrate goal register --name "Deploy"`|
114
- | `musubi-orchestrate optimize` | Path optimization | `musubi-orchestrate optimize run <path-id>` |
115
- | `musubi-orchestrate path` | Path analysis | `musubi-orchestrate path analyze <path-id>` |
110
+ | Command | Purpose | Example |
111
+ | ----------------------------- | -------------------------- | -------------------------------------------------- |
112
+ | `musubi-orchestrate replan` | Execute dynamic replanning | `musubi-orchestrate replan <context-id>` |
113
+ | `musubi-orchestrate goal` | Goal management | `musubi-orchestrate goal register --name "Deploy"` |
114
+ | `musubi-orchestrate optimize` | Path optimization | `musubi-orchestrate optimize run <path-id>` |
115
+ | `musubi-orchestrate path` | Path analysis | `musubi-orchestrate path analyze <path-id>` |
116
116
 
117
117
  ### Guardrails Commands (v3.9.0 NEW)
118
118
 
119
- | Command | Purpose | Example |
120
- | ------------------------------------------ | ------------------------------ | ----------------------------------------------------- |
121
- | `musubi-validate guardrails` | Input/Output validation | `musubi-validate guardrails --type input` |
122
- | `musubi-validate guardrails --type output` | Output content validation | `echo "content" \| musubi-validate guardrails --type output` |
123
- | `musubi-validate guardrails --type safety` | Safety check with constitutional| `musubi-validate guardrails --type safety --constitutional` |
124
- | `musubi-validate guardrails-chain` | Chain multiple guardrails | `musubi-validate guardrails-chain --parallel` |
119
+ | Command | Purpose | Example |
120
+ | ------------------------------------------ | -------------------------------- | ------------------------------------------------------------ |
121
+ | `musubi-validate guardrails` | Input/Output validation | `musubi-validate guardrails --type input` |
122
+ | `musubi-validate guardrails --type output` | Output content validation | `echo "content" \| musubi-validate guardrails --type output` |
123
+ | `musubi-validate guardrails --type safety` | Safety check with constitutional | `musubi-validate guardrails --type safety --constitutional` |
124
+ | `musubi-validate guardrails-chain` | Chain multiple guardrails | `musubi-validate guardrails-chain --parallel` |
125
125
 
126
126
  ### Detailed Command Options
127
127
 
@@ -265,20 +265,21 @@ Orchestrator can leverage advanced AI agent modules inspired by OpenHands:
265
265
 
266
266
  ### Available Modules
267
267
 
268
- | Module | Purpose | Use Case |
269
- |--------|---------|----------|
270
- | **StuckDetector** | Detect agent stuck states | When agent loops or doesn't progress |
271
- | **MemoryCondenser** | Compress session history | Long sessions exceeding context |
272
- | **AgentMemoryManager** | Extract & persist learnings | Session knowledge capture |
273
- | **CriticSystem** | Evaluate SDD stage quality | Quality gates before transitions |
274
- | **SecurityAnalyzer** | Detect security risks | Pre-commit/deployment checks |
275
- | **IssueResolver** | GitHub Issue analysis | Issue → SDD workflow |
276
- | **SkillLoader** | Load keyword-triggered skills | Dynamic skill activation |
277
- | **RepoSkillManager** | Manage .musubi/skills/ | Project-specific skills |
268
+ | Module | Purpose | Use Case |
269
+ | ---------------------- | ----------------------------- | ------------------------------------ |
270
+ | **StuckDetector** | Detect agent stuck states | When agent loops or doesn't progress |
271
+ | **MemoryCondenser** | Compress session history | Long sessions exceeding context |
272
+ | **AgentMemoryManager** | Extract & persist learnings | Session knowledge capture |
273
+ | **CriticSystem** | Evaluate SDD stage quality | Quality gates before transitions |
274
+ | **SecurityAnalyzer** | Detect security risks | Pre-commit/deployment checks |
275
+ | **IssueResolver** | GitHub Issue analysis | Issue → SDD workflow |
276
+ | **SkillLoader** | Load keyword-triggered skills | Dynamic skill activation |
277
+ | **RepoSkillManager** | Manage .musubi/skills/ | Project-specific skills |
278
278
 
279
279
  ### Module Integration Examples
280
280
 
281
281
  #### Stuck Detection
282
+
282
283
  ```javascript
283
284
  const { StuckDetector } = require('musubi/src/analyzers/stuck-detector');
284
285
  const detector = new StuckDetector();
@@ -291,6 +292,7 @@ if (analysis) {
291
292
  ```
292
293
 
293
294
  #### Quality Evaluation
295
+
294
296
  ```javascript
295
297
  const { CriticSystem } = require('musubi/src/validators/critic-system');
296
298
  const critic = new CriticSystem();
@@ -301,6 +303,7 @@ if (result.success) {
301
303
  ```
302
304
 
303
305
  #### Security Pre-check
306
+
304
307
  ```javascript
305
308
  const { SecurityAnalyzer } = require('musubi/src/analyzers/security-analyzer');
306
309
  const analyzer = new SecurityAnalyzer({ strictMode: true });
@@ -504,15 +507,97 @@ codegraph-mcp community "/path/to/project"
504
507
 
505
508
  ---
506
509
 
510
+ ## MUSUBI CodeGraphMCP Module (v5.5.0+)
511
+
512
+ **Available Module**: `src/integrations/codegraph-mcp.js`
513
+
514
+ The CodeGraphMCP module provides programmatic integration with CodeGraph MCP server.
515
+
516
+ ### Module Usage
517
+
518
+ ```javascript
519
+ const { CodeGraphMCP } = require('musubi-sdd');
520
+
521
+ const codegraph = new CodeGraphMCP({
522
+ mcpEndpoint: 'http://localhost:3000',
523
+ repoPath: '/path/to/project',
524
+ });
525
+
526
+ // Generate call graph
527
+ const callGraph = await codegraph.generateCallGraph('src/main.c', { depth: 3 });
528
+
529
+ // Analyze impact of changes
530
+ const impact = await codegraph.analyzeImpact('src/utils.c');
531
+
532
+ // Detect circular dependencies
533
+ const cycles = await codegraph.detectCircularDependencies('src/');
534
+
535
+ // Identify hotspots (highly-connected entities)
536
+ const hotspots = await codegraph.identifyHotspots(5);
537
+
538
+ // Detect code communities
539
+ const communities = await codegraph.detectCommunities();
540
+ ```
541
+
542
+ ### Features
543
+
544
+ | Feature | Description |
545
+ | ------------------------- | --------------------------------------------------------- |
546
+ | **Call Graph** | Track callers and callees with configurable depth |
547
+ | **Impact Analysis** | Identify affected files when code changes |
548
+ | **Circular Dependencies** | Find cycles in module dependencies |
549
+ | **Hotspots** | Detect highly-connected entities (refactoring candidates) |
550
+ | **Community Detection** | Group related code modules |
551
+
552
+ ---
553
+
554
+ ## MUSUBI HierarchicalReporter Module (v5.5.0+)
555
+
556
+ **Available Module**: `src/reporters/hierarchical-reporter.js`
557
+
558
+ The HierarchicalReporter module generates hierarchical analysis reports for large projects.
559
+
560
+ ### Module Usage
561
+
562
+ ```javascript
563
+ const { HierarchicalReporter } = require('musubi-sdd');
564
+
565
+ const reporter = new HierarchicalReporter();
566
+ const report = await reporter.generateReport('/path/to/project', {
567
+ format: 'markdown', // markdown, json, html
568
+ includeHotspots: true,
569
+ maxDepth: 5,
570
+ });
571
+
572
+ console.log(report.content);
573
+ ```
574
+
575
+ ### Output Formats
576
+
577
+ - **Markdown**: Human-readable hierarchical report
578
+ - **JSON**: Structured data for further processing
579
+ - **HTML**: Interactive report with navigation
580
+
581
+ ### Hotspot Analysis
582
+
583
+ The reporter identifies:
584
+
585
+ - Files with highest complexity
586
+ - Most frequently changed files
587
+ - Largest files by line count
588
+ - Files with most dependencies
589
+
590
+ ---
591
+
507
592
  ## Managed Agents Overview (25 Types)
508
593
 
509
594
  ### Orchestration & Governance (3 agents)
510
595
 
511
- | Agent | Specialty | Key Deliverables | CLI Command |
512
- | ------------------------- | ------------------------- | --------------------------------------- | --------------------- |
513
- | **Orchestrator** | Multi-agent coordination | Execution plans, integrated reports | `musubi-orchestrate` |
514
- | **Steering** | Project memory management | Steering files (structure/tech/product) | `musubi-remember` |
515
- | **Constitution Enforcer** | Constitutional validation | Compliance reports, violation alerts | `musubi-validate` |
596
+ | Agent | Specialty | Key Deliverables | CLI Command |
597
+ | ------------------------- | ------------------------- | --------------------------------------- | -------------------- |
598
+ | **Orchestrator** | Multi-agent coordination | Execution plans, integrated reports | `musubi-orchestrate` |
599
+ | **Steering** | Project memory management | Steering files (structure/tech/product) | `musubi-remember` |
600
+ | **Constitution Enforcer** | Constitutional validation | Compliance reports, violation alerts | `musubi-validate` |
516
601
 
517
602
  ### Design & Architecture (5 agents)
518
603
 
@@ -526,25 +611,25 @@ codegraph-mcp community "/path/to/project"
526
611
 
527
612
  ### Development & Quality (7 agents)
528
613
 
529
- | Agent | Specialty | Key Deliverables | CLI Command |
530
- | ------------------------- | ---------------------------- | ------------------------------------------------------------- | ------------------ |
531
- | **Software Developer** | Code implementation | Production-ready source code, unit tests, integration tests | - |
532
- | **Code Reviewer** | Code review | Review reports, improvement suggestions, refactoring plans | - |
533
- | **Test Engineer** | Test design & implementation | Test code, test design documents, test cases | `musubi-tasks` |
534
- | **Security Auditor** | Security auditing | Vulnerability reports, remediation plans, security guidelines | - |
535
- | **Quality Assurance** | Quality assurance strategy | Test plans, quality metrics, QA reports | `musubi-validate` |
536
- | **Bug Hunter** | Bug investigation & fixes | Bug reports, root cause analysis, fix code | `musubi-resolve` |
537
- | **Performance Optimizer** | Performance optimization | Performance reports, optimization code, benchmarks | - |
614
+ | Agent | Specialty | Key Deliverables | CLI Command |
615
+ | ------------------------- | ---------------------------- | ------------------------------------------------------------- | ----------------- |
616
+ | **Software Developer** | Code implementation | Production-ready source code, unit tests, integration tests | - |
617
+ | **Code Reviewer** | Code review | Review reports, improvement suggestions, refactoring plans | - |
618
+ | **Test Engineer** | Test design & implementation | Test code, test design documents, test cases | `musubi-tasks` |
619
+ | **Security Auditor** | Security auditing | Vulnerability reports, remediation plans, security guidelines | - |
620
+ | **Quality Assurance** | Quality assurance strategy | Test plans, quality metrics, QA reports | `musubi-validate` |
621
+ | **Bug Hunter** | Bug investigation & fixes | Bug reports, root cause analysis, fix code | `musubi-resolve` |
622
+ | **Performance Optimizer** | Performance optimization | Performance reports, optimization code, benchmarks | - |
538
623
 
539
624
  ### Operations & Infrastructure (5 agents)
540
625
 
541
- | Agent | Specialty | Key Deliverables | CLI Command |
542
- | ----------------------------- | --------------------------------- | ---------------------------------------------------- | ---------------- |
543
- | **Project Manager** | Project management | Project plans, WBS, Gantt charts, risk registers | `musubi-tasks` |
544
- | **DevOps Engineer** | CI/CD & infrastructure automation | Pipeline definitions, Dockerfiles, K8s manifests | - |
545
- | **Technical Writer** | Technical documentation | API docs, README, user guides, runbooks | - |
546
- | **Site Reliability Engineer** | SRE & observability | SLI/SLO/SLA definitions, monitoring configs | `musubi-gui` |
547
- | **Release Coordinator** | Release management | Release notes, deployment plans, rollback procedures | - |
626
+ | Agent | Specialty | Key Deliverables | CLI Command |
627
+ | ----------------------------- | --------------------------------- | ---------------------------------------------------- | -------------- |
628
+ | **Project Manager** | Project management | Project plans, WBS, Gantt charts, risk registers | `musubi-tasks` |
629
+ | **DevOps Engineer** | CI/CD & infrastructure automation | Pipeline definitions, Dockerfiles, K8s manifests | - |
630
+ | **Technical Writer** | Technical documentation | API docs, README, user guides, runbooks | - |
631
+ | **Site Reliability Engineer** | SRE & observability | SLI/SLO/SLA definitions, monitoring configs | `musubi-gui` |
632
+ | **Release Coordinator** | Release management | Release notes, deployment plans, rollback procedures | - |
548
633
 
549
634
  ### Specialized Experts (5 agents)
550
635
 
@@ -638,18 +723,18 @@ musubi-workflow next implementation
638
723
 
639
724
  ### 10ステージ ワークフロー
640
725
 
641
- | Stage | Name | Description | CLI Command |
642
- |-------|------|-------------|-------------|
643
- | 0 | Spike/PoC | 調査・プロトタイピング | `musubi-workflow next spike` |
644
- | 1 | Requirements | 要件定義 | `musubi-requirements` |
645
- | 2 | Design | 設計(C4 + ADR) | `musubi-design` |
646
- | 3 | Tasks | タスク分解 | `musubi-tasks` |
647
- | 4 | Implementation | 実装 | - |
648
- | 5 | Review | コードレビュー | `musubi-workflow next review` |
649
- | 6 | Testing | テスト | `musubi-validate` |
650
- | 7 | Deployment | デプロイ | - |
651
- | 8 | Monitoring | モニタリング | - |
652
- | 9 | Retrospective | 振り返り | `musubi-workflow complete` |
726
+ | Stage | Name | Description | CLI Command |
727
+ | ----- | -------------- | ---------------------- | ----------------------------- |
728
+ | 0 | Spike/PoC | 調査・プロトタイピング | `musubi-workflow next spike` |
729
+ | 1 | Requirements | 要件定義 | `musubi-requirements` |
730
+ | 2 | Design | 設計(C4 + ADR) | `musubi-design` |
731
+ | 3 | Tasks | タスク分解 | `musubi-tasks` |
732
+ | 4 | Implementation | 実装 | - |
733
+ | 5 | Review | コードレビュー | `musubi-workflow next review` |
734
+ | 6 | Testing | テスト | `musubi-validate` |
735
+ | 7 | Deployment | デプロイ | - |
736
+ | 8 | Monitoring | モニタリング | - |
737
+ | 9 | Retrospective | 振り返り | `musubi-workflow complete` |
653
738
 
654
739
  ### フィードバックループ
655
740
 
@@ -23,11 +23,13 @@ Consolidate Results
23
23
  ```
24
24
 
25
25
  **Use When**:
26
+
26
27
  - User request is complex or ambiguous
27
28
  - Multiple agents might be needed
28
29
  - Optimal agent selection is unclear
29
30
 
30
31
  **Example**:
32
+
31
33
  ```
32
34
  User: "Create a new authentication feature"
33
35
 
@@ -51,6 +53,7 @@ Agent A → Agent B → Agent C → Result
51
53
  ```
52
54
 
53
55
  **Use When**:
56
+
54
57
  - Clear dependency chain exists
55
58
  - Output of one agent is input for next
56
59
  - Order is non-negotiable
@@ -58,6 +61,7 @@ Agent A → Agent B → Agent C → Result
58
61
  **Common Chains**:
59
62
 
60
63
  ### SDD Full Workflow Chain
64
+
61
65
  ```
62
66
  1. steering → Analyze project context
63
67
  2. requirements-analyst → Create EARS requirements
@@ -70,6 +74,7 @@ Agent A → Agent B → Agent C → Result
70
74
  ```
71
75
 
72
76
  ### Quick Implementation Chain
77
+
73
78
  ```
74
79
  1. requirements-analyst → EARS requirements
75
80
  2. software-developer → Implementation
@@ -92,11 +97,13 @@ Orchestrator
92
97
  ```
93
98
 
94
99
  **Use When**:
100
+
95
101
  - Complex task requires sub-delegation
96
102
  - Specialized sub-agents needed for specific aspects
97
103
  - Hierarchical coordination is natural
98
104
 
99
105
  **Example**:
106
+
100
107
  ```
101
108
  User: "Design the entire backend architecture"
102
109
 
@@ -120,11 +127,13 @@ Orchestrator
120
127
  ```
121
128
 
122
129
  **Use When**:
130
+
123
131
  - Multiple perspectives needed
124
132
  - Collaborative refinement required
125
133
  - Cross-domain expertise needed
126
134
 
127
135
  **Example**:
136
+
128
137
  ```
129
138
  User: "Review and improve the authentication design"
130
139
 
@@ -153,11 +162,13 @@ Request ────┼── Agent B ──┼── Consolidate → Result
153
162
  ```
154
163
 
155
164
  **Use When**:
165
+
156
166
  - Subtasks are independent
157
167
  - Time efficiency is critical
158
168
  - No dependencies between agents
159
169
 
160
170
  **Example**:
171
+
161
172
  ```
162
173
  User: "Audit the codebase for security, performance, and code quality"
163
174
 
@@ -180,6 +191,7 @@ Agent Work → Validation Gate → Human Review → Continue/Reject
180
191
  ```
181
192
 
182
193
  **Use When**:
194
+
183
195
  - Critical decisions require human approval
184
196
  - Constitutional gates require validation
185
197
  - High-risk changes need oversight
@@ -187,6 +199,7 @@ Agent Work → Validation Gate → Human Review → Continue/Reject
187
199
  **Validation Gates**:
188
200
 
189
201
  ### Phase -1 Gates (Constitution Enforcer)
202
+
190
203
  ```
191
204
  Before Implementation:
192
205
  □ Library-First validated
@@ -197,6 +210,7 @@ Before Implementation:
197
210
  ```
198
211
 
199
212
  ### Design Review Gate
213
+
200
214
  ```
201
215
  After Architecture Design:
202
216
  □ C4 diagrams reviewed
@@ -206,6 +220,7 @@ After Architecture Design:
206
220
  ```
207
221
 
208
222
  ### Release Gate
223
+
209
224
  ```
210
225
  Before Production Release:
211
226
  □ All tests passing
@@ -218,16 +233,16 @@ Before Production Release:
218
233
 
219
234
  ## Pattern Selection Matrix
220
235
 
221
- | Scenario | Recommended Pattern | Reason |
222
- |----------|-------------------|--------|
223
- | New feature development | Sequential | Clear workflow stages |
224
- | Codebase audit | Swarm | Independent analysis |
225
- | Architecture design | Nested | Hierarchical delegation |
226
- | Design review | Group Chat | Multi-perspective feedback |
227
- | Production release | Human-in-Loop | Critical validation |
228
- | Unclear request | Auto | Let orchestrator decide |
229
- | Long-running workflows | Replanning | Handle failures gracefully |
230
- | Resilient execution | Replanning | Automatic recovery |
236
+ | Scenario | Recommended Pattern | Reason |
237
+ | ----------------------- | ------------------- | -------------------------- |
238
+ | New feature development | Sequential | Clear workflow stages |
239
+ | Codebase audit | Swarm | Independent analysis |
240
+ | Architecture design | Nested | Hierarchical delegation |
241
+ | Design review | Group Chat | Multi-perspective feedback |
242
+ | Production release | Human-in-Loop | Critical validation |
243
+ | Unclear request | Auto | Let orchestrator decide |
244
+ | Long-running workflows | Replanning | Handle failures gracefully |
245
+ | Resilient execution | Replanning | Automatic recovery |
231
246
 
232
247
  ---
233
248
 
@@ -288,6 +303,7 @@ Execute Alternative
288
303
  ```
289
304
 
290
305
  **Use When**:
306
+
291
307
  - Tasks may fail or timeout
292
308
  - Alternative approaches exist
293
309
  - Resilience is critical
@@ -295,14 +311,15 @@ Execute Alternative
295
311
 
296
312
  **Components**:
297
313
 
298
- | Component | Purpose | CLI Command |
299
- |-----------|---------|-------------|
300
- | ReplanningEngine | Core replanning logic | `musubi-orchestrate replan <context-id>` |
301
- | GoalProgressTracker | Track goal completion | `musubi-orchestrate goal status` |
314
+ | Component | Purpose | CLI Command |
315
+ | ---------------------- | ------------------------ | ------------------------------------------- |
316
+ | ReplanningEngine | Core replanning logic | `musubi-orchestrate replan <context-id>` |
317
+ | GoalProgressTracker | Track goal completion | `musubi-orchestrate goal status` |
302
318
  | ProactivePathOptimizer | Optimize execution paths | `musubi-orchestrate optimize run <path-id>` |
303
- | AdaptiveGoalModifier | Adjust goals dynamically | `musubi-orchestrate goal update <goal-id>` |
319
+ | AdaptiveGoalModifier | Adjust goals dynamically | `musubi-orchestrate goal update <goal-id>` |
304
320
 
305
321
  **Example**:
322
+
306
323
  ```
307
324
  User: "Deploy API to production"
308
325
 
@@ -324,6 +341,7 @@ Continue:
324
341
  ```
325
342
 
326
343
  **Trigger Types**:
344
+
327
345
  - `failure` - Task execution failed
328
346
  - `timeout` - Task exceeded time limit
329
347
  - `quality` - Output quality below threshold
@@ -331,6 +349,7 @@ Continue:
331
349
  - `dependency` - Dependency unavailable
332
350
 
333
351
  **Decision Types**:
352
+
334
353
  - `continue` - Proceed with next task
335
354
  - `retry` - Retry the failed task
336
355
  - `alternative` - Use alternative approach
@@ -338,6 +357,7 @@ Continue:
338
357
  - `human` - Escalate to human decision
339
358
 
340
359
  **CLI Usage**:
360
+
341
361
  ```bash
342
362
  # Execute replanning for a context
343
363
  musubi-orchestrate replan ctx-12345
@@ -352,4 +372,3 @@ musubi-orchestrate path analyze path-1
352
372
  musubi-orchestrate optimize suggest path-1
353
373
  musubi-orchestrate optimize run path-1
354
374
  ```
355
-