@leocm/flowcraft 0.0.0-stage → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/README.md +855 -3
  2. package/bin/cli.js +108 -0
  3. package/flowcraft.yaml +30 -0
  4. package/install.sh +24 -0
  5. package/lib/args.js +38 -0
  6. package/lib/config.js +20 -0
  7. package/lib/copy.js +131 -0
  8. package/lib/fix.js +110 -0
  9. package/lib/fsutil.js +104 -0
  10. package/lib/global.js +229 -0
  11. package/lib/init.js +43 -0
  12. package/lib/runtime.js +84 -0
  13. package/lib/version.js +55 -0
  14. package/lib/wizard.js +125 -0
  15. package/package.json +31 -4
  16. package/presets/backend.yaml +20 -0
  17. package/presets/default.yaml +15 -0
  18. package/presets/frontend.yaml +20 -0
  19. package/presets/quick-fix.yaml +15 -0
  20. package/setup/.claude/commands/P0.5.md +1 -0
  21. package/setup/.claude/commands/P0.md +1 -0
  22. package/setup/.claude/commands/P1.md +1 -0
  23. package/setup/.claude/commands/P2.md +1 -0
  24. package/setup/.claude/commands/P3.md +1 -0
  25. package/setup/.claude/commands/P4.md +1 -0
  26. package/setup/.claude/commands/P5.md +1 -0
  27. package/setup/.claude/commands/code-analysis-init.md +1 -0
  28. package/setup/.claude/commands/code-analysis-rebuild.md +1 -0
  29. package/setup/.claude/commands/code-analysis-show-memory.md +1 -0
  30. package/setup/.claude/commands/code-analysis-update.md +1 -0
  31. package/setup/.claude/hooks/check-phase-advancement.py +180 -0
  32. package/setup/.claude/hooks/check-phase-test.py +152 -0
  33. package/setup/.claude/hooks/check-phase-write.py +235 -0
  34. package/setup/.claude/hooks/dispatch.py +67 -0
  35. package/setup/.claude/hooks/file-suggestion.py +45 -0
  36. package/setup/.claude/hooks/flowcraft_env.py +137 -0
  37. package/setup/.claude/hooks/log_session.py +93 -0
  38. package/setup/.claude/hooks/permission-request.py +125 -0
  39. package/setup/.claude/hooks/post-tool-failure.py +36 -0
  40. package/setup/.claude/hooks/pre-compact.py +66 -0
  41. package/setup/.claude/hooks/review-runner.py +846 -0
  42. package/setup/.claude/hooks/session-end.py +184 -0
  43. package/setup/.claude/hooks/session-start.py +188 -0
  44. package/setup/.claude/hooks/settings.json +0 -0
  45. package/setup/.claude/hooks/setup-keys.py +282 -0
  46. package/setup/.claude/hooks/statusline.py +63 -0
  47. package/setup/.claude/hooks/stop-check.py +171 -0
  48. package/setup/.claude/hooks/subagent-start.py +50 -0
  49. package/setup/.claude/hooks/subagent-stop.py +63 -0
  50. package/setup/.claude/hooks/task-completed.py +57 -0
  51. package/setup/.claude/hooks/task_manager.py +592 -0
  52. package/setup/.claude/hooks/user-prompt-submit.py +85 -0
  53. package/setup/.claude/project-state.md +109 -0
  54. package/setup/.claude/settings.json +237 -0
  55. package/setup/.claude/settings.local.json +13 -0
  56. package/setup/.claude/skills/P5report/SKILL.md +77 -0
  57. package/setup/.claude/skills/Pstatus/SKILL.md +68 -0
  58. package/setup/.claude/skills/archive/SKILL.md +196 -0
  59. package/setup/.claude/skills/brainstorming/SKILL.md +155 -0
  60. package/setup/.claude/skills/brainstorming/scripts/frame-template.html +213 -0
  61. package/setup/.claude/skills/brainstorming/scripts/helper.js +167 -0
  62. package/setup/.claude/skills/brainstorming/scripts/server.cjs +723 -0
  63. package/setup/.claude/skills/brainstorming/scripts/start-server.py +245 -0
  64. package/setup/.claude/skills/brainstorming/scripts/stop-server.py +178 -0
  65. package/setup/.claude/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  66. package/setup/.claude/skills/brainstorming/visual-companion.md +298 -0
  67. package/setup/.claude/skills/checkpoint/SKILL.md +42 -0
  68. package/setup/.claude/skills/chrome-integration/SKILL.md +67 -0
  69. package/setup/.claude/skills/code-analysis/SKILL.md +1243 -0
  70. package/setup/.claude/skills/code-review/SKILL.md +265 -0
  71. package/setup/.claude/skills/cross-review/SKILL.md +41 -0
  72. package/setup/.claude/skills/executing-plans/SKILL.md +64 -0
  73. package/setup/.claude/skills/git-prep/SKILL.md +50 -0
  74. package/setup/.claude/skills/gitnexus/gitnexus-cli/SKILL.md +67 -0
  75. package/setup/.claude/skills/gitnexus/gitnexus-debugging/SKILL.md +89 -0
  76. package/setup/.claude/skills/gitnexus/gitnexus-exploring/SKILL.md +78 -0
  77. package/setup/.claude/skills/gitnexus/gitnexus-guide/SKILL.md +66 -0
  78. package/setup/.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md +97 -0
  79. package/setup/.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md +121 -0
  80. package/setup/.claude/skills/graphify/SKILL.md +49 -0
  81. package/setup/.claude/skills/openspec-apply-change/SKILL.md +185 -0
  82. package/setup/.claude/skills/openspec-archive-change/SKILL.md +182 -0
  83. package/setup/.claude/skills/openspec-bulk-archive-change/SKILL.md +339 -0
  84. package/setup/.claude/skills/openspec-continue-change/SKILL.md +118 -0
  85. package/setup/.claude/skills/openspec-explore/SKILL.md +311 -0
  86. package/setup/.claude/skills/openspec-ff-change/SKILL.md +113 -0
  87. package/setup/.claude/skills/openspec-new-change/SKILL.md +77 -0
  88. package/setup/.claude/skills/openspec-onboard/SKILL.md +573 -0
  89. package/setup/.claude/skills/openspec-propose/SKILL.md +149 -0
  90. package/setup/.claude/skills/openspec-sync-specs/SKILL.md +262 -0
  91. package/setup/.claude/skills/openspec-update-change/SKILL.md +91 -0
  92. package/setup/.claude/skills/openspec-verify-change/SKILL.md +175 -0
  93. package/setup/.claude/skills/oss-version-check/SKILL.md +71 -0
  94. package/setup/.claude/skills/oss-version-check/check_oss_version.py +205 -0
  95. package/setup/.claude/skills/phase/SKILL.md +63 -0
  96. package/setup/.claude/skills/playwright/SKILL.md +86 -0
  97. package/setup/.claude/skills/playwright-cli/SKILL.md +420 -0
  98. package/setup/.claude/skills/playwright-cli/references/element-attributes.md +23 -0
  99. package/setup/.claude/skills/playwright-cli/references/playwright-tests.md +39 -0
  100. package/setup/.claude/skills/playwright-cli/references/references/element-attributes.md +23 -0
  101. package/setup/.claude/skills/playwright-cli/references/references/playwright-tests.md +39 -0
  102. package/setup/.claude/skills/playwright-cli/references/references/request-mocking.md +87 -0
  103. package/setup/.claude/skills/playwright-cli/references/references/running-code.md +241 -0
  104. package/setup/.claude/skills/playwright-cli/references/references/session-management.md +225 -0
  105. package/setup/.claude/skills/playwright-cli/references/references/storage-state.md +275 -0
  106. package/setup/.claude/skills/playwright-cli/references/references/test-generation.md +433 -0
  107. package/setup/.claude/skills/playwright-cli/references/references/tracing.md +139 -0
  108. package/setup/.claude/skills/playwright-cli/references/references/video-recording.md +143 -0
  109. package/setup/.claude/skills/playwright-cli/references/request-mocking.md +87 -0
  110. package/setup/.claude/skills/playwright-cli/references/running-code.md +241 -0
  111. package/setup/.claude/skills/playwright-cli/references/session-management.md +225 -0
  112. package/setup/.claude/skills/playwright-cli/references/storage-state.md +275 -0
  113. package/setup/.claude/skills/playwright-cli/references/test-generation.md +433 -0
  114. package/setup/.claude/skills/playwright-cli/references/tracing.md +139 -0
  115. package/setup/.claude/skills/playwright-cli/references/video-recording.md +143 -0
  116. package/setup/.claude/skills/review/SKILL.md +98 -0
  117. package/setup/.claude/skills/review-tools/SKILL.md +76 -0
  118. package/setup/.claude/skills/subagent-driven-development/SKILL.md +94 -0
  119. package/setup/.claude/skills/task/SKILL.md +26 -0
  120. package/setup/.claude/skills/test-driven-development/SKILL.md +320 -0
  121. package/setup/.claude/skills/test-driven-development/writing-good-tests.md +198 -0
  122. package/setup/.claude/skills/ui-ux-pro-max/SKILL.md +377 -0
  123. package/setup/.claude/skills/ui-ux-pro-max/data/charts.csv +26 -0
  124. package/setup/.claude/skills/ui-ux-pro-max/data/colors.csv +97 -0
  125. package/setup/.claude/skills/ui-ux-pro-max/data/icons.csv +101 -0
  126. package/setup/.claude/skills/ui-ux-pro-max/data/landing.csv +31 -0
  127. package/setup/.claude/skills/ui-ux-pro-max/data/products.csv +97 -0
  128. package/setup/.claude/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  129. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  130. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  131. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  132. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  133. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  134. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  135. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  136. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  137. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  138. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  139. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  140. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  141. package/setup/.claude/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  142. package/setup/.claude/skills/ui-ux-pro-max/data/styles.csv +68 -0
  143. package/setup/.claude/skills/ui-ux-pro-max/data/typography.csv +58 -0
  144. package/setup/.claude/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  145. package/setup/.claude/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  146. package/setup/.claude/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  147. package/setup/.claude/skills/ui-ux-pro-max/scripts/core.py +253 -0
  148. package/setup/.claude/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  149. package/setup/.claude/skills/ui-ux-pro-max/scripts/search.py +114 -0
  150. package/setup/.claude/skills/ui-ux-standards/SKILL.md +154 -0
  151. package/setup/.claude/skills/verification-before-completion/SKILL.md +120 -0
  152. package/setup/.claude/skills/wiki-read/SKILL.md +190 -0
  153. package/setup/.claude/skills/writing-plans/SKILL.md +168 -0
  154. package/setup/.claude/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  155. package/setup/.claude/tasks/.last-session +1 -0
  156. package/setup/.codex/.agents/skills/P5report/SKILL.md +77 -0
  157. package/setup/.codex/.agents/skills/Pstatus/SKILL.md +30 -0
  158. package/setup/.codex/.agents/skills/archive/SKILL.md +196 -0
  159. package/setup/.codex/.agents/skills/brainstorming/SKILL.md +155 -0
  160. package/setup/.codex/.agents/skills/brainstorming/scripts/frame-template.html +213 -0
  161. package/setup/.codex/.agents/skills/brainstorming/scripts/helper.js +167 -0
  162. package/setup/.codex/.agents/skills/brainstorming/scripts/server.cjs +723 -0
  163. package/setup/.codex/.agents/skills/brainstorming/scripts/start-server.py +245 -0
  164. package/setup/.codex/.agents/skills/brainstorming/scripts/stop-server.py +178 -0
  165. package/setup/.codex/.agents/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  166. package/setup/.codex/.agents/skills/brainstorming/visual-companion.md +298 -0
  167. package/setup/.codex/.agents/skills/checkpoint/SKILL.md +42 -0
  168. package/setup/.codex/.agents/skills/chrome-integration/SKILL.md +67 -0
  169. package/setup/.codex/.agents/skills/code-analysis/SKILL.md +1243 -0
  170. package/setup/.codex/.agents/skills/code-review/SKILL.md +265 -0
  171. package/setup/.codex/.agents/skills/cross-review/SKILL.md +42 -0
  172. package/setup/.codex/.agents/skills/executing-plans/SKILL.md +64 -0
  173. package/setup/.codex/.agents/skills/git-prep/SKILL.md +50 -0
  174. package/setup/.codex/.agents/skills/gitnexus/gitnexus-cli/SKILL.md +67 -0
  175. package/setup/.codex/.agents/skills/gitnexus/gitnexus-debugging/SKILL.md +89 -0
  176. package/setup/.codex/.agents/skills/gitnexus/gitnexus-exploring/SKILL.md +78 -0
  177. package/setup/.codex/.agents/skills/gitnexus/gitnexus-guide/SKILL.md +66 -0
  178. package/setup/.codex/.agents/skills/gitnexus/gitnexus-impact-analysis/SKILL.md +97 -0
  179. package/setup/.codex/.agents/skills/gitnexus/gitnexus-refactoring/SKILL.md +121 -0
  180. package/setup/.codex/.agents/skills/graphify/SKILL.md +49 -0
  181. package/setup/.codex/.agents/skills/openspec-apply-change/SKILL.md +185 -0
  182. package/setup/.codex/.agents/skills/openspec-archive-change/SKILL.md +182 -0
  183. package/setup/.codex/.agents/skills/openspec-bulk-archive-change/SKILL.md +339 -0
  184. package/setup/.codex/.agents/skills/openspec-continue-change/SKILL.md +118 -0
  185. package/setup/.codex/.agents/skills/openspec-explore/SKILL.md +311 -0
  186. package/setup/.codex/.agents/skills/openspec-ff-change/SKILL.md +113 -0
  187. package/setup/.codex/.agents/skills/openspec-new-change/SKILL.md +77 -0
  188. package/setup/.codex/.agents/skills/openspec-onboard/SKILL.md +573 -0
  189. package/setup/.codex/.agents/skills/openspec-propose/SKILL.md +149 -0
  190. package/setup/.codex/.agents/skills/openspec-sync-specs/SKILL.md +262 -0
  191. package/setup/.codex/.agents/skills/openspec-update-change/SKILL.md +91 -0
  192. package/setup/.codex/.agents/skills/openspec-verify-change/SKILL.md +175 -0
  193. package/setup/.codex/.agents/skills/oss-version-check/SKILL.md +71 -0
  194. package/setup/.codex/.agents/skills/oss-version-check/check_oss_version.py +205 -0
  195. package/setup/.codex/.agents/skills/phase/SKILL.md +63 -0
  196. package/setup/.codex/.agents/skills/playwright/SKILL.md +86 -0
  197. package/setup/.codex/.agents/skills/playwright-cli/SKILL.md +420 -0
  198. package/setup/.codex/.agents/skills/playwright-cli/references/element-attributes.md +23 -0
  199. package/setup/.codex/.agents/skills/playwright-cli/references/playwright-tests.md +39 -0
  200. package/setup/.codex/.agents/skills/playwright-cli/references/references/element-attributes.md +23 -0
  201. package/setup/.codex/.agents/skills/playwright-cli/references/references/playwright-tests.md +39 -0
  202. package/setup/.codex/.agents/skills/playwright-cli/references/references/request-mocking.md +87 -0
  203. package/setup/.codex/.agents/skills/playwright-cli/references/references/running-code.md +241 -0
  204. package/setup/.codex/.agents/skills/playwright-cli/references/references/session-management.md +225 -0
  205. package/setup/.codex/.agents/skills/playwright-cli/references/references/storage-state.md +275 -0
  206. package/setup/.codex/.agents/skills/playwright-cli/references/references/test-generation.md +433 -0
  207. package/setup/.codex/.agents/skills/playwright-cli/references/references/tracing.md +139 -0
  208. package/setup/.codex/.agents/skills/playwright-cli/references/references/video-recording.md +143 -0
  209. package/setup/.codex/.agents/skills/playwright-cli/references/request-mocking.md +87 -0
  210. package/setup/.codex/.agents/skills/playwright-cli/references/running-code.md +241 -0
  211. package/setup/.codex/.agents/skills/playwright-cli/references/session-management.md +225 -0
  212. package/setup/.codex/.agents/skills/playwright-cli/references/storage-state.md +275 -0
  213. package/setup/.codex/.agents/skills/playwright-cli/references/test-generation.md +433 -0
  214. package/setup/.codex/.agents/skills/playwright-cli/references/tracing.md +139 -0
  215. package/setup/.codex/.agents/skills/playwright-cli/references/video-recording.md +143 -0
  216. package/setup/.codex/.agents/skills/review/SKILL.md +98 -0
  217. package/setup/.codex/.agents/skills/review-tools/SKILL.md +76 -0
  218. package/setup/.codex/.agents/skills/subagent-driven-development/SKILL.md +94 -0
  219. package/setup/.codex/.agents/skills/task/SKILL.md +27 -0
  220. package/setup/.codex/.agents/skills/test-driven-development/SKILL.md +320 -0
  221. package/setup/.codex/.agents/skills/test-driven-development/writing-good-tests.md +198 -0
  222. package/setup/.codex/.agents/skills/ui-ux-pro-max/SKILL.md +377 -0
  223. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/charts.csv +26 -0
  224. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/colors.csv +97 -0
  225. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/icons.csv +101 -0
  226. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/landing.csv +31 -0
  227. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/products.csv +97 -0
  228. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  229. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  230. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  231. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  232. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  233. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  234. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  235. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  236. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  237. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  238. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  239. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  240. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  241. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  242. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/styles.csv +68 -0
  243. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/typography.csv +58 -0
  244. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  245. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  246. package/setup/.codex/.agents/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  247. package/setup/.codex/.agents/skills/ui-ux-pro-max/scripts/core.py +253 -0
  248. package/setup/.codex/.agents/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  249. package/setup/.codex/.agents/skills/ui-ux-pro-max/scripts/search.py +114 -0
  250. package/setup/.codex/.agents/skills/ui-ux-standards/SKILL.md +154 -0
  251. package/setup/.codex/.agents/skills/verification-before-completion/SKILL.md +120 -0
  252. package/setup/.codex/.agents/skills/wiki-read/SKILL.md +190 -0
  253. package/setup/.codex/.agents/skills/writing-plans/SKILL.md +168 -0
  254. package/setup/.codex/.agents/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  255. package/setup/.codex/config.toml +10 -0
  256. package/setup/.codex/hooks/log_session.py +92 -0
  257. package/setup/.codex/hooks/review-runner.py +851 -0
  258. package/setup/.codex/hooks/sdlc-codex-hook.cjs +1039 -0
  259. package/setup/.codex/hooks/setup-keys.py +287 -0
  260. package/setup/.codex/hooks.json +121 -0
  261. package/setup/.codex/model-catalog.json +154 -0
  262. package/setup/.codex/project-state.md +103 -0
  263. package/setup/AGENTS.md +722 -0
  264. package/setup/CLAUDE.md +717 -0
  265. package/setup/install.sh +24 -0
  266. package/setup/tests/test_decision_timeout.py +241 -0
  267. package/setup/tests/test_hook_guards.py +357 -0
  268. package/setup/tests/test_sdlc_bootstrap.py +167 -0
  269. package/setup/tests/test_task_manager.py +148 -0
@@ -0,0 +1,298 @@
1
+ # Visual Companion Guide
2
+
3
+ Browser-based visual brainstorming companion for showing mockups, diagrams, and options.
4
+
5
+ ## When to Use
6
+
7
+ Decide per-question, not per-session. The test: **would the user understand this better by seeing it than reading it?**
8
+
9
+ **Use the browser** when the content itself is visual:
10
+
11
+ - **UI mockups** — wireframes, layouts, navigation structures, component designs
12
+ - **Architecture diagrams** — system components, data flow, relationship maps
13
+ - **Side-by-side visual comparisons** — comparing two layouts, two color schemes, two design directions
14
+ - **Design polish** — when the question is about look and feel, spacing, visual hierarchy
15
+ - **Spatial relationships** — state machines, flowcharts, entity relationships rendered as diagrams
16
+
17
+ **Use the terminal** when the content is text or tabular:
18
+
19
+ - **Requirements and scope questions** — "what does X mean?", "which features are in scope?"
20
+ - **Conceptual A/B/C choices** — picking between approaches described in words
21
+ - **Tradeoff lists** — pros/cons, comparison tables
22
+ - **Technical decisions** — API design, data modeling, architectural approach selection
23
+ - **Clarifying questions** — anything where the answer is words, not a visual preference
24
+
25
+ A question *about* a UI topic is not automatically a visual question. "What kind of wizard do you want?" is conceptual — use the terminal. "Which of these wizard layouts feels right?" is visual — use the browser.
26
+
27
+ ## How It Works
28
+
29
+ The server watches a directory for HTML files and serves the newest one to the browser. You write HTML content to `screen_dir`, the user sees it in their browser and can click to select options. Selections are recorded to `state_dir/events` that you read on your next turn.
30
+
31
+ **Content fragments vs full documents:** If your HTML file starts with `<!DOCTYPE` or `<html`, the server serves it as-is (just injects the helper script). Otherwise, the server automatically wraps your content in the frame template — adding the header, CSS theme, connection status, and all interactive infrastructure. **Write content fragments by default.** Only write full documents when you need complete control over the page.
32
+
33
+ ## Starting a Session
34
+
35
+ ```bash
36
+ # Start AFTER the user approves the companion. --open auto-opens their browser on
37
+ # the first screen; --project-dir persists mockups and enables same-port restart.
38
+ scripts/start-server.py --project-dir /path/to/project --open
39
+
40
+ # Returns: {"type":"server-started","port":52341,
41
+ # "url":"http://localhost:52341/?key=ab12…",
42
+ # "screen_dir":"/path/to/project/.superpowers/brainstorm/12345-1706000000/content",
43
+ # "state_dir":"/path/to/project/.superpowers/brainstorm/12345-1706000000/state"}
44
+ ```
45
+
46
+ Save `screen_dir` and `state_dir` from the response. With `--open`, the browser opens itself when you push the first screen — you don't need to ask the user to open it, but still share the URL as a fallback (headless/remote setups won't auto-open).
47
+
48
+ **The URL contains a session key (`?key=…`).** The server rejects any request
49
+ without it, so always give the user the **complete** URL from the `url` field —
50
+ never strip the query string, and never hand out a bare `http://host:port`. The
51
+ key gates HTTP and WebSocket access so a stray browser tab or another machine on
52
+ the network can't read the screens or inject events. After the first load the
53
+ browser remembers the key via a cookie, so reloads and `/files/*` assets work
54
+ without repeating it.
55
+
56
+ **Finding connection info:** The server writes its startup JSON to `$STATE_DIR/server-info`. If you launched the server in the background and didn't capture stdout, read that file to get the URL and port. When using `--project-dir`, check `<project>/.superpowers/brainstorm/` for the session directory.
57
+
58
+ **Note:** Pass the project root as `--project-dir` so mockups persist in `.superpowers/brainstorm/` and survive server restarts. Without it, files go to `/tmp` and get cleaned up. Remind the user to add `.superpowers/` to `.gitignore` if it's not already there.
59
+
60
+ **Launching the server by platform:**
61
+
62
+ **Claude Code:**
63
+ ```bash
64
+ # Default mode works — the script backgrounds the server itself.
65
+ scripts/start-server.py --project-dir /path/to/project --open
66
+ ```
67
+
68
+ On Windows, the script auto-detects and switches to foreground mode (which blocks the tool call). Use `run_in_background: true` on the Bash tool call so the server survives across conversation turns, then read `$STATE_DIR/server-info` on the next turn to get the URL and port.
69
+
70
+ **Codex:**
71
+ ```bash
72
+ # Codex reaps background processes. The script auto-detects CODEX_CI and
73
+ # switches to foreground mode. Run it normally — no extra flags needed.
74
+ scripts/start-server.py --project-dir /path/to/project --open
75
+ ```
76
+
77
+ **Gemini CLI:**
78
+ ```bash
79
+ # Use --foreground and set is_background: true on your shell tool call
80
+ # so the process survives across turns
81
+ scripts/start-server.py --project-dir /path/to/project --open --foreground
82
+ ```
83
+
84
+ **Copilot CLI:**
85
+ ```bash
86
+ # Use --foreground and start the server via the bash tool with mode: "async"
87
+ # so the process survives across turns. Capture the returned shellId for
88
+ # read_bash / stop_bash if you need to interact with it later.
89
+ scripts/start-server.py --project-dir /path/to/project --open --foreground
90
+ ```
91
+
92
+ **Other environments:** The server must keep running in the background across conversation turns. If your environment reaps detached processes, use `--foreground` and launch the command with your platform's background execution mechanism.
93
+
94
+ If the URL is unreachable from your browser (common in remote/containerized setups), bind a non-loopback host:
95
+
96
+ ```bash
97
+ scripts/start-server.py \
98
+ --project-dir /path/to/project \
99
+ --host 0.0.0.0 \
100
+ --url-host localhost
101
+ ```
102
+
103
+ Use `--url-host` to control what hostname is printed in the returned URL JSON.
104
+
105
+ ## The Loop
106
+
107
+ 1. **Check server is alive**, then **write HTML** to a new file in `screen_dir`:
108
+ - **Required: confirm the server is alive before referring to the URL or pushing a screen.** Check that `$STATE_DIR/server-info` exists and `$STATE_DIR/server-stopped` does not. If it has shut down, restart it with `start-server.py` using the **same `--project-dir`** — it reuses the same port, so the user's open tab reconnects on its own (it shows a "paused" overlay while the server is down) and you don't need to send a new URL. The server auto-exits after 4 hours idle (configurable with `--idle-timeout-minutes`).
109
+ - Use semantic filenames: `platform.html`, `visual-style.html`, `layout.html`
110
+ - **Never reuse filenames** — each screen gets a fresh file
111
+ - Use your file-creation tool — **never use cat/heredoc** (dumps noise into terminal)
112
+ - Server automatically serves the newest file
113
+
114
+ 2. **Tell user what to expect and end your turn:**
115
+ - Remind them of the URL (every step, not just first)
116
+ - Give a brief text summary of what's on screen (e.g., "Showing 3 layout options for the homepage")
117
+ - Ask them to respond in the terminal: "Take a look and let me know what you think. Click to select an option if you'd like."
118
+
119
+ 3. **On your next turn** — after the user responds in the terminal:
120
+ - Read `$STATE_DIR/events` if it exists — this contains the user's browser interactions (clicks, selections) as JSON lines
121
+ - Merge with the user's terminal text to get the full picture
122
+ - The terminal message is the primary feedback; `state_dir/events` provides structured interaction data
123
+
124
+ 4. **Iterate or advance** — if feedback changes current screen, write a new file (e.g., `layout-v2.html`). Only move to the next question when the current step is validated.
125
+
126
+ 5. **Unload when returning to terminal** — when the next step doesn't need the browser (e.g., a clarifying question, a tradeoff discussion), push a waiting screen to clear the stale content:
127
+
128
+ ```html
129
+ <!-- filename: waiting.html (or waiting-2.html, etc.) -->
130
+ <div style="display:flex;align-items:center;justify-content:center;min-height:60vh">
131
+ <p class="subtitle">Continuing in terminal...</p>
132
+ </div>
133
+ ```
134
+
135
+ This prevents the user from staring at a resolved choice while the conversation has moved on. When the next visual question comes up, push a new content file as usual.
136
+
137
+ 6. Repeat until done.
138
+
139
+ ## Writing Content Fragments
140
+
141
+ Write just the content that goes inside the page. The server wraps it in the frame template automatically (header, theme CSS, connection status, and all interactive infrastructure).
142
+
143
+ **Minimal example:**
144
+
145
+ ```html
146
+ <h2>Which layout works better?</h2>
147
+ <p class="subtitle">Consider readability and visual hierarchy</p>
148
+
149
+ <div class="options">
150
+ <div class="option" data-choice="a" onclick="toggleSelect(this)">
151
+ <div class="letter">A</div>
152
+ <div class="content">
153
+ <h3>Single Column</h3>
154
+ <p>Clean, focused reading experience</p>
155
+ </div>
156
+ </div>
157
+ <div class="option" data-choice="b" onclick="toggleSelect(this)">
158
+ <div class="letter">B</div>
159
+ <div class="content">
160
+ <h3>Two Column</h3>
161
+ <p>Sidebar navigation with main content</p>
162
+ </div>
163
+ </div>
164
+ </div>
165
+ ```
166
+
167
+ That's it. No `<html>`, no CSS, no `<script>` tags needed. The server provides all of that.
168
+
169
+ ## CSS Classes Available
170
+
171
+ The frame template provides these CSS classes for your content:
172
+
173
+ ### Options (A/B/C choices)
174
+
175
+ ```html
176
+ <div class="options">
177
+ <div class="option" data-choice="a" onclick="toggleSelect(this)">
178
+ <div class="letter">A</div>
179
+ <div class="content">
180
+ <h3>Title</h3>
181
+ <p>Description</p>
182
+ </div>
183
+ </div>
184
+ </div>
185
+ ```
186
+
187
+ **Multi-select:** Add `data-multiselect` to the container to let users select multiple options. Each click toggles the item's selected styling.
188
+
189
+ ```html
190
+ <div class="options" data-multiselect>
191
+ <!-- same option markup — users can select/deselect multiple -->
192
+ </div>
193
+ ```
194
+
195
+ ### Cards (visual designs)
196
+
197
+ ```html
198
+ <div class="cards">
199
+ <div class="card" data-choice="design1" onclick="toggleSelect(this)">
200
+ <div class="card-image"><!-- mockup content --></div>
201
+ <div class="card-body">
202
+ <h3>Name</h3>
203
+ <p>Description</p>
204
+ </div>
205
+ </div>
206
+ </div>
207
+ ```
208
+
209
+ ### Mockup container
210
+
211
+ ```html
212
+ <div class="mockup">
213
+ <div class="mockup-header">Preview: Dashboard Layout</div>
214
+ <div class="mockup-body"><!-- your mockup HTML --></div>
215
+ </div>
216
+ ```
217
+
218
+ ### Split view (side-by-side)
219
+
220
+ ```html
221
+ <div class="split">
222
+ <div class="mockup"><!-- left --></div>
223
+ <div class="mockup"><!-- right --></div>
224
+ </div>
225
+ ```
226
+
227
+ ### Pros/Cons
228
+
229
+ ```html
230
+ <div class="pros-cons">
231
+ <div class="pros"><h4>Pros</h4><ul><li>Benefit</li></ul></div>
232
+ <div class="cons"><h4>Cons</h4><ul><li>Drawback</li></ul></div>
233
+ </div>
234
+ ```
235
+
236
+ ### Mock elements (wireframe building blocks)
237
+
238
+ ```html
239
+ <div class="mock-nav">Logo | Home | About | Contact</div>
240
+ <div style="display: flex;">
241
+ <div class="mock-sidebar">Navigation</div>
242
+ <div class="mock-content">Main content area</div>
243
+ </div>
244
+ <button class="mock-button">Action Button</button>
245
+ <input class="mock-input" placeholder="Input field">
246
+ <div class="placeholder">Placeholder area</div>
247
+ ```
248
+
249
+ ### Typography and sections
250
+
251
+ - `h2` — page title
252
+ - `h3` — section heading
253
+ - `.subtitle` — secondary text below title
254
+ - `.section` — content block with bottom margin
255
+ - `.label` — small uppercase label text
256
+
257
+ ## Browser Events Format
258
+
259
+ When the user clicks options in the browser, their interactions are recorded to `$STATE_DIR/events` (one JSON object per line). The file is cleared automatically when you push a new screen.
260
+
261
+ ```jsonl
262
+ {"type":"click","choice":"a","text":"Option A - Simple Layout","timestamp":1706000101}
263
+ {"type":"click","choice":"c","text":"Option C - Complex Grid","timestamp":1706000108}
264
+ {"type":"click","choice":"b","text":"Option B - Hybrid","timestamp":1706000115}
265
+ ```
266
+
267
+ The full event stream shows the user's exploration path — they may click multiple options before settling. The last `choice` event is typically the final selection, but the pattern of clicks can reveal hesitation or preferences worth asking about.
268
+
269
+ If `$STATE_DIR/events` doesn't exist, the user didn't interact with the browser — use only their terminal text.
270
+
271
+ ## Design Tips
272
+
273
+ - **Scale fidelity to the question** — wireframes for layout, polish for polish questions
274
+ - **Explain the question on each page** — "Which layout feels more professional?" not just "Pick one"
275
+ - **Iterate before advancing** — if feedback changes current screen, write a new version
276
+ - **2-4 options max** per screen
277
+ - **Use real content when it matters** — for a photography portfolio, use actual images (Unsplash). Placeholder content obscures design issues.
278
+ - **Keep mockups simple** — focus on layout and structure, not pixel-perfect design
279
+
280
+ ## File Naming
281
+
282
+ - Use semantic names: `platform.html`, `visual-style.html`, `layout.html`
283
+ - Never reuse filenames — each screen must be a new file
284
+ - For iterations: append version suffix like `layout-v2.html`, `layout-v3.html`
285
+ - Server serves newest file by modification time
286
+
287
+ ## Cleaning Up
288
+
289
+ ```bash
290
+ scripts/stop-server.py $SESSION_DIR
291
+ ```
292
+
293
+ If the session used `--project-dir`, mockup files persist in `.superpowers/brainstorm/` for later reference. Only `/tmp` sessions get deleted on stop.
294
+
295
+ ## Reference
296
+
297
+ - Frame template (CSS reference): `scripts/frame-template.html`
298
+ - Helper script (client-side): `scripts/helper.js`
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: checkpoint
3
+ description: "Save a snapshot of current work state. | 触发词:保存进度/快照"
4
+ argument-hint: "[description]"
5
+ allowed-tools:
6
+ - Read
7
+ - Edit
8
+ - Bash
9
+ ---
10
+
11
+ Usage: `/checkpoint [description (描述)]`
12
+
13
+ Arguments: $ARGUMENTS
14
+
15
+ ---
16
+
17
+ ## Execution logic (执行逻辑)
18
+
19
+ 1. **Collect state**: read `project-state.md` (`current_phase`, `task_description`), run `git status` + `git diff --stat` (if it is a git repo)
20
+
21
+ 2. **Output the snapshot summary**:
22
+ ```
23
+ === SDLC Checkpoint ===
24
+ Time (时间):{current time}
25
+ Description (描述):{user description or "manual checkpoint (手动检查点)"}
26
+ Phase (阶段):{phase number} — {name}
27
+ Task (任务):{task_description}
28
+ Modified files (已修改文件):{list}
29
+ Architecture decisions (架构决策):{list}
30
+ Todo items (待办事项):{list}
31
+ Git status (Git 状态):{summary}
32
+ ========================
33
+ ```
34
+
35
+ 3. **Update `project-state.md`**: sync `modified_files`, `todo_items`, `last_updated`, `key_context` (current work summary)
36
+
37
+ 4. **Confirm**:
38
+ ```
39
+ ✅ Checkpoint saved (检查点已保存)。
40
+ Phase (阶段):{phase} | Modified (已修改) {n} files | {n} todo items
41
+ After compaction, restore from .claude/project-state.md.
42
+ ```
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: chrome-integration
3
+ description: "Chrome browser integration: P1 prototype preview, P3 visual regression/E2E/responsive tests. | 触发词:原型预览/视觉回归/E2E/响应式"
4
+ allowed-tools:
5
+ - Read
6
+ - Glob
7
+ - Grep
8
+ - Bash
9
+ - Write
10
+ ---
11
+
12
+ Usage: `/chrome-integration <feature>`
13
+
14
+ Arguments: $ARGUMENTS
15
+
16
+ ---
17
+
18
+ > **Note (说明)**: 浏览器交互工具层已由官方 `playwright-cli` 技能取代(R4);本技能保留 P1 原型预览与 P3 视觉回归/响应式封装。首次调用 playwright-cli 时若未安装,用 `npx @playwright/cli@latest {cmd}` 自动下载,或 `npm i -g @playwright/cli`;浏览器缺失时 `npx playwright install chromium`。
19
+
20
+ ## Allowed phases (允许的阶段)
21
+
22
+ | Phase | Chrome | Purpose |
23
+ |------|--------|------|
24
+ | P1 | **allowed** | UI prototype preview, design confirmation |
25
+ | P3 | **allowed** | visual regression tests, E2E interaction verification, responsive tests |
26
+ | Others | forbidden | — |
27
+
28
+ ---
29
+
30
+ ## P1 prototype demo flow (P1 原型展示流程)
31
+
32
+ UI tasks must create a prototype in P1 and show it in Chrome for user confirmation:
33
+
34
+ 1. **Create prototype HTML** — self-contained file (inline CSS + JS), may reference CDN component libraries
35
+ 2. **Open preview in Chrome** — open locally so the user sees the design directly
36
+ 3. **Screenshot records** — capture key pages as design references
37
+ 4. **Iterate** — modify per user feedback, preview again, until satisfied
38
+ 5. **After confirmation enter P2** — P2 coding uses this prototype as the visual baseline
39
+
40
+ ---
41
+
42
+ ## P3 usage (P3 使用规范)
43
+
44
+ - Open the local dev server to verify the UI
45
+ - Compare screenshots of rendered results
46
+ - Verify interaction flows and responsive layout
47
+
48
+ ---
49
+
50
+ ## Feature parameters (功能参数)
51
+
52
+ | Parameter | Description |
53
+ |------|------|
54
+ | prototype | create and open a prototype |
55
+ | screenshot | capture a screenshot of the current page |
56
+ | responsive | responsive tests (375/768/1440px) |
57
+
58
+ ---
59
+
60
+ ## Output format (输出格式)
61
+
62
+ ```
63
+ [Chrome integration (Chrome 集成)]
64
+ - Phase: P1/P3
65
+ - Feature: prototype preview / screenshot / responsive test
66
+ - Status: done
67
+ ```