claude-code-workflow 6.3.18 → 6.3.20

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 (832) hide show
  1. package/.claude/CLAUDE.md +8 -5
  2. package/.claude/agents/action-planning-agent.md +26 -2
  3. package/.claude/agents/code-developer.md +132 -43
  4. package/.claude/agents/debug-explore-agent.md +434 -0
  5. package/.claude/agents/issue-plan-agent.md +31 -2
  6. package/.claude/agents/test-fix-agent.md +14 -0
  7. package/.claude/commands/issue/discover.md +41 -0
  8. package/.claude/commands/issue/execute.md +200 -19
  9. package/.claude/commands/issue/new.md +93 -3
  10. package/.claude/commands/issue/plan.md +9 -3
  11. package/.claude/commands/issue/queue.md +94 -39
  12. package/.claude/commands/memory/swagger-docs.md +773 -0
  13. package/.claude/commands/workflow/brainstorm/auto-parallel.md +21 -21
  14. package/.claude/commands/workflow/execute.md +54 -34
  15. package/.claude/commands/workflow/lite-execute.md +48 -164
  16. package/.claude/commands/workflow/lite-fix.md +4 -4
  17. package/.claude/commands/workflow/lite-plan.md +5 -5
  18. package/.claude/commands/workflow/plan.md +27 -27
  19. package/.claude/commands/workflow/review.md +42 -17
  20. package/.claude/commands/workflow/tdd-plan.md +25 -25
  21. package/.claude/commands/workflow/test-fix-gen.md +10 -10
  22. package/.claude/commands/workflow/test-gen.md +14 -14
  23. package/.claude/commands/workflow/ui-design/explore-auto.md +21 -21
  24. package/.claude/commands/workflow/ui-design/imitate-auto.md +24 -24
  25. package/.claude/skills/_shared/SKILL-DESIGN-SPEC.md +693 -0
  26. package/.claude/skills/ccw/SKILL.md +462 -0
  27. package/.claude/skills/ccw/index/command-capabilities.json +127 -0
  28. package/.claude/skills/ccw/index/intent-rules.json +136 -0
  29. package/.claude/skills/ccw/index/workflow-chains.json +451 -0
  30. package/.claude/skills/ccw/phases/actions/bugfix.md +218 -0
  31. package/.claude/skills/ccw/phases/actions/coupled.md +194 -0
  32. package/.claude/skills/ccw/phases/actions/docs.md +93 -0
  33. package/.claude/skills/ccw/phases/actions/full.md +154 -0
  34. package/.claude/skills/ccw/phases/actions/issue.md +201 -0
  35. package/.claude/skills/ccw/phases/actions/rapid.md +104 -0
  36. package/.claude/skills/ccw/phases/actions/review-fix.md +84 -0
  37. package/.claude/skills/ccw/phases/actions/tdd.md +66 -0
  38. package/.claude/skills/ccw/phases/actions/ui.md +79 -0
  39. package/.claude/skills/ccw/phases/orchestrator.md +435 -0
  40. package/.claude/skills/ccw/specs/intent-classification.md +336 -0
  41. package/.claude/skills/ccw-help/SKILL.md +177 -0
  42. package/.claude/skills/ccw-help/index/all-agents.json +82 -0
  43. package/.claude/skills/{command-guide → ccw-help}/index/all-commands.json +183 -73
  44. package/.claude/skills/{command-guide → ccw-help}/index/by-category.json +187 -73
  45. package/.claude/skills/{command-guide → ccw-help}/index/by-use-case.json +295 -185
  46. package/.claude/skills/{command-guide → ccw-help}/index/command-relationships.json +19 -166
  47. package/.claude/skills/{command-guide → ccw-help}/index/essential-commands.json +10 -10
  48. package/.claude/skills/ccw-help/scripts/analyze_commands.py +337 -0
  49. package/.claude/skills/code-reviewer/README.md +340 -0
  50. package/.claude/skills/code-reviewer/SKILL.md +308 -0
  51. package/.claude/skills/code-reviewer/phases/01-code-discovery.md +246 -0
  52. package/.claude/skills/code-reviewer/phases/02-security-analysis.md +442 -0
  53. package/.claude/skills/code-reviewer/phases/03-best-practices-review.md +36 -0
  54. package/.claude/skills/code-reviewer/phases/04-report-generation.md +278 -0
  55. package/.claude/skills/code-reviewer/specs/best-practices-requirements.md +346 -0
  56. package/.claude/skills/code-reviewer/specs/quality-standards.md +252 -0
  57. package/.claude/skills/code-reviewer/specs/security-requirements.md +243 -0
  58. package/.claude/skills/code-reviewer/templates/best-practice-finding.md +234 -0
  59. package/.claude/skills/code-reviewer/templates/report-template.md +316 -0
  60. package/.claude/skills/code-reviewer/templates/security-finding.md +161 -0
  61. package/.claude/skills/skill-generator/SKILL.md +187 -0
  62. package/.claude/skills/skill-generator/phases/01-requirements-discovery.md +239 -0
  63. package/.claude/skills/skill-generator/phases/02-structure-generation.md +207 -0
  64. package/.claude/skills/skill-generator/phases/03-phase-generation.md +802 -0
  65. package/.claude/skills/skill-generator/phases/04-specs-templates.md +328 -0
  66. package/.claude/skills/skill-generator/phases/05-validation.md +334 -0
  67. package/.claude/skills/skill-generator/specs/cli-integration.md +448 -0
  68. package/.claude/skills/skill-generator/specs/execution-modes.md +396 -0
  69. package/.claude/skills/skill-generator/specs/scripting-integration.md +265 -0
  70. package/.claude/skills/skill-generator/specs/skill-requirements.md +466 -0
  71. package/.claude/skills/skill-generator/templates/autonomous-action.md +517 -0
  72. package/.claude/skills/skill-generator/templates/autonomous-orchestrator.md +276 -0
  73. package/.claude/skills/skill-generator/templates/code-analysis-action.md +503 -0
  74. package/.claude/skills/skill-generator/templates/llm-action.md +355 -0
  75. package/.claude/skills/skill-generator/templates/script-bash.md +277 -0
  76. package/.claude/skills/skill-generator/templates/script-python.md +198 -0
  77. package/.claude/skills/skill-generator/templates/sequential-phase.md +441 -0
  78. package/.claude/skills/skill-generator/templates/skill-md.md +156 -0
  79. package/.claude/workflows/chinese-response.md +15 -28
  80. package/.claude/workflows/cli-templates/prompts/documentation/swagger-api.txt +266 -0
  81. package/.claude/workflows/cli-tools-usage.md +221 -177
  82. package/.claude/workflows/windows-platform.md +13 -10
  83. package/.codex/prompts/issue-execute.md +310 -82
  84. package/.codex/prompts/issue-queue.md +22 -0
  85. package/.codex/prompts/lite-execute.md +36 -11
  86. package/README.md +309 -305
  87. package/ccw/README.md +10 -4
  88. package/ccw/dist/cli.d.ts.map +1 -1
  89. package/ccw/dist/cli.js +4 -1
  90. package/ccw/dist/cli.js.map +1 -1
  91. package/ccw/dist/commands/cli.d.ts.map +1 -1
  92. package/ccw/dist/commands/cli.js +131 -34
  93. package/ccw/dist/commands/cli.js.map +1 -1
  94. package/ccw/dist/commands/issue.d.ts +152 -0
  95. package/ccw/dist/commands/issue.d.ts.map +1 -1
  96. package/ccw/dist/commands/issue.js +550 -85
  97. package/ccw/dist/commands/issue.js.map +1 -1
  98. package/ccw/dist/commands/serve.d.ts +1 -0
  99. package/ccw/dist/commands/serve.d.ts.map +1 -1
  100. package/ccw/dist/commands/serve.js +12 -5
  101. package/ccw/dist/commands/serve.js.map +1 -1
  102. package/ccw/dist/commands/stop.d.ts.map +1 -1
  103. package/ccw/dist/commands/stop.js +29 -5
  104. package/ccw/dist/commands/stop.js.map +1 -1
  105. package/ccw/dist/commands/tool.d.ts.map +1 -1
  106. package/ccw/dist/commands/tool.js +19 -2
  107. package/ccw/dist/commands/tool.js.map +1 -1
  108. package/ccw/dist/commands/view.d.ts +1 -0
  109. package/ccw/dist/commands/view.d.ts.map +1 -1
  110. package/ccw/dist/commands/view.js +10 -3
  111. package/ccw/dist/commands/view.js.map +1 -1
  112. package/ccw/dist/config/cli-settings-manager.d.ts +86 -0
  113. package/ccw/dist/config/cli-settings-manager.d.ts.map +1 -0
  114. package/ccw/dist/config/cli-settings-manager.js +392 -0
  115. package/ccw/dist/config/cli-settings-manager.js.map +1 -0
  116. package/ccw/dist/config/litellm-api-config-manager.d.ts +71 -5
  117. package/ccw/dist/config/litellm-api-config-manager.d.ts.map +1 -1
  118. package/ccw/dist/config/litellm-api-config-manager.js +290 -20
  119. package/ccw/dist/config/litellm-api-config-manager.js.map +1 -1
  120. package/ccw/dist/core/auth/csrf-manager.d.ts +18 -0
  121. package/ccw/dist/core/auth/csrf-manager.d.ts.map +1 -0
  122. package/ccw/dist/core/auth/csrf-manager.js +80 -0
  123. package/ccw/dist/core/auth/csrf-manager.js.map +1 -0
  124. package/ccw/dist/core/auth/csrf-middleware.d.ts +8 -0
  125. package/ccw/dist/core/auth/csrf-middleware.d.ts.map +1 -0
  126. package/ccw/dist/core/auth/csrf-middleware.js +141 -0
  127. package/ccw/dist/core/auth/csrf-middleware.js.map +1 -0
  128. package/ccw/dist/core/auth/middleware.d.ts +15 -0
  129. package/ccw/dist/core/auth/middleware.d.ts.map +1 -0
  130. package/ccw/dist/core/auth/middleware.js +76 -0
  131. package/ccw/dist/core/auth/middleware.js.map +1 -0
  132. package/ccw/dist/core/auth/token-manager.d.ts +41 -0
  133. package/ccw/dist/core/auth/token-manager.d.ts.map +1 -0
  134. package/ccw/dist/core/auth/token-manager.js +171 -0
  135. package/ccw/dist/core/auth/token-manager.js.map +1 -0
  136. package/ccw/dist/core/cache-manager.d.ts +6 -6
  137. package/ccw/dist/core/cache-manager.d.ts.map +1 -1
  138. package/ccw/dist/core/cache-manager.js +70 -48
  139. package/ccw/dist/core/cache-manager.js.map +1 -1
  140. package/ccw/dist/core/claude-freshness.d.ts.map +1 -1
  141. package/ccw/dist/core/claude-freshness.js +23 -3
  142. package/ccw/dist/core/claude-freshness.js.map +1 -1
  143. package/ccw/dist/core/core-memory-store.d.ts.map +1 -1
  144. package/ccw/dist/core/core-memory-store.js +2 -1
  145. package/ccw/dist/core/core-memory-store.js.map +1 -1
  146. package/ccw/dist/core/cors.d.ts +3 -0
  147. package/ccw/dist/core/cors.d.ts.map +1 -0
  148. package/ccw/dist/core/cors.js +10 -0
  149. package/ccw/dist/core/cors.js.map +1 -0
  150. package/ccw/dist/core/dashboard-generator-patch.js +0 -1
  151. package/ccw/dist/core/dashboard-generator-patch.js.map +1 -1
  152. package/ccw/dist/core/dashboard-generator.d.ts.map +1 -1
  153. package/ccw/dist/core/dashboard-generator.js +417 -416
  154. package/ccw/dist/core/dashboard-generator.js.map +1 -1
  155. package/ccw/dist/core/data-aggregator.js +2 -2
  156. package/ccw/dist/core/data-aggregator.js.map +1 -1
  157. package/ccw/dist/core/lite-scanner.d.ts +1 -1
  158. package/ccw/dist/core/lite-scanner.d.ts.map +1 -1
  159. package/ccw/dist/core/lite-scanner.js +130 -127
  160. package/ccw/dist/core/lite-scanner.js.map +1 -1
  161. package/ccw/dist/core/routes/auth-routes.d.ts +12 -0
  162. package/ccw/dist/core/routes/auth-routes.d.ts.map +1 -0
  163. package/ccw/dist/core/routes/auth-routes.js +80 -0
  164. package/ccw/dist/core/routes/auth-routes.js.map +1 -0
  165. package/ccw/dist/core/routes/ccw-routes.d.ts +1 -14
  166. package/ccw/dist/core/routes/ccw-routes.d.ts.map +1 -1
  167. package/ccw/dist/core/routes/ccw-routes.js +9 -4
  168. package/ccw/dist/core/routes/ccw-routes.js.map +1 -1
  169. package/ccw/dist/core/routes/claude-routes.d.ts +1 -14
  170. package/ccw/dist/core/routes/claude-routes.d.ts.map +1 -1
  171. package/ccw/dist/core/routes/claude-routes.js +98 -39
  172. package/ccw/dist/core/routes/claude-routes.js.map +1 -1
  173. package/ccw/dist/core/routes/cli-routes.d.ts +14 -12
  174. package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -1
  175. package/ccw/dist/core/routes/cli-routes.js +122 -43
  176. package/ccw/dist/core/routes/cli-routes.js.map +1 -1
  177. package/ccw/dist/core/routes/cli-settings-routes.d.ts +11 -0
  178. package/ccw/dist/core/routes/cli-settings-routes.d.ts.map +1 -0
  179. package/ccw/dist/core/routes/cli-settings-routes.js +204 -0
  180. package/ccw/dist/core/routes/cli-settings-routes.js.map +1 -0
  181. package/ccw/dist/core/routes/codexlens/config-handlers.d.ts +6 -0
  182. package/ccw/dist/core/routes/codexlens/config-handlers.d.ts.map +1 -0
  183. package/ccw/dist/core/routes/codexlens/config-handlers.js +1195 -0
  184. package/ccw/dist/core/routes/codexlens/config-handlers.js.map +1 -0
  185. package/ccw/dist/core/routes/codexlens/index-handlers.d.ts +10 -0
  186. package/ccw/dist/core/routes/codexlens/index-handlers.d.ts.map +1 -0
  187. package/ccw/dist/core/routes/codexlens/index-handlers.js +322 -0
  188. package/ccw/dist/core/routes/codexlens/index-handlers.js.map +1 -0
  189. package/ccw/dist/core/routes/codexlens/semantic-handlers.d.ts +6 -0
  190. package/ccw/dist/core/routes/codexlens/semantic-handlers.d.ts.map +1 -0
  191. package/ccw/dist/core/routes/codexlens/semantic-handlers.js +865 -0
  192. package/ccw/dist/core/routes/codexlens/semantic-handlers.js.map +1 -0
  193. package/ccw/dist/core/routes/codexlens/utils.d.ts +23 -0
  194. package/ccw/dist/core/routes/codexlens/utils.d.ts.map +1 -0
  195. package/ccw/dist/core/routes/codexlens/utils.js +85 -0
  196. package/ccw/dist/core/routes/codexlens/utils.js.map +1 -0
  197. package/ccw/dist/core/routes/codexlens/watcher-handlers.d.ts +13 -0
  198. package/ccw/dist/core/routes/codexlens/watcher-handlers.d.ts.map +1 -0
  199. package/ccw/dist/core/routes/codexlens/watcher-handlers.js +235 -0
  200. package/ccw/dist/core/routes/codexlens/watcher-handlers.js.map +1 -0
  201. package/ccw/dist/core/routes/codexlens-routes.d.ts +2 -11
  202. package/ccw/dist/core/routes/codexlens-routes.d.ts.map +1 -1
  203. package/ccw/dist/core/routes/codexlens-routes.js +10 -981
  204. package/ccw/dist/core/routes/codexlens-routes.js.map +1 -1
  205. package/ccw/dist/core/routes/discovery-routes.d.ts +1 -35
  206. package/ccw/dist/core/routes/discovery-routes.d.ts.map +1 -1
  207. package/ccw/dist/core/routes/discovery-routes.js +25 -0
  208. package/ccw/dist/core/routes/discovery-routes.js.map +1 -1
  209. package/ccw/dist/core/routes/files-routes.d.ts +1 -14
  210. package/ccw/dist/core/routes/files-routes.d.ts.map +1 -1
  211. package/ccw/dist/core/routes/files-routes.js +57 -14
  212. package/ccw/dist/core/routes/files-routes.js.map +1 -1
  213. package/ccw/dist/core/routes/graph-routes.d.ts +1 -14
  214. package/ccw/dist/core/routes/graph-routes.d.ts.map +1 -1
  215. package/ccw/dist/core/routes/graph-routes.js +36 -37
  216. package/ccw/dist/core/routes/graph-routes.js.map +1 -1
  217. package/ccw/dist/core/routes/help-routes.d.ts +1 -14
  218. package/ccw/dist/core/routes/help-routes.d.ts.map +1 -1
  219. package/ccw/dist/core/routes/help-routes.js +5 -0
  220. package/ccw/dist/core/routes/help-routes.js.map +1 -1
  221. package/ccw/dist/core/routes/hooks-routes.d.ts +4 -14
  222. package/ccw/dist/core/routes/hooks-routes.d.ts.map +1 -1
  223. package/ccw/dist/core/routes/hooks-routes.js +43 -21
  224. package/ccw/dist/core/routes/hooks-routes.js.map +1 -1
  225. package/ccw/dist/core/routes/issue-routes.d.ts +1 -34
  226. package/ccw/dist/core/routes/issue-routes.d.ts.map +1 -1
  227. package/ccw/dist/core/routes/issue-routes.js +24 -0
  228. package/ccw/dist/core/routes/issue-routes.js.map +1 -1
  229. package/ccw/dist/core/routes/litellm-api-routes.d.ts +1 -14
  230. package/ccw/dist/core/routes/litellm-api-routes.d.ts.map +1 -1
  231. package/ccw/dist/core/routes/litellm-api-routes.js +513 -48
  232. package/ccw/dist/core/routes/litellm-api-routes.js.map +1 -1
  233. package/ccw/dist/core/routes/litellm-routes.d.ts +1 -14
  234. package/ccw/dist/core/routes/litellm-routes.d.ts.map +1 -1
  235. package/ccw/dist/core/routes/litellm-routes.js +28 -11
  236. package/ccw/dist/core/routes/litellm-routes.js.map +1 -1
  237. package/ccw/dist/core/routes/mcp-routes.d.ts +1 -14
  238. package/ccw/dist/core/routes/mcp-routes.d.ts.map +1 -1
  239. package/ccw/dist/core/routes/mcp-routes.js +99 -30
  240. package/ccw/dist/core/routes/mcp-routes.js.map +1 -1
  241. package/ccw/dist/core/routes/mcp-templates-db.d.ts.map +1 -1
  242. package/ccw/dist/core/routes/mcp-templates-db.js +30 -31
  243. package/ccw/dist/core/routes/mcp-templates-db.js.map +1 -1
  244. package/ccw/dist/core/routes/memory-routes.d.ts.map +1 -1
  245. package/ccw/dist/core/routes/memory-routes.js +74 -24
  246. package/ccw/dist/core/routes/memory-routes.js.map +1 -1
  247. package/ccw/dist/core/routes/nav-status-routes.d.ts +3 -0
  248. package/ccw/dist/core/routes/nav-status-routes.d.ts.map +1 -0
  249. package/ccw/dist/core/routes/nav-status-routes.js +217 -0
  250. package/ccw/dist/core/routes/nav-status-routes.js.map +1 -0
  251. package/ccw/dist/core/routes/rules-routes.d.ts +1 -14
  252. package/ccw/dist/core/routes/rules-routes.d.ts.map +1 -1
  253. package/ccw/dist/core/routes/rules-routes.js +481 -58
  254. package/ccw/dist/core/routes/rules-routes.js.map +1 -1
  255. package/ccw/dist/core/routes/session-routes.d.ts +1 -14
  256. package/ccw/dist/core/routes/session-routes.d.ts.map +1 -1
  257. package/ccw/dist/core/routes/session-routes.js +15 -3
  258. package/ccw/dist/core/routes/session-routes.js.map +1 -1
  259. package/ccw/dist/core/routes/skills-routes.d.ts +1 -14
  260. package/ccw/dist/core/routes/skills-routes.d.ts.map +1 -1
  261. package/ccw/dist/core/routes/skills-routes.js +394 -112
  262. package/ccw/dist/core/routes/skills-routes.js.map +1 -1
  263. package/ccw/dist/core/routes/status-routes.d.ts +1 -14
  264. package/ccw/dist/core/routes/status-routes.d.ts.map +1 -1
  265. package/ccw/dist/core/routes/status-routes.js +4 -0
  266. package/ccw/dist/core/routes/status-routes.js.map +1 -1
  267. package/ccw/dist/core/routes/system-routes.d.ts +4 -10
  268. package/ccw/dist/core/routes/system-routes.d.ts.map +1 -1
  269. package/ccw/dist/core/routes/system-routes.js +6 -4
  270. package/ccw/dist/core/routes/system-routes.js.map +1 -1
  271. package/ccw/dist/core/routes/types.d.ts +19 -0
  272. package/ccw/dist/core/routes/types.d.ts.map +1 -0
  273. package/ccw/dist/core/routes/types.js +2 -0
  274. package/ccw/dist/core/routes/types.js.map +1 -0
  275. package/ccw/dist/core/server.d.ts.map +1 -1
  276. package/ccw/dist/core/server.js +206 -29
  277. package/ccw/dist/core/server.js.map +1 -1
  278. package/ccw/dist/core/services/api-key-tester.d.ts +42 -0
  279. package/ccw/dist/core/services/api-key-tester.d.ts.map +1 -0
  280. package/ccw/dist/core/services/api-key-tester.js +126 -0
  281. package/ccw/dist/core/services/api-key-tester.js.map +1 -0
  282. package/ccw/dist/core/services/health-check-service.d.ts +88 -0
  283. package/ccw/dist/core/services/health-check-service.d.ts.map +1 -0
  284. package/ccw/dist/core/services/health-check-service.js +293 -0
  285. package/ccw/dist/core/services/health-check-service.js.map +1 -0
  286. package/ccw/dist/core/websocket.d.ts +9 -7
  287. package/ccw/dist/core/websocket.d.ts.map +1 -1
  288. package/ccw/dist/core/websocket.js +9 -4
  289. package/ccw/dist/core/websocket.js.map +1 -1
  290. package/ccw/dist/tools/claude-cli-tools.d.ts +152 -28
  291. package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
  292. package/ccw/dist/tools/claude-cli-tools.js +490 -100
  293. package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
  294. package/ccw/dist/tools/cli-config-manager.d.ts +24 -8
  295. package/ccw/dist/tools/cli-config-manager.d.ts.map +1 -1
  296. package/ccw/dist/tools/cli-config-manager.js +76 -156
  297. package/ccw/dist/tools/cli-config-manager.js.map +1 -1
  298. package/ccw/dist/tools/cli-executor-core.d.ts +85 -0
  299. package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -0
  300. package/ccw/dist/tools/cli-executor-core.js +1310 -0
  301. package/ccw/dist/tools/cli-executor-core.js.map +1 -0
  302. package/ccw/dist/tools/cli-executor-state.d.ts +241 -0
  303. package/ccw/dist/tools/cli-executor-state.d.ts.map +1 -0
  304. package/ccw/dist/tools/cli-executor-state.js +392 -0
  305. package/ccw/dist/tools/cli-executor-state.js.map +1 -0
  306. package/ccw/dist/tools/cli-executor-utils.d.ts +36 -0
  307. package/ccw/dist/tools/cli-executor-utils.d.ts.map +1 -0
  308. package/ccw/dist/tools/cli-executor-utils.js +298 -0
  309. package/ccw/dist/tools/cli-executor-utils.js.map +1 -0
  310. package/ccw/dist/tools/cli-executor.d.ts +3 -377
  311. package/ccw/dist/tools/cli-executor.d.ts.map +1 -1
  312. package/ccw/dist/tools/cli-executor.js +3 -1884
  313. package/ccw/dist/tools/cli-executor.js.map +1 -1
  314. package/ccw/dist/tools/cli-history-store.d.ts +2 -0
  315. package/ccw/dist/tools/cli-history-store.d.ts.map +1 -1
  316. package/ccw/dist/tools/cli-history-store.js.map +1 -1
  317. package/ccw/dist/tools/cli-output-converter.d.ts +192 -0
  318. package/ccw/dist/tools/cli-output-converter.d.ts.map +1 -0
  319. package/ccw/dist/tools/cli-output-converter.js +1047 -0
  320. package/ccw/dist/tools/cli-output-converter.js.map +1 -0
  321. package/ccw/dist/tools/cli-prompt-builder.d.ts +113 -0
  322. package/ccw/dist/tools/cli-prompt-builder.d.ts.map +1 -0
  323. package/ccw/dist/tools/cli-prompt-builder.js +363 -0
  324. package/ccw/dist/tools/cli-prompt-builder.js.map +1 -0
  325. package/ccw/dist/tools/codex-lens.d.ts +15 -1
  326. package/ccw/dist/tools/codex-lens.d.ts.map +1 -1
  327. package/ccw/dist/tools/codex-lens.js +289 -55
  328. package/ccw/dist/tools/codex-lens.js.map +1 -1
  329. package/ccw/dist/tools/detect-changed-modules.d.ts.map +1 -1
  330. package/ccw/dist/tools/detect-changed-modules.js +22 -4
  331. package/ccw/dist/tools/detect-changed-modules.js.map +1 -1
  332. package/ccw/dist/tools/index.d.ts.map +1 -1
  333. package/ccw/dist/tools/index.js +2 -0
  334. package/ccw/dist/tools/index.js.map +1 -1
  335. package/ccw/dist/tools/litellm-client.d.ts.map +1 -1
  336. package/ccw/dist/tools/litellm-client.js +10 -4
  337. package/ccw/dist/tools/litellm-client.js.map +1 -1
  338. package/ccw/dist/tools/litellm-executor.d.ts +2 -4
  339. package/ccw/dist/tools/litellm-executor.d.ts.map +1 -1
  340. package/ccw/dist/tools/litellm-executor.js +39 -8
  341. package/ccw/dist/tools/litellm-executor.js.map +1 -1
  342. package/ccw/dist/tools/native-session-discovery.d.ts +2 -0
  343. package/ccw/dist/tools/native-session-discovery.d.ts.map +1 -1
  344. package/ccw/dist/tools/native-session-discovery.js +197 -1
  345. package/ccw/dist/tools/native-session-discovery.js.map +1 -1
  346. package/ccw/dist/tools/session-manager.d.ts.map +1 -1
  347. package/ccw/dist/tools/session-manager.js +79 -0
  348. package/ccw/dist/tools/session-manager.js.map +1 -1
  349. package/ccw/dist/tools/skill-context-loader.d.ts +15 -0
  350. package/ccw/dist/tools/skill-context-loader.d.ts.map +1 -0
  351. package/ccw/dist/tools/skill-context-loader.js +198 -0
  352. package/ccw/dist/tools/skill-context-loader.js.map +1 -0
  353. package/ccw/dist/tools/smart-search.d.ts +8 -3
  354. package/ccw/dist/tools/smart-search.d.ts.map +1 -1
  355. package/ccw/dist/tools/smart-search.js +378 -75
  356. package/ccw/dist/tools/smart-search.js.map +1 -1
  357. package/ccw/dist/types/cli-settings.d.ts +86 -0
  358. package/ccw/dist/types/cli-settings.d.ts.map +1 -0
  359. package/ccw/dist/types/cli-settings.js +54 -0
  360. package/ccw/dist/types/cli-settings.js.map +1 -0
  361. package/ccw/dist/types/litellm-api-config.d.ts +40 -1
  362. package/ccw/dist/types/litellm-api-config.d.ts.map +1 -1
  363. package/ccw/dist/utils/exec-constants.d.ts +25 -0
  364. package/ccw/dist/utils/exec-constants.d.ts.map +1 -0
  365. package/ccw/dist/utils/exec-constants.js +25 -0
  366. package/ccw/dist/utils/exec-constants.js.map +1 -0
  367. package/ccw/dist/utils/path-resolver.d.ts +1 -0
  368. package/ccw/dist/utils/path-resolver.d.ts.map +1 -1
  369. package/ccw/dist/utils/path-resolver.js +48 -3
  370. package/ccw/dist/utils/path-resolver.js.map +1 -1
  371. package/ccw/dist/utils/path-validator.d.ts.map +1 -1
  372. package/ccw/dist/utils/path-validator.js +25 -6
  373. package/ccw/dist/utils/path-validator.js.map +1 -1
  374. package/ccw/dist/utils/python-utils.d.ts.map +1 -1
  375. package/ccw/dist/utils/python-utils.js +27 -7
  376. package/ccw/dist/utils/python-utils.js.map +1 -1
  377. package/ccw/dist/utils/shell-escape.d.ts +8 -0
  378. package/ccw/dist/utils/shell-escape.d.ts.map +1 -0
  379. package/ccw/dist/utils/shell-escape.js +24 -0
  380. package/ccw/dist/utils/shell-escape.js.map +1 -0
  381. package/ccw/dist/utils/uv-manager.d.ts +167 -0
  382. package/ccw/dist/utils/uv-manager.d.ts.map +1 -0
  383. package/ccw/dist/utils/uv-manager.js +644 -0
  384. package/ccw/dist/utils/uv-manager.js.map +1 -0
  385. package/ccw/src/cli.ts +4 -1
  386. package/ccw/src/commands/cli.ts +132 -34
  387. package/ccw/src/commands/issue.ts +605 -91
  388. package/ccw/src/commands/serve.ts +15 -5
  389. package/ccw/src/commands/stop.ts +32 -5
  390. package/ccw/src/commands/tool.ts +17 -2
  391. package/ccw/src/commands/view.ts +13 -3
  392. package/ccw/src/config/cli-settings-manager.ts +460 -0
  393. package/ccw/src/config/litellm-api-config-manager.ts +392 -57
  394. package/ccw/src/core/auth/csrf-manager.ts +104 -0
  395. package/ccw/src/core/auth/csrf-middleware.ts +159 -0
  396. package/ccw/src/core/auth/middleware.ts +94 -0
  397. package/ccw/src/core/auth/token-manager.ts +219 -0
  398. package/ccw/src/core/cache-manager.ts +64 -52
  399. package/ccw/src/core/claude-freshness.ts +26 -6
  400. package/ccw/src/core/core-memory-store.ts +2 -1
  401. package/ccw/src/core/cors.ts +10 -0
  402. package/ccw/src/core/dashboard-generator-patch.ts +47 -48
  403. package/ccw/src/core/dashboard-generator.ts +797 -744
  404. package/ccw/src/core/data-aggregator.ts +667 -667
  405. package/ccw/src/core/lite-scanner.ts +156 -140
  406. package/ccw/src/core/routes/auth-routes.ts +98 -0
  407. package/ccw/src/core/routes/ccw-routes.ts +10 -20
  408. package/ccw/src/core/routes/claude-routes.ts +101 -51
  409. package/ccw/src/core/routes/cli-routes.ts +152 -55
  410. package/ccw/src/core/routes/cli-settings-routes.ts +232 -0
  411. package/ccw/src/core/routes/codexlens/README.md +37 -0
  412. package/ccw/src/core/routes/codexlens/config-handlers.ts +1269 -0
  413. package/ccw/src/core/routes/codexlens/index-handlers.ts +354 -0
  414. package/ccw/src/core/routes/codexlens/semantic-handlers.ts +931 -0
  415. package/ccw/src/core/routes/codexlens/utils.ts +96 -0
  416. package/ccw/src/core/routes/codexlens/watcher-handlers.ts +265 -0
  417. package/ccw/src/core/routes/codexlens-routes.ts +11 -1044
  418. package/ccw/src/core/routes/discovery-routes.ts +1 -12
  419. package/ccw/src/core/routes/files-routes.ts +112 -40
  420. package/ccw/src/core/routes/graph-routes.ts +39 -46
  421. package/ccw/src/core/routes/help-routes.ts +2 -12
  422. package/ccw/src/core/routes/hooks-routes.ts +83 -44
  423. package/ccw/src/core/routes/issue-routes.ts +1 -12
  424. package/ccw/src/core/routes/litellm-api-routes.ts +574 -60
  425. package/ccw/src/core/routes/litellm-routes.ts +35 -27
  426. package/ccw/src/core/routes/mcp-routes.ts +157 -60
  427. package/ccw/src/core/routes/mcp-routes.ts.backup +549 -550
  428. package/ccw/src/core/routes/mcp-templates-db.ts +267 -268
  429. package/ccw/src/core/routes/memory-routes.ts +76 -22
  430. package/ccw/src/core/routes/nav-status-routes.ts +231 -0
  431. package/ccw/src/core/routes/rules-routes.ts +600 -81
  432. package/ccw/src/core/routes/session-routes.ts +28 -22
  433. package/ccw/src/core/routes/skills-routes.ts +452 -132
  434. package/ccw/src/core/routes/status-routes.ts +1 -12
  435. package/ccw/src/core/routes/system-routes.ts +15 -22
  436. package/ccw/src/core/routes/types.ts +25 -0
  437. package/ccw/src/core/server.ts +657 -468
  438. package/ccw/src/core/services/api-key-tester.ts +160 -0
  439. package/ccw/src/core/services/health-check-service.ts +366 -0
  440. package/ccw/src/core/websocket.ts +20 -12
  441. package/ccw/src/templates/dashboard-css/01-base.css +109 -0
  442. package/ccw/src/templates/dashboard-css/10-cli-status.css +202 -0
  443. package/ccw/src/templates/dashboard-css/21-cli-toolmgmt.css +308 -0
  444. package/ccw/src/templates/dashboard-css/30-core-memory.css +20 -0
  445. package/ccw/src/templates/dashboard-css/31-api-settings.css +751 -14
  446. package/ccw/src/templates/dashboard-css/33-cli-stream-viewer.css +230 -2
  447. package/ccw/src/templates/dashboard-js/api.js +5 -0
  448. package/ccw/src/templates/dashboard-js/components/cli-status.js +279 -107
  449. package/ccw/src/templates/dashboard-js/components/cli-stream-viewer.js +262 -20
  450. package/ccw/src/templates/dashboard-js/components/hook-manager.js +105 -5
  451. package/ccw/src/templates/dashboard-js/components/mcp-manager.js +317 -0
  452. package/ccw/src/templates/dashboard-js/components/navigation.js +45 -0
  453. package/ccw/src/templates/dashboard-js/components/notifications.js +128 -0
  454. package/ccw/src/templates/dashboard-js/i18n.js +4448 -3983
  455. package/ccw/src/templates/dashboard-js/main.js +71 -0
  456. package/ccw/src/templates/dashboard-js/services.js +289 -0
  457. package/ccw/src/templates/dashboard-js/views/api-settings.js +5613 -3361
  458. package/ccw/src/templates/dashboard-js/views/claude-manager.js +1 -7
  459. package/ccw/src/templates/dashboard-js/views/cli-manager.js +581 -87
  460. package/ccw/src/templates/dashboard-js/views/codexlens-manager.js +6101 -1965
  461. package/ccw/src/templates/dashboard-js/views/core-memory.js +129 -20
  462. package/ccw/src/templates/dashboard-js/views/hook-manager.js +17 -3
  463. package/ccw/src/templates/dashboard-js/views/mcp-manager.js +63 -0
  464. package/ccw/src/templates/dashboard-js/views/project-overview.js +182 -37
  465. package/ccw/src/templates/dashboard-js/views/rules-manager.js +26 -3
  466. package/ccw/src/templates/dashboard-js/views/skills-manager.js +2 -42
  467. package/ccw/src/templates/dashboard.html +6 -0
  468. package/ccw/src/tools/README.md +29 -0
  469. package/ccw/src/tools/claude-cli-tools.ts +640 -125
  470. package/ccw/src/tools/cli-config-manager.ts +102 -172
  471. package/ccw/src/tools/cli-executor-core.ts +1533 -0
  472. package/ccw/src/tools/cli-executor-state.ts +560 -0
  473. package/ccw/src/tools/cli-executor-utils.ts +349 -0
  474. package/ccw/src/tools/cli-executor.ts +3 -2309
  475. package/ccw/src/tools/cli-history-store.ts +2 -0
  476. package/ccw/src/tools/cli-output-converter.ts +1237 -0
  477. package/ccw/src/tools/cli-prompt-builder.ts +487 -0
  478. package/ccw/src/tools/codex-lens.ts +324 -59
  479. package/ccw/src/tools/detect-changed-modules.ts +24 -6
  480. package/ccw/src/tools/index.ts +2 -0
  481. package/ccw/src/tools/litellm-client.ts +10 -4
  482. package/ccw/src/tools/litellm-executor.ts +146 -114
  483. package/ccw/src/tools/native-session-discovery.ts +209 -1
  484. package/ccw/src/tools/session-manager.ts +88 -0
  485. package/ccw/src/tools/skill-context-loader.ts +213 -0
  486. package/ccw/src/tools/smart-search.ts +427 -76
  487. package/ccw/src/types/cli-settings.ts +137 -0
  488. package/ccw/src/types/litellm-api-config.ts +55 -1
  489. package/ccw/src/utils/exec-constants.ts +24 -0
  490. package/ccw/src/utils/path-resolver.ts +49 -3
  491. package/ccw/src/utils/path-validator.ts +28 -6
  492. package/ccw/src/utils/python-utils.ts +140 -121
  493. package/ccw/src/utils/shell-escape.ts +30 -0
  494. package/ccw/src/utils/uv-manager.ts +796 -0
  495. package/ccw-litellm/src/ccw_litellm/__pycache__/__init__.cpython-310.pyc +0 -0
  496. package/ccw-litellm/src/ccw_litellm/__pycache__/__init__.cpython-312.pyc +0 -0
  497. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/__init__.cpython-310.pyc +0 -0
  498. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/__init__.cpython-312.pyc +0 -0
  499. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_embedder.cpython-310.pyc +0 -0
  500. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_embedder.cpython-312.pyc +0 -0
  501. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_embedder.cpython-313.pyc +0 -0
  502. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_llm.cpython-310.pyc +0 -0
  503. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_llm.cpython-312.pyc +0 -0
  504. package/ccw-litellm/src/ccw_litellm/clients/__pycache__/litellm_llm.cpython-313.pyc +0 -0
  505. package/ccw-litellm/src/ccw_litellm/clients/litellm_embedder.py +270 -251
  506. package/ccw-litellm/src/ccw_litellm/clients/litellm_llm.py +33 -0
  507. package/ccw-litellm/src/ccw_litellm/config/__pycache__/__init__.cpython-310.pyc +0 -0
  508. package/ccw-litellm/src/ccw_litellm/config/__pycache__/__init__.cpython-312.pyc +0 -0
  509. package/ccw-litellm/src/ccw_litellm/config/__pycache__/loader.cpython-310.pyc +0 -0
  510. package/ccw-litellm/src/ccw_litellm/config/__pycache__/loader.cpython-312.pyc +0 -0
  511. package/ccw-litellm/src/ccw_litellm/config/__pycache__/loader.cpython-313.pyc +0 -0
  512. package/ccw-litellm/src/ccw_litellm/config/__pycache__/models.cpython-310.pyc +0 -0
  513. package/ccw-litellm/src/ccw_litellm/config/__pycache__/models.cpython-312.pyc +0 -0
  514. package/ccw-litellm/src/ccw_litellm/config/__pycache__/models.cpython-313.pyc +0 -0
  515. package/ccw-litellm/src/ccw_litellm/config/loader.py +343 -316
  516. package/ccw-litellm/src/ccw_litellm/config/models.py +162 -130
  517. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/__init__.cpython-310.pyc +0 -0
  518. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/__init__.cpython-312.pyc +0 -0
  519. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/embedder.cpython-310.pyc +0 -0
  520. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/embedder.cpython-312.pyc +0 -0
  521. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/llm.cpython-310.pyc +0 -0
  522. package/ccw-litellm/src/ccw_litellm/interfaces/__pycache__/llm.cpython-312.pyc +0 -0
  523. package/codex-lens/pyproject.toml +43 -0
  524. package/codex-lens/src/codexlens/__pycache__/__init__.cpython-310.pyc +0 -0
  525. package/codex-lens/src/codexlens/__pycache__/__init__.cpython-312.pyc +0 -0
  526. package/codex-lens/src/codexlens/__pycache__/__main__.cpython-310.pyc +0 -0
  527. package/codex-lens/src/codexlens/__pycache__/__main__.cpython-312.pyc +0 -0
  528. package/codex-lens/src/codexlens/__pycache__/config.cpython-310.pyc +0 -0
  529. package/codex-lens/src/codexlens/__pycache__/config.cpython-312.pyc +0 -0
  530. package/codex-lens/src/codexlens/__pycache__/config.cpython-313.pyc +0 -0
  531. package/codex-lens/src/codexlens/__pycache__/entities.cpython-310.pyc +0 -0
  532. package/codex-lens/src/codexlens/__pycache__/entities.cpython-312.pyc +0 -0
  533. package/codex-lens/src/codexlens/__pycache__/entities.cpython-313.pyc +0 -0
  534. package/codex-lens/src/codexlens/__pycache__/env_config.cpython-310.pyc +0 -0
  535. package/codex-lens/src/codexlens/__pycache__/env_config.cpython-312.pyc +0 -0
  536. package/codex-lens/src/codexlens/__pycache__/env_config.cpython-313.pyc +0 -0
  537. package/codex-lens/src/codexlens/__pycache__/errors.cpython-310.pyc +0 -0
  538. package/codex-lens/src/codexlens/__pycache__/errors.cpython-312.pyc +0 -0
  539. package/codex-lens/src/codexlens/cli/__pycache__/__init__.cpython-310.pyc +0 -0
  540. package/codex-lens/src/codexlens/cli/__pycache__/__init__.cpython-312.pyc +0 -0
  541. package/codex-lens/src/codexlens/cli/__pycache__/commands.cpython-310.pyc +0 -0
  542. package/codex-lens/src/codexlens/cli/__pycache__/commands.cpython-312.pyc +0 -0
  543. package/codex-lens/src/codexlens/cli/__pycache__/commands.cpython-313.pyc +0 -0
  544. package/codex-lens/src/codexlens/cli/__pycache__/embedding_manager.cpython-310.pyc +0 -0
  545. package/codex-lens/src/codexlens/cli/__pycache__/embedding_manager.cpython-312.pyc +0 -0
  546. package/codex-lens/src/codexlens/cli/__pycache__/embedding_manager.cpython-313.pyc +0 -0
  547. package/codex-lens/src/codexlens/cli/__pycache__/model_manager.cpython-310.pyc +0 -0
  548. package/codex-lens/src/codexlens/cli/__pycache__/model_manager.cpython-312.pyc +0 -0
  549. package/codex-lens/src/codexlens/cli/__pycache__/model_manager.cpython-313.pyc +0 -0
  550. package/codex-lens/src/codexlens/cli/__pycache__/output.cpython-310.pyc +0 -0
  551. package/codex-lens/src/codexlens/cli/__pycache__/output.cpython-312.pyc +0 -0
  552. package/codex-lens/src/codexlens/cli/commands.py +4416 -2295
  553. package/codex-lens/src/codexlens/cli/embedding_manager.py +777 -15
  554. package/codex-lens/src/codexlens/cli/model_manager.py +676 -0
  555. package/codex-lens/src/codexlens/config.py +356 -12
  556. package/codex-lens/src/codexlens/entities.py +4 -1
  557. package/codex-lens/src/codexlens/env_config.py +304 -0
  558. package/codex-lens/src/codexlens/indexing/__init__.py +23 -1
  559. package/codex-lens/src/codexlens/indexing/__pycache__/__init__.cpython-313.pyc +0 -0
  560. package/codex-lens/src/codexlens/indexing/__pycache__/embedding.cpython-313.pyc +0 -0
  561. package/codex-lens/src/codexlens/indexing/__pycache__/symbol_extractor.cpython-313.pyc +0 -0
  562. package/codex-lens/src/codexlens/indexing/embedding.py +582 -0
  563. package/codex-lens/src/codexlens/indexing/symbol_extractor.py +62 -28
  564. package/codex-lens/src/codexlens/parsers/__pycache__/__init__.cpython-310.pyc +0 -0
  565. package/codex-lens/src/codexlens/parsers/__pycache__/__init__.cpython-312.pyc +0 -0
  566. package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-310.pyc +0 -0
  567. package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-312.pyc +0 -0
  568. package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-313.pyc +0 -0
  569. package/codex-lens/src/codexlens/parsers/__pycache__/tokenizer.cpython-310.pyc +0 -0
  570. package/codex-lens/src/codexlens/parsers/__pycache__/tokenizer.cpython-312.pyc +0 -0
  571. package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-310.pyc +0 -0
  572. package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-312.pyc +0 -0
  573. package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-313.pyc +0 -0
  574. package/codex-lens/src/codexlens/parsers/factory.py +139 -10
  575. package/codex-lens/src/codexlens/parsers/treesitter_parser.py +487 -13
  576. package/codex-lens/src/codexlens/search/__pycache__/__init__.cpython-310.pyc +0 -0
  577. package/codex-lens/src/codexlens/search/__pycache__/__init__.cpython-312.pyc +0 -0
  578. package/codex-lens/src/codexlens/search/__pycache__/binary_searcher.cpython-313.pyc +0 -0
  579. package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-310.pyc +0 -0
  580. package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-312.pyc +0 -0
  581. package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-313.pyc +0 -0
  582. package/codex-lens/src/codexlens/search/__pycache__/enrichment.cpython-313.pyc +0 -0
  583. package/codex-lens/src/codexlens/search/__pycache__/graph_expander.cpython-313.pyc +0 -0
  584. package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-310.pyc +0 -0
  585. package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-312.pyc +0 -0
  586. package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-313.pyc +0 -0
  587. package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-310.pyc +0 -0
  588. package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-312.pyc +0 -0
  589. package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-313.pyc +0 -0
  590. package/codex-lens/src/codexlens/search/binary_searcher.py +277 -0
  591. package/codex-lens/src/codexlens/search/chain_search.py +1652 -8
  592. package/codex-lens/src/codexlens/search/enrichment.py +21 -0
  593. package/codex-lens/src/codexlens/search/graph_expander.py +264 -0
  594. package/codex-lens/src/codexlens/search/hybrid_search.py +772 -37
  595. package/codex-lens/src/codexlens/search/ranking.py +397 -8
  596. package/codex-lens/src/codexlens/semantic/SPLADE_IMPLEMENTATION.md +225 -0
  597. package/codex-lens/src/codexlens/semantic/__pycache__/__init__.cpython-310.pyc +0 -0
  598. package/codex-lens/src/codexlens/semantic/__pycache__/__init__.cpython-312.pyc +0 -0
  599. package/codex-lens/src/codexlens/semantic/__pycache__/ann_index.cpython-310.pyc +0 -0
  600. package/codex-lens/src/codexlens/semantic/__pycache__/ann_index.cpython-312.pyc +0 -0
  601. package/codex-lens/src/codexlens/semantic/__pycache__/ann_index.cpython-313.pyc +0 -0
  602. package/codex-lens/src/codexlens/semantic/__pycache__/base.cpython-310.pyc +0 -0
  603. package/codex-lens/src/codexlens/semantic/__pycache__/base.cpython-312.pyc +0 -0
  604. package/codex-lens/src/codexlens/semantic/__pycache__/chunker.cpython-310.pyc +0 -0
  605. package/codex-lens/src/codexlens/semantic/__pycache__/chunker.cpython-312.pyc +0 -0
  606. package/codex-lens/src/codexlens/semantic/__pycache__/chunker.cpython-313.pyc +0 -0
  607. package/codex-lens/src/codexlens/semantic/__pycache__/embedder.cpython-310.pyc +0 -0
  608. package/codex-lens/src/codexlens/semantic/__pycache__/embedder.cpython-312.pyc +0 -0
  609. package/codex-lens/src/codexlens/semantic/__pycache__/factory.cpython-310.pyc +0 -0
  610. package/codex-lens/src/codexlens/semantic/__pycache__/factory.cpython-312.pyc +0 -0
  611. package/codex-lens/src/codexlens/semantic/__pycache__/factory.cpython-313.pyc +0 -0
  612. package/codex-lens/src/codexlens/semantic/__pycache__/gpu_support.cpython-310.pyc +0 -0
  613. package/codex-lens/src/codexlens/semantic/__pycache__/gpu_support.cpython-312.pyc +0 -0
  614. package/codex-lens/src/codexlens/semantic/__pycache__/gpu_support.cpython-313.pyc +0 -0
  615. package/codex-lens/src/codexlens/semantic/__pycache__/litellm_embedder.cpython-310.pyc +0 -0
  616. package/codex-lens/src/codexlens/semantic/__pycache__/litellm_embedder.cpython-312.pyc +0 -0
  617. package/codex-lens/src/codexlens/semantic/__pycache__/litellm_embedder.cpython-313.pyc +0 -0
  618. package/codex-lens/src/codexlens/semantic/__pycache__/reranker.cpython-313.pyc +0 -0
  619. package/codex-lens/src/codexlens/semantic/__pycache__/splade_encoder.cpython-310.pyc +0 -0
  620. package/codex-lens/src/codexlens/semantic/__pycache__/splade_encoder.cpython-312.pyc +0 -0
  621. package/codex-lens/src/codexlens/semantic/__pycache__/splade_encoder.cpython-313.pyc +0 -0
  622. package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-310.pyc +0 -0
  623. package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-312.pyc +0 -0
  624. package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-313.pyc +0 -0
  625. package/codex-lens/src/codexlens/semantic/ann_index.py +654 -0
  626. package/codex-lens/src/codexlens/semantic/chunker.py +328 -23
  627. package/codex-lens/src/codexlens/semantic/factory.py +63 -3
  628. package/codex-lens/src/codexlens/semantic/gpu_support.py +19 -2
  629. package/codex-lens/src/codexlens/semantic/litellm_embedder.py +144 -144
  630. package/codex-lens/src/codexlens/semantic/reranker/__init__.py +25 -0
  631. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/__init__.cpython-310.pyc +0 -0
  632. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/__init__.cpython-312.pyc +0 -0
  633. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/__init__.cpython-313.pyc +0 -0
  634. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/api_reranker.cpython-310.pyc +0 -0
  635. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/api_reranker.cpython-312.pyc +0 -0
  636. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/api_reranker.cpython-313.pyc +0 -0
  637. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/base.cpython-310.pyc +0 -0
  638. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/base.cpython-312.pyc +0 -0
  639. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/base.cpython-313.pyc +0 -0
  640. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/factory.cpython-310.pyc +0 -0
  641. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/factory.cpython-312.pyc +0 -0
  642. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/factory.cpython-313.pyc +0 -0
  643. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/fastembed_reranker.cpython-310.pyc +0 -0
  644. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/fastembed_reranker.cpython-312.pyc +0 -0
  645. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/fastembed_reranker.cpython-313.pyc +0 -0
  646. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/legacy.cpython-310.pyc +0 -0
  647. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/legacy.cpython-312.pyc +0 -0
  648. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/legacy.cpython-313.pyc +0 -0
  649. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/litellm_reranker.cpython-313.pyc +0 -0
  650. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/onnx_reranker.cpython-310.pyc +0 -0
  651. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/onnx_reranker.cpython-312.pyc +0 -0
  652. package/codex-lens/src/codexlens/semantic/reranker/__pycache__/onnx_reranker.cpython-313.pyc +0 -0
  653. package/codex-lens/src/codexlens/semantic/reranker/api_reranker.py +403 -0
  654. package/codex-lens/src/codexlens/semantic/reranker/base.py +46 -0
  655. package/codex-lens/src/codexlens/semantic/reranker/factory.py +159 -0
  656. package/codex-lens/src/codexlens/semantic/reranker/fastembed_reranker.py +257 -0
  657. package/codex-lens/src/codexlens/semantic/reranker/legacy.py +91 -0
  658. package/codex-lens/src/codexlens/semantic/reranker/litellm_reranker.py +214 -0
  659. package/codex-lens/src/codexlens/semantic/reranker/onnx_reranker.py +268 -0
  660. package/codex-lens/src/codexlens/semantic/splade_encoder.py +567 -0
  661. package/codex-lens/src/codexlens/semantic/vector_store.py +472 -352
  662. package/codex-lens/src/codexlens/storage/__init__.py +3 -0
  663. package/codex-lens/src/codexlens/storage/__pycache__/__init__.cpython-310.pyc +0 -0
  664. package/codex-lens/src/codexlens/storage/__pycache__/__init__.cpython-312.pyc +0 -0
  665. package/codex-lens/src/codexlens/storage/__pycache__/__init__.cpython-313.pyc +0 -0
  666. package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-310.pyc +0 -0
  667. package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-312.pyc +0 -0
  668. package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-313.pyc +0 -0
  669. package/codex-lens/src/codexlens/storage/__pycache__/global_index.cpython-310.pyc +0 -0
  670. package/codex-lens/src/codexlens/storage/__pycache__/global_index.cpython-312.pyc +0 -0
  671. package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-310.pyc +0 -0
  672. package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-312.pyc +0 -0
  673. package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-313.pyc +0 -0
  674. package/codex-lens/src/codexlens/storage/__pycache__/merkle_tree.cpython-313.pyc +0 -0
  675. package/codex-lens/src/codexlens/storage/__pycache__/path_mapper.cpython-310.pyc +0 -0
  676. package/codex-lens/src/codexlens/storage/__pycache__/path_mapper.cpython-312.pyc +0 -0
  677. package/codex-lens/src/codexlens/storage/__pycache__/registry.cpython-310.pyc +0 -0
  678. package/codex-lens/src/codexlens/storage/__pycache__/registry.cpython-312.pyc +0 -0
  679. package/codex-lens/src/codexlens/storage/__pycache__/splade_index.cpython-310.pyc +0 -0
  680. package/codex-lens/src/codexlens/storage/__pycache__/splade_index.cpython-312.pyc +0 -0
  681. package/codex-lens/src/codexlens/storage/__pycache__/splade_index.cpython-313.pyc +0 -0
  682. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-310.pyc +0 -0
  683. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-312.pyc +0 -0
  684. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-313.pyc +0 -0
  685. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_utils.cpython-310.pyc +0 -0
  686. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_utils.cpython-312.pyc +0 -0
  687. package/codex-lens/src/codexlens/storage/__pycache__/vector_meta_store.cpython-310.pyc +0 -0
  688. package/codex-lens/src/codexlens/storage/__pycache__/vector_meta_store.cpython-312.pyc +0 -0
  689. package/codex-lens/src/codexlens/storage/__pycache__/vector_meta_store.cpython-313.pyc +0 -0
  690. package/codex-lens/src/codexlens/storage/dir_index.py +310 -12
  691. package/codex-lens/src/codexlens/storage/index_tree.py +240 -25
  692. package/codex-lens/src/codexlens/storage/merkle_tree.py +136 -0
  693. package/codex-lens/src/codexlens/storage/migrations/__pycache__/__init__.cpython-310.pyc +0 -0
  694. package/codex-lens/src/codexlens/storage/migrations/__pycache__/__init__.cpython-312.pyc +0 -0
  695. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_006_enhance_relationships.cpython-313.pyc +0 -0
  696. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_007_add_graph_neighbors.cpython-310.pyc +0 -0
  697. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_007_add_graph_neighbors.cpython-312.pyc +0 -0
  698. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_007_add_graph_neighbors.cpython-313.pyc +0 -0
  699. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_008_add_merkle_hashes.cpython-313.pyc +0 -0
  700. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_009_add_splade.cpython-313.pyc +0 -0
  701. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_010_add_multi_vector_chunks.cpython-313.pyc +0 -0
  702. package/codex-lens/src/codexlens/storage/migrations/migration_006_enhance_relationships.py +37 -0
  703. package/codex-lens/src/codexlens/storage/migrations/migration_007_add_graph_neighbors.py +47 -0
  704. package/codex-lens/src/codexlens/storage/migrations/migration_008_add_merkle_hashes.py +81 -0
  705. package/codex-lens/src/codexlens/storage/migrations/migration_009_add_splade.py +103 -0
  706. package/codex-lens/src/codexlens/storage/migrations/migration_010_add_multi_vector_chunks.py +162 -0
  707. package/codex-lens/src/codexlens/storage/splade_index.py +578 -0
  708. package/codex-lens/src/codexlens/storage/sqlite_store.py +508 -184
  709. package/codex-lens/src/codexlens/storage/vector_meta_store.py +415 -0
  710. package/codex-lens/src/codexlens/watcher/__init__.py +17 -0
  711. package/codex-lens/src/codexlens/watcher/__pycache__/__init__.cpython-310.pyc +0 -0
  712. package/codex-lens/src/codexlens/watcher/__pycache__/__init__.cpython-312.pyc +0 -0
  713. package/codex-lens/src/codexlens/watcher/__pycache__/__init__.cpython-313.pyc +0 -0
  714. package/codex-lens/src/codexlens/watcher/__pycache__/events.cpython-310.pyc +0 -0
  715. package/codex-lens/src/codexlens/watcher/__pycache__/events.cpython-312.pyc +0 -0
  716. package/codex-lens/src/codexlens/watcher/__pycache__/events.cpython-313.pyc +0 -0
  717. package/codex-lens/src/codexlens/watcher/__pycache__/file_watcher.cpython-310.pyc +0 -0
  718. package/codex-lens/src/codexlens/watcher/__pycache__/file_watcher.cpython-312.pyc +0 -0
  719. package/codex-lens/src/codexlens/watcher/__pycache__/file_watcher.cpython-313.pyc +0 -0
  720. package/codex-lens/src/codexlens/watcher/__pycache__/incremental_indexer.cpython-310.pyc +0 -0
  721. package/codex-lens/src/codexlens/watcher/__pycache__/incremental_indexer.cpython-312.pyc +0 -0
  722. package/codex-lens/src/codexlens/watcher/__pycache__/incremental_indexer.cpython-313.pyc +0 -0
  723. package/codex-lens/src/codexlens/watcher/__pycache__/manager.cpython-310.pyc +0 -0
  724. package/codex-lens/src/codexlens/watcher/__pycache__/manager.cpython-312.pyc +0 -0
  725. package/codex-lens/src/codexlens/watcher/__pycache__/manager.cpython-313.pyc +0 -0
  726. package/codex-lens/src/codexlens/watcher/events.py +82 -0
  727. package/codex-lens/src/codexlens/watcher/file_watcher.py +347 -0
  728. package/codex-lens/src/codexlens/watcher/incremental_indexer.py +369 -0
  729. package/codex-lens/src/codexlens/watcher/manager.py +255 -0
  730. package/package.json +4 -1
  731. package/.claude/commands/workflow/docs/analyze.md +0 -1467
  732. package/.claude/commands/workflow/docs/copyright.md +0 -1265
  733. package/.claude/skills/command-guide/SKILL.md +0 -388
  734. package/.claude/skills/command-guide/UPDATE-GUIDELINE.md +0 -592
  735. package/.claude/skills/command-guide/guides/cli-tools-guide.md +0 -410
  736. package/.claude/skills/command-guide/guides/examples.md +0 -537
  737. package/.claude/skills/command-guide/guides/getting-started.md +0 -242
  738. package/.claude/skills/command-guide/guides/implementation-details.md +0 -1010
  739. package/.claude/skills/command-guide/guides/index-structure.md +0 -326
  740. package/.claude/skills/command-guide/guides/troubleshooting.md +0 -92
  741. package/.claude/skills/command-guide/guides/ui-design-workflow-guide.md +0 -316
  742. package/.claude/skills/command-guide/guides/workflow-patterns.md +0 -662
  743. package/.claude/skills/command-guide/reference/agents/action-planning-agent.md +0 -855
  744. package/.claude/skills/command-guide/reference/agents/cli-execution-agent.md +0 -267
  745. package/.claude/skills/command-guide/reference/agents/cli-explore-agent.md +0 -182
  746. package/.claude/skills/command-guide/reference/agents/cli-lite-planning-agent.md +0 -446
  747. package/.claude/skills/command-guide/reference/agents/cli-planning-agent.md +0 -558
  748. package/.claude/skills/command-guide/reference/agents/code-developer.md +0 -311
  749. package/.claude/skills/command-guide/reference/agents/conceptual-planning-agent.md +0 -308
  750. package/.claude/skills/command-guide/reference/agents/context-search-agent.md +0 -581
  751. package/.claude/skills/command-guide/reference/agents/doc-generator.md +0 -330
  752. package/.claude/skills/command-guide/reference/agents/memory-bridge.md +0 -94
  753. package/.claude/skills/command-guide/reference/agents/test-context-search-agent.md +0 -400
  754. package/.claude/skills/command-guide/reference/agents/test-fix-agent.md +0 -344
  755. package/.claude/skills/command-guide/reference/agents/ui-design-agent.md +0 -593
  756. package/.claude/skills/command-guide/reference/agents/universal-executor.md +0 -131
  757. package/.claude/skills/command-guide/reference/commands/cli/cli-init.md +0 -440
  758. package/.claude/skills/command-guide/reference/commands/enhance-prompt.md +0 -93
  759. package/.claude/skills/command-guide/reference/commands/memory/code-map-memory.md +0 -687
  760. package/.claude/skills/command-guide/reference/commands/memory/docs-full-cli.md +0 -471
  761. package/.claude/skills/command-guide/reference/commands/memory/docs-related-cli.md +0 -386
  762. package/.claude/skills/command-guide/reference/commands/memory/docs.md +0 -616
  763. package/.claude/skills/command-guide/reference/commands/memory/load-skill-memory.md +0 -182
  764. package/.claude/skills/command-guide/reference/commands/memory/load.md +0 -240
  765. package/.claude/skills/command-guide/reference/commands/memory/skill-memory.md +0 -525
  766. package/.claude/skills/command-guide/reference/commands/memory/style-skill-memory.md +0 -396
  767. package/.claude/skills/command-guide/reference/commands/memory/tech-research.md +0 -314
  768. package/.claude/skills/command-guide/reference/commands/memory/update-full.md +0 -332
  769. package/.claude/skills/command-guide/reference/commands/memory/update-related.md +0 -332
  770. package/.claude/skills/command-guide/reference/commands/memory/workflow-skill-memory.md +0 -517
  771. package/.claude/skills/command-guide/reference/commands/task/breakdown.md +0 -204
  772. package/.claude/skills/command-guide/reference/commands/task/create.md +0 -152
  773. package/.claude/skills/command-guide/reference/commands/task/execute.md +0 -270
  774. package/.claude/skills/command-guide/reference/commands/task/replan.md +0 -437
  775. package/.claude/skills/command-guide/reference/commands/version.md +0 -254
  776. package/.claude/skills/command-guide/reference/commands/workflow/action-plan-verify.md +0 -447
  777. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/api-designer.md +0 -585
  778. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/artifacts.md +0 -452
  779. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/auto-parallel.md +0 -443
  780. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/data-architect.md +0 -220
  781. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/product-manager.md +0 -200
  782. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/product-owner.md +0 -200
  783. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/scrum-master.md +0 -200
  784. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/subject-matter-expert.md +0 -200
  785. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/synthesis.md +0 -398
  786. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/system-architect.md +0 -387
  787. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/ui-designer.md +0 -221
  788. package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/ux-expert.md +0 -221
  789. package/.claude/skills/command-guide/reference/commands/workflow/execute.md +0 -465
  790. package/.claude/skills/command-guide/reference/commands/workflow/init.md +0 -164
  791. package/.claude/skills/command-guide/reference/commands/workflow/lite-execute.md +0 -748
  792. package/.claude/skills/command-guide/reference/commands/workflow/lite-fix.md +0 -664
  793. package/.claude/skills/command-guide/reference/commands/workflow/lite-plan.md +0 -645
  794. package/.claude/skills/command-guide/reference/commands/workflow/plan.md +0 -551
  795. package/.claude/skills/command-guide/reference/commands/workflow/replan.md +0 -515
  796. package/.claude/skills/command-guide/reference/commands/workflow/review-fix.md +0 -606
  797. package/.claude/skills/command-guide/reference/commands/workflow/review-module-cycle.md +0 -765
  798. package/.claude/skills/command-guide/reference/commands/workflow/review-session-cycle.md +0 -776
  799. package/.claude/skills/command-guide/reference/commands/workflow/review.md +0 -298
  800. package/.claude/skills/command-guide/reference/commands/workflow/session/complete.md +0 -547
  801. package/.claude/skills/command-guide/reference/commands/workflow/session/list.md +0 -114
  802. package/.claude/skills/command-guide/reference/commands/workflow/session/resume.md +0 -77
  803. package/.claude/skills/command-guide/reference/commands/workflow/session/start.md +0 -257
  804. package/.claude/skills/command-guide/reference/commands/workflow/tdd-plan.md +0 -460
  805. package/.claude/skills/command-guide/reference/commands/workflow/tdd-verify.md +0 -400
  806. package/.claude/skills/command-guide/reference/commands/workflow/test-cycle-execute.md +0 -498
  807. package/.claude/skills/command-guide/reference/commands/workflow/test-fix-gen.md +0 -699
  808. package/.claude/skills/command-guide/reference/commands/workflow/test-gen.md +0 -529
  809. package/.claude/skills/command-guide/reference/commands/workflow/tools/conflict-resolution.md +0 -766
  810. package/.claude/skills/command-guide/reference/commands/workflow/tools/context-gather.md +0 -433
  811. package/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-agent.md +0 -487
  812. package/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-tdd.md +0 -518
  813. package/.claude/skills/command-guide/reference/commands/workflow/tools/tdd-coverage-analysis.md +0 -309
  814. package/.claude/skills/command-guide/reference/commands/workflow/tools/test-concept-enhanced.md +0 -163
  815. package/.claude/skills/command-guide/reference/commands/workflow/tools/test-context-gather.md +0 -232
  816. package/.claude/skills/command-guide/reference/commands/workflow/tools/test-task-generate.md +0 -254
  817. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/animation-extract.md +0 -1150
  818. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/codify-style.md +0 -652
  819. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/design-sync.md +0 -454
  820. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/explore-auto.md +0 -678
  821. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/generate.md +0 -504
  822. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/imitate-auto.md +0 -745
  823. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/import-from-code.md +0 -537
  824. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/layout-extract.md +0 -788
  825. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/reference-page-generator.md +0 -356
  826. package/.claude/skills/command-guide/reference/commands/workflow/ui-design/style-extract.md +0 -773
  827. package/.claude/skills/command-guide/scripts/analyze_commands.py +0 -502
  828. package/.claude/skills/command-guide/scripts/update-index.sh +0 -130
  829. package/.claude/skills/command-guide/templates/issue-bug.md +0 -104
  830. package/.claude/skills/command-guide/templates/issue-diagnosis.md +0 -275
  831. package/.claude/skills/command-guide/templates/issue-feature.md +0 -97
  832. package/.claude/skills/command-guide/templates/issue-question.md +0 -141
@@ -1,1467 +0,0 @@
1
- ---
2
- name: analyze
3
- description: Multi-phase iterative project analysis with user-guided focus, produces architecture/design/method reports through incremental updates
4
- argument-hint: "[scope|path] [--type=architecture|design|methods|comprehensive]"
5
- allowed-tools: Task(*), AskUserQuestion(*), Read(*), Bash(*), Glob(*), Grep(*), TodoWrite(*), Write(*)
6
- ---
7
-
8
- # Workflow Docs Analyze Command (/workflow:docs:analyze)
9
-
10
- ## Overview
11
-
12
- **Iterative project analysis command** that guides users through multi-phase analysis to produce tailored project reports. Uses multi-agent collaboration with incremental report updates based on user feedback.
13
-
14
- **Core Differentiator**: Unlike static analysis tools, this command engages in multi-round dialogue to understand user's specific focus areas and iteratively refines reports until user satisfaction.
15
-
16
- ## Report Types
17
-
18
- | Type | Focus | Output |
19
- |------|-------|--------|
20
- | `architecture` | System structure, module relationships, dependencies | ARCHITECTURE-REPORT.md |
21
- | `design` | Design patterns, class diagrams, component interactions | DESIGN-REPORT.md |
22
- | `methods` | Key algorithms, critical paths, core functions explained | METHODS-REPORT.md |
23
- | `comprehensive` | All above combined | COMPREHENSIVE-REPORT.md |
24
-
25
- ## Execution Philosophy
26
-
27
- **User-Centric Iteration Model**:
28
- 1. **Discover** user's actual analysis needs (not assume)
29
- 2. **Explore** codebase from multiple angles
30
- 3. **Generate** initial report with clear structure
31
- 4. **Iterate** based on user feedback until satisfied
32
- 5. **Finalize** polished report
33
-
34
- ## Execution Process
35
-
36
- ```
37
- Input Parsing:
38
- ├─ Parse: scope/path (optional, defaults to project root)
39
- └─ Parse: --type flag (optional, determines initial focus)
40
-
41
- Phase 1: Requirements Discovery (AskUserQuestion)
42
- ├─ Ask: Report type preference (if not specified)
43
- ├─ Ask: Focus areas within chosen type
44
- ├─ Ask: Depth level (overview/detailed/deep-dive)
45
- └─ Output: analysis_config object
46
-
47
- Phase 2: Project Exploration (cli-explore-agent)
48
- ├─ Execute: Parallel exploration by focus areas
49
- ├─ Generate: exploration-{angle}.json files
50
- └─ Output: explorations-manifest.json
51
-
52
- Phase 3: Deep Analysis (Gemini CLI)
53
- ├─ Execute: Multi-dimensional analysis
54
- ├─ Generate: analysis-{dimension}.json files
55
- └─ Output: analysis-manifest.json
56
-
57
- Phase 4: Initial Report Generation
58
- ├─ Synthesize: Merge all analysis results
59
- ├─ Generate: {TYPE}-REPORT.md (draft)
60
- └─ Output: Present report to user
61
-
62
- Phase 5: Iterative Refinement (Loop)
63
- ├─ Ask: User feedback on current report
64
- ├─ Decision:
65
- │ ├─ "satisfied" → Finalize and exit
66
- │ ├─ "expand section X" → Deep-dive specific area
67
- │ ├─ "add details on Y" → Augment with new analysis
68
- │ └─ "change focus" → Re-run Phase 3 with new config
69
- └─ Update: Incremental report modification
70
-
71
- Finalize:
72
- └─ Output: Final {TYPE}-REPORT.md
73
- ```
74
-
75
- ## 5-Phase Execution
76
-
77
- ### Phase 1: Requirements Discovery
78
-
79
- **Purpose**: Understand user's actual analysis needs through interactive questioning
80
-
81
- **Step 1.1: Initialize TodoWrite**
82
-
83
- ```javascript
84
- TodoWrite([
85
- {content: "Phase 1: Requirements Discovery", status: "in_progress", activeForm: "Discovering analysis requirements"},
86
- {content: "Phase 2: Project Exploration", status: "pending", activeForm: "Exploring project structure"},
87
- {content: "Phase 3: Deep Analysis", status: "pending", activeForm: "Performing deep analysis"},
88
- {content: "Phase 4: Initial Report Generation", status: "pending", activeForm: "Generating initial report"},
89
- {content: "Phase 5: Iterative Refinement", status: "pending", activeForm: "Refining report based on feedback"}
90
- ])
91
- ```
92
-
93
- **Step 1.2: Report Type Selection (if not specified)**
94
-
95
- ```javascript
96
- if (!type_specified) {
97
- AskUserQuestion({
98
- questions: [{
99
- question: "What type of project analysis report would you like?",
100
- header: "Report Type",
101
- multiSelect: false,
102
- options: [
103
- {label: "Architecture (Recommended)", description: "System structure, module relationships, layer analysis, dependency graph"},
104
- {label: "Design", description: "Design patterns, class relationships, component interactions, abstraction analysis"},
105
- {label: "Methods", description: "Key algorithms, critical code paths, core function explanations with examples"},
106
- {label: "Comprehensive", description: "All above combined into a complete project analysis"}
107
- ]
108
- }]
109
- })
110
- }
111
- ```
112
-
113
- **Step 1.3: Focus Area Discovery**
114
-
115
- ```javascript
116
- // Based on report type, ask focused questions
117
- const focusQuestions = {
118
- architecture: {
119
- question: "Which architectural aspects are you most interested in?",
120
- header: "Focus Areas",
121
- multiSelect: true,
122
- options: [
123
- {label: "Layer Structure", description: "How the system is divided into layers (presentation, business, data)"},
124
- {label: "Module Dependencies", description: "How modules depend on and communicate with each other"},
125
- {label: "Entry Points", description: "How requests flow through the system from entry to response"},
126
- {label: "Data Flow", description: "How data moves and transforms across the system"}
127
- ]
128
- },
129
- design: {
130
- question: "Which design aspects do you want to understand?",
131
- header: "Design Focus",
132
- multiSelect: true,
133
- options: [
134
- {label: "Design Patterns", description: "Identify and explain patterns used in the codebase"},
135
- {label: "Class Relationships", description: "Inheritance, composition, and associations between classes"},
136
- {label: "Interface Contracts", description: "How components communicate through interfaces/protocols"},
137
- {label: "State Management", description: "How application state is managed and mutated"}
138
- ]
139
- },
140
- methods: {
141
- question: "What kind of method analysis do you need?",
142
- header: "Method Focus",
143
- multiSelect: true,
144
- options: [
145
- {label: "Core Algorithms", description: "Key algorithms that define the system's behavior"},
146
- {label: "Critical Paths", description: "Most important execution flows in the application"},
147
- {label: "Public APIs", description: "External-facing methods and their contracts"},
148
- {label: "Complex Logic", description: "Methods with high cyclomatic complexity explained"}
149
- ]
150
- }
151
- };
152
-
153
- AskUserQuestion({questions: [focusQuestions[selected_type]]})
154
- ```
155
-
156
- **Step 1.4: Depth Level Selection**
157
-
158
- ```javascript
159
- AskUserQuestion({
160
- questions: [{
161
- question: "How detailed should the analysis be?",
162
- header: "Depth",
163
- multiSelect: false,
164
- options: [
165
- {label: "Overview (Recommended)", description: "High-level understanding, suitable for onboarding or quick review"},
166
- {label: "Detailed", description: "In-depth analysis with code examples and explanations"},
167
- {label: "Deep-Dive", description: "Exhaustive analysis with implementation details and edge cases"}
168
- ]
169
- }]
170
- })
171
- ```
172
-
173
- **Step 1.5: Store Analysis Config**
174
-
175
- ```javascript
176
- const analysis_config = {
177
- type: selected_type,
178
- focus_areas: selected_focus_areas,
179
- depth: selected_depth,
180
- scope: scope_path || ".",
181
- timestamp: new Date().toISOString()
182
- };
183
-
184
- // Create output directory
185
- const outputDir = `.workflow/.scratchpad/analyze-${Date.now()}`;
186
- bash(`mkdir -p ${outputDir}`);
187
- Write(`${outputDir}/analysis-config.json`, JSON.stringify(analysis_config, null, 2));
188
- ```
189
-
190
- **TodoWrite**: Mark Phase 1 completed, Phase 2 in_progress
191
-
192
- ---
193
-
194
- ### Phase 2: Project Exploration
195
-
196
- **Purpose**: Multi-angle exploration based on user's focus areas
197
-
198
- **Step 2.1: Launch Parallel Explore Agents**
199
-
200
- ```javascript
201
- const explorationAngles = mapFocusToAngles(analysis_config.focus_areas);
202
- // Examples:
203
- // - "Layer Structure" → ["architecture", "dependencies"]
204
- // - "Design Patterns" → ["patterns", "abstractions"]
205
- // - "Core Algorithms" → ["algorithms", "complexity"]
206
-
207
- const explorationTasks = explorationAngles.map((angle, index) =>
208
- Task({
209
- subagent_type: "cli-explore-agent",
210
- run_in_background: false,
211
- description: `Explore: ${angle}`,
212
- prompt: `
213
- ## Exploration Objective
214
- Execute **${angle}** exploration for project analysis report.
215
-
216
- ## Context
217
- - **Angle**: ${angle}
218
- - **Report Type**: ${analysis_config.type}
219
- - **Depth**: ${analysis_config.depth}
220
- - **Scope**: ${analysis_config.scope}
221
- - **Output**: ${outputDir}/exploration-${angle}.json
222
-
223
- ## Exploration Protocol
224
-
225
- **Step 1: Structural Discovery**
226
- - Execute: ccw tool exec get_modules_by_depth '{}'
227
- - Find files relevant to ${angle} using rg/glob
228
- - Map directory structure and module boundaries
229
-
230
- **Step 2: Pattern Recognition**
231
- - Identify ${angle}-related patterns and conventions
232
- - Note file naming, organization patterns
233
- - Extract key abstractions
234
-
235
- **Step 3: Relationship Mapping**
236
- - Map dependencies and relationships
237
- - Identify integration points
238
- - Note coupling and cohesion patterns
239
-
240
- ## Output Format
241
- {
242
- "angle": "${angle}",
243
- "findings": {
244
- "structure": [...],
245
- "patterns": [...],
246
- "relationships": [...],
247
- "key_files": [{path, relevance, rationale}]
248
- },
249
- "insights": [...],
250
- "depth_notes": "${analysis_config.depth}-specific observations"
251
- }
252
-
253
- Write output to: ${outputDir}/exploration-${angle}.json
254
- `
255
- })
256
- );
257
- ```
258
-
259
- **Step 2.2: Generate Exploration Manifest**
260
-
261
- ```javascript
262
- const manifest = {
263
- config: analysis_config,
264
- explorations: explorationAngles.map(angle => ({
265
- angle,
266
- file: `exploration-${angle}.json`
267
- })),
268
- timestamp: new Date().toISOString()
269
- };
270
- Write(`${outputDir}/explorations-manifest.json`, JSON.stringify(manifest, null, 2));
271
- ```
272
-
273
- **TodoWrite**: Mark Phase 2 completed, Phase 3 in_progress
274
-
275
- ---
276
-
277
- ### Phase 3: Deep Analysis
278
-
279
- **Purpose**: Use Gemini CLI for in-depth analysis based on exploration results
280
-
281
- **Step 3.1: Synthesize Exploration Results**
282
-
283
- ```javascript
284
- // Read all exploration files
285
- const explorations = explorationAngles.map(angle =>
286
- JSON.parse(Read(`${outputDir}/exploration-${angle}.json`))
287
- );
288
-
289
- // Extract key files to analyze
290
- const keyFiles = explorations.flatMap(e => e.findings.key_files)
291
- .sort((a, b) => b.relevance - a.relevance)
292
- .slice(0, 20); // Top 20 most relevant files
293
- ```
294
-
295
- **Step 3.2: Execute Deep Analysis via Gemini CLI**
296
-
297
- ```javascript
298
- const analysisPrompt = buildAnalysisPrompt(analysis_config, keyFiles);
299
-
300
- Bash({
301
- command: `ccw cli -p "
302
- PURPOSE: Generate ${analysis_config.type} analysis report for project
303
- TASK:
304
- • Analyze project structure and patterns from ${analysis_config.type} perspective
305
- • Focus on: ${analysis_config.focus_areas.join(', ')}
306
- • Depth level: ${analysis_config.depth}
307
- • Key files to analyze: ${keyFiles.map(f => f.path).join(', ')}
308
- MODE: analysis
309
- CONTEXT: @**/* | Exploration results from ${outputDir}/
310
- EXPECTED:
311
- - Structured ${analysis_config.type} analysis
312
- - Clear explanations with code references
313
- - Mermaid diagrams where applicable
314
- - Actionable insights
315
- RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) |
316
- Focus on ${analysis_config.focus_areas.join(', ')} |
317
- Depth: ${analysis_config.depth}
318
- " --tool gemini --mode analysis`,
319
- run_in_background: true,
320
- timeout: 600000
321
- });
322
- ```
323
-
324
- **Step 3.3: Store Analysis Results**
325
-
326
- ```javascript
327
- // After CLI completes, store structured results
328
- Write(`${outputDir}/deep-analysis.json`, JSON.stringify({
329
- type: analysis_config.type,
330
- focus_areas: analysis_config.focus_areas,
331
- analysis_result: cli_output,
332
- diagrams: extracted_diagrams,
333
- code_references: extracted_references
334
- }, null, 2));
335
- ```
336
-
337
- **TodoWrite**: Mark Phase 3 completed, Phase 3.5 in_progress
338
-
339
- ---
340
-
341
- ### Phase 3.5: Diagram Generation
342
-
343
- **Purpose**: Generate Mermaid diagrams based on analysis results, tailored to report type
344
-
345
- **Step 3.5.1: Determine Required Diagrams**
346
-
347
- ```javascript
348
- // Map report types to required diagram types
349
- const diagramRequirements = {
350
- architecture: [
351
- {type: 'architecture', format: 'graph TD', name: 'System Architecture'},
352
- {type: 'layers', format: 'graph TD', name: 'Layer Structure'},
353
- {type: 'dependencies', format: 'graph LR', name: 'Module Dependencies'},
354
- {type: 'dataflow', format: 'flowchart LR', name: 'Data Flow'}
355
- ],
356
- design: [
357
- {type: 'class', format: 'classDiagram', name: 'Class Diagram'},
358
- {type: 'components', format: 'graph TD', name: 'Component Diagram'},
359
- {type: 'patterns', format: 'graph TD', name: 'Design Patterns'},
360
- {type: 'state', format: 'stateDiagram-v2', name: 'State Management'}
361
- ],
362
- methods: [
363
- {type: 'algorithm', format: 'flowchart TD', name: 'Algorithm Flowchart'},
364
- {type: 'sequence', format: 'sequenceDiagram', name: 'Call Sequence'},
365
- {type: 'critical_path', format: 'flowchart LR', name: 'Critical Path'},
366
- {type: 'api', format: 'graph LR', name: 'API Structure'}
367
- ],
368
- comprehensive: [
369
- {type: 'architecture', format: 'graph TD', name: 'System Architecture'},
370
- {type: 'class', format: 'classDiagram', name: 'Class Diagram'},
371
- {type: 'sequence', format: 'sequenceDiagram', name: 'Key Sequences'},
372
- {type: 'dataflow', format: 'flowchart LR', name: 'Data Flow'}
373
- ]
374
- };
375
-
376
- const requiredDiagrams = diagramRequirements[config.type];
377
- bash(`mkdir -p ${outputDir}/diagrams`);
378
- ```
379
-
380
- **Step 3.5.2: Generate Architecture Diagrams (graph TD)**
381
-
382
- ```javascript
383
- function generateArchitectureDiagram(analysis) {
384
- let mermaid = 'graph TD\n';
385
-
386
- // Subgraphs for layers/modules
387
- const layers = analysis.structure?.layers || extractLayers(analysis);
388
- for (const layer of layers) {
389
- mermaid += ` subgraph ${sanitizeId(layer.name)}["${escapeLabel(layer.name)}"]\n`;
390
- for (const component of layer.components || []) {
391
- mermaid += ` ${sanitizeId(component.id)}["${escapeLabel(component.name)}"]\n`;
392
- }
393
- mermaid += ' end\n';
394
- }
395
-
396
- // Connections
397
- const connections = analysis.relationships || [];
398
- for (const conn of connections) {
399
- const label = conn.label ? `|"${escapeLabel(conn.label)}"|` : '';
400
- mermaid += ` ${sanitizeId(conn.from)} -->${label} ${sanitizeId(conn.to)}\n`;
401
- }
402
-
403
- // Styling
404
- mermaid += '\n %% Styling\n';
405
- mermaid += ' classDef core fill:#e1f5fe,stroke:#01579b\n';
406
- mermaid += ' classDef external fill:#fff3e0,stroke:#e65100\n';
407
-
408
- return mermaid;
409
- }
410
-
411
- if (requiredDiagrams.some(d => d.type === 'architecture')) {
412
- const archDiagram = generateArchitectureDiagram(deepAnalysis);
413
- Write(`${outputDir}/diagrams/architecture.mmd`, archDiagram);
414
- }
415
- ```
416
-
417
- **Step 3.5.3: Generate Layer/Dependency Diagrams**
418
-
419
- ```javascript
420
- function generateLayerDiagram(analysis) {
421
- let mermaid = 'graph TD\n';
422
-
423
- const layers = ['Presentation', 'Application', 'Domain', 'Infrastructure'];
424
- const detectedLayers = analysis.layers || inferLayers(analysis);
425
-
426
- for (let i = 0; i < detectedLayers.length; i++) {
427
- const layer = detectedLayers[i];
428
- mermaid += ` subgraph L${i}["${escapeLabel(layer.name)}"]\n`;
429
- mermaid += ` direction LR\n`;
430
- for (const mod of layer.modules || []) {
431
- mermaid += ` ${sanitizeId(mod)}["${escapeLabel(mod)}"]\n`;
432
- }
433
- mermaid += ' end\n';
434
-
435
- if (i < detectedLayers.length - 1) {
436
- mermaid += ` L${i} --> L${i + 1}\n`;
437
- }
438
- }
439
-
440
- return mermaid;
441
- }
442
-
443
- function generateDependencyDiagram(analysis) {
444
- let mermaid = 'graph LR\n';
445
-
446
- const modules = analysis.modules || [];
447
- const deps = analysis.dependencies || [];
448
-
449
- // Nodes
450
- for (const mod of modules) {
451
- const shape = mod.type === 'core' ? '([' : '[';
452
- const shapeEnd = mod.type === 'core' ? '])' : ']';
453
- mermaid += ` ${sanitizeId(mod.name)}${shape}"${escapeLabel(mod.name)}"${shapeEnd}\n`;
454
- }
455
-
456
- // Edges with labels
457
- for (const dep of deps) {
458
- const style = dep.type === 'weak' ? '-.->' : '-->';
459
- const label = dep.count ? `|"${dep.count} refs"|` : '';
460
- mermaid += ` ${sanitizeId(dep.from)} ${style}${label} ${sanitizeId(dep.to)}\n`;
461
- }
462
-
463
- return mermaid;
464
- }
465
-
466
- if (requiredDiagrams.some(d => d.type === 'layers')) {
467
- Write(`${outputDir}/diagrams/layers.mmd`, generateLayerDiagram(deepAnalysis));
468
- }
469
- if (requiredDiagrams.some(d => d.type === 'dependencies')) {
470
- Write(`${outputDir}/diagrams/dependencies.mmd`, generateDependencyDiagram(deepAnalysis));
471
- }
472
- ```
473
-
474
- **Step 3.5.4: Generate Class Diagrams (classDiagram)**
475
-
476
- ```javascript
477
- function generateClassDiagram(analysis) {
478
- let mermaid = 'classDiagram\n';
479
-
480
- const entities = analysis.entities || analysis.classes || [];
481
-
482
- // Classes with properties and methods
483
- for (const entity of entities.slice(0, 15)) { // Limit for readability
484
- mermaid += ` class ${sanitizeId(entity.name)} {\n`;
485
-
486
- // Properties
487
- for (const prop of (entity.properties || []).slice(0, 8)) {
488
- const vis = {public: '+', private: '-', protected: '#'}[prop.visibility] || '+';
489
- mermaid += ` ${vis}${sanitizeType(prop.type)} ${prop.name}\n`;
490
- }
491
-
492
- // Methods
493
- for (const method of (entity.methods || []).slice(0, 6)) {
494
- const vis = {public: '+', private: '-', protected: '#'}[method.visibility] || '+';
495
- const params = (method.params || []).map(p => `${p.name}`).join(', ');
496
- mermaid += ` ${vis}${method.name}(${params}) ${sanitizeType(method.returnType || 'void')}\n`;
497
- }
498
-
499
- mermaid += ' }\n';
500
- }
501
-
502
- // Relationships
503
- const relationships = analysis.relationships || [];
504
- const arrows = {
505
- inheritance: '--|>',
506
- implementation: '..|>',
507
- composition: '*--',
508
- aggregation: 'o--',
509
- association: '-->',
510
- dependency: '..>'
511
- };
512
-
513
- for (const rel of relationships) {
514
- const arrow = arrows[rel.type] || '-->';
515
- const label = rel.label ? ` : ${escapeLabel(rel.label)}` : '';
516
- mermaid += ` ${sanitizeId(rel.from)} ${arrow} ${sanitizeId(rel.to)}${label}\n`;
517
- }
518
-
519
- return mermaid;
520
- }
521
-
522
- if (requiredDiagrams.some(d => d.type === 'class')) {
523
- Write(`${outputDir}/diagrams/class-diagram.mmd`, generateClassDiagram(deepAnalysis));
524
- }
525
- ```
526
-
527
- **Step 3.5.5: Generate Flowcharts (flowchart TD)**
528
-
529
- ```javascript
530
- function generateAlgorithmFlowchart(algorithm) {
531
- let mermaid = 'flowchart TD\n';
532
-
533
- // Start
534
- mermaid += ` START(["Start: ${escapeLabel(algorithm.name)}"])\n`;
535
-
536
- // Input processing
537
- if (algorithm.inputs?.length > 0) {
538
- mermaid += ` INPUT[/"Input: ${algorithm.inputs.map(i => i.name).join(', ')}"/]\n`;
539
- mermaid += ' START --> INPUT\n';
540
- }
541
-
542
- // Process steps
543
- let prevNode = algorithm.inputs?.length > 0 ? 'INPUT' : 'START';
544
- for (let i = 0; i < (algorithm.steps || []).length; i++) {
545
- const step = algorithm.steps[i];
546
- const nodeId = `STEP${i}`;
547
-
548
- if (step.type === 'decision') {
549
- mermaid += ` ${nodeId}{"${escapeLabel(step.description)}"}\n`;
550
- mermaid += ` ${prevNode} --> ${nodeId}\n`;
551
- if (step.yes_branch) {
552
- mermaid += ` ${nodeId} -->|"Yes"| ${sanitizeId(step.yes_branch)}\n`;
553
- }
554
- if (step.no_branch) {
555
- mermaid += ` ${nodeId} -->|"No"| ${sanitizeId(step.no_branch)}\n`;
556
- }
557
- } else {
558
- mermaid += ` ${nodeId}["${escapeLabel(step.description)}"]\n`;
559
- mermaid += ` ${prevNode} --> ${nodeId}\n`;
560
- }
561
- prevNode = nodeId;
562
- }
563
-
564
- // Output and end
565
- mermaid += ` OUTPUT[/"Output: ${escapeLabel(algorithm.output || 'Result')}"/]\n`;
566
- mermaid += ` ${prevNode} --> OUTPUT\n`;
567
- mermaid += ' END_([End])\n';
568
- mermaid += ' OUTPUT --> END_\n';
569
-
570
- return mermaid;
571
- }
572
-
573
- function generateDataFlowDiagram(analysis) {
574
- let mermaid = 'flowchart LR\n';
575
-
576
- const flows = analysis.dataFlows || [];
577
-
578
- // Data stores
579
- mermaid += ' subgraph DataStores["Data Stores"]\n';
580
- for (const store of analysis.dataStores || []) {
581
- mermaid += ` ${sanitizeId(store.id)}[("${escapeLabel(store.name)}")]\n`;
582
- }
583
- mermaid += ' end\n';
584
-
585
- // Processes
586
- mermaid += ' subgraph Processes["Processes"]\n';
587
- for (const proc of analysis.processes || []) {
588
- mermaid += ` ${sanitizeId(proc.id)}["${escapeLabel(proc.name)}"]\n`;
589
- }
590
- mermaid += ' end\n';
591
-
592
- // Flows
593
- for (const flow of flows) {
594
- mermaid += ` ${sanitizeId(flow.from)} -->|"${escapeLabel(flow.data)}"| ${sanitizeId(flow.to)}\n`;
595
- }
596
-
597
- return mermaid;
598
- }
599
-
600
- // Generate algorithm flowcharts
601
- const algorithms = deepAnalysis.algorithms || [];
602
- for (const algo of algorithms.slice(0, 3)) { // Top 3 algorithms
603
- const flowchart = generateAlgorithmFlowchart(algo);
604
- Write(`${outputDir}/diagrams/algorithm-${sanitizeId(algo.name)}.mmd`, flowchart);
605
- }
606
-
607
- if (requiredDiagrams.some(d => d.type === 'dataflow')) {
608
- Write(`${outputDir}/diagrams/dataflow.mmd`, generateDataFlowDiagram(deepAnalysis));
609
- }
610
- ```
611
-
612
- **Step 3.5.6: Generate Sequence Diagrams (sequenceDiagram)**
613
-
614
- ```javascript
615
- function generateSequenceDiagram(scenario) {
616
- let mermaid = 'sequenceDiagram\n';
617
-
618
- // Title
619
- mermaid += ` title ${escapeLabel(scenario.name)}\n`;
620
-
621
- // Participants
622
- for (const actor of scenario.actors || []) {
623
- const type = actor.type === 'external' ? 'actor' : 'participant';
624
- mermaid += ` ${type} ${sanitizeId(actor.id)} as ${escapeLabel(actor.name)}\n`;
625
- }
626
-
627
- mermaid += '\n';
628
-
629
- // Messages
630
- for (const msg of scenario.messages || []) {
631
- let arrow;
632
- switch (msg.type) {
633
- case 'async': arrow = '->>'; break;
634
- case 'response': arrow = '-->>'; break;
635
- case 'create': arrow = '->>+'; break;
636
- case 'destroy': arrow = '->>-'; break;
637
- default: arrow = '->>';
638
- }
639
-
640
- mermaid += ` ${sanitizeId(msg.from)}${arrow}${sanitizeId(msg.to)}: ${escapeLabel(msg.description)}\n`;
641
-
642
- // Activations
643
- if (msg.activate) {
644
- mermaid += ` activate ${sanitizeId(msg.to)}\n`;
645
- }
646
- if (msg.deactivate) {
647
- mermaid += ` deactivate ${sanitizeId(msg.from)}\n`;
648
- }
649
-
650
- // Notes
651
- if (msg.note) {
652
- mermaid += ` Note over ${sanitizeId(msg.to)}: ${escapeLabel(msg.note)}\n`;
653
- }
654
- }
655
-
656
- // Loops and conditions
657
- for (const block of scenario.blocks || []) {
658
- if (block.type === 'loop') {
659
- mermaid += ` loop ${escapeLabel(block.condition)}\n`;
660
- for (const m of block.messages) {
661
- mermaid += ` ${sanitizeId(m.from)}->>${sanitizeId(m.to)}: ${escapeLabel(m.description)}\n`;
662
- }
663
- mermaid += ' end\n';
664
- }
665
- }
666
-
667
- return mermaid;
668
- }
669
-
670
- // Generate sequence diagrams for key scenarios
671
- const scenarios = deepAnalysis.sequences || deepAnalysis.scenarios || [];
672
- for (const scenario of scenarios.slice(0, 3)) {
673
- const seqDiagram = generateSequenceDiagram(scenario);
674
- Write(`${outputDir}/diagrams/sequence-${sanitizeId(scenario.name)}.mmd`, seqDiagram);
675
- }
676
- ```
677
-
678
- **Step 3.5.7: Generate State Diagrams (stateDiagram-v2)**
679
-
680
- ```javascript
681
- function generateStateDiagram(stateAnalysis) {
682
- let mermaid = 'stateDiagram-v2\n';
683
-
684
- const states = stateAnalysis.states || [];
685
- const transitions = stateAnalysis.transitions || [];
686
-
687
- // States
688
- for (const state of states) {
689
- if (state.type === 'initial') {
690
- mermaid += ` [*] --> ${sanitizeId(state.name)}\n`;
691
- } else if (state.type === 'final') {
692
- mermaid += ` ${sanitizeId(state.name)} --> [*]\n`;
693
- } else if (state.substates) {
694
- mermaid += ` state ${sanitizeId(state.name)} {\n`;
695
- for (const sub of state.substates) {
696
- mermaid += ` ${sanitizeId(sub.name)}\n`;
697
- }
698
- mermaid += ' }\n';
699
- } else {
700
- mermaid += ` ${sanitizeId(state.name)} : ${escapeLabel(state.description || state.name)}\n`;
701
- }
702
- }
703
-
704
- // Transitions
705
- for (const trans of transitions) {
706
- const label = trans.event ? ` : ${escapeLabel(trans.event)}` : '';
707
- mermaid += ` ${sanitizeId(trans.from)} --> ${sanitizeId(trans.to)}${label}\n`;
708
- }
709
-
710
- return mermaid;
711
- }
712
-
713
- if (requiredDiagrams.some(d => d.type === 'state')) {
714
- const stateAnalysis = deepAnalysis.stateManagement || {};
715
- if (stateAnalysis.states?.length > 0) {
716
- Write(`${outputDir}/diagrams/state.mmd`, generateStateDiagram(stateAnalysis));
717
- }
718
- }
719
- ```
720
-
721
- **Step 3.5.8: Helper Functions & Validation**
722
-
723
- ```javascript
724
- // Sanitize ID for Mermaid (only alphanumeric and underscore)
725
- function sanitizeId(text) {
726
- return text.replace(/[^a-zA-Z0-9_]/g, '_').replace(/^[0-9]/, '_$&');
727
- }
728
-
729
- // Escape special characters in labels
730
- function escapeLabel(text) {
731
- if (!text) return '';
732
- return text
733
- .replace(/"/g, "'")
734
- .replace(/[(){}[\]<>]/g, char => `#${char.charCodeAt(0)};`)
735
- .substring(0, 50); // Limit length
736
- }
737
-
738
- // Sanitize type names
739
- function sanitizeType(type) {
740
- if (!type) return 'any';
741
- return type.replace(/[<>]/g, '').replace(/\|/g, ' or ');
742
- }
743
-
744
- // Validate all generated diagrams
745
- function validateMermaidDiagrams(diagramDir) {
746
- const files = Glob(`${diagramDir}/*.mmd`);
747
- const results = [];
748
-
749
- for (const file of files) {
750
- const content = Read(file);
751
- const issues = [];
752
-
753
- // Check for common syntax errors
754
- if (content.includes('undefined')) issues.push('Contains undefined');
755
- if (content.match(/-->.*-->/)) issues.push('Double arrow syntax');
756
- if (!content.match(/^(graph|flowchart|classDiagram|sequenceDiagram|stateDiagram)/m)) {
757
- issues.push('Missing diagram type declaration');
758
- }
759
-
760
- // Check for unescaped special chars in labels
761
- const labelMatches = content.match(/\["[^"]*[(){}[\]<>][^"]*"\]/g);
762
- if (labelMatches?.some(m => !m.includes('#'))) {
763
- issues.push('Unescaped special characters in labels');
764
- }
765
-
766
- results.push({
767
- file: file.split('/').pop(),
768
- valid: issues.length === 0,
769
- issues
770
- });
771
- }
772
-
773
- return results;
774
- }
775
-
776
- const validationResults = validateMermaidDiagrams(`${outputDir}/diagrams`);
777
- Write(`${outputDir}/diagrams/validation.json`, JSON.stringify(validationResults, null, 2));
778
-
779
- // Log validation summary
780
- const validCount = validationResults.filter(r => r.valid).length;
781
- console.log(`Diagram Validation: ${validCount}/${validationResults.length} passed`);
782
- ```
783
-
784
- **Step 3.5.9: Generate Diagram Manifest**
785
-
786
- ```javascript
787
- const diagramManifest = {
788
- report_type: config.type,
789
- generated_at: new Date().toISOString(),
790
- diagrams: requiredDiagrams.map(req => {
791
- const filename = `${req.type}.mmd`;
792
- const exists = file_exists(`${outputDir}/diagrams/${filename}`);
793
- return {
794
- type: req.type,
795
- format: req.format,
796
- name: req.name,
797
- filename: exists ? filename : null,
798
- status: exists ? 'generated' : 'skipped'
799
- };
800
- }),
801
- validation: validationResults
802
- };
803
-
804
- Write(`${outputDir}/diagrams/manifest.json`, JSON.stringify(diagramManifest, null, 2));
805
- ```
806
-
807
- **TodoWrite**: Mark Phase 3.5 completed, Phase 4 in_progress
808
-
809
- ---
810
-
811
- ### Phase 4: Initial Report Generation
812
-
813
- **Purpose**: Synthesize all analysis into structured report
814
-
815
- **Step 4.1: Load All Analysis Data and Diagrams**
816
-
817
- ```javascript
818
- const config = JSON.parse(Read(`${outputDir}/analysis-config.json`));
819
- const explorations = JSON.parse(Read(`${outputDir}/explorations-manifest.json`));
820
- const deepAnalysis = JSON.parse(Read(`${outputDir}/deep-analysis.json`));
821
- const diagramManifest = JSON.parse(Read(`${outputDir}/diagrams/manifest.json`));
822
-
823
- // Load all generated diagrams
824
- const diagrams = {};
825
- for (const diag of diagramManifest.diagrams.filter(d => d.status === 'generated')) {
826
- diagrams[diag.type] = Read(`${outputDir}/diagrams/${diag.filename}`);
827
- }
828
- ```
829
-
830
- **Step 4.2: Generate Report Structure**
831
-
832
- ```javascript
833
- const reportTemplate = getReportTemplate(config.type);
834
- // Templates define section structure for each report type
835
-
836
- const reportSections = {
837
- architecture: [
838
- "# Architecture Report",
839
- "## Executive Summary",
840
- "## System Overview",
841
- "## Layer Analysis",
842
- "## Module Dependencies",
843
- "## Data Flow",
844
- "## Entry Points & Critical Paths",
845
- "## Dependency Graph (Mermaid)",
846
- "## Recommendations"
847
- ],
848
- design: [
849
- "# Design Report",
850
- "## Executive Summary",
851
- "## Design Patterns Used",
852
- "## Class Relationships",
853
- "## Interface Contracts",
854
- "## State Management",
855
- "## Component Diagrams (Mermaid)",
856
- "## Design Recommendations"
857
- ],
858
- methods: [
859
- "# Key Methods Report",
860
- "## Executive Summary",
861
- "## Core Algorithms",
862
- "## Critical Code Paths",
863
- "## Public API Reference",
864
- "## Complex Logic Breakdown",
865
- "## Sequence Diagrams (Mermaid)",
866
- "## Optimization Suggestions"
867
- ],
868
- comprehensive: [
869
- "# Comprehensive Project Analysis",
870
- "## Executive Summary",
871
- "## Architecture Overview",
872
- "## Design Patterns & Principles",
873
- "## Key Methods & Algorithms",
874
- "## System Diagrams",
875
- "## Recommendations & Next Steps"
876
- ]
877
- };
878
- ```
879
-
880
- **Step 4.3: Generate Initial Report**
881
-
882
- ```javascript
883
- const reportPath = `${outputDir}/${config.type.toUpperCase()}-REPORT.md`;
884
- const report = generateReport(reportSections[config.type], explorations, deepAnalysis);
885
- Write(reportPath, report);
886
- ```
887
-
888
- **Step 4.4: Present to User**
889
-
890
- ```markdown
891
- ## Initial Report Generated
892
-
893
- **Report Type**: ${config.type}
894
- **Focus Areas**: ${config.focus_areas.join(', ')}
895
- **Depth**: ${config.depth}
896
-
897
- **Output**: ${reportPath}
898
-
899
- ### Report Preview
900
- [First 50 lines of report...]
901
-
902
- ---
903
- **Ready for your feedback.** The report can be refined based on your input.
904
- ```
905
-
906
- **TodoWrite**: Mark Phase 4 completed, Phase 5 in_progress
907
-
908
- ---
909
-
910
- ### Phase 5: Iterative Refinement (Discovery-Driven)
911
-
912
- **Purpose**: Generate targeted questions based on agent analysis findings, then refine report based on user responses
913
-
914
- **Core Philosophy**: Questions are NOT predetermined. They emerge from what the agent discovered during analysis.
915
-
916
- **Step 5.1: Extract Discoveries from Analysis**
917
-
918
- ```javascript
919
- // Parse deep analysis results for actionable discoveries
920
- function extractDiscoveries(deepAnalysis) {
921
- return {
922
- // Ambiguities: Areas where analysis found multiple interpretations
923
- ambiguities: deepAnalysis.findings.filter(f => f.confidence < 0.7),
924
-
925
- // Complexity hotspots: Areas that may need deeper explanation
926
- complexityHotspots: deepAnalysis.findings.filter(f => f.complexity === 'high'),
927
-
928
- // Pattern variations: Where code deviates from expected patterns
929
- patternDeviations: deepAnalysis.patterns.filter(p => p.consistency < 0.8),
930
-
931
- // Unclear dependencies: Relationships that couldn't be fully traced
932
- unclearDependencies: deepAnalysis.dependencies.filter(d => d.type === 'implicit'),
933
-
934
- // Potential issues: Areas flagged for attention
935
- potentialIssues: deepAnalysis.recommendations.filter(r => r.priority === 'investigate'),
936
-
937
- // Depth opportunities: Sections that could benefit from expansion
938
- depthOpportunities: deepAnalysis.sections.filter(s => s.has_more_detail)
939
- };
940
- }
941
-
942
- const discoveries = extractDiscoveries(deepAnalysis);
943
- ```
944
-
945
- **Step 5.2: Generate Dynamic Questions Based on Discoveries**
946
-
947
- ```javascript
948
- function buildDynamicQuestions(discoveries, config) {
949
- const questions = [];
950
-
951
- // Question 1: Address ambiguities found
952
- if (discoveries.ambiguities.length > 0) {
953
- const topAmbiguity = discoveries.ambiguities[0];
954
- questions.push({
955
- question: `Analysis found ambiguity in "${topAmbiguity.area}": ${topAmbiguity.description}. Which interpretation is correct?`,
956
- header: "Clarify",
957
- multiSelect: false,
958
- options: topAmbiguity.interpretations.map((interp, i) => ({
959
- label: interp.summary,
960
- description: interp.detail
961
- }))
962
- });
963
- }
964
-
965
- // Question 2: Complexity deep-dive selection
966
- if (discoveries.complexityHotspots.length > 0) {
967
- questions.push({
968
- question: `These areas have high complexity. Which would you like explained in more detail?`,
969
- header: "Deep-Dive",
970
- multiSelect: true,
971
- options: discoveries.complexityHotspots.slice(0, 4).map(h => ({
972
- label: h.name,
973
- description: `${h.file}:${h.line} - ${h.brief}`
974
- }))
975
- });
976
- }
977
-
978
- // Question 3: Pattern deviation confirmation
979
- if (discoveries.patternDeviations.length > 0) {
980
- const deviation = discoveries.patternDeviations[0];
981
- questions.push({
982
- question: `Found pattern inconsistency: "${deviation.pattern}" is used differently in ${deviation.locations.length} places. Should I analyze this deviation?`,
983
- header: "Patterns",
984
- multiSelect: false,
985
- options: [
986
- {label: "Yes, analyze differences", description: "Add detailed comparison to report"},
987
- {label: "Skip, it's intentional", description: "Note as intentional variation"},
988
- {label: "Flag as tech debt", description: "Add to recommendations section"}
989
- ]
990
- });
991
- }
992
-
993
- // Question 4: Dependency clarification
994
- if (discoveries.unclearDependencies.length > 0) {
995
- questions.push({
996
- question: `Found ${discoveries.unclearDependencies.length} implicit dependencies. Should I trace them fully?`,
997
- header: "Dependencies",
998
- multiSelect: false,
999
- options: [
1000
- {label: "Yes, trace all (Recommended)", description: "Complete dependency graph, may take longer"},
1001
- {label: "Only critical paths", description: "Focus on main execution flows"},
1002
- {label: "Skip for now", description: "Keep current analysis level"}
1003
- ]
1004
- });
1005
- }
1006
-
1007
- // Always include satisfaction check as final question
1008
- questions.push({
1009
- question: "How would you like to proceed with the current report?",
1010
- header: "Action",
1011
- multiSelect: false,
1012
- options: [
1013
- {label: "Continue refining", description: "Apply above selections and show next discoveries"},
1014
- {label: "Finalize report", description: "Report meets my needs, generate final version"},
1015
- {label: "Change scope", description: "Adjust focus areas or analysis depth"}
1016
- ]
1017
- });
1018
-
1019
- return questions.slice(0, 4); // Max 4 questions per iteration
1020
- }
1021
-
1022
- const dynamicQuestions = buildDynamicQuestions(discoveries, config);
1023
- AskUserQuestion({questions: dynamicQuestions});
1024
- ```
1025
-
1026
- **Step 5.3: Process User Responses and Update Analysis**
1027
-
1028
- ```javascript
1029
- function processResponses(responses, discoveries, deepAnalysis) {
1030
- const updates = [];
1031
-
1032
- // Handle ambiguity resolution
1033
- if (responses.clarify) {
1034
- const resolution = {
1035
- area: discoveries.ambiguities[0].area,
1036
- resolved_to: responses.clarify,
1037
- confidence: 1.0 // User confirmed
1038
- };
1039
- updates.push({type: 'resolve_ambiguity', data: resolution});
1040
- }
1041
-
1042
- // Handle deep-dive requests
1043
- if (responses.deepDive && responses.deepDive.length > 0) {
1044
- const deepDiveTargets = responses.deepDive;
1045
- updates.push({type: 'expand_sections', data: deepDiveTargets});
1046
- }
1047
-
1048
- // Handle pattern deviation response
1049
- if (responses.patterns) {
1050
- updates.push({type: 'pattern_handling', data: responses.patterns});
1051
- }
1052
-
1053
- // Handle dependency tracing
1054
- if (responses.dependencies) {
1055
- updates.push({type: 'dependency_depth', data: responses.dependencies});
1056
- }
1057
-
1058
- return updates;
1059
- }
1060
-
1061
- const updates = processResponses(user_responses, discoveries, deepAnalysis);
1062
- ```
1063
-
1064
- **Step 5.4: Incremental Analysis & Report Update**
1065
-
1066
- ```javascript
1067
- // Execute targeted re-analysis based on user responses
1068
- async function applyUpdates(updates, outputDir, config) {
1069
- for (const update of updates) {
1070
- switch (update.type) {
1071
- case 'expand_sections':
1072
- // Re-run Gemini CLI for specific sections only
1073
- for (const target of update.data) {
1074
- Bash({
1075
- command: `ccw cli -p "
1076
- PURPOSE: Deep-dive analysis of ${target.name}
1077
- TASK: Provide detailed explanation of ${target.file}:${target.line}
1078
- • Trace execution flow step by step
1079
- • Explain complex logic with examples
1080
- • Show relationships to other components
1081
- MODE: analysis
1082
- CONTEXT: @${target.file} | Previous analysis from ${outputDir}/
1083
- EXPECTED: Detailed section content for report insertion
1084
- RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md)
1085
- " --tool gemini --mode analysis`,
1086
- run_in_background: true
1087
- });
1088
- }
1089
- break;
1090
-
1091
- case 'resolve_ambiguity':
1092
- // Update analysis with confirmed interpretation
1093
- deepAnalysis.findings = deepAnalysis.findings.map(f =>
1094
- f.area === update.data.area
1095
- ? {...f, interpretation: update.data.resolved_to, confidence: 1.0}
1096
- : f
1097
- );
1098
- break;
1099
-
1100
- case 'dependency_depth':
1101
- if (update.data === 'Yes, trace all (Recommended)') {
1102
- // Launch dependency tracing agent
1103
- Task({
1104
- subagent_type: "cli-explore-agent",
1105
- description: "Trace full dependencies",
1106
- prompt: `Trace all implicit dependencies found in ${outputDir}/deep-analysis.json`
1107
- });
1108
- }
1109
- break;
1110
- }
1111
- }
1112
- }
1113
-
1114
- await applyUpdates(updates, outputDir, config);
1115
-
1116
- // Regenerate report sections affected by updates
1117
- const currentReport = Read(reportPath);
1118
- const updatedSections = regenerateAffectedSections(currentReport, updates);
1119
- Write(reportPath, updatedSections);
1120
- Write(`${outputDir}/iterations/v${iteration_count}.md`, currentReport); // Archive previous version
1121
- ```
1122
-
1123
- **Step 5.5: Check Termination or Continue Loop**
1124
-
1125
- ```javascript
1126
- iteration_count++;
1127
-
1128
- if (user_responses.action === 'Finalize report') {
1129
- // Exit refinement loop
1130
- finalized = true;
1131
- } else if (user_responses.action === 'Change scope') {
1132
- // Return to Phase 1 for scope adjustment
1133
- goto Phase1_Step1_3; // Focus area selection
1134
- } else {
1135
- // Extract new discoveries from updated analysis
1136
- const newDiscoveries = extractDiscoveries(deepAnalysis);
1137
-
1138
- if (newDiscoveries.total_count === 0) {
1139
- // No more discoveries to clarify
1140
- console.log("All ambiguities resolved. Report is comprehensive.");
1141
- AskUserQuestion({
1142
- questions: [{
1143
- question: "No further clarifications needed. Finalize the report?",
1144
- header: "Complete",
1145
- multiSelect: false,
1146
- options: [
1147
- {label: "Yes, finalize", description: "Generate final polished report"},
1148
- {label: "Add custom section", description: "I want to add something specific"}
1149
- ]
1150
- }]
1151
- });
1152
- } else {
1153
- // Continue with next round of discovery-driven questions
1154
- goto Step5.2;
1155
- }
1156
- }
1157
-
1158
- // Safety limit
1159
- if (iteration_count > 7) {
1160
- console.log("Maximum refinement iterations reached. Finalizing report.");
1161
- finalized = true;
1162
- }
1163
- ```
1164
-
1165
- **Step 5.6: Discovery Summary Between Iterations**
1166
-
1167
- ```javascript
1168
- // Show user what was learned in this iteration
1169
- function summarizeIteration(iteration_count, updates, discoveries) {
1170
- return `
1171
- ### Iteration ${iteration_count} Summary
1172
-
1173
- **Clarifications Applied**: ${updates.filter(u => u.type === 'resolve_ambiguity').length}
1174
- **Sections Expanded**: ${updates.filter(u => u.type === 'expand_sections').length}
1175
- **Patterns Addressed**: ${updates.filter(u => u.type === 'pattern_handling').length}
1176
-
1177
- **Remaining Discoveries**:
1178
- - Ambiguities: ${discoveries.ambiguities.length}
1179
- - Complexity hotspots: ${discoveries.complexityHotspots.length}
1180
- - Pattern deviations: ${discoveries.patternDeviations.length}
1181
-
1182
- **Report Sections Updated**: [list affected sections]
1183
- `;
1184
- }
1185
-
1186
- console.log(summarizeIteration(iteration_count, updates, discoveries));
1187
- ```
1188
-
1189
- ---
1190
-
1191
- ### Finalization
1192
-
1193
- **Step 6.1: Polish Final Report**
1194
-
1195
- ```javascript
1196
- // Add metadata and finalize formatting
1197
- const finalReport = `
1198
- <!-- Generated by /workflow:docs:analyze -->
1199
- <!-- Type: ${config.type} | Focus: ${config.focus_areas.join(', ')} | Depth: ${config.depth} -->
1200
- <!-- Generated: ${new Date().toISOString()} | Iterations: ${iteration_count} -->
1201
-
1202
- ${report_content}
1203
-
1204
- ---
1205
- *Report generated through ${iteration_count} refinement iterations.*
1206
- `;
1207
-
1208
- Write(reportPath, finalReport);
1209
- ```
1210
-
1211
- **Step 6.2: Summary Output**
1212
-
1213
- ```markdown
1214
- ## Analysis Complete
1215
-
1216
- **Final Report**: ${reportPath}
1217
- **Report Type**: ${config.type}
1218
- **Focus Areas**: ${config.focus_areas.join(', ')}
1219
- **Refinement Iterations**: ${iteration_count}
1220
-
1221
- ### Report Contents
1222
- - ${section_count} sections
1223
- - ${diagram_count} Mermaid diagrams
1224
- - ${code_reference_count} code references
1225
-
1226
- ### Recommended Next Steps
1227
- 1. Share report with team members
1228
- 2. Use findings to guide development decisions
1229
- 3. Run `/workflow:plan` to create implementation tasks based on recommendations
1230
- ```
1231
-
1232
- **TodoWrite**: Mark Phase 5 completed
1233
-
1234
- ---
1235
-
1236
- ## TodoWrite Pattern
1237
-
1238
- **Dynamic Task Tracking** with phase-level visibility:
1239
-
1240
- ```javascript
1241
- // Initial state
1242
- [
1243
- {content: "Phase 1: Requirements Discovery", status: "pending", activeForm: "Discovering analysis requirements"},
1244
- {content: "Phase 2: Project Exploration", status: "pending", activeForm: "Exploring project structure"},
1245
- {content: "Phase 3: Deep Analysis", status: "pending", activeForm: "Performing deep analysis"},
1246
- {content: "Phase 3.5: Diagram Generation", status: "pending", activeForm: "Generating Mermaid diagrams"},
1247
- {content: "Phase 4: Initial Report Generation", status: "pending", activeForm: "Generating initial report"},
1248
- {content: "Phase 5: Iterative Refinement", status: "pending", activeForm: "Refining report based on feedback"}
1249
- ]
1250
-
1251
- // During Phase 3.5, show diagram generation progress
1252
- [
1253
- {content: "Phase 1: Requirements Discovery", status: "completed", activeForm: "Discovering analysis requirements"},
1254
- {content: "Phase 2: Project Exploration", status: "completed", activeForm: "Exploring project structure"},
1255
- {content: "Phase 3: Deep Analysis", status: "completed", activeForm: "Performing deep analysis"},
1256
- {content: "Phase 3.5: Diagram Generation", status: "in_progress", activeForm: "Generating Mermaid diagrams"},
1257
- {content: " → Architecture diagram", status: "completed", activeForm: "Generating architecture diagram"},
1258
- {content: " → Class diagram", status: "in_progress", activeForm: "Generating class diagram"},
1259
- {content: " → Sequence diagrams", status: "pending", activeForm: "Generating sequence diagrams"},
1260
- {content: "Phase 4: Initial Report Generation", status: "pending", activeForm: "Generating initial report"},
1261
- {content: "Phase 5: Iterative Refinement", status: "pending", activeForm: "Refining report based on feedback"}
1262
- ]
1263
-
1264
- // During Phase 5 iterations, expand to show current refinement
1265
- [
1266
- {content: "Phase 1: Requirements Discovery", status: "completed", activeForm: "Discovering analysis requirements"},
1267
- {content: "Phase 2: Project Exploration", status: "completed", activeForm: "Exploring project structure"},
1268
- {content: "Phase 3: Deep Analysis", status: "completed", activeForm: "Performing deep analysis"},
1269
- {content: "Phase 3.5: Diagram Generation", status: "completed", activeForm: "Generating Mermaid diagrams"},
1270
- {content: "Phase 4: Initial Report Generation", status: "completed", activeForm: "Generating initial report"},
1271
- {content: "Phase 5: Iterative Refinement", status: "in_progress", activeForm: "Refining report based on feedback"},
1272
- {content: " → Iteration 2: Expanding Architecture section", status: "in_progress", activeForm: "Expanding section"}
1273
- ]
1274
- ```
1275
-
1276
- ## Usage Examples
1277
-
1278
- ```bash
1279
- # Interactive analysis (prompts for all preferences)
1280
- /workflow:docs:analyze
1281
-
1282
- # Architecture report for specific directory
1283
- /workflow:docs:analyze src/core --type=architecture
1284
-
1285
- # Design patterns analysis
1286
- /workflow:docs:analyze --type=design
1287
-
1288
- # Comprehensive analysis of entire project
1289
- /workflow:docs:analyze --type=comprehensive
1290
-
1291
- # Key methods analysis for API module
1292
- /workflow:docs:analyze src/api --type=methods
1293
- ```
1294
-
1295
- ## Output Structure
1296
-
1297
- ```
1298
- .workflow/.scratchpad/analyze-{timestamp}/
1299
- ├── analysis-config.json # User's analysis preferences
1300
- ├── exploration-{angle}.json # Per-angle exploration results
1301
- ├── explorations-manifest.json # Exploration summary
1302
- ├── deep-analysis.json # Gemini CLI analysis output
1303
- ├── diagrams/ # Generated Mermaid diagrams
1304
- │ ├── manifest.json # Diagram generation manifest
1305
- │ ├── validation.json # Syntax validation results
1306
- │ ├── architecture.mmd # System architecture (graph TD)
1307
- │ ├── layers.mmd # Layer structure (graph TD)
1308
- │ ├── dependencies.mmd # Module dependencies (graph LR)
1309
- │ ├── class-diagram.mmd # Class relationships (classDiagram)
1310
- │ ├── dataflow.mmd # Data flow (flowchart LR)
1311
- │ ├── algorithm-*.mmd # Algorithm flowcharts (flowchart TD)
1312
- │ ├── sequence-*.mmd # Call sequences (sequenceDiagram)
1313
- │ └── state.mmd # State transitions (stateDiagram-v2)
1314
- ├── {TYPE}-REPORT.md # Final report (main output)
1315
- └── iterations/ # Refinement history
1316
- ├── v1-initial.md
1317
- ├── v2-expanded.md
1318
- └── ...
1319
- ```
1320
-
1321
- ## Report Quality Standards
1322
-
1323
- **All reports must include**:
1324
- 1. **Executive Summary**: 3-5 key takeaways
1325
- 2. **Visual Diagrams**: Mermaid syntax for architecture/flow visualization
1326
- 3. **Code References**: `file:line` format for easy navigation
1327
- 4. **Actionable Insights**: Specific recommendations, not generic advice
1328
- 5. **Consistent Depth**: Match user's selected depth level throughout
1329
-
1330
- **Quality Gates**:
1331
- - [ ] All focus areas addressed
1332
- - [ ] Diagrams render correctly (Mermaid syntax valid)
1333
- - [ ] Code references are accurate (files exist)
1334
- - [ ] No placeholder content
1335
- - [ ] Recommendations are project-specific
1336
-
1337
- ## Error Handling
1338
-
1339
- | Error | Recovery |
1340
- |-------|----------|
1341
- | CLI timeout | Reduce scope, retry with fewer files |
1342
- | Exploration failure | Fall back to direct file reading |
1343
- | User abandons iteration | Save current progress, allow resume |
1344
- | Invalid scope path | Prompt user to correct path |
1345
-
1346
- ## Related Commands
1347
-
1348
- **Prerequisite Commands**:
1349
- - None required (can be run independently)
1350
-
1351
- **Follow-up Commands**:
1352
- - `/workflow:plan` - Create implementation tasks from recommendations
1353
- - `/memory:docs` - Generate project documentation
1354
- - `/workflow:review` - Review specific areas identified in analysis
1355
-
1356
- **Alternative Commands**:
1357
- - `/memory:code-map-memory` - For feature-specific code mapping
1358
- - `/memory:load` - For quick context loading without reports
1359
-
1360
- ---
1361
-
1362
- ## Mermaid Diagram Specifications
1363
-
1364
- ### Diagram Types by Report
1365
-
1366
- | Report Type | Diagrams Generated |
1367
- |-------------|-------------------|
1368
- | `architecture` | architecture.mmd, layers.mmd, dependencies.mmd, dataflow.mmd |
1369
- | `design` | class-diagram.mmd, components.mmd, patterns.mmd, state.mmd |
1370
- | `methods` | algorithm-*.mmd, sequence-*.mmd, critical-path.mmd, api.mmd |
1371
- | `comprehensive` | architecture.mmd, class-diagram.mmd, sequence-*.mmd, dataflow.mmd |
1372
-
1373
- ### Syntax Rules (Ensuring Valid Diagrams)
1374
-
1375
- ```javascript
1376
- // 1. Node IDs: Only alphanumeric and underscore
1377
- sanitizeId("User-Service") → "User_Service"
1378
- sanitizeId("3rdParty") → "_3rdParty"
1379
-
1380
- // 2. Labels: Escape special characters with HTML entities
1381
- escapeLabel("Process(data)") → "Process#40;data#41;"
1382
- escapeLabel("Check {valid?}") → "Check #123;valid?#125;"
1383
-
1384
- // 3. Edge labels: Always use double quotes
1385
- // ✓ Correct
1386
- A -->|"calls(param)"| B
1387
-
1388
- // ✗ Wrong
1389
- A -->|calls(param)| B
1390
-
1391
- // 4. Subgraph titles: Use quoted labels
1392
- // ✓ Correct
1393
- subgraph ServiceLayer["Service Layer (Core)"]
1394
-
1395
- // ✗ Wrong
1396
- subgraph ServiceLayer[Service Layer (Core)]
1397
- ```
1398
-
1399
- ### Diagram Format Examples
1400
-
1401
- **Architecture (graph TD)**:
1402
- ```mermaid
1403
- graph TD
1404
- subgraph Presentation["Presentation Layer"]
1405
- API["API Gateway"]
1406
- CLI["CLI Interface"]
1407
- end
1408
- subgraph Business["Business Layer"]
1409
- SVC["Core Services"]
1410
- end
1411
- API --> SVC
1412
- CLI --> SVC
1413
- ```
1414
-
1415
- **Class Diagram (classDiagram)**:
1416
- ```mermaid
1417
- classDiagram
1418
- class UserService {
1419
- +string name
1420
- +getUser(id) User
1421
- -validate() boolean
1422
- }
1423
- class Repository {
1424
- <<interface>>
1425
- +find(id) Entity
1426
- }
1427
- UserService --> Repository : uses
1428
- ```
1429
-
1430
- **Sequence Diagram (sequenceDiagram)**:
1431
- ```mermaid
1432
- sequenceDiagram
1433
- participant C as Client
1434
- participant S as Server
1435
- participant D as Database
1436
- C->>S: request(data)
1437
- activate S
1438
- S->>D: query
1439
- D-->>S: result
1440
- S-->>C: response
1441
- deactivate S
1442
- ```
1443
-
1444
- **Flowchart (flowchart TD)**:
1445
- ```mermaid
1446
- flowchart TD
1447
- START(["Start"])
1448
- INPUT[/"Read input"/]
1449
- CHECK{"Valid?"}
1450
- PROCESS["Process data"]
1451
- OUTPUT[/"Write output"/]
1452
- END_(["End"])
1453
-
1454
- START --> INPUT --> CHECK
1455
- CHECK -->|"Yes"| PROCESS --> OUTPUT --> END_
1456
- CHECK -->|"No"| END_
1457
- ```
1458
-
1459
- ### Validation Checks
1460
-
1461
- The diagram generator validates:
1462
- - [ ] Diagram type declaration present
1463
- - [ ] No `undefined` values in output
1464
- - [ ] Special characters properly escaped
1465
- - [ ] No double arrow syntax errors
1466
- - [ ] Subgraph brackets balanced
1467
- - [ ] Node IDs are valid identifiers