claude-code-workflow 6.3.32 → 6.3.36

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 (483) hide show
  1. package/.claude/CLAUDE.md +6 -1
  2. package/.claude/agents/action-planning-agent.md +885 -885
  3. package/.claude/agents/cli-discuss-agent.md +391 -391
  4. package/.claude/agents/cli-execution-agent.md +68 -6
  5. package/.claude/agents/cli-lite-planning-agent.md +323 -37
  6. package/.claude/agents/cli-planning-agent.md +2 -2
  7. package/.claude/agents/code-developer.md +407 -403
  8. package/.claude/agents/conceptual-planning-agent.md +11 -0
  9. package/.claude/agents/debug-explore-agent.md +3 -3
  10. package/.claude/agents/doc-generator.md +3 -3
  11. package/.claude/agents/issue-plan-agent.md +417 -340
  12. package/.claude/agents/issue-queue-agent.md +1 -1
  13. package/.claude/agents/memory-bridge.md +95 -95
  14. package/.claude/agents/test-context-search-agent.md +402 -402
  15. package/.claude/agents/ui-design-agent.md +595 -595
  16. package/.claude/agents/universal-executor.md +134 -134
  17. package/.claude/commands/cli/codex-review.md +361 -0
  18. package/.claude/commands/issue/discover-by-prompt.md +1 -1
  19. package/.claude/commands/issue/execute.md +581 -581
  20. package/.claude/commands/issue/new.md +413 -413
  21. package/.claude/commands/issue/plan.md +21 -7
  22. package/.claude/commands/issue/queue.md +441 -382
  23. package/.claude/commands/memory/code-map-memory.md +687 -687
  24. package/.claude/commands/memory/compact.md +383 -383
  25. package/.claude/commands/memory/docs-full-cli.md +471 -471
  26. package/.claude/commands/memory/docs-related-cli.md +386 -386
  27. package/.claude/commands/memory/docs.md +615 -615
  28. package/.claude/commands/memory/load-skill-memory.md +182 -182
  29. package/.claude/commands/memory/skill-memory.md +525 -525
  30. package/.claude/commands/memory/style-skill-memory.md +396 -396
  31. package/.claude/commands/memory/swagger-docs.md +773 -773
  32. package/.claude/commands/memory/tech-research-rules.md +2 -2
  33. package/.claude/commands/memory/update-full.md +332 -332
  34. package/.claude/commands/memory/workflow-skill-memory.md +517 -517
  35. package/.claude/commands/task/create.md +151 -151
  36. package/.claude/commands/task/replan.md +436 -436
  37. package/.claude/commands/version.md +254 -254
  38. package/.claude/commands/workflow/brainstorm/api-designer.md +587 -587
  39. package/.claude/commands/workflow/brainstorm/auto-parallel.md +11 -0
  40. package/.claude/commands/workflow/brainstorm/data-architect.md +220 -220
  41. package/.claude/commands/workflow/brainstorm/product-manager.md +200 -200
  42. package/.claude/commands/workflow/brainstorm/product-owner.md +200 -200
  43. package/.claude/commands/workflow/brainstorm/scrum-master.md +200 -200
  44. package/.claude/commands/workflow/brainstorm/subject-matter-expert.md +200 -200
  45. package/.claude/commands/workflow/brainstorm/system-architect.md +389 -389
  46. package/.claude/commands/workflow/brainstorm/ui-designer.md +221 -221
  47. package/.claude/commands/workflow/brainstorm/ux-expert.md +221 -221
  48. package/.claude/commands/workflow/debug-with-file.md +666 -0
  49. package/.claude/commands/workflow/debug.md +327 -327
  50. package/.claude/commands/workflow/execute.md +498 -498
  51. package/.claude/commands/workflow/lite-execute.md +74 -31
  52. package/.claude/commands/workflow/lite-fix.md +631 -631
  53. package/.claude/commands/workflow/lite-lite-lite.md +39 -11
  54. package/.claude/commands/workflow/lite-plan.md +4 -2
  55. package/.claude/commands/workflow/multi-cli-plan.md +97 -39
  56. package/.claude/commands/workflow/plan.md +551 -551
  57. package/.claude/commands/workflow/replan.md +515 -515
  58. package/.claude/commands/workflow/review-fix.md +610 -610
  59. package/.claude/commands/workflow/review-module-cycle.md +771 -771
  60. package/.claude/commands/workflow/review-session-cycle.md +782 -782
  61. package/.claude/commands/workflow/review.md +322 -322
  62. package/.claude/commands/workflow/session/list.md +95 -95
  63. package/.claude/commands/workflow/session/resume.md +60 -60
  64. package/.claude/commands/workflow/session/solidify.md +299 -299
  65. package/.claude/commands/workflow/tdd-plan.md +597 -460
  66. package/.claude/commands/workflow/test-cycle-execute.md +504 -504
  67. package/.claude/commands/workflow/test-fix-gen.md +699 -699
  68. package/.claude/commands/workflow/tools/conflict-resolution.md +2 -2
  69. package/.claude/commands/workflow/tools/task-generate-tdd.md +517 -517
  70. package/.claude/commands/workflow/tools/tdd-coverage-analysis.md +309 -309
  71. package/.claude/commands/workflow/tools/test-concept-enhanced.md +1 -1
  72. package/.claude/commands/workflow/tools/test-context-gather.md +235 -235
  73. package/.claude/commands/workflow/tools/test-task-generate.md +255 -255
  74. package/.claude/commands/workflow/ui-design/animation-extract.md +1150 -1150
  75. package/.claude/commands/workflow/ui-design/design-sync.md +454 -454
  76. package/.claude/commands/workflow/ui-design/explore-auto.md +678 -678
  77. package/.claude/commands/workflow/ui-design/imitate-auto.md +745 -745
  78. package/.claude/commands/workflow/ui-design/layout-extract.md +788 -788
  79. package/.claude/commands/workflow/ui-design/reference-page-generator.md +356 -356
  80. package/.claude/commands/workflow/ui-design/style-extract.md +773 -773
  81. package/.claude/skills/ccw/SKILL.md +522 -352
  82. package/.claude/skills/ccw/command.json +641 -547
  83. package/.claude/skills/ccw-help/SKILL.md +116 -116
  84. package/.claude/skills/ccw-help/command.json +520 -520
  85. package/.claude/skills/copyright-docs/phases/01.5-project-exploration.md +150 -150
  86. package/.claude/skills/copyright-docs/phases/02.5-consolidation.md +192 -192
  87. package/.claude/skills/copyright-docs/templates/agent-base.md +200 -200
  88. package/.claude/skills/project-analyze/phases/03.5-consolidation.md +233 -233
  89. package/.claude/skills/project-analyze/specs/writing-style.md +152 -152
  90. package/.claude/skills/review-code/phases/state-manager.md +752 -752
  91. package/.claude/skills/review-code/specs/rules/index.md +140 -140
  92. package/.claude/skills/skill-generator/specs/cli-integration.md +13 -19
  93. package/.claude/skills/skill-generator/specs/scripting-integration.md +265 -265
  94. package/.claude/skills/skill-generator/templates/code-analysis-action.md +503 -503
  95. package/.claude/skills/skill-generator/templates/llm-action.md +355 -355
  96. package/.claude/skills/skill-generator/templates/script-bash.md +277 -277
  97. package/.claude/skills/skill-generator/templates/script-python.md +198 -198
  98. package/.claude/skills/skill-generator/templates/skill-md.md +235 -235
  99. package/.claude/skills/skill-tuning/SKILL.md +303 -303
  100. package/.claude/skills/skill-tuning/phases/actions/action-abort.md +164 -164
  101. package/.claude/skills/skill-tuning/phases/actions/action-apply-fix.md +206 -206
  102. package/.claude/skills/skill-tuning/phases/actions/action-complete.md +195 -195
  103. package/.claude/skills/skill-tuning/phases/actions/action-diagnose-agent.md +317 -317
  104. package/.claude/skills/skill-tuning/phases/actions/action-diagnose-context.md +243 -243
  105. package/.claude/skills/skill-tuning/phases/actions/action-diagnose-dataflow.md +318 -318
  106. package/.claude/skills/skill-tuning/phases/actions/action-diagnose-memory.md +269 -269
  107. package/.claude/skills/skill-tuning/phases/actions/action-diagnose-token-consumption.md +200 -200
  108. package/.claude/skills/skill-tuning/phases/actions/action-gemini-analysis.md +322 -322
  109. package/.claude/skills/skill-tuning/phases/actions/action-generate-report.md +228 -228
  110. package/.claude/skills/skill-tuning/phases/actions/action-init.md +149 -149
  111. package/.claude/skills/skill-tuning/phases/actions/action-propose-fixes.md +317 -317
  112. package/.claude/skills/skill-tuning/phases/actions/action-verify.md +222 -222
  113. package/.claude/skills/skill-tuning/phases/orchestrator.md +377 -377
  114. package/.claude/skills/skill-tuning/phases/state-schema.md +378 -378
  115. package/.claude/skills/skill-tuning/specs/problem-taxonomy.md +318 -318
  116. package/.claude/skills/skill-tuning/specs/quality-gates.md +263 -263
  117. package/.claude/skills/skill-tuning/specs/tuning-strategies.md +1537 -1537
  118. package/.claude/skills/skill-tuning/templates/diagnosis-report.md +153 -153
  119. package/.claude/skills/skill-tuning/templates/fix-proposal.md +204 -204
  120. package/.claude/skills/software-manual/SKILL.md +184 -184
  121. package/.claude/skills/software-manual/phases/01-requirements-discovery.md +162 -162
  122. package/.claude/skills/software-manual/phases/02-project-exploration.md +101 -101
  123. package/.claude/skills/software-manual/phases/03-parallel-analysis.md +183 -183
  124. package/.claude/skills/software-manual/phases/03.5-consolidation.md +82 -82
  125. package/.claude/skills/software-manual/phases/04-screenshot-capture.md +89 -89
  126. package/.claude/skills/software-manual/phases/05-html-assembly.md +132 -132
  127. package/.claude/skills/software-manual/phases/06-iterative-refinement.md +259 -259
  128. package/.claude/skills/software-manual/scripts/screenshot-helper.md +447 -447
  129. package/.claude/skills/software-manual/scripts/swagger-runner.md +419 -419
  130. package/.claude/skills/software-manual/scripts/typedoc-runner.md +357 -357
  131. package/.claude/skills/software-manual/specs/html-template.md +325 -325
  132. package/.claude/skills/software-manual/specs/quality-standards.md +253 -253
  133. package/.claude/skills/software-manual/specs/writing-style.md +298 -298
  134. package/.claude/skills/text-formatter/SKILL.md +196 -196
  135. package/.claude/skills/text-formatter/phases/01-input-collection.md +111 -111
  136. package/.claude/skills/text-formatter/phases/02-content-analysis.md +248 -248
  137. package/.claude/skills/text-formatter/phases/03-format-transform.md +245 -245
  138. package/.claude/skills/text-formatter/phases/04-output-preview.md +183 -183
  139. package/.claude/skills/text-formatter/specs/callout-types.md +293 -293
  140. package/.claude/skills/text-formatter/specs/element-mapping.md +226 -226
  141. package/.claude/skills/text-formatter/specs/format-rules.md +273 -273
  142. package/.claude/skills/text-formatter/templates/bbcode-template.md +350 -350
  143. package/.claude/workflows/chinese-response.md +25 -25
  144. package/.claude/workflows/cli-templates/memory/style-skill-memory/skill-md-template.md +299 -299
  145. package/.claude/workflows/cli-templates/planning-roles/product-owner.md +261 -261
  146. package/.claude/workflows/cli-templates/prompts/{analysis/03-analyze-performance.txt → analysis-analyze-performance.txt} +29 -29
  147. package/.claude/workflows/cli-templates/prompts/{analysis/03-assess-security-risks.txt → analysis-assess-security-risks.txt} +29 -29
  148. package/.claude/workflows/cli-templates/prompts/{analysis/02-review-architecture.txt → analysis-review-architecture.txt} +29 -29
  149. package/.claude/workflows/cli-templates/prompts/{analysis/02-review-code-quality.txt → analysis-review-code-quality.txt} +28 -28
  150. package/.claude/workflows/cli-templates/prompts/{analysis/03-review-quality-standards.txt → analysis-review-quality-standards.txt} +29 -29
  151. package/.claude/workflows/cli-templates/prompts/{analysis/01-trace-code-execution.txt → analysis-trace-code-execution.txt} +115 -115
  152. package/.claude/workflows/cli-templates/prompts/{documentation/api.txt → documentation-api.txt} +14 -14
  153. package/.claude/workflows/cli-templates/prompts/{documentation/folder-navigation.txt → documentation-folder-navigation.txt} +26 -26
  154. package/.claude/workflows/cli-templates/prompts/{documentation/project-architecture.txt → documentation-project-architecture.txt} +40 -40
  155. package/.claude/workflows/cli-templates/prompts/{documentation/project-examples.txt → documentation-project-examples.txt} +34 -34
  156. package/.claude/workflows/cli-templates/prompts/{documentation/project-readme.txt → documentation-project-readme.txt} +34 -34
  157. package/.claude/workflows/cli-templates/prompts/{documentation/swagger-api.txt → documentation-swagger-api.txt} +266 -266
  158. package/.claude/workflows/cli-templates/prompts/{planning/02-design-component-spec.txt → planning-design-component-spec.txt} +28 -28
  159. package/.claude/workflows/cli-templates/prompts/{verification/codex-technical.txt → verification-codex-technical.txt} +28 -28
  160. package/.claude/workflows/cli-templates/prompts/{verification/cross-validation.txt → verification-cross-validation.txt} +28 -28
  161. package/.claude/workflows/cli-templates/prompts/{verification/gemini-strategic.txt → verification-gemini-strategic.txt} +27 -27
  162. package/.claude/workflows/cli-templates/prompts/{workflow/analysis-results-structure.txt → workflow-analysis-results-structure.txt} +224 -224
  163. package/.claude/workflows/cli-templates/prompts/{workflow/impl-plan-template.txt → workflow-impl-plan-template.txt} +286 -286
  164. package/.claude/workflows/cli-templates/prompts/{workflow/skill-conflict-patterns.txt → workflow-skill-conflict-patterns.txt} +2 -2
  165. package/.claude/workflows/cli-templates/prompts/{workflow/skill-lessons-learned.txt → workflow-skill-lessons-learned.txt} +2 -2
  166. package/.claude/workflows/cli-templates/prompts/{workflow/task-json-agent-mode.txt → workflow-task-json-agent-mode.txt} +123 -123
  167. package/.claude/workflows/cli-templates/schemas/issues-jsonl-schema.json +29 -0
  168. package/.claude/workflows/cli-templates/schemas/plan-json-schema.json +200 -0
  169. package/.claude/workflows/cli-templates/schemas/project-guidelines-schema.json +141 -141
  170. package/.claude/workflows/cli-tools-usage.md +113 -117
  171. package/.claude/workflows/coding-philosophy.md +69 -69
  172. package/.claude/workflows/context-tools.md +76 -76
  173. package/.claude/workflows/file-modification.md +64 -64
  174. package/.claude/workflows/review-directory-specification.md +336 -336
  175. package/.claude/workflows/windows-platform.md +19 -19
  176. package/.claude/workflows/workflow-architecture.md +942 -942
  177. package/.codex/prompts/debug-with-file.md +609 -0
  178. package/.codex/prompts/issue-execute.md +176 -70
  179. package/README.md +250 -214
  180. package/ccw/dist/cli.d.ts.map +1 -1
  181. package/ccw/dist/cli.js +15 -0
  182. package/ccw/dist/cli.js.map +1 -1
  183. package/ccw/dist/commands/cli.d.ts +5 -0
  184. package/ccw/dist/commands/cli.d.ts.map +1 -1
  185. package/ccw/dist/commands/cli.js +114 -18
  186. package/ccw/dist/commands/cli.js.map +1 -1
  187. package/ccw/dist/commands/install.d.ts +17 -0
  188. package/ccw/dist/commands/install.d.ts.map +1 -1
  189. package/ccw/dist/commands/install.js +211 -2
  190. package/ccw/dist/commands/install.js.map +1 -1
  191. package/ccw/dist/commands/issue.d.ts.map +1 -1
  192. package/ccw/dist/commands/issue.js +245 -32
  193. package/ccw/dist/commands/issue.js.map +1 -1
  194. package/ccw/dist/commands/uninstall.d.ts.map +1 -1
  195. package/ccw/dist/commands/uninstall.js +22 -1
  196. package/ccw/dist/commands/uninstall.js.map +1 -1
  197. package/ccw/dist/commands/view.d.ts.map +1 -1
  198. package/ccw/dist/commands/view.js +3 -0
  199. package/ccw/dist/commands/view.js.map +1 -1
  200. package/ccw/dist/commands/workflow.d.ts +11 -0
  201. package/ccw/dist/commands/workflow.d.ts.map +1 -0
  202. package/ccw/dist/commands/workflow.js +294 -0
  203. package/ccw/dist/commands/workflow.js.map +1 -0
  204. package/ccw/dist/core/routes/claude-routes.d.ts.map +1 -1
  205. package/ccw/dist/core/routes/claude-routes.js +57 -3
  206. package/ccw/dist/core/routes/claude-routes.js.map +1 -1
  207. package/ccw/dist/core/routes/cli-routes.d.ts +13 -0
  208. package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -1
  209. package/ccw/dist/core/routes/cli-routes.js +46 -0
  210. package/ccw/dist/core/routes/cli-routes.js.map +1 -1
  211. package/ccw/dist/core/routes/hooks-routes.d.ts.map +1 -1
  212. package/ccw/dist/core/routes/hooks-routes.js +36 -0
  213. package/ccw/dist/core/routes/hooks-routes.js.map +1 -1
  214. package/ccw/dist/core/routes/issue-routes.d.ts.map +1 -1
  215. package/ccw/dist/core/routes/issue-routes.js +211 -29
  216. package/ccw/dist/core/routes/issue-routes.js.map +1 -1
  217. package/ccw/dist/core/routes/mcp-routes.d.ts.map +1 -1
  218. package/ccw/dist/core/routes/mcp-routes.js +4 -1
  219. package/ccw/dist/core/routes/mcp-routes.js.map +1 -1
  220. package/ccw/dist/core/routes/rules-routes.d.ts.map +1 -1
  221. package/ccw/dist/core/routes/rules-routes.js +22 -6
  222. package/ccw/dist/core/routes/rules-routes.js.map +1 -1
  223. package/ccw/dist/core/routes/session-routes.d.ts.map +1 -1
  224. package/ccw/dist/core/routes/session-routes.js +23 -1
  225. package/ccw/dist/core/routes/session-routes.js.map +1 -1
  226. package/ccw/dist/mcp-server/index.js +8 -2
  227. package/ccw/dist/mcp-server/index.js.map +1 -1
  228. package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
  229. package/ccw/dist/tools/claude-cli-tools.js +52 -28
  230. package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
  231. package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -1
  232. package/ccw/dist/tools/cli-executor-core.js +33 -8
  233. package/ccw/dist/tools/cli-executor-core.js.map +1 -1
  234. package/ccw/dist/tools/cli-executor-state.d.ts +2 -0
  235. package/ccw/dist/tools/cli-executor-state.d.ts.map +1 -1
  236. package/ccw/dist/tools/cli-executor-state.js.map +1 -1
  237. package/ccw/dist/tools/cli-executor-utils.d.ts +7 -0
  238. package/ccw/dist/tools/cli-executor-utils.d.ts.map +1 -1
  239. package/ccw/dist/tools/cli-executor-utils.js +18 -4
  240. package/ccw/dist/tools/cli-executor-utils.js.map +1 -1
  241. package/ccw/dist/tools/cli-history-store.d.ts +21 -0
  242. package/ccw/dist/tools/cli-history-store.d.ts.map +1 -1
  243. package/ccw/dist/tools/cli-history-store.js +106 -30
  244. package/ccw/dist/tools/cli-history-store.js.map +1 -1
  245. package/ccw/dist/tools/cli-output-converter.d.ts +2 -1
  246. package/ccw/dist/tools/cli-output-converter.d.ts.map +1 -1
  247. package/ccw/dist/tools/cli-output-converter.js +65 -10
  248. package/ccw/dist/tools/cli-output-converter.js.map +1 -1
  249. package/ccw/dist/tools/codex-lens-lsp.d.ts +61 -0
  250. package/ccw/dist/tools/codex-lens-lsp.d.ts.map +1 -0
  251. package/ccw/dist/tools/codex-lens-lsp.js +320 -0
  252. package/ccw/dist/tools/codex-lens-lsp.js.map +1 -0
  253. package/ccw/dist/tools/codex-lens.d.ts.map +1 -1
  254. package/ccw/dist/tools/codex-lens.js +130 -91
  255. package/ccw/dist/tools/codex-lens.js.map +1 -1
  256. package/ccw/dist/tools/index.d.ts.map +1 -1
  257. package/ccw/dist/tools/index.js +4 -0
  258. package/ccw/dist/tools/index.js.map +1 -1
  259. package/ccw/dist/tools/template-discovery.d.ts +85 -0
  260. package/ccw/dist/tools/template-discovery.d.ts.map +1 -0
  261. package/ccw/dist/tools/template-discovery.js +239 -0
  262. package/ccw/dist/tools/template-discovery.js.map +1 -0
  263. package/ccw/dist/tools/vscode-lsp.d.ts +57 -0
  264. package/ccw/dist/tools/vscode-lsp.d.ts.map +1 -0
  265. package/ccw/dist/tools/vscode-lsp.js +250 -0
  266. package/ccw/dist/tools/vscode-lsp.js.map +1 -0
  267. package/ccw/dist/utils/path-resolver.d.ts +16 -2
  268. package/ccw/dist/utils/path-resolver.d.ts.map +1 -1
  269. package/ccw/dist/utils/path-resolver.js +36 -6
  270. package/ccw/dist/utils/path-resolver.js.map +1 -1
  271. package/ccw/dist/utils/path-validator.d.ts +5 -0
  272. package/ccw/dist/utils/path-validator.d.ts.map +1 -1
  273. package/ccw/dist/utils/path-validator.js +16 -5
  274. package/ccw/dist/utils/path-validator.js.map +1 -1
  275. package/ccw/dist/utils/project-root.d.ts +25 -0
  276. package/ccw/dist/utils/project-root.d.ts.map +1 -0
  277. package/ccw/dist/utils/project-root.js +63 -0
  278. package/ccw/dist/utils/project-root.js.map +1 -0
  279. package/ccw/dist/utils/shell-escape.d.ts +47 -3
  280. package/ccw/dist/utils/shell-escape.d.ts.map +1 -1
  281. package/ccw/dist/utils/shell-escape.js +98 -15
  282. package/ccw/dist/utils/shell-escape.js.map +1 -1
  283. package/ccw/dist/utils/update-checker.d.ts +11 -0
  284. package/ccw/dist/utils/update-checker.d.ts.map +1 -0
  285. package/ccw/dist/utils/update-checker.js +167 -0
  286. package/ccw/dist/utils/update-checker.js.map +1 -0
  287. package/ccw/scripts/IMPLEMENTATION-SUMMARY.md +2 -2
  288. package/ccw/scripts/QUICK-REFERENCE.md +1 -1
  289. package/ccw/scripts/README-memory-embedder.md +1 -1
  290. package/ccw/scripts/memory_embedder.py +1 -1
  291. package/ccw/src/cli.ts +16 -0
  292. package/ccw/src/commands/cli.ts +124 -18
  293. package/ccw/src/commands/install.ts +239 -2
  294. package/ccw/src/commands/issue.ts +286 -36
  295. package/ccw/src/commands/uninstall.ts +23 -1
  296. package/ccw/src/commands/view.ts +4 -0
  297. package/ccw/src/commands/workflow.ts +348 -0
  298. package/ccw/src/core/routes/claude-routes.ts +64 -3
  299. package/ccw/src/core/routes/cli-routes.ts +58 -0
  300. package/ccw/src/core/routes/hooks-routes.ts +35 -0
  301. package/ccw/src/core/routes/issue-routes.ts +242 -28
  302. package/ccw/src/core/routes/mcp-routes.ts +6 -2
  303. package/ccw/src/core/routes/rules-routes.ts +24 -6
  304. package/ccw/src/core/routes/session-routes.ts +24 -1
  305. package/ccw/src/mcp-server/index.ts +7 -2
  306. package/ccw/src/templates/dashboard-css/26-claude-manager.css +179 -0
  307. package/ccw/src/templates/dashboard-css/32-issue-manager.css +3587 -3302
  308. package/ccw/src/templates/dashboard-css/33-cli-stream-viewer.css +1 -0
  309. package/ccw/src/templates/dashboard-js/components/cli-history.js +4 -1
  310. package/ccw/src/templates/dashboard-js/components/cli-stream-viewer.js +57 -21
  311. package/ccw/src/templates/dashboard-js/components/hook-manager.js +1492 -1492
  312. package/ccw/src/templates/dashboard-js/components/mcp-manager.js +107 -20
  313. package/ccw/src/templates/dashboard-js/components/version-check.js +135 -1
  314. package/ccw/src/templates/dashboard-js/i18n.js +42 -0
  315. package/ccw/src/templates/dashboard-js/views/claude-manager.js +168 -0
  316. package/ccw/src/templates/dashboard-js/views/cli-manager.js +1 -0
  317. package/ccw/src/templates/dashboard-js/views/issue-manager.js +360 -1
  318. package/ccw/src/templates/dashboard-js/views/lite-tasks.js +3502 -3478
  319. package/ccw/src/templates/dashboard-js/views/mcp-manager.js +16 -0
  320. package/ccw/src/templates/dashboard.html +112 -0
  321. package/ccw/src/tools/claude-cli-tools.ts +54 -28
  322. package/ccw/src/tools/cli-executor-core.ts +36 -8
  323. package/ccw/src/tools/cli-executor-state.ts +2 -0
  324. package/ccw/src/tools/cli-executor-utils.ts +26 -4
  325. package/ccw/src/tools/cli-history-store.ts +122 -31
  326. package/ccw/src/tools/cli-output-converter.ts +76 -12
  327. package/ccw/src/tools/codex-lens-lsp.ts +405 -0
  328. package/ccw/src/tools/codex-lens.ts +143 -93
  329. package/ccw/src/tools/index.ts +4 -0
  330. package/ccw/src/tools/template-discovery.ts +303 -0
  331. package/ccw/src/tools/vscode-lsp.ts +317 -0
  332. package/ccw/src/utils/path-resolver.ts +37 -6
  333. package/ccw/src/utils/path-validator.ts +17 -5
  334. package/ccw/src/utils/project-root.ts +73 -0
  335. package/ccw/src/utils/shell-escape.ts +103 -16
  336. package/ccw/src/utils/update-checker.ts +178 -0
  337. package/codex-lens/pyproject.toml +14 -0
  338. package/codex-lens/src/codexlens/__pycache__/config.cpython-312.pyc +0 -0
  339. package/codex-lens/src/codexlens/__pycache__/config.cpython-313.pyc +0 -0
  340. package/codex-lens/src/codexlens/__pycache__/errors.cpython-312.pyc +0 -0
  341. package/codex-lens/src/codexlens/__pycache__/errors.cpython-313.pyc +0 -0
  342. package/codex-lens/src/codexlens/api/__init__.py +88 -0
  343. package/codex-lens/src/codexlens/api/__pycache__/__init__.cpython-312.pyc +0 -0
  344. package/codex-lens/src/codexlens/api/__pycache__/__init__.cpython-313.pyc +0 -0
  345. package/codex-lens/src/codexlens/api/__pycache__/definition.cpython-312.pyc +0 -0
  346. package/codex-lens/src/codexlens/api/__pycache__/definition.cpython-313.pyc +0 -0
  347. package/codex-lens/src/codexlens/api/__pycache__/file_context.cpython-312.pyc +0 -0
  348. package/codex-lens/src/codexlens/api/__pycache__/file_context.cpython-313.pyc +0 -0
  349. package/codex-lens/src/codexlens/api/__pycache__/hover.cpython-312.pyc +0 -0
  350. package/codex-lens/src/codexlens/api/__pycache__/hover.cpython-313.pyc +0 -0
  351. package/codex-lens/src/codexlens/api/__pycache__/models.cpython-312.pyc +0 -0
  352. package/codex-lens/src/codexlens/api/__pycache__/models.cpython-313.pyc +0 -0
  353. package/codex-lens/src/codexlens/api/__pycache__/references.cpython-312.pyc +0 -0
  354. package/codex-lens/src/codexlens/api/__pycache__/references.cpython-313.pyc +0 -0
  355. package/codex-lens/src/codexlens/api/__pycache__/semantic.cpython-312.pyc +0 -0
  356. package/codex-lens/src/codexlens/api/__pycache__/semantic.cpython-313.pyc +0 -0
  357. package/codex-lens/src/codexlens/api/__pycache__/symbols.cpython-312.pyc +0 -0
  358. package/codex-lens/src/codexlens/api/__pycache__/symbols.cpython-313.pyc +0 -0
  359. package/codex-lens/src/codexlens/api/__pycache__/utils.cpython-312.pyc +0 -0
  360. package/codex-lens/src/codexlens/api/__pycache__/utils.cpython-313.pyc +0 -0
  361. package/codex-lens/src/codexlens/api/definition.py +126 -0
  362. package/codex-lens/src/codexlens/api/file_context.py +271 -0
  363. package/codex-lens/src/codexlens/api/hover.py +148 -0
  364. package/codex-lens/src/codexlens/api/models.py +281 -0
  365. package/codex-lens/src/codexlens/api/references.py +345 -0
  366. package/codex-lens/src/codexlens/api/semantic.py +471 -0
  367. package/codex-lens/src/codexlens/api/symbols.py +146 -0
  368. package/codex-lens/src/codexlens/api/utils.py +153 -0
  369. package/codex-lens/src/codexlens/config.py +7 -0
  370. package/codex-lens/src/codexlens/errors.py +4 -0
  371. package/codex-lens/src/codexlens/hybrid_search/__init__.py +28 -0
  372. package/codex-lens/src/codexlens/hybrid_search/__pycache__/__init__.cpython-312.pyc +0 -0
  373. package/codex-lens/src/codexlens/hybrid_search/__pycache__/__init__.cpython-313.pyc +0 -0
  374. package/codex-lens/src/codexlens/hybrid_search/__pycache__/data_structures.cpython-312.pyc +0 -0
  375. package/codex-lens/src/codexlens/hybrid_search/__pycache__/data_structures.cpython-313.pyc +0 -0
  376. package/codex-lens/src/codexlens/hybrid_search/__pycache__/engine.cpython-313.pyc +0 -0
  377. package/codex-lens/src/codexlens/hybrid_search/data_structures.py +602 -0
  378. package/codex-lens/src/codexlens/lsp/__init__.py +34 -0
  379. package/codex-lens/src/codexlens/lsp/__pycache__/__init__.cpython-312.pyc +0 -0
  380. package/codex-lens/src/codexlens/lsp/__pycache__/__init__.cpython-313.pyc +0 -0
  381. package/codex-lens/src/codexlens/lsp/__pycache__/handlers.cpython-313.pyc +0 -0
  382. package/codex-lens/src/codexlens/lsp/__pycache__/lsp_bridge.cpython-312.pyc +0 -0
  383. package/codex-lens/src/codexlens/lsp/__pycache__/lsp_bridge.cpython-313.pyc +0 -0
  384. package/codex-lens/src/codexlens/lsp/__pycache__/lsp_graph_builder.cpython-312.pyc +0 -0
  385. package/codex-lens/src/codexlens/lsp/__pycache__/lsp_graph_builder.cpython-313.pyc +0 -0
  386. package/codex-lens/src/codexlens/lsp/__pycache__/providers.cpython-313.pyc +0 -0
  387. package/codex-lens/src/codexlens/lsp/__pycache__/server.cpython-313.pyc +0 -0
  388. package/codex-lens/src/codexlens/lsp/__pycache__/standalone_manager.cpython-313.pyc +0 -0
  389. package/codex-lens/src/codexlens/lsp/handlers.py +551 -0
  390. package/codex-lens/src/codexlens/lsp/lsp_bridge.py +834 -0
  391. package/codex-lens/src/codexlens/lsp/lsp_graph_builder.py +375 -0
  392. package/codex-lens/src/codexlens/lsp/providers.py +177 -0
  393. package/codex-lens/src/codexlens/lsp/server.py +263 -0
  394. package/codex-lens/src/codexlens/lsp/standalone_manager.py +1159 -0
  395. package/codex-lens/src/codexlens/mcp/__init__.py +20 -0
  396. package/codex-lens/src/codexlens/mcp/__pycache__/__init__.cpython-313.pyc +0 -0
  397. package/codex-lens/src/codexlens/mcp/__pycache__/hooks.cpython-313.pyc +0 -0
  398. package/codex-lens/src/codexlens/mcp/__pycache__/provider.cpython-313.pyc +0 -0
  399. package/codex-lens/src/codexlens/mcp/__pycache__/schema.cpython-313.pyc +0 -0
  400. package/codex-lens/src/codexlens/mcp/hooks.py +170 -0
  401. package/codex-lens/src/codexlens/mcp/provider.py +202 -0
  402. package/codex-lens/src/codexlens/mcp/schema.py +113 -0
  403. package/codex-lens/src/codexlens/search/__init__.py +53 -15
  404. package/codex-lens/src/codexlens/search/__pycache__/__init__.cpython-312.pyc +0 -0
  405. package/codex-lens/src/codexlens/search/__pycache__/__init__.cpython-313.pyc +0 -0
  406. package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-312.pyc +0 -0
  407. package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-313.pyc +0 -0
  408. package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-312.pyc +0 -0
  409. package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-313.pyc +0 -0
  410. package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-312.pyc +0 -0
  411. package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-313.pyc +0 -0
  412. package/codex-lens/src/codexlens/search/association_tree/QUICK_START.md +257 -0
  413. package/codex-lens/src/codexlens/search/association_tree/README.md +188 -0
  414. package/codex-lens/src/codexlens/search/association_tree/__init__.py +21 -0
  415. package/codex-lens/src/codexlens/search/association_tree/__pycache__/__init__.cpython-313.pyc +0 -0
  416. package/codex-lens/src/codexlens/search/association_tree/__pycache__/builder.cpython-313.pyc +0 -0
  417. package/codex-lens/src/codexlens/search/association_tree/__pycache__/data_structures.cpython-313.pyc +0 -0
  418. package/codex-lens/src/codexlens/search/association_tree/__pycache__/deduplicator.cpython-313.pyc +0 -0
  419. package/codex-lens/src/codexlens/search/association_tree/builder.py +450 -0
  420. package/codex-lens/src/codexlens/search/association_tree/data_structures.py +191 -0
  421. package/codex-lens/src/codexlens/search/association_tree/deduplicator.py +301 -0
  422. package/codex-lens/src/codexlens/search/chain_search.py +864 -3
  423. package/codex-lens/src/codexlens/search/clustering/__init__.py +124 -0
  424. package/codex-lens/src/codexlens/search/clustering/__pycache__/__init__.cpython-312.pyc +0 -0
  425. package/codex-lens/src/codexlens/search/clustering/__pycache__/__init__.cpython-313.pyc +0 -0
  426. package/codex-lens/src/codexlens/search/clustering/__pycache__/base.cpython-312.pyc +0 -0
  427. package/codex-lens/src/codexlens/search/clustering/__pycache__/base.cpython-313.pyc +0 -0
  428. package/codex-lens/src/codexlens/search/clustering/__pycache__/dbscan_strategy.cpython-313.pyc +0 -0
  429. package/codex-lens/src/codexlens/search/clustering/__pycache__/factory.cpython-312.pyc +0 -0
  430. package/codex-lens/src/codexlens/search/clustering/__pycache__/factory.cpython-313.pyc +0 -0
  431. package/codex-lens/src/codexlens/search/clustering/__pycache__/frequency_strategy.cpython-312.pyc +0 -0
  432. package/codex-lens/src/codexlens/search/clustering/__pycache__/frequency_strategy.cpython-313.pyc +0 -0
  433. package/codex-lens/src/codexlens/search/clustering/__pycache__/hdbscan_strategy.cpython-313.pyc +0 -0
  434. package/codex-lens/src/codexlens/search/clustering/__pycache__/noop_strategy.cpython-312.pyc +0 -0
  435. package/codex-lens/src/codexlens/search/clustering/__pycache__/noop_strategy.cpython-313.pyc +0 -0
  436. package/codex-lens/src/codexlens/search/clustering/base.py +153 -0
  437. package/codex-lens/src/codexlens/search/clustering/dbscan_strategy.py +197 -0
  438. package/codex-lens/src/codexlens/search/clustering/factory.py +202 -0
  439. package/codex-lens/src/codexlens/search/clustering/frequency_strategy.py +263 -0
  440. package/codex-lens/src/codexlens/search/clustering/hdbscan_strategy.py +153 -0
  441. package/codex-lens/src/codexlens/search/clustering/noop_strategy.py +83 -0
  442. package/codex-lens/src/codexlens/search/hybrid_search.py +194 -2
  443. package/codex-lens/src/codexlens/search/ranking.py +6 -4
  444. package/codex-lens/src/codexlens/semantic/__pycache__/chunker.cpython-312.pyc +0 -0
  445. package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-312.pyc +0 -0
  446. package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-313.pyc +0 -0
  447. package/codex-lens/src/codexlens/storage/__pycache__/global_index.cpython-312.pyc +0 -0
  448. package/codex-lens/src/codexlens/storage/__pycache__/global_index.cpython-313.pyc +0 -0
  449. package/codex-lens/src/codexlens/storage/dir_index.py +172 -0
  450. package/codex-lens/src/codexlens/storage/global_index.py +33 -0
  451. package/package.json +92 -92
  452. /package/.claude/workflows/cli-templates/prompts/{analysis/02-analyze-code-patterns.txt → analysis-analyze-code-patterns.txt} +0 -0
  453. /package/.claude/workflows/cli-templates/prompts/{analysis/02-analyze-technical-document.txt → analysis-analyze-technical-document.txt} +0 -0
  454. /package/.claude/workflows/cli-templates/prompts/{analysis/01-diagnose-bug-root-cause.txt → analysis-diagnose-bug-root-cause.txt} +0 -0
  455. /package/.claude/workflows/cli-templates/prompts/{development/03-debug-runtime-issues.txt → development-debug-runtime-issues.txt} +0 -0
  456. /package/.claude/workflows/cli-templates/prompts/{development/02-generate-tests.txt → development-generate-tests.txt} +0 -0
  457. /package/.claude/workflows/cli-templates/prompts/{development/02-implement-component-ui.txt → development-implement-component-ui.txt} +0 -0
  458. /package/.claude/workflows/cli-templates/prompts/{development/02-implement-feature.txt → development-implement-feature.txt} +0 -0
  459. /package/.claude/workflows/cli-templates/prompts/{development/02-refactor-codebase.txt → development-refactor-codebase.txt} +0 -0
  460. /package/.claude/workflows/cli-templates/prompts/{documentation/module-readme.txt → documentation-module-readme.txt} +0 -0
  461. /package/.claude/workflows/cli-templates/prompts/{memory/02-document-module-structure.txt → memory-document-module-structure.txt} +0 -0
  462. /package/.claude/workflows/cli-templates/prompts/{planning/02-breakdown-task-steps.txt → planning-breakdown-task-steps.txt} +0 -0
  463. /package/.claude/workflows/cli-templates/prompts/{planning/03-evaluate-concept-feasibility.txt → planning-evaluate-concept-feasibility.txt} +0 -0
  464. /package/.claude/workflows/cli-templates/prompts/{planning/01-plan-architecture-design.txt → planning-plan-architecture-design.txt} +0 -0
  465. /package/.claude/workflows/cli-templates/prompts/{planning/03-plan-migration-strategy.txt → planning-plan-migration-strategy.txt} +0 -0
  466. /package/.claude/workflows/cli-templates/prompts/{rules/rule-api.txt → rules-rule-api.txt} +0 -0
  467. /package/.claude/workflows/cli-templates/prompts/{rules/rule-components.txt → rules-rule-components.txt} +0 -0
  468. /package/.claude/workflows/cli-templates/prompts/{rules/rule-config.txt → rules-rule-config.txt} +0 -0
  469. /package/.claude/workflows/cli-templates/prompts/{rules/rule-core.txt → rules-rule-core.txt} +0 -0
  470. /package/.claude/workflows/cli-templates/prompts/{rules/rule-patterns.txt → rules-rule-patterns.txt} +0 -0
  471. /package/.claude/workflows/cli-templates/prompts/{rules/rule-testing.txt → rules-rule-testing.txt} +0 -0
  472. /package/.claude/workflows/cli-templates/prompts/{rules/tech-rules-agent-prompt.txt → rules-tech-rules-agent-prompt.txt} +0 -0
  473. /package/.claude/workflows/cli-templates/prompts/{tech/tech-module-format.txt → tech-tech-module-format.txt} +0 -0
  474. /package/.claude/workflows/cli-templates/prompts/{tech/tech-skill-index.txt → tech-tech-skill-index.txt} +0 -0
  475. /package/.claude/workflows/cli-templates/prompts/{test/test-concept-analysis.txt → test-test-concept-analysis.txt} +0 -0
  476. /package/.claude/workflows/cli-templates/prompts/{universal/00-universal-creative-style.txt → universal-universal-creative-style.txt} +0 -0
  477. /package/.claude/workflows/cli-templates/prompts/{universal/00-universal-rigorous-style.txt → universal-universal-rigorous-style.txt} +0 -0
  478. /package/.claude/workflows/cli-templates/prompts/{workflow/codex-feasibility-validation.txt → workflow-codex-feasibility-validation.txt} +0 -0
  479. /package/.claude/workflows/cli-templates/prompts/{workflow/gemini-solution-design.txt → workflow-gemini-solution-design.txt} +0 -0
  480. /package/.claude/workflows/cli-templates/prompts/{workflow/skill-aggregation.txt → workflow-skill-aggregation.txt} +0 -0
  481. /package/.claude/workflows/cli-templates/prompts/{workflow/skill-index.txt → workflow-skill-index.txt} +0 -0
  482. /package/.claude/workflows/cli-templates/prompts/{workflow/skill-sessions-timeline.txt → workflow-skill-sessions-timeline.txt} +0 -0
  483. /package/.claude/workflows/cli-templates/prompts/{workflow/task-json-cli-mode.txt → workflow-task-json-cli-mode.txt} +0 -0
@@ -1,678 +1,678 @@
1
- ---
2
- name: explore-auto
3
- description: Interactive exploratory UI design workflow with style-centric batch generation, creates design variants from prompts/images with parallel execution and user selection
4
- argument-hint: "[--input "<value>"] [--targets "<list>"] [--target-type "page|component"] [--session <id>] [--style-variants <count>] [--layout-variants <count>]"
5
- allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*), Glob(*), Write(*), Task(conceptual-planning-agent)
6
- ---
7
-
8
- # UI Design Auto Workflow Command
9
-
10
- ## Overview & Execution Model
11
-
12
- **Fully autonomous orchestrator**: Executes all design phases sequentially from style extraction to design integration, with optional batch planning.
13
-
14
- **Unified Target System**: Generates `style_variants × layout_variants × targets` prototypes, where targets can be:
15
- - **Pages** (full-page layouts): home, dashboard, settings, etc.
16
- - **Components** (isolated UI elements): navbar, card, hero, form, etc.
17
- - **Mixed**: Can combine both in a single workflow
18
-
19
- **Autonomous Flow** (⚠️ CONTINUOUS EXECUTION - DO NOT STOP):
20
- 1. User triggers: `/workflow:ui-design:explore-auto [params]`
21
- 2. Phase 5: Target confirmation → User confirms → **IMMEDIATELY triggers Phase 7**
22
- 3. Phase 7 (style-extract) → **Attach tasks → Execute → Collapse** → Auto-continues to Phase 8
23
- 4. Phase 8 (animation-extract, conditional):
24
- - **IF should_extract_animation**: **Attach tasks → Execute → Collapse** → Auto-continues to Phase 9
25
- - **ELSE**: Skip (use code import) → Auto-continues to Phase 9
26
- 5. Phase 9 (layout-extract) → **Attach tasks → Execute → Collapse** → Auto-continues to Phase 10
27
- 6. **Phase 10 (ui-assembly)** → **Attach tasks → Execute → Collapse** → Workflow complete
28
-
29
- **Phase Transition Mechanism**:
30
- - **Phase 5 (User Interaction)**: User confirms targets → IMMEDIATELY executes Phase 7
31
- - **Phase 7-10 (Autonomous)**: SlashCommand execute **ATTACHES** tasks to current workflow
32
- - **Task Execution**: Orchestrator **EXECUTES** these attached tasks itself
33
- - **Task Collapse**: After tasks complete, collapse them into phase summary
34
- - **Phase Transition**: Automatically execute next phase after collapsing
35
- - No additional user interaction after Phase 5 confirmation
36
-
37
- **Auto-Continue Mechanism**: TodoWrite tracks phase status with dynamic task attachment/collapse. After executing all attached tasks, you MUST immediately collapse them, restore phase summary, and execute the next phase. No user intervention required. The workflow is NOT complete until Phase 10 (UI assembly) finishes.
38
-
39
- **Task Attachment Model**: SlashCommand execute is NOT delegation - it's task expansion. The orchestrator executes these attached tasks itself, not waiting for external completion.
40
-
41
- **Target Type Detection**: Automatically inferred from prompt/targets, or explicitly set via `--target-type`.
42
-
43
- ## Execution Process
44
-
45
- ```
46
- Input Parsing:
47
- ├─ Parse flags: --input, --targets, --target-type, --device-type, --session, --style-variants, --layout-variants
48
- └─ Decision (input detection):
49
- ├─ Contains * or glob matches → images_input (visual)
50
- ├─ File/directory exists → code import source
51
- └─ Pure text → design prompt
52
-
53
- Phase 1-4: Parameter Parsing & Initialization
54
- ├─ Phase 1: Normalize parameters (legacy deprecation warning)
55
- ├─ Phase 2: Intelligent prompt parsing (extract variant counts)
56
- ├─ Phase 3: Device type inference (explicit > keywords > target_type > default)
57
- └─ Phase 4: Run initialization and directory setup
58
-
59
- Phase 5: Unified Target Inference
60
- ├─ Priority: --pages/--components (legacy) → --targets → prompt analysis → synthesis → default
61
- ├─ Display confirmation with modification options
62
- └─ User confirms → IMMEDIATELY triggers Phase 7
63
-
64
- Phase 6: Code Import (Conditional)
65
- └─ Decision (design_source):
66
- ├─ code_only | hybrid → Execute /workflow:ui-design:import-from-code
67
- └─ visual_only → Skip to Phase 7
68
-
69
- Phase 7: Style Extraction
70
- └─ Decision (needs_visual_supplement):
71
- ├─ visual_only OR supplement needed → Execute /workflow:ui-design:style-extract
72
- └─ code_only AND style_complete → Use code import
73
-
74
- Phase 8: Animation Extraction
75
- └─ Decision (should_extract_animation):
76
- ├─ visual_only OR incomplete OR regenerate → Execute /workflow:ui-design:animation-extract
77
- └─ code_only AND animation_complete → Use code import
78
-
79
- Phase 9: Layout Extraction
80
- └─ Decision (needs_visual_supplement OR NOT layout_complete):
81
- ├─ True → Execute /workflow:ui-design:layout-extract
82
- └─ False → Use code import
83
-
84
- Phase 10: UI Assembly
85
- └─ Execute /workflow:ui-design:generate → Workflow complete
86
- ```
87
-
88
- ## Core Rules
89
-
90
- 1. **Start Immediately**: TodoWrite initialization → Phase 7 execution
91
- 2. **No Preliminary Validation**: Sub-commands handle their own validation
92
- 3. **Parse & Pass**: Extract data from each output for next phase
93
- 4. **Default to All**: When selecting variants/prototypes, use ALL generated items
94
- 5. **Track Progress**: Update TodoWrite dynamically with task attachment/collapse pattern
95
- 6. **⚠️ CRITICAL: Task Attachment Model** - SlashCommand execute **ATTACHES** tasks to current workflow. Orchestrator **EXECUTES** these attached tasks itself, not waiting for external completion. This is NOT delegation - it's task expansion.
96
- 7. **⚠️ CRITICAL: DO NOT STOP** - This is a continuous multi-phase workflow. After executing all attached tasks, you MUST immediately collapse them and execute the next phase. Workflow is NOT complete until Phase 10 (UI assembly) finishes.
97
-
98
- ## Parameter Requirements
99
-
100
- **Recommended Parameter**:
101
- - `--input "<value>"`: Unified input source (auto-detects type)
102
- - **Glob pattern** (images): `"design-refs/*"`, `"screenshots/*.png"`
103
- - **File/directory path** (code): `"./src/components"`, `"/path/to/styles"`
104
- - **Text description** (prompt): `"modern dashboard with 3 styles"`, `"minimalist design"`
105
- - **Combination**: `"design-refs/* modern dashboard"` (glob + description)
106
- - Multiple inputs: Separate with `|` → `"design-refs/*|modern style"`
107
-
108
- **Detection Logic**:
109
- - Contains `*` or matches existing files → **glob pattern** (images)
110
- - Existing file/directory path → **code import**
111
- - Pure text without paths → **design prompt**
112
- - Contains `|` separator → **multiple inputs** (glob|prompt or path|prompt)
113
-
114
- **Legacy Parameters** (deprecated, use `--input` instead):
115
- - `--images "<glob>"`: Reference image paths (shows deprecation warning)
116
- - `--prompt "<description>"`: Design description (shows deprecation warning)
117
-
118
- **Optional Parameters** (all have smart defaults):
119
- - `--targets "<list>"`: Comma-separated targets (pages/components) to generate (inferred from prompt/session if omitted)
120
- - `--target-type "page|component|auto"`: Explicitly set target type (default: `auto` - intelligent detection)
121
- - `--device-type "desktop|mobile|tablet|responsive|auto"`: Device type for layout optimization (default: `auto` - intelligent detection)
122
- - **Desktop**: 1920×1080px - Mouse-driven, spacious layouts
123
- - **Mobile**: 375×812px - Touch-friendly, compact layouts
124
- - **Tablet**: 768×1024px - Hybrid touch/mouse layouts
125
- - **Responsive**: 1920×1080px base with mobile-first breakpoints
126
- - `--session <id>`: Workflow session ID (standalone mode if omitted)
127
- - `--style-variants <count>`: Style variants (default: inferred from prompt or 3, range: 1-5)
128
- - `--layout-variants <count>`: Layout variants per style (default: inferred or 3, range: 1-5)
129
-
130
- **Legacy Target Parameters** (maintained for backward compatibility):
131
- - `--pages "<list>"`: Alias for `--targets` with `--target-type page`
132
- - `--components "<list>"`: Alias for `--targets` with `--target-type component`
133
-
134
- **Input Rules**:
135
- - Must provide: `--input` OR (legacy: `--images`/`--prompt`) OR `--targets`
136
- - `--input` can combine multiple input types
137
- - If `--targets` not provided, intelligently inferred from prompt/session
138
-
139
- **Supported Target Types**:
140
- - **Pages** (full layouts): home, dashboard, settings, profile, login, etc.
141
- - **Components** (UI elements):
142
- - Navigation: navbar, header, menu, breadcrumb, tabs, sidebar
143
- - Content: hero, card, list, table, grid, timeline
144
- - Input: form, search, filter, input-group
145
- - Feedback: modal, alert, toast, badge, progress
146
- - Media: gallery, carousel, video-player, image-card
147
- - Other: footer, pagination, dropdown, tooltip, avatar
148
-
149
- **Intelligent Prompt Parsing**: Extracts variant counts from natural language:
150
- - "Generate **3 style variants**" → `--style-variants 3`
151
- - "**2 layout options**" → `--layout-variants 2`
152
- - "Create **4 styles** with **2 layouts each**" → `--style-variants 4 --layout-variants 2`
153
- - Explicit flags override prompt inference
154
-
155
- ## Execution Modes
156
-
157
- **Matrix Mode** (style-centric):
158
- - Generates `style_variants × layout_variants × targets` prototypes
159
- - **Phase 1**: `style_variants` complete design systems (extract)
160
- - **Phase 2**: Layout templates extraction (layout-extract)
161
- - **Phase 3**: Style-centric batch generation (generate)
162
- - Sub-phase 1: `targets × layout_variants` target-specific layout plans
163
- - **Sub-phase 2**: `S` style-centric agents (each handles `L×T` combinations)
164
- - Sub-phase 3: `style_variants × layout_variants × targets` final prototypes
165
- - Performance: Efficient parallel execution with S agents
166
- - Quality: HTML structure adapts to design_attributes
167
- - Pages: Full-page layouts with complete structure
168
- - Components: Isolated elements with minimal wrapper
169
-
170
- **Integrated vs. Standalone**:
171
- - `--session` flag determines session integration or standalone execution
172
-
173
- ## 10-Phase Execution
174
-
175
- ### Phase 1: Parameter Parsing & Input Detection
176
-
177
- **Unified Principle**: Detect → Classify → Store (avoid string concatenation and escaping)
178
-
179
- **Step 1: Parameter Normalization**
180
- ```bash
181
- # Legacy parameters (deprecated)
182
- IF --images OR --prompt:
183
- WARN: "⚠️ --images/--prompt deprecated. Use --input"
184
- images_input = --images; prompt_text = --prompt
185
-
186
- # Unified --input (split by "|")
187
- ELSE IF --input:
188
- FOR part IN split(--input, "|"):
189
- IF "*" IN part OR glob_exists(part): images_input = part
190
- ELSE IF path_exists(part): prompt_text += part
191
- ELSE: prompt_text += part
192
- ```
193
-
194
- **Step 2: Design Source Detection**
195
- ```bash
196
- code_base_path = extract_first_valid_path(prompt_text)
197
- has_visual_input = (images_input AND glob_exists(images_input))
198
-
199
- design_source = classify_source(code_base_path, has_visual_input):
200
- • code + visual → "hybrid"
201
- • code only → "code_only"
202
- • visual/prompt → "visual_only"
203
- • none → ERROR
204
- ```
205
-
206
- **Stored Variables**: `design_source`, `code_base_path`, `has_visual_input`, `images_input`, `prompt_text`
207
-
208
- ---
209
-
210
- ### Phase 2: Intelligent Prompt Parsing
211
-
212
- **Unified Principle**: explicit > inferred > default
213
-
214
- ```bash
215
- # Variant counts (priority chain)
216
- style_variants = --style-variants OR extract_number(prompt_text, "style") OR 3
217
- layout_variants = --layout-variants OR extract_number(prompt_text, "layout") OR 3
218
-
219
- VALIDATE: 1 ≤ variants ≤ 5
220
- ```
221
-
222
- **Stored Variables**: `style_variants`, `layout_variants`
223
-
224
- ---
225
-
226
- ### Phase 3: Device Type Inference
227
-
228
- **Unified Principle**: explicit > prompt keywords > target_type > default
229
-
230
- ```bash
231
- # Device type (priority chain)
232
- device_type = --device-type (if != "auto")
233
- OR detect_keywords(prompt_text, ["mobile", "desktop", "tablet", "responsive"])
234
- OR infer_from_target(target_type) # component→desktop, page→responsive
235
- OR "responsive"
236
-
237
- device_source = track_detection_source()
238
- ```
239
-
240
- **Detection Keywords**: mobile, phone, smartphone → mobile | desktop, web, laptop → desktop | tablet, ipad → tablet | responsive, adaptive → responsive
241
-
242
- **Device Presets**: Desktop (1920×1080) | Mobile (375×812) | Tablet (768×1024) | Responsive (1920×1080 + breakpoints)
243
-
244
- **Stored Variables**: `device_type`, `device_source`
245
-
246
- ### Phase 4: Run Initialization & Directory Setup
247
- ```bash
248
- design_id = "design-run-$(date +%Y%m%d)-$RANDOM"
249
- relative_base_path = --session ? ".workflow/active/WFS-{session}/${design_id}" : ".workflow/${design_id}"
250
-
251
- # Create directory and convert to absolute path
252
- Bash(mkdir -p "${relative_base_path}/style-extraction")
253
- Bash(mkdir -p "${relative_base_path}/prototypes")
254
- base_path=$(cd "${relative_base_path}" && pwd)
255
-
256
- Write({base_path}/.run-metadata.json): {
257
- "design_id": "${design_id}", "session_id": "${session_id}", "timestamp": "...",
258
- "workflow": "ui-design:auto",
259
- "architecture": "style-centric-batch-generation",
260
- "parameters": { "style_variants": ${style_variants}, "layout_variants": ${layout_variants},
261
- "targets": "${inferred_target_list}", "target_type": "${target_type}",
262
- "prompt": "${prompt_text}", "images": "${images_input}",
263
- "input": "${--input}",
264
- "device_type": "${device_type}", "device_source": "${device_source}" },
265
- "status": "in_progress",
266
- "performance_mode": "optimized"
267
- }
268
-
269
- # Initialize default flags for animation extraction logic
270
- animation_complete = false # Default: always extract animations unless code import proves complete
271
- needs_visual_supplement = false # Will be set to true in hybrid mode
272
- skip_animation_extraction = false # User preference for code import scenario
273
- ```
274
-
275
- ### Phase 5: Unified Target Inference with Intelligent Type Detection
276
- ```bash
277
- # Priority: --pages/--components (legacy) → --targets → --prompt analysis → synthesis → default
278
- target_list = []; target_type = "auto"; target_source = "none"
279
-
280
- # Step 1-2: Explicit parameters (legacy or unified)
281
- IF --pages: target_list = split(--pages); target_type = "page"; target_source = "explicit_legacy"
282
- ELSE IF --components: target_list = split(--components); target_type = "component"; target_source = "explicit_legacy"
283
- ELSE IF --targets:
284
- target_list = split(--targets); target_source = "explicit"
285
- target_type = --target-type != "auto" ? --target-type : detect_target_type(target_list)
286
-
287
- # Step 3: Prompt analysis (Claude internal analysis)
288
- ELSE IF prompt_text:
289
- analysis_result = analyze_prompt(prompt_text) # Extract targets, types, purpose
290
- target_list = analysis_result.targets
291
- target_type = analysis_result.primary_type OR detect_target_type(target_list)
292
- target_source = "prompt_analysis"
293
-
294
- # Step 4: Session synthesis
295
- ELSE IF --session AND exists(role analysis documents):
296
- target_list = extract_targets_from_synthesis(); target_type = "page"; target_source = "synthesis"
297
-
298
- # Step 5: Fallback
299
- IF NOT target_list: target_list = ["home"]; target_type = "page"; target_source = "default"
300
-
301
- # Validate and clean
302
- validated_targets = [normalize(t) for t in target_list if is_valid(t)]
303
- IF NOT validated_targets: validated_targets = ["home"]; target_type = "page"
304
- IF --target-type != "auto": target_type = --target-type
305
-
306
- # Interactive confirmation
307
- DISPLAY_CONFIRMATION(target_type, target_source, validated_targets, device_type, device_source):
308
- "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
309
- "{emoji} {LABEL} CONFIRMATION (Style-Centric)"
310
- "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
311
- "Type: {target_type} | Source: {target_source}"
312
- "Targets ({count}): {', '.join(validated_targets)}"
313
- "Device: {device_type} | Source: {device_source}"
314
- "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
315
- "Performance: {style_variants} agent calls"
316
- "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
317
- "Modification Options:"
318
- " • 'continue/yes/ok' - Proceed with current configuration"
319
- " • 'targets: a,b,c' - Replace target list"
320
- " • 'skip: x,y' - Remove specific targets"
321
- " • 'add: z' - Add new targets"
322
- " • 'type: page|component' - Change target type"
323
- " • 'device: desktop|mobile|tablet|responsive' - Change device type"
324
- "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
325
-
326
- user_input = WAIT_FOR_USER_INPUT()
327
-
328
- # Process user modifications
329
- MATCH user_input:
330
- "continue|yes|ok" → proceed
331
- "targets: ..." → validated_targets = parse_new_list()
332
- "skip: ..." → validated_targets = remove_items()
333
- "add: ..." → validated_targets = add_items()
334
- "type: ..." → target_type = extract_type()
335
- "device: ..." → device_type = extract_device()
336
- default → proceed with current list
337
-
338
- STORE: inferred_target_list, target_type, target_inference_source
339
-
340
- # ⚠️ CRITICAL: User confirmation complete, IMMEDIATELY initialize TodoWrite and execute Phase 7
341
- # This is the only user interaction point in the workflow
342
- # After this point, all subsequent phases execute automatically without user intervention
343
- ```
344
-
345
- **Helper Function: detect_target_type()**
346
- ```bash
347
- detect_target_type(target_list):
348
- page_keywords = ["home", "dashboard", "settings", "profile", "login", "signup", "auth", ...]
349
- component_keywords = ["navbar", "header", "footer", "hero", "card", "button", "form", ...]
350
-
351
- page_matches = count_matches(target_list, page_keywords + ["page", "screen", "view"])
352
- component_matches = count_matches(target_list, component_keywords + ["component", "widget"])
353
-
354
- RETURN "component" IF component_matches > page_matches ELSE "page"
355
- ```
356
-
357
- ### Phase 6: Code Import & Completeness Assessment (Conditional)
358
-
359
- **Step 6.1: Execute** - Import design system from code files
360
-
361
- ```javascript
362
- IF design_source IN ["code_only", "hybrid"]:
363
- REPORT: "🔍 Phase 6: Code Import ({design_source})"
364
- command = "/workflow:ui-design:import-from-code --design-id \"{design_id}\" --source \"{code_base_path}\""
365
-
366
- TRY:
367
- # SlashCommand execute ATTACHES import-from-code's tasks to current workflow
368
- # Orchestrator will EXECUTE these attached tasks itself:
369
- # - Phase 0: Discover and categorize code files
370
- # - Phase 1.1-1.3: Style/Animation/Layout Agent extraction
371
- SlashCommand(command)
372
- CATCH error:
373
- WARN: "⚠️ Code import failed: {error}"
374
- WARN: "Cleaning up incomplete import directories"
375
- Bash(rm -rf "{base_path}/style-extraction" "{base_path}/animation-extraction" "{base_path}/layout-extraction" 2>/dev/null)
376
-
377
- IF design_source == "code_only":
378
- REPORT: "Cannot proceed with code-only mode after import failure"
379
- EXIT 1
380
- ELSE: # hybrid mode
381
- WARN: "Continuing with visual-only mode"
382
- design_source = "visual_only"
383
-
384
- # Check file existence and assess completeness
385
- style_exists = exists("{base_path}/style-extraction/style-1/design-tokens.json")
386
- animation_exists = exists("{base_path}/animation-extraction/animation-tokens.json")
387
- layout_count = bash(ls {base_path}/layout-extraction/layout-*.json 2>/dev/null | wc -l)
388
- layout_exists = (layout_count > 0)
389
-
390
- style_complete = false
391
- animation_complete = false
392
- layout_complete = false
393
- missing_categories = []
394
-
395
- # Style completeness check
396
- IF style_exists:
397
- tokens = Read("{base_path}/style-extraction/style-1/design-tokens.json")
398
- style_complete = (
399
- tokens.colors?.brand && tokens.colors?.surface &&
400
- tokens.typography?.font_family && tokens.spacing &&
401
- Object.keys(tokens.colors.brand || {}).length >= 3 &&
402
- Object.keys(tokens.spacing || {}).length >= 8
403
- )
404
- IF NOT style_complete AND tokens._metadata?.completeness?.missing_categories:
405
- missing_categories.extend(tokens._metadata.completeness.missing_categories)
406
- ELSE:
407
- missing_categories.push("style tokens")
408
-
409
- # Animation completeness check
410
- IF animation_exists:
411
- anim = Read("{base_path}/animation-extraction/animation-tokens.json")
412
- animation_complete = (
413
- anim.duration && anim.easing &&
414
- Object.keys(anim.duration || {}).length >= 3 &&
415
- Object.keys(anim.easing || {}).length >= 3
416
- )
417
- IF NOT animation_complete AND anim._metadata?.completeness?.missing_items:
418
- missing_categories.extend(anim._metadata.completeness.missing_items)
419
- ELSE:
420
- missing_categories.push("animation tokens")
421
-
422
- # Layout completeness check
423
- IF layout_exists:
424
- # Read first layout file to verify structure
425
- first_layout = bash(ls {base_path}/layout-extraction/layout-*.json 2>/dev/null | head -1)
426
- layout_data = Read(first_layout)
427
- layout_complete = (
428
- layout_count >= 1 &&
429
- layout_data.template?.dom_structure &&
430
- layout_data.template?.css_layout_rules
431
- )
432
- IF NOT layout_complete:
433
- missing_categories.push("complete layout structure")
434
- ELSE:
435
- missing_categories.push("layout templates")
436
-
437
- needs_visual_supplement = false
438
-
439
- IF design_source == "code_only" AND NOT (style_complete AND layout_complete):
440
- REPORT: "⚠️ Missing: {', '.join(missing_categories)}"
441
- REPORT: "Options: 'continue' | 'supplement: <images>' | 'cancel'"
442
- user_response = WAIT_FOR_USER_INPUT()
443
- MATCH user_response:
444
- "continue" → needs_visual_supplement = false
445
- "supplement: ..." → needs_visual_supplement = true; --images = extract_path(user_response)
446
- "cancel" → EXIT 0
447
- default → needs_visual_supplement = false
448
- ELSE IF design_source == "hybrid":
449
- needs_visual_supplement = true
450
-
451
- # Animation reuse confirmation (code import with complete animations)
452
- IF design_source == "code_only" AND animation_complete:
453
- REPORT: "✅ Complete animation system detected (from code import)"
454
- REPORT: " Duration scales: {duration_count} | Easing functions: {easing_count}"
455
- REPORT: ""
456
- REPORT: "Options:"
457
- REPORT: " • 'reuse' (default) - Reuse existing animation system"
458
- REPORT: " • 'regenerate' - Regenerate animation system (interactive)"
459
- REPORT: " • 'cancel' - Cancel workflow"
460
- user_response = WAIT_FOR_USER_INPUT()
461
- MATCH user_response:
462
- "reuse" → skip_animation_extraction = true
463
- "regenerate" → skip_animation_extraction = false
464
- "cancel" → EXIT 0
465
- default → skip_animation_extraction = true # Default: reuse
466
-
467
- STORE: needs_visual_supplement, style_complete, animation_complete, layout_complete, skip_animation_extraction
468
- ```
469
-
470
- ### Phase 7: Style Extraction
471
-
472
- **Step 7.1: Execute** - Extract style design systems
473
-
474
- ```javascript
475
- IF design_source == "visual_only" OR needs_visual_supplement:
476
- REPORT: "🎨 Phase 7: Style Extraction (variants: {style_variants})"
477
- command = "/workflow:ui-design:style-extract --design-id \"{design_id}\" " +
478
- (images_input ? "--images \"{images_input}\" " : "") +
479
- (prompt_text ? "--prompt \"{prompt_text}\" " : "") +
480
- "--variants {style_variants} --interactive"
481
-
482
- # SlashCommand execute ATTACHES style-extract's tasks to current workflow
483
- # Orchestrator will EXECUTE these attached tasks itself
484
- SlashCommand(command)
485
-
486
- # After executing all attached tasks, collapse them into phase summary
487
- ELSE:
488
- REPORT: "✅ Phase 7: Style (Using Code Import)"
489
- ```
490
-
491
- ### Phase 8: Animation Extraction
492
-
493
- **Step 8.1: Execute** - Extract animation patterns
494
-
495
- ```javascript
496
- # Determine if animation extraction is needed
497
- should_extract_animation = false
498
-
499
- IF (design_source == "visual_only" OR needs_visual_supplement):
500
- # Pure visual input or hybrid mode requiring visual supplement
501
- should_extract_animation = true
502
- ELSE IF NOT animation_complete:
503
- # Code import but animations are incomplete
504
- should_extract_animation = true
505
- ELSE IF design_source == "code_only" AND animation_complete AND NOT skip_animation_extraction:
506
- # Code import with complete animations, but user chose to regenerate
507
- should_extract_animation = true
508
-
509
- IF should_extract_animation:
510
- REPORT: "🚀 Phase 8: Animation Extraction"
511
-
512
- # Build command with available inputs
513
- command_parts = [f"/workflow:ui-design:animation-extract --design-id \"{design_id}\""]
514
-
515
- IF images_input:
516
- command_parts.append(f"--images \"{images_input}\"")
517
-
518
- IF prompt_text:
519
- command_parts.append(f"--prompt \"{prompt_text}\"")
520
-
521
- command_parts.append("--interactive")
522
-
523
- command = " ".join(command_parts)
524
-
525
- # SlashCommand execute ATTACHES animation-extract's tasks to current workflow
526
- # Orchestrator will EXECUTE these attached tasks itself
527
- SlashCommand(command)
528
-
529
- # After executing all attached tasks, collapse them into phase summary
530
- ELSE:
531
- REPORT: "✅ Phase 8: Animation (Using Code Import)"
532
-
533
- # Output: animation-tokens.json + animation-guide.md
534
- # When phase finishes, IMMEDIATELY execute Phase 9 (auto-continue)
535
- ```
536
-
537
- ### Phase 9: Layout Extraction
538
-
539
- **Step 9.1: Execute** - Extract layout templates
540
-
541
- ```javascript
542
- targets_string = ",".join(inferred_target_list)
543
-
544
- IF (design_source == "visual_only" OR needs_visual_supplement) OR (NOT layout_complete):
545
- REPORT: "🚀 Phase 9: Layout Extraction ({targets_string}, variants: {layout_variants}, device: {device_type})"
546
- command = "/workflow:ui-design:layout-extract --design-id \"{design_id}\" " +
547
- (images_input ? "--images \"{images_input}\" " : "") +
548
- (prompt_text ? "--prompt \"{prompt_text}\" " : "") +
549
- "--targets \"{targets_string}\" --variants {layout_variants} --device-type \"{device_type}\" --interactive"
550
-
551
- # SlashCommand execute ATTACHES layout-extract's tasks to current workflow
552
- # Orchestrator will EXECUTE these attached tasks itself
553
- SlashCommand(command)
554
-
555
- # After executing all attached tasks, collapse them into phase summary
556
- ELSE:
557
- REPORT: "✅ Phase 9: Layout (Using Code Import)"
558
- ```
559
-
560
- ### Phase 10: UI Assembly
561
-
562
- **Step 10.1: Execute** - Assemble UI prototypes from design tokens and layout templates
563
-
564
- ```javascript
565
- command = "/workflow:ui-design:generate --design-id \"{design_id}\"" + (--session ? " --session {session_id}" : "")
566
-
567
- total = style_variants × layout_variants × len(inferred_target_list)
568
-
569
- REPORT: "🚀 Phase 10: UI Assembly | Matrix: {s}×{l}×{n} = {total} prototypes"
570
- REPORT: " → Pure assembly: Combining layout templates + design tokens"
571
- REPORT: " → Device: {device_type} (from layout templates)"
572
- REPORT: " → Assembly tasks: {total} combinations"
573
-
574
- # SlashCommand execute ATTACHES generate's tasks to current workflow
575
- # Orchestrator will EXECUTE these attached tasks itself
576
- SlashCommand(command)
577
-
578
- # After executing all attached tasks, collapse them into phase summary
579
- # Workflow complete - generate command handles preview file generation (compare.html, PREVIEW.md)
580
- # Output (generated by generate command):
581
- # - {target}-style-{s}-layout-{l}.html (assembled prototypes)
582
- # - {target}-style-{s}-layout-{l}.css
583
- # - compare.html (interactive matrix view)
584
- # - PREVIEW.md (usage instructions)
585
- ```
586
-
587
- ## TodoWrite Pattern
588
- ```javascript
589
- // Initialize IMMEDIATELY after Phase 5 user confirmation to track multi-phase execution (4 orchestrator-level tasks)
590
- TodoWrite({todos: [
591
- {"content": "Phase 7: Style Extraction", "status": "in_progress", "activeForm": "Executing style extraction"},
592
- {"content": "Phase 8: Animation Extraction", "status": "pending", "activeForm": "Executing animation extraction"},
593
- {"content": "Phase 9: Layout Extraction", "status": "pending", "activeForm": "Executing layout extraction"},
594
- {"content": "Phase 10: UI Assembly", "status": "pending", "activeForm": "Executing UI assembly"}
595
- ]})
596
-
597
- // ⚠️ CRITICAL: Dynamic TodoWrite task attachment strategy:
598
- //
599
- // **Key Concept**: SlashCommand execute ATTACHES tasks to current workflow.
600
- // Orchestrator EXECUTES these attached tasks itself, not waiting for external completion.
601
- //
602
- // Phase 7-10 SlashCommand Execute Pattern (when tasks are attached):
603
- // Example - Phase 7 with sub-tasks:
604
- // [
605
- // {"content": "Phase 7: Style Extraction", "status": "in_progress", "activeForm": "Executing style extraction"},
606
- // {"content": " → Analyze style references", "status": "in_progress", "activeForm": "Analyzing style references"},
607
- // {"content": " → Generate style variants", "status": "pending", "activeForm": "Generating style variants"},
608
- // {"content": " → Create design tokens", "status": "pending", "activeForm": "Creating design tokens"},
609
- // {"content": "Phase 8: Animation Extraction", "status": "pending", "activeForm": "Executing animation extraction"},
610
- // ...
611
- // ]
612
- //
613
- // After sub-tasks complete, COLLAPSE back to:
614
- // [
615
- // {"content": "Phase 7: Style Extraction", "status": "completed", "activeForm": "Executing style extraction"},
616
- // {"content": "Phase 8: Animation Extraction", "status": "in_progress", "activeForm": "Executing animation extraction"},
617
- // ...
618
- // ]
619
- //
620
- ```
621
-
622
- ## Completion Output
623
- ```
624
- ✅ UI Design Explore-Auto Workflow Complete!
625
-
626
- Architecture: Style-Centric Batch Generation
627
- Run ID: {run_id} | Session: {session_id or "standalone"}
628
- Type: {icon} {target_type} | Device: {device_type} | Matrix: {s}×{l}×{n} = {total} prototypes
629
-
630
- Phase 7: {s} complete design systems (style-extract with multi-select)
631
- Phase 9: {n×l} layout templates (layout-extract with multi-select)
632
- - Device: {device_type} layouts
633
- - {n} targets × {l} layout variants = {n×l} structural templates
634
- - User-selected concepts generated in parallel
635
- Phase 10: UI Assembly (generate)
636
- - Pure assembly: layout templates + design tokens
637
- - {s}×{l}×{n} = {total} final prototypes
638
- - Preview files: compare.html, PREVIEW.md (auto-generated by generate command)
639
-
640
- Assembly Process:
641
- ✅ Separation of Concerns: Layout (structure) + Style (tokens) kept separate
642
- ✅ Layout Extraction: {n×l} reusable structural templates
643
- ✅ Multi-Selection Workflow: User selects multiple variants from generated options
644
- ✅ Pure Assembly: No design decisions in generate phase
645
- ✅ Device-Optimized: Layouts designed for {device_type}
646
-
647
- Design Quality:
648
- ✅ Token-Driven Styling: 100% var() usage
649
- ✅ Structural Variety: {l} distinct layouts per target (user-selected)
650
- ✅ Style Variety: {s} independent design systems (user-selected)
651
- ✅ Device-Optimized: Layouts designed for {device_type}
652
-
653
- 📂 {base_path}/
654
- ├── .intermediates/ (Intermediate analysis files)
655
- │ ├── style-analysis/ (analysis-options.json with embedded user_selection, computed-styles.json if URL mode)
656
- │ ├── animation-analysis/ (analysis-options.json with embedded user_selection, animations-*.json if URL mode)
657
- │ └── layout-analysis/ (analysis-options.json with embedded user_selection, dom-structure-*.json if URL mode)
658
- ├── style-extraction/ ({s} complete design systems)
659
- ├── animation-extraction/ (animation-tokens.json, animation-guide.md)
660
- ├── layout-extraction/ ({n×l} layout template files: layout-{target}-{variant}.json)
661
- ├── prototypes/ ({total} assembled prototypes)
662
- └── .run-metadata.json (includes device type)
663
-
664
- 🌐 Preview: {base_path}/prototypes/compare.html
665
- - Interactive {s}×{l} matrix view
666
- - Side-by-side comparison
667
- - Target-specific layouts with style-aware structure
668
- - Toggle between {n} targets
669
-
670
- {icon} Targets: {', '.join(targets)} (type: {target_type})
671
- - Each target has {l} custom-designed layouts
672
- - Each style × target × layout has unique HTML structure (not just CSS!)
673
- - Layout plans stored as structured JSON
674
- - Optimized for {device_type} viewing
675
-
676
- Next: Open compare.html to preview all design variants
677
- ```
678
-
1
+ ---
2
+ name: explore-auto
3
+ description: Interactive exploratory UI design workflow with style-centric batch generation, creates design variants from prompts/images with parallel execution and user selection
4
+ argument-hint: "[--input "<value>"] [--targets "<list>"] [--target-type "page|component"] [--session <id>] [--style-variants <count>] [--layout-variants <count>]"
5
+ allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*), Glob(*), Write(*), Task(conceptual-planning-agent)
6
+ ---
7
+
8
+ # UI Design Auto Workflow Command
9
+
10
+ ## Overview & Execution Model
11
+
12
+ **Fully autonomous orchestrator**: Executes all design phases sequentially from style extraction to design integration, with optional batch planning.
13
+
14
+ **Unified Target System**: Generates `style_variants × layout_variants × targets` prototypes, where targets can be:
15
+ - **Pages** (full-page layouts): home, dashboard, settings, etc.
16
+ - **Components** (isolated UI elements): navbar, card, hero, form, etc.
17
+ - **Mixed**: Can combine both in a single workflow
18
+
19
+ **Autonomous Flow** (⚠️ CONTINUOUS EXECUTION - DO NOT STOP):
20
+ 1. User triggers: `/workflow:ui-design:explore-auto [params]`
21
+ 2. Phase 5: Target confirmation → User confirms → **IMMEDIATELY triggers Phase 7**
22
+ 3. Phase 7 (style-extract) → **Attach tasks → Execute → Collapse** → Auto-continues to Phase 8
23
+ 4. Phase 8 (animation-extract, conditional):
24
+ - **IF should_extract_animation**: **Attach tasks → Execute → Collapse** → Auto-continues to Phase 9
25
+ - **ELSE**: Skip (use code import) → Auto-continues to Phase 9
26
+ 5. Phase 9 (layout-extract) → **Attach tasks → Execute → Collapse** → Auto-continues to Phase 10
27
+ 6. **Phase 10 (ui-assembly)** → **Attach tasks → Execute → Collapse** → Workflow complete
28
+
29
+ **Phase Transition Mechanism**:
30
+ - **Phase 5 (User Interaction)**: User confirms targets → IMMEDIATELY executes Phase 7
31
+ - **Phase 7-10 (Autonomous)**: SlashCommand execute **ATTACHES** tasks to current workflow
32
+ - **Task Execution**: Orchestrator **EXECUTES** these attached tasks itself
33
+ - **Task Collapse**: After tasks complete, collapse them into phase summary
34
+ - **Phase Transition**: Automatically execute next phase after collapsing
35
+ - No additional user interaction after Phase 5 confirmation
36
+
37
+ **Auto-Continue Mechanism**: TodoWrite tracks phase status with dynamic task attachment/collapse. After executing all attached tasks, you MUST immediately collapse them, restore phase summary, and execute the next phase. No user intervention required. The workflow is NOT complete until Phase 10 (UI assembly) finishes.
38
+
39
+ **Task Attachment Model**: SlashCommand execute is NOT delegation - it's task expansion. The orchestrator executes these attached tasks itself, not waiting for external completion.
40
+
41
+ **Target Type Detection**: Automatically inferred from prompt/targets, or explicitly set via `--target-type`.
42
+
43
+ ## Execution Process
44
+
45
+ ```
46
+ Input Parsing:
47
+ ├─ Parse flags: --input, --targets, --target-type, --device-type, --session, --style-variants, --layout-variants
48
+ └─ Decision (input detection):
49
+ ├─ Contains * or glob matches → images_input (visual)
50
+ ├─ File/directory exists → code import source
51
+ └─ Pure text → design prompt
52
+
53
+ Phase 1-4: Parameter Parsing & Initialization
54
+ ├─ Phase 1: Normalize parameters (legacy deprecation warning)
55
+ ├─ Phase 2: Intelligent prompt parsing (extract variant counts)
56
+ ├─ Phase 3: Device type inference (explicit > keywords > target_type > default)
57
+ └─ Phase 4: Run initialization and directory setup
58
+
59
+ Phase 5: Unified Target Inference
60
+ ├─ Priority: --pages/--components (legacy) → --targets → prompt analysis → synthesis → default
61
+ ├─ Display confirmation with modification options
62
+ └─ User confirms → IMMEDIATELY triggers Phase 7
63
+
64
+ Phase 6: Code Import (Conditional)
65
+ └─ Decision (design_source):
66
+ ├─ code_only | hybrid → Execute /workflow:ui-design:import-from-code
67
+ └─ visual_only → Skip to Phase 7
68
+
69
+ Phase 7: Style Extraction
70
+ └─ Decision (needs_visual_supplement):
71
+ ├─ visual_only OR supplement needed → Execute /workflow:ui-design:style-extract
72
+ └─ code_only AND style_complete → Use code import
73
+
74
+ Phase 8: Animation Extraction
75
+ └─ Decision (should_extract_animation):
76
+ ├─ visual_only OR incomplete OR regenerate → Execute /workflow:ui-design:animation-extract
77
+ └─ code_only AND animation_complete → Use code import
78
+
79
+ Phase 9: Layout Extraction
80
+ └─ Decision (needs_visual_supplement OR NOT layout_complete):
81
+ ├─ True → Execute /workflow:ui-design:layout-extract
82
+ └─ False → Use code import
83
+
84
+ Phase 10: UI Assembly
85
+ └─ Execute /workflow:ui-design:generate → Workflow complete
86
+ ```
87
+
88
+ ## Core Rules
89
+
90
+ 1. **Start Immediately**: TodoWrite initialization → Phase 7 execution
91
+ 2. **No Preliminary Validation**: Sub-commands handle their own validation
92
+ 3. **Parse & Pass**: Extract data from each output for next phase
93
+ 4. **Default to All**: When selecting variants/prototypes, use ALL generated items
94
+ 5. **Track Progress**: Update TodoWrite dynamically with task attachment/collapse pattern
95
+ 6. **⚠️ CRITICAL: Task Attachment Model** - SlashCommand execute **ATTACHES** tasks to current workflow. Orchestrator **EXECUTES** these attached tasks itself, not waiting for external completion. This is NOT delegation - it's task expansion.
96
+ 7. **⚠️ CRITICAL: DO NOT STOP** - This is a continuous multi-phase workflow. After executing all attached tasks, you MUST immediately collapse them and execute the next phase. Workflow is NOT complete until Phase 10 (UI assembly) finishes.
97
+
98
+ ## Parameter Requirements
99
+
100
+ **Recommended Parameter**:
101
+ - `--input "<value>"`: Unified input source (auto-detects type)
102
+ - **Glob pattern** (images): `"design-refs/*"`, `"screenshots/*.png"`
103
+ - **File/directory path** (code): `"./src/components"`, `"/path/to/styles"`
104
+ - **Text description** (prompt): `"modern dashboard with 3 styles"`, `"minimalist design"`
105
+ - **Combination**: `"design-refs/* modern dashboard"` (glob + description)
106
+ - Multiple inputs: Separate with `|` → `"design-refs/*|modern style"`
107
+
108
+ **Detection Logic**:
109
+ - Contains `*` or matches existing files → **glob pattern** (images)
110
+ - Existing file/directory path → **code import**
111
+ - Pure text without paths → **design prompt**
112
+ - Contains `|` separator → **multiple inputs** (glob|prompt or path|prompt)
113
+
114
+ **Legacy Parameters** (deprecated, use `--input` instead):
115
+ - `--images "<glob>"`: Reference image paths (shows deprecation warning)
116
+ - `--prompt "<description>"`: Design description (shows deprecation warning)
117
+
118
+ **Optional Parameters** (all have smart defaults):
119
+ - `--targets "<list>"`: Comma-separated targets (pages/components) to generate (inferred from prompt/session if omitted)
120
+ - `--target-type "page|component|auto"`: Explicitly set target type (default: `auto` - intelligent detection)
121
+ - `--device-type "desktop|mobile|tablet|responsive|auto"`: Device type for layout optimization (default: `auto` - intelligent detection)
122
+ - **Desktop**: 1920×1080px - Mouse-driven, spacious layouts
123
+ - **Mobile**: 375×812px - Touch-friendly, compact layouts
124
+ - **Tablet**: 768×1024px - Hybrid touch/mouse layouts
125
+ - **Responsive**: 1920×1080px base with mobile-first breakpoints
126
+ - `--session <id>`: Workflow session ID (standalone mode if omitted)
127
+ - `--style-variants <count>`: Style variants (default: inferred from prompt or 3, range: 1-5)
128
+ - `--layout-variants <count>`: Layout variants per style (default: inferred or 3, range: 1-5)
129
+
130
+ **Legacy Target Parameters** (maintained for backward compatibility):
131
+ - `--pages "<list>"`: Alias for `--targets` with `--target-type page`
132
+ - `--components "<list>"`: Alias for `--targets` with `--target-type component`
133
+
134
+ **Input Rules**:
135
+ - Must provide: `--input` OR (legacy: `--images`/`--prompt`) OR `--targets`
136
+ - `--input` can combine multiple input types
137
+ - If `--targets` not provided, intelligently inferred from prompt/session
138
+
139
+ **Supported Target Types**:
140
+ - **Pages** (full layouts): home, dashboard, settings, profile, login, etc.
141
+ - **Components** (UI elements):
142
+ - Navigation: navbar, header, menu, breadcrumb, tabs, sidebar
143
+ - Content: hero, card, list, table, grid, timeline
144
+ - Input: form, search, filter, input-group
145
+ - Feedback: modal, alert, toast, badge, progress
146
+ - Media: gallery, carousel, video-player, image-card
147
+ - Other: footer, pagination, dropdown, tooltip, avatar
148
+
149
+ **Intelligent Prompt Parsing**: Extracts variant counts from natural language:
150
+ - "Generate **3 style variants**" → `--style-variants 3`
151
+ - "**2 layout options**" → `--layout-variants 2`
152
+ - "Create **4 styles** with **2 layouts each**" → `--style-variants 4 --layout-variants 2`
153
+ - Explicit flags override prompt inference
154
+
155
+ ## Execution Modes
156
+
157
+ **Matrix Mode** (style-centric):
158
+ - Generates `style_variants × layout_variants × targets` prototypes
159
+ - **Phase 1**: `style_variants` complete design systems (extract)
160
+ - **Phase 2**: Layout templates extraction (layout-extract)
161
+ - **Phase 3**: Style-centric batch generation (generate)
162
+ - Sub-phase 1: `targets × layout_variants` target-specific layout plans
163
+ - **Sub-phase 2**: `S` style-centric agents (each handles `L×T` combinations)
164
+ - Sub-phase 3: `style_variants × layout_variants × targets` final prototypes
165
+ - Performance: Efficient parallel execution with S agents
166
+ - Quality: HTML structure adapts to design_attributes
167
+ - Pages: Full-page layouts with complete structure
168
+ - Components: Isolated elements with minimal wrapper
169
+
170
+ **Integrated vs. Standalone**:
171
+ - `--session` flag determines session integration or standalone execution
172
+
173
+ ## 10-Phase Execution
174
+
175
+ ### Phase 1: Parameter Parsing & Input Detection
176
+
177
+ **Unified Principle**: Detect → Classify → Store (avoid string concatenation and escaping)
178
+
179
+ **Step 1: Parameter Normalization**
180
+ ```bash
181
+ # Legacy parameters (deprecated)
182
+ IF --images OR --prompt:
183
+ WARN: "⚠️ --images/--prompt deprecated. Use --input"
184
+ images_input = --images; prompt_text = --prompt
185
+
186
+ # Unified --input (split by "|")
187
+ ELSE IF --input:
188
+ FOR part IN split(--input, "|"):
189
+ IF "*" IN part OR glob_exists(part): images_input = part
190
+ ELSE IF path_exists(part): prompt_text += part
191
+ ELSE: prompt_text += part
192
+ ```
193
+
194
+ **Step 2: Design Source Detection**
195
+ ```bash
196
+ code_base_path = extract_first_valid_path(prompt_text)
197
+ has_visual_input = (images_input AND glob_exists(images_input))
198
+
199
+ design_source = classify_source(code_base_path, has_visual_input):
200
+ • code + visual → "hybrid"
201
+ • code only → "code_only"
202
+ • visual/prompt → "visual_only"
203
+ • none → ERROR
204
+ ```
205
+
206
+ **Stored Variables**: `design_source`, `code_base_path`, `has_visual_input`, `images_input`, `prompt_text`
207
+
208
+ ---
209
+
210
+ ### Phase 2: Intelligent Prompt Parsing
211
+
212
+ **Unified Principle**: explicit > inferred > default
213
+
214
+ ```bash
215
+ # Variant counts (priority chain)
216
+ style_variants = --style-variants OR extract_number(prompt_text, "style") OR 3
217
+ layout_variants = --layout-variants OR extract_number(prompt_text, "layout") OR 3
218
+
219
+ VALIDATE: 1 ≤ variants ≤ 5
220
+ ```
221
+
222
+ **Stored Variables**: `style_variants`, `layout_variants`
223
+
224
+ ---
225
+
226
+ ### Phase 3: Device Type Inference
227
+
228
+ **Unified Principle**: explicit > prompt keywords > target_type > default
229
+
230
+ ```bash
231
+ # Device type (priority chain)
232
+ device_type = --device-type (if != "auto")
233
+ OR detect_keywords(prompt_text, ["mobile", "desktop", "tablet", "responsive"])
234
+ OR infer_from_target(target_type) # component→desktop, page→responsive
235
+ OR "responsive"
236
+
237
+ device_source = track_detection_source()
238
+ ```
239
+
240
+ **Detection Keywords**: mobile, phone, smartphone → mobile | desktop, web, laptop → desktop | tablet, ipad → tablet | responsive, adaptive → responsive
241
+
242
+ **Device Presets**: Desktop (1920×1080) | Mobile (375×812) | Tablet (768×1024) | Responsive (1920×1080 + breakpoints)
243
+
244
+ **Stored Variables**: `device_type`, `device_source`
245
+
246
+ ### Phase 4: Run Initialization & Directory Setup
247
+ ```bash
248
+ design_id = "design-run-$(date +%Y%m%d)-$RANDOM"
249
+ relative_base_path = --session ? ".workflow/active/WFS-{session}/${design_id}" : ".workflow/${design_id}"
250
+
251
+ # Create directory and convert to absolute path
252
+ Bash(mkdir -p "${relative_base_path}/style-extraction")
253
+ Bash(mkdir -p "${relative_base_path}/prototypes")
254
+ base_path=$(cd "${relative_base_path}" && pwd)
255
+
256
+ Write({base_path}/.run-metadata.json): {
257
+ "design_id": "${design_id}", "session_id": "${session_id}", "timestamp": "...",
258
+ "workflow": "ui-design:auto",
259
+ "architecture": "style-centric-batch-generation",
260
+ "parameters": { "style_variants": ${style_variants}, "layout_variants": ${layout_variants},
261
+ "targets": "${inferred_target_list}", "target_type": "${target_type}",
262
+ "prompt": "${prompt_text}", "images": "${images_input}",
263
+ "input": "${--input}",
264
+ "device_type": "${device_type}", "device_source": "${device_source}" },
265
+ "status": "in_progress",
266
+ "performance_mode": "optimized"
267
+ }
268
+
269
+ # Initialize default flags for animation extraction logic
270
+ animation_complete = false # Default: always extract animations unless code import proves complete
271
+ needs_visual_supplement = false # Will be set to true in hybrid mode
272
+ skip_animation_extraction = false # User preference for code import scenario
273
+ ```
274
+
275
+ ### Phase 5: Unified Target Inference with Intelligent Type Detection
276
+ ```bash
277
+ # Priority: --pages/--components (legacy) → --targets → --prompt analysis → synthesis → default
278
+ target_list = []; target_type = "auto"; target_source = "none"
279
+
280
+ # Step 1-2: Explicit parameters (legacy or unified)
281
+ IF --pages: target_list = split(--pages); target_type = "page"; target_source = "explicit_legacy"
282
+ ELSE IF --components: target_list = split(--components); target_type = "component"; target_source = "explicit_legacy"
283
+ ELSE IF --targets:
284
+ target_list = split(--targets); target_source = "explicit"
285
+ target_type = --target-type != "auto" ? --target-type : detect_target_type(target_list)
286
+
287
+ # Step 3: Prompt analysis (Claude internal analysis)
288
+ ELSE IF prompt_text:
289
+ analysis_result = analyze_prompt(prompt_text) # Extract targets, types, purpose
290
+ target_list = analysis_result.targets
291
+ target_type = analysis_result.primary_type OR detect_target_type(target_list)
292
+ target_source = "prompt_analysis"
293
+
294
+ # Step 4: Session synthesis
295
+ ELSE IF --session AND exists(role analysis documents):
296
+ target_list = extract_targets_from_synthesis(); target_type = "page"; target_source = "synthesis"
297
+
298
+ # Step 5: Fallback
299
+ IF NOT target_list: target_list = ["home"]; target_type = "page"; target_source = "default"
300
+
301
+ # Validate and clean
302
+ validated_targets = [normalize(t) for t in target_list if is_valid(t)]
303
+ IF NOT validated_targets: validated_targets = ["home"]; target_type = "page"
304
+ IF --target-type != "auto": target_type = --target-type
305
+
306
+ # Interactive confirmation
307
+ DISPLAY_CONFIRMATION(target_type, target_source, validated_targets, device_type, device_source):
308
+ "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
309
+ "{emoji} {LABEL} CONFIRMATION (Style-Centric)"
310
+ "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
311
+ "Type: {target_type} | Source: {target_source}"
312
+ "Targets ({count}): {', '.join(validated_targets)}"
313
+ "Device: {device_type} | Source: {device_source}"
314
+ "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
315
+ "Performance: {style_variants} agent calls"
316
+ "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
317
+ "Modification Options:"
318
+ " • 'continue/yes/ok' - Proceed with current configuration"
319
+ " • 'targets: a,b,c' - Replace target list"
320
+ " • 'skip: x,y' - Remove specific targets"
321
+ " • 'add: z' - Add new targets"
322
+ " • 'type: page|component' - Change target type"
323
+ " • 'device: desktop|mobile|tablet|responsive' - Change device type"
324
+ "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
325
+
326
+ user_input = WAIT_FOR_USER_INPUT()
327
+
328
+ # Process user modifications
329
+ MATCH user_input:
330
+ "continue|yes|ok" → proceed
331
+ "targets: ..." → validated_targets = parse_new_list()
332
+ "skip: ..." → validated_targets = remove_items()
333
+ "add: ..." → validated_targets = add_items()
334
+ "type: ..." → target_type = extract_type()
335
+ "device: ..." → device_type = extract_device()
336
+ default → proceed with current list
337
+
338
+ STORE: inferred_target_list, target_type, target_inference_source
339
+
340
+ # ⚠️ CRITICAL: User confirmation complete, IMMEDIATELY initialize TodoWrite and execute Phase 7
341
+ # This is the only user interaction point in the workflow
342
+ # After this point, all subsequent phases execute automatically without user intervention
343
+ ```
344
+
345
+ **Helper Function: detect_target_type()**
346
+ ```bash
347
+ detect_target_type(target_list):
348
+ page_keywords = ["home", "dashboard", "settings", "profile", "login", "signup", "auth", ...]
349
+ component_keywords = ["navbar", "header", "footer", "hero", "card", "button", "form", ...]
350
+
351
+ page_matches = count_matches(target_list, page_keywords + ["page", "screen", "view"])
352
+ component_matches = count_matches(target_list, component_keywords + ["component", "widget"])
353
+
354
+ RETURN "component" IF component_matches > page_matches ELSE "page"
355
+ ```
356
+
357
+ ### Phase 6: Code Import & Completeness Assessment (Conditional)
358
+
359
+ **Step 6.1: Execute** - Import design system from code files
360
+
361
+ ```javascript
362
+ IF design_source IN ["code_only", "hybrid"]:
363
+ REPORT: "🔍 Phase 6: Code Import ({design_source})"
364
+ command = "/workflow:ui-design:import-from-code --design-id \"{design_id}\" --source \"{code_base_path}\""
365
+
366
+ TRY:
367
+ # SlashCommand execute ATTACHES import-from-code's tasks to current workflow
368
+ # Orchestrator will EXECUTE these attached tasks itself:
369
+ # - Phase 0: Discover and categorize code files
370
+ # - Phase 1.1-1.3: Style/Animation/Layout Agent extraction
371
+ SlashCommand(command)
372
+ CATCH error:
373
+ WARN: "⚠️ Code import failed: {error}"
374
+ WARN: "Cleaning up incomplete import directories"
375
+ Bash(rm -rf "{base_path}/style-extraction" "{base_path}/animation-extraction" "{base_path}/layout-extraction" 2>/dev/null)
376
+
377
+ IF design_source == "code_only":
378
+ REPORT: "Cannot proceed with code-only mode after import failure"
379
+ EXIT 1
380
+ ELSE: # hybrid mode
381
+ WARN: "Continuing with visual-only mode"
382
+ design_source = "visual_only"
383
+
384
+ # Check file existence and assess completeness
385
+ style_exists = exists("{base_path}/style-extraction/style-1/design-tokens.json")
386
+ animation_exists = exists("{base_path}/animation-extraction/animation-tokens.json")
387
+ layout_count = bash(ls {base_path}/layout-extraction/layout-*.json 2>/dev/null | wc -l)
388
+ layout_exists = (layout_count > 0)
389
+
390
+ style_complete = false
391
+ animation_complete = false
392
+ layout_complete = false
393
+ missing_categories = []
394
+
395
+ # Style completeness check
396
+ IF style_exists:
397
+ tokens = Read("{base_path}/style-extraction/style-1/design-tokens.json")
398
+ style_complete = (
399
+ tokens.colors?.brand && tokens.colors?.surface &&
400
+ tokens.typography?.font_family && tokens.spacing &&
401
+ Object.keys(tokens.colors.brand || {}).length >= 3 &&
402
+ Object.keys(tokens.spacing || {}).length >= 8
403
+ )
404
+ IF NOT style_complete AND tokens._metadata?.completeness?.missing_categories:
405
+ missing_categories.extend(tokens._metadata.completeness.missing_categories)
406
+ ELSE:
407
+ missing_categories.push("style tokens")
408
+
409
+ # Animation completeness check
410
+ IF animation_exists:
411
+ anim = Read("{base_path}/animation-extraction/animation-tokens.json")
412
+ animation_complete = (
413
+ anim.duration && anim.easing &&
414
+ Object.keys(anim.duration || {}).length >= 3 &&
415
+ Object.keys(anim.easing || {}).length >= 3
416
+ )
417
+ IF NOT animation_complete AND anim._metadata?.completeness?.missing_items:
418
+ missing_categories.extend(anim._metadata.completeness.missing_items)
419
+ ELSE:
420
+ missing_categories.push("animation tokens")
421
+
422
+ # Layout completeness check
423
+ IF layout_exists:
424
+ # Read first layout file to verify structure
425
+ first_layout = bash(ls {base_path}/layout-extraction/layout-*.json 2>/dev/null | head -1)
426
+ layout_data = Read(first_layout)
427
+ layout_complete = (
428
+ layout_count >= 1 &&
429
+ layout_data.template?.dom_structure &&
430
+ layout_data.template?.css_layout_rules
431
+ )
432
+ IF NOT layout_complete:
433
+ missing_categories.push("complete layout structure")
434
+ ELSE:
435
+ missing_categories.push("layout templates")
436
+
437
+ needs_visual_supplement = false
438
+
439
+ IF design_source == "code_only" AND NOT (style_complete AND layout_complete):
440
+ REPORT: "⚠️ Missing: {', '.join(missing_categories)}"
441
+ REPORT: "Options: 'continue' | 'supplement: <images>' | 'cancel'"
442
+ user_response = WAIT_FOR_USER_INPUT()
443
+ MATCH user_response:
444
+ "continue" → needs_visual_supplement = false
445
+ "supplement: ..." → needs_visual_supplement = true; --images = extract_path(user_response)
446
+ "cancel" → EXIT 0
447
+ default → needs_visual_supplement = false
448
+ ELSE IF design_source == "hybrid":
449
+ needs_visual_supplement = true
450
+
451
+ # Animation reuse confirmation (code import with complete animations)
452
+ IF design_source == "code_only" AND animation_complete:
453
+ REPORT: "✅ Complete animation system detected (from code import)"
454
+ REPORT: " Duration scales: {duration_count} | Easing functions: {easing_count}"
455
+ REPORT: ""
456
+ REPORT: "Options:"
457
+ REPORT: " • 'reuse' (default) - Reuse existing animation system"
458
+ REPORT: " • 'regenerate' - Regenerate animation system (interactive)"
459
+ REPORT: " • 'cancel' - Cancel workflow"
460
+ user_response = WAIT_FOR_USER_INPUT()
461
+ MATCH user_response:
462
+ "reuse" → skip_animation_extraction = true
463
+ "regenerate" → skip_animation_extraction = false
464
+ "cancel" → EXIT 0
465
+ default → skip_animation_extraction = true # Default: reuse
466
+
467
+ STORE: needs_visual_supplement, style_complete, animation_complete, layout_complete, skip_animation_extraction
468
+ ```
469
+
470
+ ### Phase 7: Style Extraction
471
+
472
+ **Step 7.1: Execute** - Extract style design systems
473
+
474
+ ```javascript
475
+ IF design_source == "visual_only" OR needs_visual_supplement:
476
+ REPORT: "🎨 Phase 7: Style Extraction (variants: {style_variants})"
477
+ command = "/workflow:ui-design:style-extract --design-id \"{design_id}\" " +
478
+ (images_input ? "--images \"{images_input}\" " : "") +
479
+ (prompt_text ? "--prompt \"{prompt_text}\" " : "") +
480
+ "--variants {style_variants} --interactive"
481
+
482
+ # SlashCommand execute ATTACHES style-extract's tasks to current workflow
483
+ # Orchestrator will EXECUTE these attached tasks itself
484
+ SlashCommand(command)
485
+
486
+ # After executing all attached tasks, collapse them into phase summary
487
+ ELSE:
488
+ REPORT: "✅ Phase 7: Style (Using Code Import)"
489
+ ```
490
+
491
+ ### Phase 8: Animation Extraction
492
+
493
+ **Step 8.1: Execute** - Extract animation patterns
494
+
495
+ ```javascript
496
+ # Determine if animation extraction is needed
497
+ should_extract_animation = false
498
+
499
+ IF (design_source == "visual_only" OR needs_visual_supplement):
500
+ # Pure visual input or hybrid mode requiring visual supplement
501
+ should_extract_animation = true
502
+ ELSE IF NOT animation_complete:
503
+ # Code import but animations are incomplete
504
+ should_extract_animation = true
505
+ ELSE IF design_source == "code_only" AND animation_complete AND NOT skip_animation_extraction:
506
+ # Code import with complete animations, but user chose to regenerate
507
+ should_extract_animation = true
508
+
509
+ IF should_extract_animation:
510
+ REPORT: "🚀 Phase 8: Animation Extraction"
511
+
512
+ # Build command with available inputs
513
+ command_parts = [f"/workflow:ui-design:animation-extract --design-id \"{design_id}\""]
514
+
515
+ IF images_input:
516
+ command_parts.append(f"--images \"{images_input}\"")
517
+
518
+ IF prompt_text:
519
+ command_parts.append(f"--prompt \"{prompt_text}\"")
520
+
521
+ command_parts.append("--interactive")
522
+
523
+ command = " ".join(command_parts)
524
+
525
+ # SlashCommand execute ATTACHES animation-extract's tasks to current workflow
526
+ # Orchestrator will EXECUTE these attached tasks itself
527
+ SlashCommand(command)
528
+
529
+ # After executing all attached tasks, collapse them into phase summary
530
+ ELSE:
531
+ REPORT: "✅ Phase 8: Animation (Using Code Import)"
532
+
533
+ # Output: animation-tokens.json + animation-guide.md
534
+ # When phase finishes, IMMEDIATELY execute Phase 9 (auto-continue)
535
+ ```
536
+
537
+ ### Phase 9: Layout Extraction
538
+
539
+ **Step 9.1: Execute** - Extract layout templates
540
+
541
+ ```javascript
542
+ targets_string = ",".join(inferred_target_list)
543
+
544
+ IF (design_source == "visual_only" OR needs_visual_supplement) OR (NOT layout_complete):
545
+ REPORT: "🚀 Phase 9: Layout Extraction ({targets_string}, variants: {layout_variants}, device: {device_type})"
546
+ command = "/workflow:ui-design:layout-extract --design-id \"{design_id}\" " +
547
+ (images_input ? "--images \"{images_input}\" " : "") +
548
+ (prompt_text ? "--prompt \"{prompt_text}\" " : "") +
549
+ "--targets \"{targets_string}\" --variants {layout_variants} --device-type \"{device_type}\" --interactive"
550
+
551
+ # SlashCommand execute ATTACHES layout-extract's tasks to current workflow
552
+ # Orchestrator will EXECUTE these attached tasks itself
553
+ SlashCommand(command)
554
+
555
+ # After executing all attached tasks, collapse them into phase summary
556
+ ELSE:
557
+ REPORT: "✅ Phase 9: Layout (Using Code Import)"
558
+ ```
559
+
560
+ ### Phase 10: UI Assembly
561
+
562
+ **Step 10.1: Execute** - Assemble UI prototypes from design tokens and layout templates
563
+
564
+ ```javascript
565
+ command = "/workflow:ui-design:generate --design-id \"{design_id}\"" + (--session ? " --session {session_id}" : "")
566
+
567
+ total = style_variants × layout_variants × len(inferred_target_list)
568
+
569
+ REPORT: "🚀 Phase 10: UI Assembly | Matrix: {s}×{l}×{n} = {total} prototypes"
570
+ REPORT: " → Pure assembly: Combining layout templates + design tokens"
571
+ REPORT: " → Device: {device_type} (from layout templates)"
572
+ REPORT: " → Assembly tasks: {total} combinations"
573
+
574
+ # SlashCommand execute ATTACHES generate's tasks to current workflow
575
+ # Orchestrator will EXECUTE these attached tasks itself
576
+ SlashCommand(command)
577
+
578
+ # After executing all attached tasks, collapse them into phase summary
579
+ # Workflow complete - generate command handles preview file generation (compare.html, PREVIEW.md)
580
+ # Output (generated by generate command):
581
+ # - {target}-style-{s}-layout-{l}.html (assembled prototypes)
582
+ # - {target}-style-{s}-layout-{l}.css
583
+ # - compare.html (interactive matrix view)
584
+ # - PREVIEW.md (usage instructions)
585
+ ```
586
+
587
+ ## TodoWrite Pattern
588
+ ```javascript
589
+ // Initialize IMMEDIATELY after Phase 5 user confirmation to track multi-phase execution (4 orchestrator-level tasks)
590
+ TodoWrite({todos: [
591
+ {"content": "Phase 7: Style Extraction", "status": "in_progress", "activeForm": "Executing style extraction"},
592
+ {"content": "Phase 8: Animation Extraction", "status": "pending", "activeForm": "Executing animation extraction"},
593
+ {"content": "Phase 9: Layout Extraction", "status": "pending", "activeForm": "Executing layout extraction"},
594
+ {"content": "Phase 10: UI Assembly", "status": "pending", "activeForm": "Executing UI assembly"}
595
+ ]})
596
+
597
+ // ⚠️ CRITICAL: Dynamic TodoWrite task attachment strategy:
598
+ //
599
+ // **Key Concept**: SlashCommand execute ATTACHES tasks to current workflow.
600
+ // Orchestrator EXECUTES these attached tasks itself, not waiting for external completion.
601
+ //
602
+ // Phase 7-10 SlashCommand Execute Pattern (when tasks are attached):
603
+ // Example - Phase 7 with sub-tasks:
604
+ // [
605
+ // {"content": "Phase 7: Style Extraction", "status": "in_progress", "activeForm": "Executing style extraction"},
606
+ // {"content": " → Analyze style references", "status": "in_progress", "activeForm": "Analyzing style references"},
607
+ // {"content": " → Generate style variants", "status": "pending", "activeForm": "Generating style variants"},
608
+ // {"content": " → Create design tokens", "status": "pending", "activeForm": "Creating design tokens"},
609
+ // {"content": "Phase 8: Animation Extraction", "status": "pending", "activeForm": "Executing animation extraction"},
610
+ // ...
611
+ // ]
612
+ //
613
+ // After sub-tasks complete, COLLAPSE back to:
614
+ // [
615
+ // {"content": "Phase 7: Style Extraction", "status": "completed", "activeForm": "Executing style extraction"},
616
+ // {"content": "Phase 8: Animation Extraction", "status": "in_progress", "activeForm": "Executing animation extraction"},
617
+ // ...
618
+ // ]
619
+ //
620
+ ```
621
+
622
+ ## Completion Output
623
+ ```
624
+ ✅ UI Design Explore-Auto Workflow Complete!
625
+
626
+ Architecture: Style-Centric Batch Generation
627
+ Run ID: {run_id} | Session: {session_id or "standalone"}
628
+ Type: {icon} {target_type} | Device: {device_type} | Matrix: {s}×{l}×{n} = {total} prototypes
629
+
630
+ Phase 7: {s} complete design systems (style-extract with multi-select)
631
+ Phase 9: {n×l} layout templates (layout-extract with multi-select)
632
+ - Device: {device_type} layouts
633
+ - {n} targets × {l} layout variants = {n×l} structural templates
634
+ - User-selected concepts generated in parallel
635
+ Phase 10: UI Assembly (generate)
636
+ - Pure assembly: layout templates + design tokens
637
+ - {s}×{l}×{n} = {total} final prototypes
638
+ - Preview files: compare.html, PREVIEW.md (auto-generated by generate command)
639
+
640
+ Assembly Process:
641
+ ✅ Separation of Concerns: Layout (structure) + Style (tokens) kept separate
642
+ ✅ Layout Extraction: {n×l} reusable structural templates
643
+ ✅ Multi-Selection Workflow: User selects multiple variants from generated options
644
+ ✅ Pure Assembly: No design decisions in generate phase
645
+ ✅ Device-Optimized: Layouts designed for {device_type}
646
+
647
+ Design Quality:
648
+ ✅ Token-Driven Styling: 100% var() usage
649
+ ✅ Structural Variety: {l} distinct layouts per target (user-selected)
650
+ ✅ Style Variety: {s} independent design systems (user-selected)
651
+ ✅ Device-Optimized: Layouts designed for {device_type}
652
+
653
+ 📂 {base_path}/
654
+ ├── .intermediates/ (Intermediate analysis files)
655
+ │ ├── style-analysis/ (analysis-options.json with embedded user_selection, computed-styles.json if URL mode)
656
+ │ ├── animation-analysis/ (analysis-options.json with embedded user_selection, animations-*.json if URL mode)
657
+ │ └── layout-analysis/ (analysis-options.json with embedded user_selection, dom-structure-*.json if URL mode)
658
+ ├── style-extraction/ ({s} complete design systems)
659
+ ├── animation-extraction/ (animation-tokens.json, animation-guide.md)
660
+ ├── layout-extraction/ ({n×l} layout template files: layout-{target}-{variant}.json)
661
+ ├── prototypes/ ({total} assembled prototypes)
662
+ └── .run-metadata.json (includes device type)
663
+
664
+ 🌐 Preview: {base_path}/prototypes/compare.html
665
+ - Interactive {s}×{l} matrix view
666
+ - Side-by-side comparison
667
+ - Target-specific layouts with style-aware structure
668
+ - Toggle between {n} targets
669
+
670
+ {icon} Targets: {', '.join(targets)} (type: {target_type})
671
+ - Each target has {l} custom-designed layouts
672
+ - Each style × target × layout has unique HTML structure (not just CSS!)
673
+ - Layout plans stored as structured JSON
674
+ - Optimized for {device_type} viewing
675
+
676
+ Next: Open compare.html to preview all design variants
677
+ ```
678
+