@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,168 @@
1
+ ---
2
+ name: writing-plans
3
+ description: "Write an implementation plan from a spec before touching code. | 触发词:写计划/实施计划"
4
+ ---
5
+
6
+ # Writing Plans
7
+
8
+ ## Overview
9
+
10
+ Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
11
+
12
+ Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.
13
+
14
+ **Announce at start:** "I'm using the writing-plans skill to create the implementation plan."
15
+
16
+ **Context:** If working in an isolated worktree, it should have been created via the `superpowers:using-git-worktrees` skill at execution time.
17
+
18
+ **Save plans to:** `docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md`
19
+ - (User preferences for plan location override this default)
20
+
21
+ ## Scope Check
22
+
23
+ If the spec covers multiple independent subsystems, it should have been broken into sub-project specs during brainstorming. If it wasn't, suggest breaking this into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
24
+
25
+ ## File Structure
26
+
27
+ Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.
28
+
29
+ - Design units with clear boundaries and well-defined interfaces. Each file should have one clear responsibility.
30
+ - You reason best about code you can hold in context at once, and your edits are more reliable when files are focused. Prefer smaller, focused files over large ones that do too much.
31
+ - Files that change together should live together. Split by responsibility, not by technical layer.
32
+ - In existing codebases, follow established patterns. If the codebase uses large files, don't unilaterally restructure - but if a file you're modifying has grown unwieldy, including a split in the plan is reasonable.
33
+
34
+ This structure informs the task decomposition. Each task should produce self-contained changes that make sense independently.
35
+
36
+ ## Task Right-Sizing
37
+
38
+ A task is the smallest unit that carries its own test cycle and is worth a
39
+ fresh reviewer's gate. When drawing task boundaries: fold setup,
40
+ configuration, scaffolding, and documentation steps into the task whose
41
+ deliverable needs them; split only where a reviewer could meaningfully
42
+ reject one task while approving its neighbor. Each task ends with an
43
+ independently testable deliverable.
44
+
45
+ ## Bite-Sized Task Granularity
46
+
47
+ **Each step is one action (2-5 minutes):**
48
+ - "Write the failing test" - step
49
+ - "Run it to make sure it fails" - step
50
+ - "Implement the minimal code to make the test pass" - step
51
+ - "Run the tests and make sure they pass" - step
52
+ - "Commit" - step
53
+
54
+ ## Plan Document Header
55
+
56
+ **Every plan MUST start with this header:**
57
+
58
+ ```markdown
59
+ # [Feature Name] Implementation Plan
60
+
61
+ > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
62
+
63
+ **Goal:** [One sentence describing what this builds]
64
+
65
+ **Architecture:** [2-3 sentences about approach]
66
+
67
+ **Tech Stack:** [Key technologies/libraries]
68
+
69
+ ## Global Constraints
70
+
71
+ [The spec's project-wide requirements — version floors, dependency limits,
72
+ naming and copy rules, platform requirements — one line each, with exact
73
+ values copied verbatim from the spec. Every task's requirements implicitly
74
+ include this section.]
75
+
76
+ ---
77
+ ```
78
+
79
+ ## Task Structure
80
+
81
+ ````markdown
82
+ ### Task N: [Component Name]
83
+
84
+ **Files:**
85
+ - Create: `exact/path/to/file.py`
86
+ - Modify: `exact/path/to/existing.py:123-145`
87
+ - Test: `tests/exact/path/to/test.py`
88
+
89
+ **Interfaces:**
90
+ - Consumes: [what this task uses from earlier tasks — exact signatures]
91
+ - Produces: [what later tasks rely on — exact function names, parameter
92
+ and return types. A task's implementer sees only their own task; this
93
+ block is how they learn the names and types neighboring tasks use.]
94
+
95
+ - [ ] **Step 1: Write the failing test**
96
+
97
+ ```python
98
+ def test_specific_behavior():
99
+ result = function(input)
100
+ assert result == expected
101
+ ```
102
+
103
+ - [ ] **Step 2: Run test to verify it fails**
104
+
105
+ Run: `pytest tests/path/test.py::test_name -v`
106
+ Expected: FAIL with "function not defined"
107
+
108
+ - [ ] **Step 3: Write minimal implementation**
109
+
110
+ ```python
111
+ def function(input):
112
+ return expected
113
+ ```
114
+
115
+ - [ ] **Step 4: Run test to verify it passes**
116
+
117
+ Run: `pytest tests/path/test.py::test_name -v`
118
+ Expected: PASS
119
+
120
+ - [ ] **Step 5: Commit**
121
+
122
+ ```bash
123
+ git add tests/path/test.py src/path/file.py
124
+ git commit -m "feat: add specific feature"
125
+ ```
126
+ ````
127
+
128
+ ## No Placeholders
129
+
130
+ Every step must contain the actual content an engineer needs. These are **plan failures** — never write them:
131
+ - "TBD", "TODO", "implement later", "fill in details"
132
+ - "Add appropriate error handling" / "add validation" / "handle edge cases"
133
+ - "Write tests for the above" (without actual test code)
134
+ - "Similar to Task N" (repeat the code — the engineer may be reading tasks out of order)
135
+ - Steps that describe what to do without showing how (code blocks required for code steps)
136
+ - References to types, functions, or methods not defined in any task
137
+
138
+ ## Self-Review
139
+
140
+ After writing the complete plan, look at the spec with fresh eyes and check the plan against it. This is a checklist you run yourself — not a subagent dispatch.
141
+
142
+ **1. Spec coverage:** Skim each section/requirement in the spec. Can you point to a task that implements it? List any gaps.
143
+
144
+ **2. Placeholder scan:** Search your plan for red flags — any of the patterns from the "No Placeholders" section above. Fix them.
145
+
146
+ **3. Type consistency:** Do the types, method signatures, and property names you used in later tasks match what you defined in earlier tasks? A function called `clearLayers()` in Task 3 but `clearFullLayers()` in Task 7 is a bug.
147
+
148
+ If you find issues, fix them inline. No need to re-review — just fix and move on. If you find a spec requirement with no task, add the task.
149
+
150
+ ## Execution Handoff
151
+
152
+ After saving the plan, offer execution choice:
153
+
154
+ **"Plan complete and saved to `docs/superpowers/plans/<filename>.md`. Two execution options:**
155
+
156
+ **1. Subagent-Driven (recommended)** - I dispatch a fresh subagent per task, review between tasks, fast iteration
157
+
158
+ **2. Inline Execution** - Execute tasks in this session using executing-plans, batch execution with checkpoints
159
+
160
+ **Which approach?"**
161
+
162
+ **If Subagent-Driven chosen:**
163
+ - **REQUIRED SUB-SKILL:** Use superpowers:subagent-driven-development
164
+ - Fresh subagent per task + two-stage review
165
+
166
+ **If Inline Execution chosen:**
167
+ - **REQUIRED SUB-SKILL:** Use superpowers:executing-plans
168
+ - Batch execution with checkpoints for review
@@ -0,0 +1,49 @@
1
+ # Plan Document Reviewer Prompt Template
2
+
3
+ Use this template when dispatching a plan document reviewer subagent.
4
+
5
+ **Purpose:** Verify the plan is complete, matches the spec, and has proper task decomposition.
6
+
7
+ **Dispatch after:** The complete plan is written.
8
+
9
+ ```
10
+ Subagent (general-purpose):
11
+ description: "Review plan document"
12
+ prompt: |
13
+ You are a plan document reviewer. Verify this plan is complete and ready for implementation.
14
+
15
+ **Plan to review:** [PLAN_FILE_PATH]
16
+ **Spec for reference:** [SPEC_FILE_PATH]
17
+
18
+ ## What to Check
19
+
20
+ | Category | What to Look For |
21
+ |----------|------------------|
22
+ | Completeness | TODOs, placeholders, incomplete tasks, missing steps |
23
+ | Spec Alignment | Plan covers spec requirements, no major scope creep |
24
+ | Task Decomposition | Tasks have clear boundaries, steps are actionable |
25
+ | Buildability | Could an engineer follow this plan without getting stuck? |
26
+
27
+ ## Calibration
28
+
29
+ **Only flag issues that would cause real problems during implementation.**
30
+ An implementer building the wrong thing or getting stuck is an issue.
31
+ Minor wording, stylistic preferences, and "nice to have" suggestions are not.
32
+
33
+ Approve unless there are serious gaps — missing requirements from the spec,
34
+ contradictory steps, placeholder content, or tasks so vague they can't be acted on.
35
+
36
+ ## Output Format
37
+
38
+ ## Plan Review
39
+
40
+ **Status:** Approved | Issues Found
41
+
42
+ **Issues (if any):**
43
+ - [Task X, Step Y]: [specific issue] - [why it matters for implementation]
44
+
45
+ **Recommendations (advisory, do not block approval):**
46
+ - [suggestions for improvement]
47
+ ```
48
+
49
+ **Reviewer returns:** Status, Issues (if any), Recommendations
@@ -0,0 +1 @@
1
+ s
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: P5report
3
+ description: "Generate a professional P5 stage summary report. | 触发词:生成报告/P5报告"
4
+ ---
5
+
6
+ # P5 Phase Report Generation (P5 阶段报告生成)
7
+
8
+ ## Trigger conditions (触发条件)
9
+ - Auto-executed in the P5 phase
10
+ - User manually runs `/P5report`
11
+
12
+ ## Report structure (报告结构)
13
+
14
+ ### 1. Task overview (任务概述)
15
+ - Task description
16
+ - Start time
17
+ - End time
18
+ - Total duration
19
+
20
+ ### 2. Phase history (阶段历史)
21
+ - Start and end time of each phase
22
+ - Phase transition records
23
+
24
+ ### 3. Deliverable list (交付物清单)
25
+ - Delivered file list
26
+ - File status (completed / tests passed)
27
+
28
+ ### 4. Test results (测试结果)
29
+ - Test case count
30
+ - Passed/failed statistics
31
+
32
+ ### 5. Summary (总结)
33
+ - Task completion status
34
+ - Key achievements
35
+
36
+ ## Report format (报告格式)
37
+
38
+ ```markdown
39
+ # Task Summary Report (任务总结报告)
40
+
41
+ ## Task Overview (任务概述)
42
+ - **Task (任务描述)**: {task_description}
43
+ - **Started (开始时间)**: {started_at}
44
+ - **Completed (结束时间)**: {completed_at}
45
+ - **Duration (总耗时)**: {duration}
46
+
47
+ ## Phase History (阶段历史)
48
+ | Phase (阶段) | Start (开始时间) | End (结束时间) | Duration (耗时) |
49
+ |------|----------|----------|------|
50
+ | P1 | {time} | {time} | {duration} |
51
+ | P2 | {time} | {time} | {duration} |
52
+ | P3 | {time} | {time} | {duration} |
53
+ | P4 | {time} | {time} | {duration} |
54
+ | P5 | {time} | {time} | {duration} |
55
+
56
+ ## Deliverables (交付物清单)
57
+ | File (文件) | Status (状态) |
58
+ |------|------|
59
+ | {file} | ✓ completed (已完成) |
60
+ | {file} | ✓ tests passed (测试通过) |
61
+
62
+ ## Test Results (测试结果)
63
+ - **Cases (测试用例)**: {count}
64
+ - **Passed (通过)**: {passed}
65
+ - **Failed (失败)**: {failed}
66
+
67
+ ## Summary (总结)
68
+ {summary}
69
+ ```
70
+
71
+ ## Execution flow (执行流程)
72
+
73
+ 1. Read `.claude/project-state.md`
74
+ 2. Extract task info (`task_description`, `phase_history`, `deliverable_checklist`)
75
+ 3. Run tests to get results
76
+ 4. Generate the report and save to `.claude/reports/{date}-{task}.md`
77
+ 5. Display the report content
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: Pstatus
3
+ description: "View full SDLC project status. | 触发词:查看状态/项目状态/当前进度"
4
+ allowed-tools:
5
+ - Read
6
+ - Glob
7
+ - Grep
8
+ ---
9
+
10
+ Usage: `/Pstatus`
11
+
12
+ Arguments: $ARGUMENTS
13
+
14
+ ---
15
+ ## Execution logic (执行逻辑)
16
+
17
+ 1. **Read `project-state.md`**: all YAML fields
18
+ 2. **Collect Git info** (if available): current branch, uncommitted changes, latest commit
19
+ 3. **Generate the status report** (Markdown):
20
+
21
+ **SDLC project status report (SDLC 项目状态报告)**
22
+
23
+ - **Task (任务)**: {task_description} | Started (开始): {started_at} | Updated (更新): {last_updated}
24
+ - **Phase progress (阶段进度)**: current {current_phase} (user-confirmed / auto-driven (用户确认/自动驱动)) | review retries (审查重试): {n}/3
25
+ - **Progress (进度)**: P1 ✅ → P2 🔄 → P3 ⬜ → P4 ⬜ → P5 ⬜
26
+ - **File changes (文件变更)**: {n} modified
27
+ - **Architecture decisions (架构决策)**: {list}
28
+ - **Todo items (待办事项)**: {list}
29
+
30
+ 4. **Sync-update** `project-state.md` (if the info is not current) + update `last_updated`
@@ -0,0 +1,196 @@
1
+ ---
2
+ name: archive
3
+ description: "Archive & clean historical memory to free context space. | 触发词:清理历史/归档/释放空间"
4
+ allowed-tools:
5
+ - Read
6
+ - Edit
7
+ - Write
8
+ - Bash
9
+ ---
10
+
11
+ Usage: `/archive`
12
+
13
+ Arguments: $ARGUMENTS
14
+
15
+ ---
16
+
17
+ ## Function (功能)
18
+
19
+ Automatically clean historical memory in `.codex/project-state.md` (Codex 端唯一状态文件), archiving rarely-used information to `.codex/archive/` to free context space; the Claude mirror `.claude/project-state.md` is synced afterwards.
20
+
21
+ ---
22
+
23
+ ## Execution logic (执行逻辑)
24
+
25
+ ### 1. Read the current state
26
+ Read `.codex/project-state.md` (Codex 端唯一状态文件,Claude 端镜像 `.claude/project-state.md`) and extract:
27
+ - `completed_tasks` count
28
+ - `phase_history` count
29
+ - `architecture_decisions` count
30
+
31
+ ### 2. Archive completed_tasks (when ≥5)
32
+ If `completed_tasks.length >= 5`:
33
+ 1. Extract the oldest `N-3` tasks (keep the most recent 3)
34
+ 2. Append to `.codex/archive/tasks-{year}.md` (minimal format; mirror to `.claude/archive/tasks-{year}.md`):
35
+ ```markdown
36
+ - {completed_at}: {task} ({files_count} files)
37
+ ```
38
+ 3. Delete the archived tasks from `project-state.md`
39
+
40
+ ### 3. Compress phase_history (when ≥10)
41
+ If `phase_history.length >= 10`:
42
+ 1. Keep the most recent 5 entries
43
+ 2. Delete the rest
44
+ 3. Add a comment in the file: `# History compressed, keeping the latest 5`
45
+
46
+ ### 4. Trim architecture_decisions (when ≥8)
47
+ If `architecture_decisions.length >= 8`:
48
+ 1. Identify global decisions (spanning multiple modules) → sync to `global_architecture`
49
+ 2. Keep decisions relevant to the current task (≤5)
50
+ 3. Delete outdated/duplicate decisions
51
+
52
+ ### 5. Sync mirrors (同步镜像)
53
+ After cleaning, copy `.codex/project-state.md` → `.claude/project-state.md` and `.codex/archive/tasks-{year}.md` → `.claude/archive/tasks-{year}.md` so both ends stay consistent.
54
+
55
+ ### 6. Generate the archive report
56
+ ```markdown
57
+ # Archive complete (归档完成)
58
+
59
+ **Before (清理前)**: completed_tasks {n} | phase_history {n} | architecture_decisions {n}
60
+ **After (清理后)**: completed_tasks 3 | phase_history 5 | architecture_decisions {n}
61
+ **Location (归档位置)**: .codex/archive/tasks-{year}.md(镜像 .claude/archive/tasks-{year}.md)
62
+ **Space saved (节省空间)**: ~{n} lines (~{n} tokens)
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Archive file format (归档文件格式)
68
+
69
+ ### `.codex/archive/tasks-{year}.md` (minimal)
70
+
71
+ ```markdown
72
+ # {year} Completed task archive (已完成任务归档)
73
+
74
+ > Archived at (归档时间): {timestamp}
75
+
76
+ - 2025-01-15: User login feature (5 files)
77
+ - 2025-01-20: Data display optimization (3 files)
78
+ - 2025-02-01: Performance optimization (8 files)
79
+ ```
80
+
81
+ **Not saved**: prd_summary, key_decisions, detailed info (no longer needed)
82
+
83
+ ---
84
+
85
+ ## Trigger timing (触发时机)
86
+
87
+ ### Automatic triggers (自动触发)
88
+ - After P5 completes, if `completed_tasks >= 5`, prompt the user whether to archive
89
+ - Before Context Compaction, auto-compress phase_history
90
+
91
+ ### Manual triggers (手动触发)
92
+ - User runs `/archive`
93
+ - User says "清理历史" (clean history), "归档旧任务" (archive old tasks), "释放空间" (free space)
94
+
95
+ ---
96
+
97
+ ## Safety protection (安全保护)
98
+
99
+ - ✅ Back up the original `project-state.md` before archiving → `.codex/archive/state-backup-{timestamp}.md`(mirror to `.claude/archive/`)
100
+ - ✅ Archive files are append-only, never deleted
101
+ - ✅ Keep the most recent 3 completed_tasks (not archived)
102
+ - ✅ `project_roadmap` and `global_architecture` are never archived
103
+
104
+ ---
105
+
106
+ ## Example (示例)
107
+
108
+ ### Before archiving (project-state.md, ~180 lines)
109
+
110
+ ```yaml
111
+ completed_tasks:
112
+ - task: "Implement user login"
113
+ prd_summary: "R1:user login R2:password encryption"
114
+ key_decisions: ["React18", "JWT"]
115
+ files_count: 5
116
+ completed_at: "2024-12-01"
117
+ - task: "Data display feature"
118
+ prd_summary: "R1:list display R2:pagination"
119
+ key_decisions: ["Redux Toolkit", "Ant Design"]
120
+ files_count: 3
121
+ completed_at: "2024-12-15"
122
+ - task: "Search feature"
123
+ prd_summary: "R1:keyword search R2:filters"
124
+ key_decisions: ["Debounce", "URL params"]
125
+ files_count: 4
126
+ completed_at: "2025-01-05"
127
+ - task: "Export feature"
128
+ prd_summary: "R1:Excel export R2:PDF export"
129
+ key_decisions: ["xlsx lib", "jsPDF"]
130
+ files_count: 6
131
+ completed_at: "2025-01-20"
132
+ - task: "Permission management"
133
+ prd_summary: "R1:role permissions R2:menu control"
134
+ key_decisions: ["RBAC", "dynamic routes"]
135
+ files_count: 7
136
+ completed_at: "2025-02-01"
137
+
138
+ phase_history:
139
+ - "P1→P2 2024-12-01 10:00"
140
+ - "P2→P3 2024-12-01 14:00"
141
+ - "P3→P4 2024-12-01 16:00"
142
+ - "P4→P5 2024-12-01 17:00"
143
+ - "P0→P1 2024-12-15 09:00"
144
+ - "P1→P2 2024-12-15 11:00"
145
+ # ... 15 entries in total
146
+ ```
147
+
148
+ ### After archiving (project-state.md, ~60 lines)
149
+
150
+ ```yaml
151
+ completed_tasks:
152
+ - task: "Search feature"
153
+ prd_summary: "R1:keyword search R2:filters"
154
+ key_decisions: ["Debounce"]
155
+ files_count: 4
156
+ completed_at: "2025-01-05"
157
+ - task: "Export feature"
158
+ prd_summary: "R1:Excel export R2:PDF export"
159
+ key_decisions: ["xlsx lib"]
160
+ files_count: 6
161
+ completed_at: "2025-01-20"
162
+ - task: "Permission management"
163
+ prd_summary: "R1:role permissions R2:menu control"
164
+ key_decisions: ["RBAC"]
165
+ files_count: 7
166
+ completed_at: "2025-02-01"
167
+
168
+ phase_history:
169
+ # History compressed, keeping the latest 5
170
+ - "P1→P2 2025-02-01 10:00"
171
+ - "P2→P3 2025-02-01 14:00"
172
+ - "P3→P4 2025-02-01 16:00"
173
+ - "P4→P5 2025-02-01 17:00"
174
+ - "P0→P1 2025-02-08 09:00"
175
+ ```
176
+
177
+ ### Archive files (tasks-2024.md + tasks-2025.md, ~10 lines)
178
+
179
+ ```markdown
180
+ # 2024 Completed task archive (已完成任务归档)
181
+
182
+ > Archived at (归档时间): 2025-02-08 10:30
183
+
184
+ - 2024-12-01: Implement user login (5 files)
185
+ - 2024-12-15: Data display feature (3 files)
186
+ ```
187
+
188
+ **Saved**: 180 → 60 lines (**-67%**, ~1500 tokens)
189
+
190
+ ---
191
+
192
+ ## Notes (注意事项)
193
+
194
+ - Archiving is a **one-way operation**; detailed info after archiving is not restored (only summaries are kept)
195
+ - To view archived task details, check Git history or code
196
+ - Recommend batch-archiving during a stable period (after multiple tasks complete)
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: brainstorming
3
+ description: "Explore user intent, requirements and design before any creative work. | 触发词:创意/需求澄清/设计"
4
+ ---
5
+
6
+ # Brainstorming Ideas Into Designs
7
+
8
+ Help turn ideas into fully formed designs and specs through natural collaborative dialogue.
9
+
10
+ Start by understanding the current project context, then ask questions one at a time to refine the idea. Once you understand what you're building, present the design and get user approval.
11
+
12
+ <HARD-GATE>
13
+ Do NOT invoke any implementation skill, write any code, scaffold any project, or take any implementation action until you have presented a design and the user has approved it. This applies to EVERY project regardless of perceived simplicity.
14
+ </HARD-GATE>
15
+
16
+ ## Anti-Pattern: "This Is Too Simple To Need A Design"
17
+
18
+ Every project goes through this process. A todo list, a single-function utility, a config change — all of them. "Simple" projects are where unexamined assumptions cause the most wasted work. The design can be short (a few sentences for truly simple projects), but you MUST present it and get approval.
19
+
20
+ ## Checklist
21
+
22
+ You MUST create a task for each of these items and complete them in order:
23
+
24
+ 1. **Explore project context** — check files, docs, recent commits
25
+ 2. **Offer the visual companion just-in-time** — NOT upfront. The first time a question would genuinely be clearer shown than described, offer it then (its own message); on approval its browser tab opens for you. If no visual question ever arises, never offer it. See the Visual Companion section below.
26
+ 3. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria
27
+ 4. **Propose 2-3 approaches** — with trade-offs and your recommendation
28
+ 5. **Present design** — in sections scaled to their complexity, get user approval after each section
29
+ 6. **Write design doc** — save to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` and commit
30
+ 7. **Spec self-review** — quick inline check for placeholders, contradictions, ambiguity, scope (see below)
31
+ 8. **User reviews written spec** — ask user to review the spec file before proceeding
32
+ 9. **Transition to implementation** — invoke writing-plans skill to create implementation plan
33
+
34
+ ## Decision Point Format (决策点格式)
35
+
36
+ When presenting choices — multiple-choice clarifying questions, 2-3 approach options, or design decisions — use the Decision Card format from AGENTS.md / CLAUDE.md → Display Format Standard (展示格式规范): bold black title (`**🧭 决策点 N | 名称**`), options labeled A./B./C. in order, recommended option marked ✅ Recommended (推荐), others 🔀 Alternative (备选), each option lists Features/When-to-use/Costs (特点/适合/代价). No thin box-drawing characters; no trailing operation hint line.
37
+
38
+ ## Process Flow
39
+
40
+ ```dot
41
+ digraph brainstorming {
42
+ "Explore project context" [shape=box];
43
+ "Ask clarifying questions" [shape=box];
44
+ "Propose 2-3 approaches" [shape=box];
45
+ "Present design sections" [shape=box];
46
+ "User approves design?" [shape=diamond];
47
+ "Write design doc" [shape=box];
48
+ "Spec self-review\n(fix inline)" [shape=box];
49
+ "User reviews spec?" [shape=diamond];
50
+ "Invoke writing-plans skill" [shape=doublecircle];
51
+
52
+ "Explore project context" -> "Ask clarifying questions";
53
+ "Ask clarifying questions" -> "Propose 2-3 approaches";
54
+ "Propose 2-3 approaches" -> "Present design sections";
55
+ "Present design sections" -> "User approves design?";
56
+ "User approves design?" -> "Present design sections" [label="no, revise"];
57
+ "User approves design?" -> "Write design doc" [label="yes"];
58
+ "Write design doc" -> "Spec self-review\n(fix inline)";
59
+ "Spec self-review\n(fix inline)" -> "User reviews spec?";
60
+ "User reviews spec?" -> "Write design doc" [label="changes requested"];
61
+ "User reviews spec?" -> "Invoke writing-plans skill" [label="approved"];
62
+ }
63
+ ```
64
+
65
+ **The terminal state is invoking writing-plans.** Do NOT invoke frontend-design, mcp-builder, or any other implementation skill. The ONLY skill you invoke after brainstorming is writing-plans.
66
+
67
+ ## The Process
68
+
69
+ **Understanding the idea:**
70
+
71
+ - Check out the current project state first (files, docs, recent commits)
72
+ - Before asking detailed questions, assess scope: if the request describes multiple independent subsystems (e.g., "build a platform with chat, file storage, billing, and analytics"), flag this immediately. Don't spend questions refining details of a project that needs to be decomposed first.
73
+ - If the project is too large for a single spec, help the user decompose into sub-projects: what are the independent pieces, how do they relate, what order should they be built? Then brainstorm the first sub-project through the normal design flow. Each sub-project gets its own spec → plan → implementation cycle.
74
+ - For appropriately-scoped projects, ask questions one at a time to refine the idea
75
+ - Prefer multiple choice questions when possible, but open-ended is fine too
76
+ - Only one question per message - if a topic needs more exploration, break it into multiple questions
77
+ - Focus on understanding: purpose, constraints, success criteria
78
+
79
+ **Exploring approaches:**
80
+
81
+ - Propose 2-3 different approaches with trade-offs
82
+ - Present options conversationally with your recommendation and reasoning
83
+ - Lead with your recommended option and explain why
84
+ - YAGNI ruthlessly - remove unnecessary features from every approach and design
85
+
86
+ **Presenting the design:**
87
+
88
+ - Once you believe you understand what you're building, present the design
89
+ - Scale each section to its complexity: a few sentences if straightforward, up to 200-300 words if nuanced
90
+ - Ask after each section whether it looks right so far
91
+ - Cover: architecture, components, data flow, error handling, testing
92
+ - Be ready to go back and clarify if something doesn't make sense
93
+
94
+ **Design for isolation and clarity:**
95
+
96
+ - Break the system into smaller units that each have one clear purpose, communicate through well-defined interfaces, and can be understood and tested independently
97
+ - For each unit, you should be able to answer: what does it do, how do you use it, and what does it depend on?
98
+ - Can someone understand what a unit does without reading its internals? Can you change the internals without breaking consumers? If not, the boundaries need work.
99
+ - Smaller, well-bounded units are also easier for you to work with - you reason better about code you can hold in context at once, and your edits are more reliable when files are focused. When a file grows large, that's often a signal that it's doing too much.
100
+
101
+ **Working in existing codebases:**
102
+
103
+ - Explore the current structure before proposing changes. Follow existing patterns.
104
+ - Where existing code has problems that affect the work (e.g., a file that's grown too large, unclear boundaries, tangled responsibilities), include targeted improvements as part of the design - the way a good developer improves code they're working in.
105
+ - Don't propose unrelated refactoring. Stay focused on what serves the current goal.
106
+
107
+ ## After the Design
108
+
109
+ **Documentation:**
110
+
111
+ - Write the validated design (spec) to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md`
112
+ - (User preferences for spec location override this default)
113
+ - Use elements-of-style:writing-clearly-and-concisely skill if available
114
+ - Commit the design document to git
115
+
116
+ **Spec Self-Review:**
117
+ After writing the spec document, look at it with fresh eyes:
118
+
119
+ 1. **Placeholder scan:** Any "TBD", "TODO", incomplete sections, or vague requirements? Fix them.
120
+ 2. **Internal consistency:** Do any sections contradict each other? Does the architecture match the feature descriptions?
121
+ 3. **Scope check:** Is this focused enough for a single implementation plan, or does it need decomposition?
122
+ 4. **Ambiguity check:** Could any requirement be interpreted two different ways? If so, pick one and make it explicit.
123
+
124
+ Fix any issues inline. No need to re-review — just fix and move on.
125
+
126
+ **User Review Gate:**
127
+ After the spec review loop passes, ask the user to review the written spec before proceeding:
128
+
129
+ > "Spec written and committed to `<path>`. Please review it and let me know if you want to make any changes before we start writing out the implementation plan."
130
+
131
+ Wait for the user's response. If they request changes, make them and re-run the spec review loop. Only proceed once the user approves.
132
+
133
+ **Implementation:**
134
+
135
+ - Invoke the writing-plans skill to create a detailed implementation plan
136
+ - Do NOT invoke any other skill. writing-plans is the next step.
137
+
138
+ ## Visual Companion
139
+
140
+ A browser-based companion for showing mockups, diagrams, and visual options during brainstorming. Available as a tool — not a mode. Accepting the companion means it's available for questions that benefit from visual treatment; it does NOT mean every question goes through the browser.
141
+
142
+ **Offering the companion (just-in-time):** Do NOT offer it upfront. Wait until a question would genuinely be clearer shown than told — a real mockup / layout / diagram question, not merely a UI *topic*. The first time that happens, offer it then, as its own message:
143
+ > "This next part might be easier if I show you — I can put together mockups, diagrams, and comparisons in a browser tab as we go. It's still new and can be token-intensive. Want me to? I'll open it for you."
144
+
145
+ **This offer MUST be its own message.** Only the offer — no clarifying question, summary, or other content. Wait for the user's response. If they accept, start the server with `--open` so their browser opens to the first screen automatically. If they decline, continue text-only and don't offer again unless they raise it.
146
+
147
+ **Per-question decision:** Even after the user accepts, decide FOR EACH QUESTION whether to use the browser or the terminal. The test: **would the user understand this better by seeing it than reading it?**
148
+
149
+ - **Use the browser** for content that IS visual — mockups, wireframes, layout comparisons, architecture diagrams, side-by-side visual designs
150
+ - **Use the terminal** for content that is text — requirements questions, conceptual choices, tradeoff lists, A/B/C/D text options, scope decisions
151
+
152
+ A question about a UI topic is not automatically a visual question. "What does personality mean in this context?" is a conceptual question — use the terminal. "Which wizard layout works better?" is a visual question — use the browser.
153
+
154
+ If they agree to the companion, read the detailed guide before proceeding:
155
+ `skills/brainstorming/visual-companion.md`