claude-code-workflow 7.2.30 → 7.3.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 (183) hide show
  1. package/.claude/commands/workflow-skill.md +130 -0
  2. package/.claude/skills/ccw-chain/SKILL.md +44 -71
  3. package/.claude/skills/ccw-chain/chains/ccw-cycle.json +13 -3
  4. package/.claude/skills/ccw-chain/chains/ccw-exploration.json +33 -22
  5. package/.claude/skills/ccw-chain/chains/ccw-issue.json +23 -12
  6. package/.claude/skills/ccw-chain/chains/ccw-lightweight.json +23 -9
  7. package/.claude/skills/ccw-chain/chains/ccw-main.json +15 -2
  8. package/.claude/skills/ccw-chain/chains/ccw-standard.json +28 -16
  9. package/.claude/skills/ccw-chain/chains/ccw-team.json +7 -2
  10. package/.claude/skills/ccw-chain/chains/ccw-with-file.json +25 -9
  11. package/.claude/skills/chain-loader/phases/01-analyze-skill.md +53 -53
  12. package/.claude/skills/chain-loader/specs/chain-schema.md +30 -3
  13. package/.claude/skills/chain-loader/templates/chain-json.md +63 -63
  14. package/.claude/skills/workflow-plan/SKILL.md +1 -0
  15. package/.claude/skills/workflow-plan/phases/01-session-discovery.md +19 -2
  16. package/.claude/skills/workflow-plan/phases/02-context-gathering.md +2 -2
  17. package/.claude/skills/workflow-plan/phases/04-task-generation.md +9 -1
  18. package/.codex/skills/analyze-with-file/SKILL.md +383 -134
  19. package/.codex/skills/brainstorm/SKILL.md +3 -3
  20. package/.codex/skills/brainstorm-with-file/SKILL.md +208 -88
  21. package/.codex/skills/clean/SKILL.md +1 -1
  22. package/.codex/skills/csv-wave-pipeline/SKILL.md +2 -2
  23. package/.codex/skills/investigate/orchestrator.md +24 -0
  24. package/.codex/skills/issue-discover/SKILL.md +374 -361
  25. package/.codex/skills/issue-discover/phases/01-issue-new.md +1 -1
  26. package/.codex/skills/issue-discover/phases/02-discover.md +2 -2
  27. package/.codex/skills/issue-discover/phases/03-discover-by-prompt.md +1 -1
  28. package/.codex/skills/issue-discover/phases/04-quick-execute.md +2 -2
  29. package/.codex/skills/parallel-dev-cycle/SKILL.md +44 -37
  30. package/.codex/skills/project-documentation-workflow/SKILL.md +1 -1
  31. package/.codex/skills/review-cycle/SKILL.md +31 -12
  32. package/.codex/skills/roadmap-with-file/SKILL.md +141 -133
  33. package/.codex/skills/security-audit/orchestrator.md +29 -0
  34. package/.codex/skills/session-sync/SKILL.md +1 -1
  35. package/.codex/skills/ship/orchestrator.md +24 -0
  36. package/.codex/skills/spec-add/SKILL.md +5 -5
  37. package/.codex/skills/spec-generator/SKILL.md +33 -2
  38. package/.codex/skills/spec-generator/phases/01-5-requirement-clarification.md +3 -3
  39. package/.codex/skills/spec-generator/phases/01-discovery.md +1 -1
  40. package/.codex/skills/spec-generator/phases/02-product-brief.md +1 -1
  41. package/.codex/skills/spec-generator/phases/03-requirements.md +1 -1
  42. package/.codex/skills/spec-generator/phases/04-architecture.md +1 -1
  43. package/.codex/skills/spec-generator/phases/05-epics-stories.md +1 -1
  44. package/.codex/skills/spec-generator/phases/06-readiness-check.md +1 -1
  45. package/.codex/skills/spec-generator/phases/07-issue-export.md +1 -1
  46. package/.codex/skills/spec-setup/SKILL.md +669 -669
  47. package/.codex/skills/team-arch-opt/specs/team-config.json +1 -1
  48. package/.codex/skills/team-brainstorm/SKILL.md +259 -259
  49. package/.codex/skills/team-coordinate/SKILL.md +359 -359
  50. package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +1 -1
  51. package/.codex/skills/team-designer/SKILL.md +27 -1
  52. package/.codex/skills/team-designer/phases/01-requirements-analysis.md +2 -2
  53. package/.codex/skills/team-designer/phases/02-scaffold-generation.md +1 -1
  54. package/.codex/skills/team-designer/phases/04-validation.md +1 -1
  55. package/.codex/skills/team-executor/SKILL.md +218 -218
  56. package/.codex/skills/team-frontend/SKILL.md +227 -227
  57. package/.codex/skills/team-frontend-debug/SKILL.md +278 -278
  58. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/analyze.md +2 -2
  59. package/.codex/skills/team-interactive-craft/SKILL.md +220 -220
  60. package/.codex/skills/team-interactive-craft/roles/coordinator/role.md +209 -209
  61. package/.codex/skills/team-issue/SKILL.md +269 -269
  62. package/.codex/skills/team-issue/roles/coordinator/role.md +1 -1
  63. package/.codex/skills/team-lifecycle-v4/SKILL.md +305 -305
  64. package/.codex/skills/team-motion-design/SKILL.md +222 -222
  65. package/.codex/skills/team-motion-design/roles/coordinator/role.md +210 -210
  66. package/.codex/skills/team-perf-opt/SKILL.md +258 -258
  67. package/.codex/skills/team-perf-opt/specs/team-config.json +1 -1
  68. package/.codex/skills/team-planex/SKILL.md +216 -216
  69. package/.codex/skills/team-quality-assurance/SKILL.md +229 -229
  70. package/.codex/skills/team-review/SKILL.md +227 -227
  71. package/.codex/skills/team-roadmap-dev/SKILL.md +238 -238
  72. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/roadmap-discuss.md +5 -5
  73. package/.codex/skills/team-tech-debt/SKILL.md +206 -206
  74. package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +1 -1
  75. package/.codex/skills/team-testing/SKILL.md +237 -237
  76. package/.codex/skills/team-ui-polish/SKILL.md +218 -218
  77. package/.codex/skills/team-ui-polish/roles/coordinator/role.md +213 -213
  78. package/.codex/skills/team-uidesign/SKILL.md +219 -219
  79. package/.codex/skills/team-uidesign/roles/coordinator/role.md +2 -2
  80. package/.codex/skills/team-ultra-analyze/SKILL.md +260 -260
  81. package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +1 -1
  82. package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +1 -1
  83. package/.codex/skills/team-ux-improve/SKILL.md +227 -227
  84. package/.codex/skills/team-ux-improve/roles/coordinator/role.md +1 -1
  85. package/.codex/skills/team-ux-improve/specs/team-config.json +1 -1
  86. package/.codex/skills/team-visual-a11y/SKILL.md +319 -319
  87. package/.codex/skills/team-visual-a11y/roles/coordinator/role.md +213 -213
  88. package/.codex/skills/workflow-execute/SKILL.md +5 -5
  89. package/.codex/skills/workflow-lite-planex/SKILL.md +3 -3
  90. package/.codex/skills/workflow-plan/SKILL.md +3 -3
  91. package/.codex/skills/workflow-tdd-plan/SKILL.md +4 -4
  92. package/.codex/skills/workflow-test-fix-cycle/SKILL.md +403 -402
  93. package/ccw/dist/cli.d.ts.map +1 -1
  94. package/ccw/dist/cli.js +16 -0
  95. package/ccw/dist/cli.js.map +1 -1
  96. package/ccw/dist/commands/chain-loader.d.ts +2 -0
  97. package/ccw/dist/commands/chain-loader.d.ts.map +1 -0
  98. package/ccw/dist/commands/chain-loader.js +11 -0
  99. package/ccw/dist/commands/chain-loader.js.map +1 -0
  100. package/ccw/dist/commands/install.d.ts.map +1 -1
  101. package/ccw/dist/commands/install.js +52 -1
  102. package/ccw/dist/commands/install.js.map +1 -1
  103. package/ccw/dist/commands/launcher.d.ts +2 -0
  104. package/ccw/dist/commands/launcher.d.ts.map +1 -0
  105. package/ccw/dist/commands/launcher.js +434 -0
  106. package/ccw/dist/commands/launcher.js.map +1 -0
  107. package/ccw/dist/tools/chain-loader.d.ts.map +1 -1
  108. package/ccw/dist/tools/chain-loader.js +457 -45
  109. package/ccw/dist/tools/chain-loader.js.map +1 -1
  110. package/ccw/dist/tools/skill-context-loader.d.ts.map +1 -1
  111. package/ccw/dist/tools/skill-context-loader.js +12 -26
  112. package/ccw/dist/tools/skill-context-loader.js.map +1 -1
  113. package/ccw/dist/types/chain-types.d.ts +41 -1
  114. package/ccw/dist/types/chain-types.d.ts.map +1 -1
  115. package/ccw/dist/utils/chain-visualizer.d.ts +13 -0
  116. package/ccw/dist/utils/chain-visualizer.d.ts.map +1 -0
  117. package/ccw/dist/utils/chain-visualizer.js +164 -0
  118. package/ccw/dist/utils/chain-visualizer.js.map +1 -0
  119. package/package.json +1 -1
  120. package/.claude/commands/cli/cli-init.md +0 -441
  121. package/.claude/commands/cli/codex-review.md +0 -361
  122. package/.claude/commands/flow-create.md +0 -663
  123. package/.claude/skills/ccw-chain/phases/analyze-with-file.md +0 -788
  124. package/.claude/skills/ccw-chain/phases/brainstorm/SKILL.md +0 -408
  125. package/.claude/skills/ccw-chain/phases/brainstorm/phases/01-mode-routing.md +0 -207
  126. package/.claude/skills/ccw-chain/phases/brainstorm/phases/02-artifacts.md +0 -567
  127. package/.claude/skills/ccw-chain/phases/brainstorm/phases/03-role-analysis.md +0 -748
  128. package/.claude/skills/ccw-chain/phases/brainstorm/phases/04-synthesis.md +0 -827
  129. package/.claude/skills/ccw-chain/phases/brainstorm-with-file.md +0 -482
  130. package/.claude/skills/ccw-chain/phases/collaborative-plan-with-file.md +0 -639
  131. package/.claude/skills/ccw-chain/phases/debug-with-file.md +0 -656
  132. package/.claude/skills/ccw-chain/phases/integration-test-cycle.md +0 -936
  133. package/.claude/skills/ccw-chain/phases/issue-convert-to-plan.md +0 -720
  134. package/.claude/skills/ccw-chain/phases/issue-discover.md +0 -483
  135. package/.claude/skills/ccw-chain/phases/issue-execute.md +0 -629
  136. package/.claude/skills/ccw-chain/phases/issue-from-brainstorm.md +0 -382
  137. package/.claude/skills/ccw-chain/phases/issue-plan.md +0 -343
  138. package/.claude/skills/ccw-chain/phases/issue-queue.md +0 -464
  139. package/.claude/skills/ccw-chain/phases/refactor-cycle.md +0 -852
  140. package/.claude/skills/ccw-chain/phases/review-cycle/SKILL.md +0 -132
  141. package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-fix.md +0 -760
  142. package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-module.md +0 -764
  143. package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-session.md +0 -775
  144. package/.claude/skills/ccw-chain/phases/roadmap-with-file.md +0 -544
  145. package/.claude/skills/ccw-chain/phases/spec-generator/SKILL.md +0 -338
  146. package/.claude/skills/ccw-chain/phases/spec-generator/phases/01-5-requirement-clarification.md +0 -404
  147. package/.claude/skills/ccw-chain/phases/spec-generator/phases/01-discovery.md +0 -257
  148. package/.claude/skills/ccw-chain/phases/spec-generator/phases/02-product-brief.md +0 -274
  149. package/.claude/skills/ccw-chain/phases/spec-generator/phases/03-requirements.md +0 -184
  150. package/.claude/skills/ccw-chain/phases/spec-generator/phases/04-architecture.md +0 -248
  151. package/.claude/skills/ccw-chain/phases/spec-generator/phases/05-epics-stories.md +0 -178
  152. package/.claude/skills/ccw-chain/phases/spec-generator/phases/06-5-auto-fix.md +0 -144
  153. package/.claude/skills/ccw-chain/phases/spec-generator/phases/06-readiness-check.md +0 -480
  154. package/.claude/skills/ccw-chain/phases/team-planex.md +0 -123
  155. package/.claude/skills/ccw-chain/phases/ui-design-explore-auto.md +0 -678
  156. package/.claude/skills/ccw-chain/phases/unified-execute-with-file.md +0 -870
  157. package/.claude/skills/ccw-chain/phases/workflow-execute/SKILL.md +0 -625
  158. package/.claude/skills/ccw-chain/phases/workflow-execute/phases/06-review.md +0 -215
  159. package/.claude/skills/ccw-chain/phases/workflow-lite-plan.md +0 -616
  160. package/.claude/skills/ccw-chain/phases/workflow-multi-cli-plan.md +0 -424
  161. package/.claude/skills/ccw-chain/phases/workflow-plan/SKILL.md +0 -466
  162. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/01-session-discovery.md +0 -99
  163. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/02-context-gathering.md +0 -338
  164. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/03-conflict-resolution.md +0 -422
  165. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/04-task-generation.md +0 -440
  166. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/05-plan-verify.md +0 -395
  167. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/06-replan.md +0 -594
  168. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/SKILL.md +0 -527
  169. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/01-session-discovery.md +0 -57
  170. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/02-context-gathering.md +0 -407
  171. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/03-test-coverage-analysis.md +0 -172
  172. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/04-conflict-resolution.md +0 -426
  173. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/05-tdd-task-generation.md +0 -473
  174. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/06-tdd-structure-validation.md +0 -189
  175. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/07-tdd-verify.md +0 -635
  176. package/.claude/skills/ccw-chain/phases/workflow-test-fix/SKILL.md +0 -482
  177. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/01-session-start.md +0 -60
  178. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/02-test-context-gather.md +0 -493
  179. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/03-test-concept-enhanced.md +0 -150
  180. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/04-test-task-generate.md +0 -346
  181. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/05-test-cycle-execute.md +0 -538
  182. package/.claude/skills/ccw-chain/specs/intent-patterns.md +0 -60
  183. package/.claude/skills/team-edict.zip +0 -0
@@ -228,7 +228,7 @@ const topic = isRole
228
228
 
229
229
  ```javascript
230
230
  if (executionMode === null) {
231
- const modeAnswer = request_user_input({
231
+ const modeAnswer = functions.request_user_input({
232
232
  questions: [{
233
233
  question: "Choose brainstorming mode:",
234
234
  header: "Mode",
@@ -324,7 +324,7 @@ TOPIC: ${topic}" --tool gemini --mode analysis --rule planning-breakdown-task-st
324
324
  features.forEach(f => console.log(` - [${f.id}] ${f.title}`))
325
325
  }
326
326
 
327
- const answer = request_user_input({
327
+ const answer = functions.request_user_input({
328
328
  questions: [{
329
329
  question: "Approve brainstorm framework?",
330
330
  header: "Validate",
@@ -339,7 +339,7 @@ TOPIC: ${topic}" --tool gemini --mode analysis --rule planning-breakdown-task-st
339
339
  if (answer.Validate === "Cancel") return
340
340
  if (answer.Validate === "Modify Roles") {
341
341
  // Allow user to adjust via request_user_input
342
- const roleAnswer = request_user_input({
342
+ const roleAnswer = functions.request_user_input({
343
343
  questions: [{
344
344
  question: "Select roles for analysis:",
345
345
  header: "Roles",
@@ -8,15 +8,18 @@ argument-hint: "TOPIC=\"<idea or topic>\" [--perspectives=creative,pragmatic,sys
8
8
 
9
9
  ## Overview
10
10
 
11
- Interactive brainstorming workflow with **documented thought evolution**. Expands initial ideas through questioning, inline multi-perspective analysis, and iterative refinement.
11
+ Interactive brainstorming workflow with **documented thought evolution**. Expands initial ideas through questioning, inline multi-perspective analysis, external research, and iterative refinement.
12
12
 
13
- **Core workflow**: Seed Idea → Expand → Multi-Perspective Explore → Synthesize → Refine → Crystallize
13
+ **Core workflow**: Seed Idea → Expand → Multi-Perspective Explore → Research → Refine → Crystallize → Next Step
14
14
 
15
15
  **Key features**:
16
16
  - **brainstorm.md**: Complete thought evolution timeline
17
17
  - **Multi-perspective analysis**: Creative + Pragmatic + Systematic (serial, inline)
18
+ - **External research**: Web search for inspiration, patterns, and best practices via `web.run`
18
19
  - **Idea expansion**: Progressive questioning and exploration
19
20
  - **Diverge-Converge cycles**: Generate options then focus on best paths
21
+ - **Progress tracking**: `functions.update_plan` for real-time phase progress visibility
22
+ - **Structured handoff**: Terminal gate with execution planning, issue creation, or completion
20
23
 
21
24
  ## Auto Mode
22
25
 
@@ -62,12 +65,13 @@ When `--yes` or `-y`: Auto-confirm exploration decisions, use recommended perspe
62
65
  Step 0: Session Setup
63
66
  ├─ Parse topic, flags (--perspectives, --continue, -y)
64
67
  ├─ Generate session ID: BS-{slug}-{date}
65
- └─ Create session folder (or detect existing → continue mode)
68
+ ├─ Create session folder (or detect existing → continue mode)
69
+ └─ functions.update_plan (5 phases: Seed → Explore → Refine → Converge → GATE)
66
70
 
67
71
  Step 1: Seed Understanding
68
72
  ├─ Parse topic, identify brainstorm dimensions
69
73
  ├─ Role/perspective selection with user (or auto)
70
- ├─ Initial scoping (mode, focus areas, constraints)
74
+ ├─ Initial scoping via functions.request_user_input (mode, focus, constraints)
71
75
  ├─ Expand seed into exploration vectors
72
76
  └─ Initialize brainstorm.md
73
77
 
@@ -79,18 +83,21 @@ Step 2: Divergent Exploration (Inline, No Agents)
79
83
  │ ├─ Creative perspective: innovation, cross-domain, challenge assumptions
80
84
  │ ├─ Pragmatic perspective: feasibility, effort, blockers
81
85
  │ └─ Systematic perspective: decomposition, patterns, scalability
82
- ├─ Aggregate findings perspectives.json
86
+ ├─ External research via web.run (optional — patterns, best practices, inspiration)
87
+ ├─ Aggregate findings → perspectives.json + research.json
83
88
  ├─ Update brainstorm.md with Round 1
84
89
  └─ Initial Idea Coverage Check
85
90
 
86
91
  Step 3: Interactive Refinement (Multi-Round, max 6)
87
- ├─ Present current ideas and perspectives
88
- ├─ Gather user feedback
92
+ ├─ Present current ideas and perspectives (Cumulative Context)
93
+ ├─ Record findings to brainstorm.md BEFORE updating Current Ideas
94
+ ├─ Gather user feedback via functions.request_user_input
89
95
  ├─ Process response:
90
96
  │ ├─ Deep Dive → deeper inline analysis on selected ideas
91
97
  │ ├─ Diverge → new inline analysis with different angles
92
98
  │ ├─ Challenge → devil's advocate inline analysis
93
99
  │ ├─ Merge → synthesize complementary ideas inline
100
+ │ ├─ 外部研究 → web.run for external inspiration/validation
94
101
  │ └─ Converge → exit loop for synthesis
95
102
  ├─ Update brainstorm.md with round details
96
103
  └─ Repeat until user selects converge or max rounds
@@ -98,8 +105,11 @@ Step 3: Interactive Refinement (Multi-Round, max 6)
98
105
  Step 4: Convergence & Crystallization
99
106
  ├─ Consolidate all insights → synthesis.json
100
107
  ├─ Update brainstorm.md with final synthesis
101
- ├─ Interactive Top-Idea Review (per-idea confirm/modify/reject)
102
- └─ Offer options: show next-step commands / export / done
108
+ ├─ Batch top-idea review via functions.request_user_input
109
+ └─ MANDATORY Terminal Gate: 执行任务 / 产出Issue / 完成
110
+ ├─ Execute Task → handoff-spec.json with implementation scope
111
+ ├─ Create Issue → display issue creation command
112
+ └─ Done → end workflow
103
113
  ```
104
114
 
105
115
  ## Output Artifacts
@@ -193,7 +203,7 @@ const selectedPerspectiveNames = perspectivesMatch
193
203
  const topic = $ARGUMENTS.replace(/--yes|-y|--continue|--perspectives[=\s][\w,]+|--max-ideas[=\s]\d+|TOPIC=/g, '').replace(/^["']|["']$/g, '').trim()
194
204
 
195
205
  // Determine project root
196
- const projectRoot = Bash('git rev-parse --show-toplevel 2>/dev/null || pwd').trim()
206
+ const projectRoot = functions.exec_command('git rev-parse --show-toplevel 2>/dev/null || pwd').trim()
197
207
 
198
208
  const slug = topic.toLowerCase().replace(/[^a-z0-9\u4e00-\u9fa5]+/g, '-').substring(0, 40)
199
209
  const dateStr = getUtc8ISOString().substring(0, 10)
@@ -202,7 +212,16 @@ const sessionFolder = `${projectRoot}/.workflow/.brainstorm/${sessionId}`
202
212
 
203
213
  // Auto-detect continue: session folder + brainstorm.md exists → continue mode
204
214
  // If continue → load brainstorm.md + perspectives, resume from last round
205
- Bash(`mkdir -p ${sessionFolder}`)
215
+ functions.exec_command(`mkdir -p ${sessionFolder}`)
216
+
217
+ // Initialize progress tracking (MANDATORY)
218
+ functions.update_plan([
219
+ { id: "phase-1", title: "Phase 1: Seed Understanding", status: "in_progress" },
220
+ { id: "phase-2", title: "Phase 2: Divergent Exploration", status: "pending" },
221
+ { id: "phase-3", title: "Phase 3: Interactive Refinement", status: "pending" },
222
+ { id: "phase-4", title: "Phase 4: Convergence & Crystallization", status: "pending" },
223
+ { id: "next-step", title: "GATE: Post-Completion Next Step", status: "pending" }
224
+ ])
206
225
  ```
207
226
 
208
227
  ### Phase 1: Seed Understanding
@@ -255,43 +274,37 @@ For new brainstorm sessions, gather user preferences before exploration (skipped
255
274
 
256
275
  ```javascript
257
276
  if (!autoYes && !continueMode) {
258
- // 1. Brainstorm Mode (single-select)
259
- const mode = request_user_input({
260
- questions: [{
261
- header: "Brainstorm Mode",
262
- id: "mode",
263
- question: "Select brainstorming intensity:",
264
- options: [
265
- { label: "Creative Mode", description: "Fast, high novelty, 1 perspective" },
266
- { label: "Balanced Mode(Recommended)", description: "Moderate, 3 perspectives" },
267
- { label: "Deep Mode", description: "Comprehensive, 3 perspectives + deep refinement" }
268
- ]
269
- }]
270
- })
271
-
272
- // 2. Focus Areas (multi-select)
273
- const focusAreas = request_user_input({
274
- questions: [{
275
- header: "Focus Areas",
276
- id: "focus",
277
- question: "Select brainstorming focus:",
278
- options: generateFocusOptions(dimensions) // Dynamic based on dimensions
279
- }]
280
- })
281
-
282
- // 3. Constraints (multi-select)
283
- const constraints = request_user_input({
284
- questions: [{
285
- header: "Constraints",
286
- id: "constraints",
287
- question: "Any constraints to consider?",
288
- options: [
289
- { label: "Existing Architecture", description: "Must fit current system" },
290
- { label: "Time Constraints", description: "Short implementation timeline" },
291
- { label: "Resource Constraints", description: "Limited team/budget" },
292
- { label: "No Constraints", description: "Blue-sky thinking" }
293
- ]
294
- }]
277
+ // Single batch: Mode + Focus + Constraints (max 4 questions per call)
278
+ const scoping = functions.request_user_input({
279
+ questions: [
280
+ {
281
+ header: "Mode", // max 12 chars
282
+ question: "Select brainstorming intensity:",
283
+ multiSelect: false,
284
+ options: [
285
+ { label: "Balanced (Recommended)", description: "Moderate, 3 perspectives" },
286
+ { label: "Creative", description: "Fast, high novelty, 1 perspective" },
287
+ { label: "Deep", description: "Comprehensive, 3 perspectives + deep refinement" }
288
+ ]
289
+ },
290
+ {
291
+ header: "Focus",
292
+ question: "Select brainstorming focus areas:",
293
+ multiSelect: true,
294
+ options: generateFocusOptions(dimensions) // Dynamic based on dimensions
295
+ },
296
+ {
297
+ header: "Constraints",
298
+ question: "Any constraints to consider?",
299
+ multiSelect: true,
300
+ options: [
301
+ { label: "Existing Arch", description: "Must fit current system" },
302
+ { label: "Time Limited", description: "Short implementation timeline" },
303
+ { label: "Resource Limited", description: "Limited team/budget" },
304
+ { label: "No Constraints", description: "Blue-sky thinking" }
305
+ ]
306
+ }
307
+ ]
295
308
  })
296
309
  }
297
310
  ```
@@ -374,7 +387,7 @@ Write(`${sessionFolder}/brainstorm.md`, brainstormMd)
374
387
  ##### Step 2.1: Detect Codebase & Explore
375
388
 
376
389
  ```javascript
377
- const hasCodebase = Bash(`
390
+ const hasCodebase = functions.exec_command(`
378
391
  test -f package.json && echo "nodejs" ||
379
392
  test -f go.mod && echo "golang" ||
380
393
  test -f Cargo.toml && echo "rust" ||
@@ -443,6 +456,9 @@ perspectives.forEach(perspective => {
443
456
  ##### Step 2.3: Aggregate Multi-Perspective Findings
444
457
 
445
458
  ```javascript
459
+ // Update progress
460
+ functions.update_plan([{ id: "phase-2", title: "Phase 2: Divergent Exploration", status: "in_progress" }])
461
+
446
462
  const synthesis = {
447
463
  session_id: sessionId,
448
464
  timestamp: getUtc8ISOString(),
@@ -467,6 +483,32 @@ const synthesis = {
467
483
  Write(`${sessionFolder}/perspectives.json`, JSON.stringify(synthesis, null, 2))
468
484
  ```
469
485
 
486
+ ##### Step 2.3b: External Research (Optional)
487
+
488
+ Search for external inspiration, industry best practices, and prior art to enrich brainstorming context.
489
+
490
+ ```javascript
491
+ // Triggered when: topic involves established patterns, industry trends, or competitive landscape
492
+ const researchQueries = generateResearchQueries(topic, dimensions)
493
+
494
+ researchQueries.forEach(query => {
495
+ const results = web.run({ search_query: query })
496
+ // Extract: patterns, inspiration, best practices, case studies
497
+ })
498
+
499
+ // Write research findings
500
+ Write(`${sessionFolder}/research.json`, JSON.stringify({
501
+ queries: researchQueries,
502
+ findings: [...], // [{source, insight, relevance_to_topic}]
503
+ inspiration: [...], // Cross-domain ideas from external sources
504
+ best_practices: [...],
505
+ _metadata: { timestamp: getUtc8ISOString() }
506
+ }, null, 2))
507
+
508
+ // Merge research findings into perspectives.json synthesis
509
+ // Update convergent_themes and unique_contributions with external evidence
510
+ ```
511
+
470
512
  ##### Step 2.4: Update brainstorm.md
471
513
 
472
514
  Append Round 1 with exploration results using the [Round Documentation Pattern](#round-documentation-pattern).
@@ -509,6 +551,14 @@ ${explorationVectors.map((vector, i) => {
509
551
  - Creative mode: Run 1 auto-round (1× Diverge), then auto-converge
510
552
  - Skip user direction prompts; auto-select based on idea scores
511
553
 
554
+ **Cumulative Context Rule**: Each round's analysis MUST include ALL prior findings as context. Never analyze in isolation — always build on:
555
+ - Previous rounds' ideas and ratings
556
+ - User feedback from all prior rounds
557
+ - Research findings (if any)
558
+ - Challenged assumptions and their outcomes
559
+
560
+ **Record-Before-Continue Rule**: MUST write round findings to brainstorm.md BEFORE updating Current Ideas or presenting next interaction.
561
+
512
562
  ##### Step 3.1: Present Findings & Gather User Direction
513
563
 
514
564
  **Current Understanding Summary** (Round >= 2, BEFORE presenting new findings):
@@ -516,19 +566,32 @@ ${explorationVectors.map((vector, i) => {
516
566
  - Example: "Top ideas so far: [idea1], [idea2]. Last round [deepened/challenged/merged]. Here are the latest findings:"
517
567
 
518
568
  ```javascript
569
+ // Update progress
570
+ functions.update_plan([{ id: "phase-3", title: "Phase 3: Interactive Refinement", status: "in_progress" }])
571
+
519
572
  if (!autoYes) {
520
- const feedback = request_user_input({
573
+ // Dynamic options based on round context
574
+ const baseOptions = [
575
+ { label: "Deep Dive", description: "Explore selected ideas in detail" },
576
+ { label: "Diverge More", description: "Generate more ideas from different angles" },
577
+ { label: "Challenge", description: "Devil's advocate — test ideas critically" },
578
+ { label: "Merge Ideas", description: "Combine complementary ideas" }
579
+ ]
580
+
581
+ // Add research option if not yet done or if new angles emerged
582
+ if (!researchDone || newAnglesEmerged) {
583
+ baseOptions.push({ label: "外部研究", description: "Search for external inspiration and best practices" })
584
+ }
585
+
586
+ // Always include converge as final option
587
+ baseOptions.push({ label: "Ready to Converge", description: "Sufficient ideas, proceed to synthesis" })
588
+
589
+ const feedback = functions.request_user_input({
521
590
  questions: [{
522
- header: "Brainstorm Direction",
523
- id: "direction",
591
+ header: "Direction", // max 12 chars
524
592
  question: `Brainstorm round ${round}: What would you like to do next?`,
525
- options: [
526
- { label: "Deep Dive", description: "Explore selected ideas in detail" },
527
- { label: "Diverge More", description: "Generate more ideas from different angles" },
528
- { label: "Challenge", description: "Devil's advocate — test ideas critically" },
529
- { label: "Merge Ideas", description: "Combine complementary ideas" },
530
- { label: "Ready to Converge", description: "Sufficient ideas, proceed to synthesis" }
531
- ]
593
+ multiSelect: false,
594
+ options: baseOptions.slice(0, 4) // max 4 options per schema
532
595
  }]
533
596
  })
534
597
  }
@@ -547,6 +610,7 @@ if (!autoYes) {
547
610
  | **Diverge More** | Inline analysis with different angles: alternative framings, cross-domain inspiration, what-if scenarios, constraint relaxation. Generate new ideas. |
548
611
  | **Challenge** | Inline devil's advocate analysis: 3 strongest objections per idea, challenge assumptions, failure scenarios, competitive alternatives, survivability rating (1-5). |
549
612
  | **Merge Ideas** | Ask which ideas to merge. Inline synthesis: identify complementary elements, resolve contradictions, create unified concept, preserve strengths. Write to `ideas/merged-idea-{n}.md`. |
613
+ | **外部研究** | Execute `web.run` with topic-specific queries. Search for: industry patterns, competitive solutions, best practices, academic research. Merge findings into current round. Update `research.json`. |
550
614
  | **Ready to Converge** | Record why concluding. Exit loop → Phase 4. |
551
615
 
552
616
  ##### Step 3.3: Deep Dive on Selected Ideas
@@ -698,25 +762,34 @@ Write(`${sessionFolder}/synthesis.json`, JSON.stringify(synthesis, null, 2))
698
762
 
699
763
  ##### Step 4.3: Interactive Top-Idea Review (skip in auto mode)
700
764
 
701
- Walk through top ideas one-by-one (ordered by score):
765
+ Batch review of top ideas (max 4 questions per call, so group top ideas accordingly):
702
766
 
703
767
  ```javascript
704
- for (const [index, idea] of rankedIdeas.entries()) {
705
- const review = request_user_input({
706
- questions: [{
707
- header: `Idea #${index + 1}`,
708
- id: `idea_${index + 1}`,
709
- question: `Idea #${index + 1}: "${idea.title}" (score: ${idea.score}, novelty: ${idea.novelty}, feasibility: ${idea.feasibility}). Your decision:`,
710
- options: [
711
- { label: "Accept(Recommended)", description: "Keep this idea in final recommendations" },
712
- { label: "Modify", description: "Adjust scope, description, or priority" },
713
- { label: "Reject", description: "Remove from final recommendations" }
714
- ]
715
- }]
716
- })
717
- // Accept → "accepted" | Modify → gather text → "modified" | Reject → gather reason → "rejected"
718
- // Accept All Remaining mark all remaining as "accepted", break loop
719
- // Record review decision to brainstorm.md Decision Log + update synthesis.json
768
+ // Update progress
769
+ functions.update_plan([{ id: "phase-4", title: "Phase 4: Convergence & Crystallization", status: "in_progress" }])
770
+
771
+ if (!autoYes) {
772
+ // Batch review: up to 4 ideas per functions.request_user_input call
773
+ const batchSize = 4
774
+ for (let batch = 0; batch < rankedIdeas.length; batch += batchSize) {
775
+ const batchIdeas = rankedIdeas.slice(batch, batch + batchSize)
776
+ const review = functions.request_user_input({
777
+ questions: batchIdeas.map((idea, i) => ({
778
+ header: `Idea #${batch + i + 1}`, // max 12 chars
779
+ question: `"${idea.title}" (score: ${idea.score}). Your decision:`,
780
+ multiSelect: false,
781
+ options: [
782
+ { label: "Accept", description: "Keep in final recommendations" },
783
+ { label: "Modify", description: "Adjust scope or priority" },
784
+ { label: "Reject", description: "Remove from recommendations" },
785
+ { label: "Accept Rest", description: "Accept all remaining ideas" }
786
+ ]
787
+ }))
788
+ })
789
+ // Process: Accept → "accepted" | Modify → gather text → "modified" | Reject → "rejected"
790
+ // Accept Rest → mark all remaining as "accepted", break outer loop
791
+ // Record review decisions to brainstorm.md Decision Log + update synthesis.json
792
+ }
720
793
  }
721
794
  ```
722
795
 
@@ -730,25 +803,66 @@ for (const [index, idea] of rankedIdeas.entries()) {
730
803
  | 3 | [title] | 6 | 3 | 4 | Rejected | [reason] |
731
804
  ```
732
805
 
733
- ##### Step 4.4: Post-Completion Options
806
+ ##### Step 4.4: MANDATORY Terminal Gate (Post-Completion Next Step)
734
807
 
735
- **Available Options** (this skill is brainstorming-only NEVER auto-launch other skills):
808
+ **CRITICAL**: This gate MUST execute. The workflow MUST NOT end without this `functions.request_user_input` call.
736
809
 
737
- | Option | Purpose | Action |
738
- |--------|---------|--------|
739
- | **Show Next-Step Commands** | Show available commands | Display command list for user to manually run |
740
- | **Export Report** | Generate shareable report | Create formatted report document |
741
- | **Done** | No further action | End workflow |
810
+ ```javascript
811
+ // Update progress — mark phase 4 complete, activate terminal gate
812
+ functions.update_plan([
813
+ { id: "phase-4", title: "Phase 4: Convergence & Crystallization", status: "completed" },
814
+ { id: "next-step", title: "GATE: Post-Completion Next Step", status: "in_progress" }
815
+ ])
816
+
817
+ const nextStep = functions.request_user_input({
818
+ questions: [{
819
+ header: "Next Step", // max 12 chars
820
+ question: "Brainstorming complete. What would you like to do next?",
821
+ multiSelect: false,
822
+ options: [
823
+ { label: "Execute Task", description: "Build implementation scope and handoff spec from top ideas" },
824
+ { label: "Create Issue", description: "Convert top ideas into trackable issues" },
825
+ { label: "Done", description: "End workflow, all artifacts saved" }
826
+ ]
827
+ }]
828
+ })
742
829
 
743
- **Next-step commands to display** (user runs manually, NOT auto-launched):
744
- - `/workflow-lite-plan "..."` → Generate implementation plan
745
- - `/issue:new "..."` Track top ideas as issues
746
- - `/workflow:analyze-with-file "..."` Analyze top idea in detail
830
+ // Handle next step
831
+ if (nextStep === "Execute Task") {
832
+ // Build implementation scope from accepted ideas
833
+ // Step A: Identify scope items from top ideas
834
+ // Step B: Generate handoff-spec.json with implementation details
835
+ // Step C: Write handoff-spec.json to session folder
836
+ Write(`${sessionFolder}/handoff-spec.json`, JSON.stringify({
837
+ session_id: sessionId,
838
+ topic,
839
+ scope_items: acceptedIdeas.map(idea => ({
840
+ title: idea.title,
841
+ description: idea.description,
842
+ implementation_approach: idea.next_steps,
843
+ priority: idea.score >= 8 ? 'high' : idea.score >= 5 ? 'medium' : 'low',
844
+ estimated_complexity: idea.feasibility <= 2 ? 'high' : idea.feasibility <= 4 ? 'medium' : 'low'
845
+ })),
846
+ recommended_workflow: 'workflow-lite-plan or workflow-plan',
847
+ _metadata: { generated: getUtc8ISOString(), source_session: sessionId }
848
+ }, null, 2))
849
+ // Display: "Handoff spec created. Run /workflow-lite-plan to execute."
850
+ } else if (nextStep === "Create Issue") {
851
+ // Display command for user to run manually
852
+ // "/issue:from-brainstorm ${sessionFolder}" or "/issue:new ..."
853
+ }
854
+
855
+ // Mark terminal gate complete
856
+ functions.update_plan([
857
+ { id: "next-step", title: "GATE: Post-Completion Next Step", status: "completed" }
858
+ ])
859
+ ```
747
860
 
748
861
  **Success Criteria**:
749
862
  - synthesis.json created with complete synthesis
750
863
  - brainstorm.md finalized with all conclusions
751
- - User offered meaningful next step options
864
+ - Terminal gate executed with user's next-step choice
865
+ - If "Execute Task": handoff-spec.json created with implementation scope
752
866
  - Session complete and all artifacts available
753
867
 
754
868
  ## Templates
@@ -812,7 +926,9 @@ Remaining questions or exploration directions
812
926
  │ ├── pragmatic.json
813
927
  │ └── systematic.json
814
928
  ├── perspectives.json # Phase 2: Aggregated findings with synthesis
929
+ ├── research.json # Phase 2/3: External research findings (if web.run used)
815
930
  ├── synthesis.json # Phase 4: Final synthesis
931
+ ├── handoff-spec.json # Phase 4: Implementation scope (if "Execute Task" selected)
816
932
  └── ideas/ # Phase 3: Individual idea deep-dives
817
933
  ├── idea-1.md
818
934
  ├── idea-2.md
@@ -825,8 +941,10 @@ Remaining questions or exploration directions
825
941
  | `exploration-codebase.json` | 2 | Codebase context: relevant files, patterns, constraints |
826
942
  | `perspectives/*.json` | 2 | Per-perspective idea generation results |
827
943
  | `perspectives.json` | 2 | Aggregated findings with cross-perspective synthesis |
944
+ | `research.json` | 2-3 | External research: patterns, best practices, inspiration |
828
945
  | `ideas/*.md` | 3 | Individual idea deep-dives and merged ideas |
829
946
  | `synthesis.json` | 4 | Final synthesis: top ideas, recommendations, insights |
947
+ | `handoff-spec.json` | 4 | Implementation scope and handoff (if Execute Task selected) |
830
948
 
831
949
  ### Brainstorm Dimensions
832
950
 
@@ -888,6 +1006,8 @@ Remaining questions or exploration directions
888
1006
  |-----------|--------|----------|
889
1007
  | No codebase detected | Normal flow, pure topic brainstorming | Proceed without exploration-codebase.json |
890
1008
  | Codebase search fails | Continue with available context | Note limitation in brainstorm.md |
1009
+ | Web research fails | Continue without external findings | Note in brainstorm.md, rely on inline analysis |
1010
+ | Research conflicts with ideas | Present as competing evidence | Let user decide which direction to pursue |
891
1011
  | No good ideas | Reframe problem or adjust constraints | Try new exploration angles |
892
1012
  | Perspectives conflict | Present as tradeoff options | Let user select preferred direction |
893
1013
  | Max rounds reached (6) | Force synthesis phase | Highlight unresolved questions |
@@ -252,7 +252,7 @@ Manifest: ${sessionFolder}/cleanup-manifest.json
252
252
  }
253
253
 
254
254
  // User confirmation
255
- const selection = request_user_input({
255
+ const selection = functions.request_user_input({
256
256
  questions: [
257
257
  {
258
258
  header: "清理类别",
@@ -437,7 +437,7 @@ REQUIREMENT: ${requirement}" --tool gemini --mode analysis --rule planning-break
437
437
  waveTasks.forEach(t => console.log(` - [${t.id}] ${t.title}`))
438
438
  }
439
439
 
440
- const answer = request_user_input({
440
+ const answer = functions.request_user_input({
441
441
  questions: [{
442
442
  header: "验证",
443
443
  id: "validation",
@@ -820,7 +820,7 @@ ${[...new Set(tasks.flatMap(t => (t.files_modified || '').split(';')).filter(Boo
820
820
 
821
821
  ```javascript
822
822
  if (!AUTO_YES && failed.length > 0) {
823
- const answer = request_user_input({
823
+ const answer = functions.request_user_input({
824
824
  questions: [{
825
825
  header: "下一步",
826
826
  id: "next_step",
@@ -81,6 +81,20 @@ Utility subagents callable by the investigator agent during analysis phases:
81
81
 
82
82
  ## Phase Execution
83
83
 
84
+ ### Progress Tracking Initialization
85
+
86
+ Before spawning any agent, initialize progress tracking for all phases:
87
+
88
+ ```
89
+ functions.update_plan([
90
+ { id: "phase-1", title: "Phase 1: Root Cause Investigation", status: "in_progress" },
91
+ { id: "phase-2", title: "Phase 2: Pattern Analysis", status: "pending" },
92
+ { id: "phase-3", title: "Phase 3: Hypothesis Testing", status: "pending" },
93
+ { id: "phase-4", title: "Phase 4: Implementation", status: "pending" },
94
+ { id: "phase-5", title: "Phase 5: Verification & Report", status: "pending" }
95
+ ])
96
+ ```
97
+
84
98
  ### Phase 1: Root Cause Investigation
85
99
 
86
100
  **Objective**: Spawn the investigator agent and assign the Phase 1 investigation task. Agent reproduces the bug, collects evidence, and runs initial diagnosis.
@@ -127,6 +141,8 @@ const p1Result = wait_agent({ targets: ["investigator"], timeout_ms: 300000 })
127
141
  |----------|-------------|
128
142
  | p1Result | Phase 1 completion summary with evidence, reproduction, initial diagnosis |
129
143
 
144
+ **Progress**: `functions.update_plan([{id: "phase-1", status: "completed"}, {id: "phase-2", status: "in_progress"}])`
145
+
130
146
  ---
131
147
 
132
148
  ### Phase 2: Pattern Analysis
@@ -169,6 +185,8 @@ const p2Result = wait_agent({ targets: ["investigator"], timeout_ms: 300000 })
169
185
  |----------|-------------|
170
186
  | p2Result | Pattern analysis section: scope classification, similar occurrences, scope justification |
171
187
 
188
+ **Progress**: `functions.update_plan([{id: "phase-2", status: "completed"}, {id: "phase-3", status: "in_progress"}])`
189
+
172
190
  ---
173
191
 
174
192
  ### Phase 3: Hypothesis Testing
@@ -218,6 +236,8 @@ const p3Result = wait_agent({ targets: ["investigator"], timeout_ms: 480000 })
218
236
 
219
237
  If BLOCKED: close investigator and surface the diagnostic dump to the user. Do not proceed to Phase 4.
220
238
 
239
+ **Progress (on success)**: `functions.update_plan([{id: "phase-3", status: "completed"}, {id: "phase-4", status: "in_progress"}])`
240
+
221
241
  ---
222
242
 
223
243
  ### Phase 4: Implementation
@@ -261,6 +281,8 @@ const p4Result = wait_agent({ targets: ["investigator"], timeout_ms: 480000 })
261
281
  |----------|-------------|
262
282
  | p4Result | fix_applied section: files changed, regression test details, reproduction verified |
263
283
 
284
+ **Progress**: `functions.update_plan([{id: "phase-4", status: "completed"}, {id: "phase-5", status: "in_progress"}])`
285
+
264
286
  ---
265
287
 
266
288
  ### Phase 5: Verification & Report
@@ -303,6 +325,8 @@ const p5Result = wait_agent({ targets: ["investigator"], timeout_ms: 300000 })
303
325
  |----------|-------------|
304
326
  | p5Result | Completion status, test suite results, path to debug report file |
305
327
 
328
+ **Progress**: `functions.update_plan([{id: "phase-5", status: "completed"}])`
329
+
306
330
  ---
307
331
 
308
332
  ## Lifecycle Management