claude-code-workflow 7.2.29 → 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 (169) hide show
  1. package/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json +2 -2
  2. package/.ccw/workflows/cli-templates/schemas/task-schema.json +14 -7
  3. package/.claude/agents/action-planning-agent.md +7 -4
  4. package/.claude/agents/cli-explore-agent.md +77 -63
  5. package/.claude/agents/cli-lite-planning-agent.md +11 -10
  6. package/.claude/agents/issue-plan-agent.md +421 -426
  7. package/.claude/commands/workflow/spec/setup.md +1 -1
  8. package/.claude/commands/workflow-skill.md +130 -0
  9. package/.claude/skills/ccw-chain/SKILL.md +92 -0
  10. package/.claude/skills/ccw-chain/chains/ccw-cycle.json +31 -0
  11. package/.claude/skills/ccw-chain/chains/ccw-exploration.json +58 -0
  12. package/.claude/skills/ccw-chain/chains/ccw-issue.json +44 -0
  13. package/.claude/skills/ccw-chain/chains/ccw-lightweight.json +71 -0
  14. package/.claude/skills/ccw-chain/chains/ccw-main.json +65 -0
  15. package/.claude/skills/ccw-chain/chains/ccw-standard.json +51 -0
  16. package/.claude/skills/ccw-chain/chains/ccw-team.json +15 -0
  17. package/.claude/skills/ccw-chain/chains/ccw-with-file.json +47 -0
  18. package/.claude/skills/ccw-chain/specs/auto-mode.md +47 -0
  19. package/.claude/skills/chain-loader/SKILL.md +78 -0
  20. package/.claude/skills/chain-loader/phases/01-analyze-skill.md +53 -0
  21. package/.claude/skills/chain-loader/phases/02-design-graph.md +73 -0
  22. package/.claude/skills/chain-loader/phases/03-generate-validate.md +75 -0
  23. package/.claude/skills/chain-loader/specs/chain-schema.md +126 -0
  24. package/.claude/skills/chain-loader/specs/design-patterns.md +99 -0
  25. package/.claude/skills/chain-loader/templates/chain-json.md +63 -0
  26. package/.claude/skills/review-cycle/phases/review-module.md +764 -764
  27. package/.claude/skills/review-cycle/phases/review-session.md +775 -775
  28. package/.claude/skills/workflow-multi-cli-plan/SKILL.md +2 -2
  29. package/.claude/skills/workflow-plan/SKILL.md +1 -0
  30. package/.claude/skills/workflow-plan/phases/01-session-discovery.md +19 -2
  31. package/.claude/skills/workflow-plan/phases/02-context-gathering.md +2 -2
  32. package/.claude/skills/workflow-plan/phases/03-conflict-resolution.md +422 -422
  33. package/.claude/skills/workflow-plan/phases/04-task-generation.md +9 -1
  34. package/.claude/skills/workflow-plan/phases/05-plan-verify.md +395 -395
  35. package/.claude/skills/workflow-tdd-plan/phases/02-context-gathering.md +407 -407
  36. package/.claude/skills/workflow-tdd-plan/phases/04-conflict-resolution.md +426 -426
  37. package/.claude/skills/workflow-test-fix/phases/02-test-context-gather.md +493 -493
  38. package/.codex/skills/analyze-with-file/SKILL.md +383 -134
  39. package/.codex/skills/brainstorm/SKILL.md +3 -3
  40. package/.codex/skills/brainstorm-with-file/SKILL.md +208 -88
  41. package/.codex/skills/clean/SKILL.md +1 -1
  42. package/.codex/skills/csv-wave-pipeline/SKILL.md +2 -2
  43. package/.codex/skills/investigate/orchestrator.md +24 -0
  44. package/.codex/skills/issue-discover/SKILL.md +374 -361
  45. package/.codex/skills/issue-discover/phases/01-issue-new.md +1 -1
  46. package/.codex/skills/issue-discover/phases/02-discover.md +2 -2
  47. package/.codex/skills/issue-discover/phases/03-discover-by-prompt.md +1 -1
  48. package/.codex/skills/issue-discover/phases/04-quick-execute.md +2 -2
  49. package/.codex/skills/parallel-dev-cycle/SKILL.md +44 -37
  50. package/.codex/skills/project-documentation-workflow/SKILL.md +1 -1
  51. package/.codex/skills/review-cycle/SKILL.md +31 -12
  52. package/.codex/skills/roadmap-with-file/SKILL.md +141 -133
  53. package/.codex/skills/security-audit/orchestrator.md +29 -0
  54. package/.codex/skills/session-sync/SKILL.md +1 -1
  55. package/.codex/skills/ship/orchestrator.md +24 -0
  56. package/.codex/skills/spec-add/SKILL.md +5 -5
  57. package/.codex/skills/spec-generator/SKILL.md +33 -2
  58. package/.codex/skills/spec-generator/phases/01-5-requirement-clarification.md +3 -3
  59. package/.codex/skills/spec-generator/phases/01-discovery.md +1 -1
  60. package/.codex/skills/spec-generator/phases/02-product-brief.md +1 -1
  61. package/.codex/skills/spec-generator/phases/03-requirements.md +1 -1
  62. package/.codex/skills/spec-generator/phases/04-architecture.md +1 -1
  63. package/.codex/skills/spec-generator/phases/05-epics-stories.md +1 -1
  64. package/.codex/skills/spec-generator/phases/06-readiness-check.md +1 -1
  65. package/.codex/skills/spec-generator/phases/07-issue-export.md +1 -1
  66. package/.codex/skills/spec-setup/SKILL.md +669 -669
  67. package/.codex/skills/team-arch-opt/specs/team-config.json +1 -1
  68. package/.codex/skills/team-brainstorm/SKILL.md +259 -259
  69. package/.codex/skills/team-coordinate/SKILL.md +359 -359
  70. package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +1 -1
  71. package/.codex/skills/team-designer/SKILL.md +27 -1
  72. package/.codex/skills/team-designer/phases/01-requirements-analysis.md +2 -2
  73. package/.codex/skills/team-designer/phases/02-scaffold-generation.md +1 -1
  74. package/.codex/skills/team-designer/phases/04-validation.md +1 -1
  75. package/.codex/skills/team-executor/SKILL.md +218 -218
  76. package/.codex/skills/team-frontend/SKILL.md +227 -227
  77. package/.codex/skills/team-frontend-debug/SKILL.md +278 -278
  78. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/analyze.md +2 -2
  79. package/.codex/skills/team-interactive-craft/SKILL.md +220 -220
  80. package/.codex/skills/team-interactive-craft/roles/coordinator/role.md +209 -209
  81. package/.codex/skills/team-issue/SKILL.md +269 -269
  82. package/.codex/skills/team-issue/roles/coordinator/role.md +1 -1
  83. package/.codex/skills/team-lifecycle-v4/SKILL.md +305 -305
  84. package/.codex/skills/team-motion-design/SKILL.md +222 -222
  85. package/.codex/skills/team-motion-design/roles/coordinator/role.md +210 -210
  86. package/.codex/skills/team-perf-opt/SKILL.md +258 -258
  87. package/.codex/skills/team-perf-opt/specs/team-config.json +1 -1
  88. package/.codex/skills/team-planex/SKILL.md +216 -216
  89. package/.codex/skills/team-quality-assurance/SKILL.md +229 -229
  90. package/.codex/skills/team-review/SKILL.md +227 -227
  91. package/.codex/skills/team-roadmap-dev/SKILL.md +238 -238
  92. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/roadmap-discuss.md +5 -5
  93. package/.codex/skills/team-tech-debt/SKILL.md +206 -206
  94. package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +1 -1
  95. package/.codex/skills/team-testing/SKILL.md +237 -237
  96. package/.codex/skills/team-ui-polish/SKILL.md +218 -218
  97. package/.codex/skills/team-ui-polish/roles/coordinator/role.md +213 -213
  98. package/.codex/skills/team-uidesign/SKILL.md +219 -219
  99. package/.codex/skills/team-uidesign/roles/coordinator/role.md +2 -2
  100. package/.codex/skills/team-ultra-analyze/SKILL.md +260 -260
  101. package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +1 -1
  102. package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +1 -1
  103. package/.codex/skills/team-ux-improve/SKILL.md +227 -227
  104. package/.codex/skills/team-ux-improve/roles/coordinator/role.md +1 -1
  105. package/.codex/skills/team-ux-improve/specs/team-config.json +1 -1
  106. package/.codex/skills/team-visual-a11y/SKILL.md +319 -319
  107. package/.codex/skills/team-visual-a11y/roles/coordinator/role.md +213 -213
  108. package/.codex/skills/workflow-execute/SKILL.md +5 -5
  109. package/.codex/skills/workflow-lite-planex/SKILL.md +3 -3
  110. package/.codex/skills/workflow-plan/SKILL.md +3 -3
  111. package/.codex/skills/workflow-tdd-plan/SKILL.md +4 -4
  112. package/.codex/skills/workflow-test-fix-cycle/SKILL.md +403 -402
  113. package/README.md +14 -0
  114. package/ccw/dist/cli.d.ts.map +1 -1
  115. package/ccw/dist/cli.js +16 -0
  116. package/ccw/dist/cli.js.map +1 -1
  117. package/ccw/dist/commands/chain-loader.d.ts +2 -0
  118. package/ccw/dist/commands/chain-loader.d.ts.map +1 -0
  119. package/ccw/dist/commands/chain-loader.js +11 -0
  120. package/ccw/dist/commands/chain-loader.js.map +1 -0
  121. package/ccw/dist/commands/install.d.ts.map +1 -1
  122. package/ccw/dist/commands/install.js +52 -1
  123. package/ccw/dist/commands/install.js.map +1 -1
  124. package/ccw/dist/commands/launcher.d.ts +2 -0
  125. package/ccw/dist/commands/launcher.d.ts.map +1 -0
  126. package/ccw/dist/commands/launcher.js +434 -0
  127. package/ccw/dist/commands/launcher.js.map +1 -0
  128. package/ccw/dist/core/routes/litellm-api-routes.d.ts.map +1 -1
  129. package/ccw/dist/core/routes/litellm-api-routes.js +0 -23
  130. package/ccw/dist/core/routes/litellm-api-routes.js.map +1 -1
  131. package/ccw/dist/tools/chain-loader.d.ts +10 -0
  132. package/ccw/dist/tools/chain-loader.d.ts.map +1 -0
  133. package/ccw/dist/tools/chain-loader.js +1054 -0
  134. package/ccw/dist/tools/chain-loader.js.map +1 -0
  135. package/ccw/dist/tools/index.d.ts.map +1 -1
  136. package/ccw/dist/tools/index.js +2 -0
  137. package/ccw/dist/tools/index.js.map +1 -1
  138. package/ccw/dist/tools/json-builder.js +20 -0
  139. package/ccw/dist/tools/json-builder.js.map +1 -1
  140. package/ccw/dist/tools/skill-context-loader.d.ts.map +1 -1
  141. package/ccw/dist/tools/skill-context-loader.js +12 -26
  142. package/ccw/dist/tools/skill-context-loader.js.map +1 -1
  143. package/ccw/dist/types/chain-types.d.ts +112 -0
  144. package/ccw/dist/types/chain-types.d.ts.map +1 -0
  145. package/ccw/dist/types/chain-types.js +5 -0
  146. package/ccw/dist/types/chain-types.js.map +1 -0
  147. package/ccw/dist/utils/chain-visualizer.d.ts +13 -0
  148. package/ccw/dist/utils/chain-visualizer.d.ts.map +1 -0
  149. package/ccw/dist/utils/chain-visualizer.js +164 -0
  150. package/ccw/dist/utils/chain-visualizer.js.map +1 -0
  151. package/ccw/scripts/prepublish-clean.mjs +0 -1
  152. package/package.json +1 -3
  153. package/.claude/commands/cli/cli-init.md +0 -441
  154. package/.claude/commands/cli/codex-review.md +0 -361
  155. package/.claude/commands/flow-create.md +0 -663
  156. package/.claude/skills/team-edict.zip +0 -0
  157. package/ccw-litellm/README.md +0 -180
  158. package/ccw-litellm/pyproject.toml +0 -35
  159. package/ccw-litellm/src/ccw_litellm/__init__.py +0 -47
  160. package/ccw-litellm/src/ccw_litellm/cli.py +0 -108
  161. package/ccw-litellm/src/ccw_litellm/clients/__init__.py +0 -12
  162. package/ccw-litellm/src/ccw_litellm/clients/litellm_embedder.py +0 -270
  163. package/ccw-litellm/src/ccw_litellm/clients/litellm_llm.py +0 -198
  164. package/ccw-litellm/src/ccw_litellm/config/__init__.py +0 -22
  165. package/ccw-litellm/src/ccw_litellm/config/loader.py +0 -343
  166. package/ccw-litellm/src/ccw_litellm/config/models.py +0 -162
  167. package/ccw-litellm/src/ccw_litellm/interfaces/__init__.py +0 -14
  168. package/ccw-litellm/src/ccw_litellm/interfaces/embedder.py +0 -52
  169. package/ccw-litellm/src/ccw_litellm/interfaces/llm.py +0 -45
@@ -145,7 +145,7 @@ if (clarityScore >= 1 && clarityScore <= 2 && !issueData.affected_components?.le
145
145
  ```javascript
146
146
  // ONLY ask questions if clarity is low
147
147
  if (clarityScore < 2 && (!issueData.context || issueData.context.length < 20)) {
148
- const answer = request_user_input({
148
+ const answer = functions.request_user_input({
149
149
  questions: [{
150
150
  header: "Clarify",
151
151
  id: "clarify",
@@ -87,7 +87,7 @@ if (args.perspectives) {
87
87
  selectedPerspectives = args.perspectives.split(',').map(p => p.trim());
88
88
  } else {
89
89
  // Interactive selection via request_user_input
90
- const response = request_user_input({
90
+ const response = functions.request_user_input({
91
91
  questions: [{
92
92
  header: "Focus",
93
93
  id: "focus",
@@ -273,7 +273,7 @@ await updateDiscoveryState(outputDir, {
273
273
  ```javascript
274
274
  const hasHighPriority = issues.some(i => i.priority === 'critical' || i.priority === 'high');
275
275
 
276
- await request_user_input({
276
+ await functions.request_user_input({
277
277
  questions: [{
278
278
  header: "Next Step",
279
279
  id: "next_step",
@@ -390,7 +390,7 @@ await updateDiscoveryState(outputDir, {
390
390
  });
391
391
 
392
392
  // Prompt user for next action
393
- await request_user_input({
393
+ await functions.request_user_input({
394
394
  questions: [{
395
395
  header: "Next Step",
396
396
  id: "next_step",
@@ -157,7 +157,7 @@ Quick Execute Summary:
157
157
  request_user_input:
158
158
 
159
159
  ```javascript
160
- request_user_input({
160
+ functions.request_user_input({
161
161
  questions: [{
162
162
  header: "Confirm",
163
163
  id: "confirm_execute",
@@ -212,7 +212,7 @@ for each task in sortedTasks:
212
212
  // 计算未执行 findings
213
213
  const remainingFindings = allFindings.filter(f => !executedFindingIds.has(f.id))
214
214
 
215
- request_user_input({
215
+ functions.request_user_input({
216
216
  questions: [{
217
217
  header: "Post Execute",
218
218
  id: "post_quick_execute",
@@ -92,6 +92,7 @@ Prep packages are generated by the interactive prompt `/prompts:prep-cycle`. See
92
92
  Input Parsing:
93
93
  └─ Parse arguments (TASK | --cycle-id + --extend)
94
94
  └─ Convert to structured context (cycleId, state, progressDir)
95
+ └─ Initialize progress tracking: functions.update_plan([...phases])
95
96
 
96
97
  Phase 1: Session Initialization
97
98
  └─ Ref: phases/01-session-init.md
@@ -219,43 +220,49 @@ Master state file: `{projectRoot}/.workflow/.cycle/{cycleId}.json`
219
220
 
220
221
  **Recovery**: If state corrupted, rebuild from `.progress/` markdown files and changes.log.
221
222
 
222
- ## TodoWrite Pattern
223
+ ## Progress Tracking
223
224
 
224
- ### Phase-Level Tracking (Tasks Attached)
225
+ ### Initialization (MANDATORY)
225
226
 
226
- ```json
227
- [
228
- {"content": "Phase 1: Session Initialization", "status": "completed"},
229
- {"content": "Phase 2: Agent Execution", "status": "in_progress"},
230
- {"content": " Spawn RA Agent", "status": "completed"},
231
- {"content": " Spawn EP Agent", "status": "completed"},
232
- {"content": " Spawn CD Agent", "status": "in_progress"},
233
- {"content": " → Spawn VAS Agent", "status": "pending"},
234
- {"content": "Phase 3: Result Aggregation", "status": "pending"},
235
- {"content": "Phase 4: Completion & Summary", "status": "pending"}
236
- ]
227
+ ```javascript
228
+ // Initialize progress tracking after input parsing
229
+ functions.update_plan([
230
+ { id: "phase-1", title: "Phase 1: Session Initialization", status: "in_progress" },
231
+ { id: "phase-2", title: "Phase 2: Agent Execution", status: "pending" },
232
+ { id: "phase-3", title: "Phase 3: Result Aggregation", status: "pending" },
233
+ { id: "phase-4", title: "Phase 4: Completion & Summary", status: "pending" }
234
+ ])
237
235
  ```
238
236
 
239
- ### Phase-Level Tracking (Collapsed)
240
-
241
- ```json
242
- [
243
- {"content": "Phase 1: Session Initialization", "status": "completed"},
244
- {"content": "Phase 2: Agent Execution (4 agents completed)", "status": "completed"},
245
- {"content": "Phase 3: Result Aggregation", "status": "in_progress"},
246
- {"content": "Phase 4: Completion & Summary", "status": "pending"}
247
- ]
248
- ```
249
-
250
- ### Iteration Loop Tracking
251
-
252
- ```json
253
- [
254
- {"content": "Phase 1: Session Initialization", "status": "completed"},
255
- {"content": "Iteration 1: Agent Execution + Aggregation", "status": "completed"},
256
- {"content": "Iteration 2: Feedback → Re-execution → Aggregation", "status": "in_progress"},
257
- {"content": "Phase 4: Completion & Summary", "status": "pending"}
258
- ]
237
+ ### Phase Transitions
238
+
239
+ ```javascript
240
+ // After Phase 1 completes
241
+ functions.update_plan([
242
+ { id: "phase-1", status: "completed" },
243
+ { id: "phase-2", status: "in_progress" }
244
+ ])
245
+
246
+ // After Phase 2 completes
247
+ functions.update_plan([
248
+ { id: "phase-2", status: "completed" },
249
+ { id: "phase-3", status: "in_progress" }
250
+ ])
251
+
252
+ // After Phase 3 iterate or complete
253
+ // If iterating back to Phase 2:
254
+ functions.update_plan([
255
+ { id: "phase-3", status: "completed" },
256
+ { id: "phase-2", title: "Phase 2: Agent Execution (Iteration N)", status: "in_progress" }
257
+ ])
258
+ // If proceeding to Phase 4:
259
+ functions.update_plan([
260
+ { id: "phase-3", status: "completed" },
261
+ { id: "phase-4", status: "in_progress" }
262
+ ])
263
+
264
+ // After Phase 4 completes
265
+ functions.update_plan([{ id: "phase-4", status: "completed" }])
259
266
  ```
260
267
 
261
268
  ## Versioning
@@ -344,11 +351,11 @@ Feedback via `assign_task` (file refs + issue summary, never full content):
344
351
 
345
352
  ## Core Rules
346
353
 
347
- 1. **Start Immediately**: First action is TodoWrite initialization, then Phase 1 execution
354
+ 1. **Start Immediately**: First action is `functions.update_plan` initialization, then Phase 1 execution
348
355
  2. **Progressive Phase Loading**: Read phase docs ONLY when that phase is about to execute
349
356
  3. **Parse Every Output**: Extract PHASE_RESULT data from each agent for next phase
350
357
  4. **Auto-Continue**: After each phase, execute next pending phase automatically
351
- 5. **Track Progress**: Update TodoWrite dynamically with attachment/collapse pattern
358
+ 5. **Track Progress**: Update `functions.update_plan` at each phase transition
352
359
  6. **Single Writer**: Only main flow writes to master state file; agents report via PHASE_RESULT
353
360
  7. **File References**: Pass file paths between agents, not content
354
361
  8. **DO NOT STOP**: Continuous execution until all phases complete or max iterations reached
@@ -370,13 +377,13 @@ Feedback via `assign_task` (file refs + issue summary, never full content):
370
377
 
371
378
  - [ ] Read phase reference document
372
379
  - [ ] Check current state for dependencies
373
- - [ ] Update TodoWrite with phase tasks
380
+ - [ ] Update `functions.update_plan` with phase status
374
381
 
375
382
  ### After Each Phase
376
383
 
377
384
  - [ ] Parse agent outputs (PHASE_RESULT)
378
385
  - [ ] Update master state file
379
- - [ ] Collapse TodoWrite sub-tasks
386
+ - [ ] Update `functions.update_plan` phase completion
380
387
  - [ ] Determine next action (continue / iterate / complete)
381
388
 
382
389
  ## Reference Documents
@@ -295,7 +295,7 @@ ${waveDistribution.map(w => `║ Wave ${w.wave}: ${w.tasks} tasks${' '.repeat(
295
295
  }
296
296
  }
297
297
 
298
- const answer = request_user_input({
298
+ const answer = functions.request_user_input({
299
299
  questions: [{
300
300
  header: "确认任务",
301
301
  id: "confirm_tasks",
@@ -363,15 +363,25 @@ close_agent({ id: agentId })
363
363
 
364
364
  ## Progress Tracking Pattern
365
365
 
366
- **Review Pipeline Initialization**:
366
+ **Review Pipeline Initialization** (before Phase 1):
367
367
  ```
368
- Phase 1: Discovery & Initialization → pending
369
- Phase 2: Parallel Reviews (7 dimensions) pending
370
- Phase 3: Aggregation → pending
371
- Phase 4: Deep-dive (conditional) → pending
372
- Phase 5: Review Completion → pending
368
+ functions.update_plan([
369
+ { id: "phase-1", title: "Phase 1: Discovery & Initialization", status: "in_progress" },
370
+ { id: "phase-2", title: "Phase 2: Parallel Reviews (7 dimensions)", status: "pending" },
371
+ { id: "phase-3", title: "Phase 3: Aggregation", status: "pending" },
372
+ { id: "phase-4", title: "Phase 4: Deep-dive (conditional)", status: "pending" },
373
+ { id: "phase-5", title: "Phase 5: Review Completion", status: "pending" }
374
+ ])
373
375
  ```
374
376
 
377
+ **Phase Transitions**:
378
+ - **Phase 1 complete**: `functions.update_plan([{id: "phase-1", status: "completed"}, {id: "phase-2", status: "in_progress"}])`
379
+ - **Phase 2 complete**: `functions.update_plan([{id: "phase-2", status: "completed"}, {id: "phase-3", status: "in_progress"}])`
380
+ - **Phase 3 → Phase 4 (iteration needed)**: `functions.update_plan([{id: "phase-3", status: "completed"}, {id: "phase-4", status: "in_progress"}])`
381
+ - **Phase 3 → Phase 5 (no iteration)**: `functions.update_plan([{id: "phase-3", status: "completed"}, {id: "phase-4", status: "completed"}, {id: "phase-5", status: "in_progress"}])`
382
+ - **Phase 4 complete**: `functions.update_plan([{id: "phase-4", status: "completed"}, {id: "phase-5", status: "in_progress"}])`
383
+ - **Phase 5 complete**: `functions.update_plan([{id: "phase-5", status: "completed"}])`
384
+
375
385
  **During Phase 2 (sub-tasks for each dimension)**:
376
386
  ```
377
387
  → Security review → in_progress / completed
@@ -380,15 +390,24 @@ Phase 5: Review Completion → pending
380
390
  ... other dimensions
381
391
  ```
382
392
 
383
- **Fix Pipeline (added after Phase 5 if triggered)**:
393
+ **Fix Pipeline (added after Phase 5 if --fix triggered)**:
384
394
  ```
385
- Phase 6: Fix Discovery & Batching → pending
386
- Phase 7: Parallel Planning → pending
387
- Phase 7.5: Export to Task JSON → pending
388
- Phase 8: Execution → pending
389
- Phase 9: Fix Completion → pending
395
+ functions.update_plan([
396
+ { id: "phase-6", title: "Phase 6: Fix Discovery & Batching", status: "in_progress" },
397
+ { id: "phase-7", title: "Phase 7: Parallel Planning", status: "pending" },
398
+ { id: "phase-7.5", title: "Phase 7.5: Export to Task JSON", status: "pending" },
399
+ { id: "phase-8", title: "Phase 8: Execution", status: "pending" },
400
+ { id: "phase-9", title: "Phase 9: Fix Completion", status: "pending" }
401
+ ])
390
402
  ```
391
403
 
404
+ **Fix Pipeline Transitions**:
405
+ - **Phase 6 complete**: `functions.update_plan([{id: "phase-6", status: "completed"}, {id: "phase-7", status: "in_progress"}])`
406
+ - **Phase 7 complete**: `functions.update_plan([{id: "phase-7", status: "completed"}, {id: "phase-7.5", status: "in_progress"}])`
407
+ - **Phase 7.5 complete**: `functions.update_plan([{id: "phase-7.5", status: "completed"}, {id: "phase-8", status: "in_progress"}])`
408
+ - **Phase 8 complete**: `functions.update_plan([{id: "phase-8", status: "completed"}, {id: "phase-9", status: "in_progress"}])`
409
+ - **Phase 9 complete**: `functions.update_plan([{id: "phase-9", status: "completed"}])`
410
+
392
411
  ## Error Handling
393
412
 
394
413
  ### Review Pipeline Errors
@@ -119,34 +119,54 @@ Strategic requirement roadmap with **iterative decomposition**. Creates a single
119
119
 
120
120
  **Core workflow**: Understand → Decompose → Iterate → Validate → Handoff
121
121
 
122
+ **Key features**:
123
+ - **roadmap.md**: Single source of truth — strategy, roadmap, convergence, iteration history
124
+ - **Dual decomposition**: Progressive (MVP→Optimized) or Direct (topological tasks)
125
+ - **External research**: Web search for architecture patterns and best practices via `web.run`
126
+ - **Issue creation**: Issues persisted to global `issues.jsonl` for execution pipeline
127
+ - **Progress tracking**: `functions.update_plan` for real-time phase progress visibility
128
+ - **Decision recording**: Structured decision trail with context and rationale
129
+ - **Structured handoff**: Terminal gate with execution planning, issue viewing, or completion
130
+
122
131
  ```
123
132
  ┌─────────────────────────────────────────────────────────────────────────┐
124
133
  │ ROADMAP ITERATIVE WORKFLOW │
125
134
  ├─────────────────────────────────────────────────────────────────────────┤
126
135
  │ │
136
+ │ Session Init │
137
+ │ ├─ Parse flags, generate session ID │
138
+ │ ├─ functions.exec_command (mkdir session folder) │
139
+ │ └─ functions.update_plan (5 phases: Understand → Decompose → │
140
+ │ Refine → Handoff → GATE) │
141
+ │ │
127
142
  │ Phase 1: Requirement Understanding & Strategy │
128
143
  │ ├─ Parse requirement: goal / constraints / stakeholders │
129
144
  │ ├─ Assess uncertainty level → recommend mode │
130
- │ ├─ User confirms strategy (-m skips, -y auto-selects)
145
+ │ ├─ User confirms strategy via functions.request_user_input
131
146
  │ └─ Initialize roadmap.md with Strategy Assessment │
132
147
  │ │
133
148
  │ Phase 2: Decomposition & Issue Creation │
149
+ │ ├─ Optional codebase exploration (functions.exec_command detection) │
134
150
  │ ├─ cli-roadmap-plan-agent executes decomposition │
135
151
  │ ├─ Progressive: 2-4 layers (MVP→Optimized) with convergence │
136
152
  │ ├─ Direct: Topological task sequence with convergence │
137
153
  │ ├─ Create issues via ccw issue create → issues.jsonl │
138
154
  │ └─ Update roadmap.md with Roadmap table + Issue references │
139
155
  │ │
140
- │ Phase 3: Iterative Refinement (Multi-Round)
141
- │ ├─ Present roadmap to user
142
- │ ├─ Feedback: Approve | Adjust Scope | Modify Convergence | Replan
143
- ├─ Update roadmap.md with each round
156
+ │ Phase 3: Iterative Refinement (Multi-Round, Decision Recording)
157
+ │ ├─ Present roadmap to user (Cumulative Context)
158
+ │ ├─ Feedback via functions.request_user_input:
159
+ │ Approve | Adjust Scope | Refine Criteria | Research/Re-decompose
160
+ │ ├─ External research via web.run (optional — patterns, practices) │
161
+ │ ├─ Record decisions in Iteration History (Record-Before-Continue) │
144
162
  │ └─ Repeat until approved (max 5 rounds) │
145
163
  │ │
146
164
  │ Phase 4: Handoff (PLANNING ENDS HERE) │
147
165
  │ ├─ Final roadmap.md with Issue ID references │
148
- ├─ Options: view issues | done (show next-step commands)
149
- └─ Issues ready in .workflow/issues/issues.jsonl
166
+ └─ MANDATORY Terminal Gate: 执行计划 / 查看Issue / 完成
167
+ ├─ Execute Plan display csv-wave-pipeline command
168
+ │ ├─ View Issues → ccw issue list │
169
+ │ └─ Done → end workflow │
150
170
  │ │
151
171
  └─────────────────────────────────────────────────────────────────────────┘
152
172
  ```
@@ -360,7 +380,16 @@ if (continueMode || file_exists(`${sessionFolder}/roadmap.md`)) {
360
380
  // Extract current phase and continue from there
361
381
  }
362
382
 
363
- Bash(`mkdir -p ${sessionFolder}`)
383
+ functions.exec_command(`mkdir -p ${sessionFolder}`)
384
+
385
+ // Initialize progress tracking (MANDATORY)
386
+ functions.update_plan([
387
+ { id: "phase-1", title: "Phase 1: Requirement Understanding & Strategy", status: "in_progress" },
388
+ { id: "phase-2", title: "Phase 2: Decomposition & Issue Creation", status: "pending" },
389
+ { id: "phase-3", title: "Phase 3: Iterative Refinement", status: "pending" },
390
+ { id: "phase-4", title: "Phase 4: Handoff", status: "pending" },
391
+ { id: "next-step", title: "GATE: Post-Completion Next Step", status: "pending" }
392
+ ])
364
393
  ```
365
394
 
366
395
  ---
@@ -403,19 +432,19 @@ Bash(`mkdir -p ${sessionFolder}`)
403
432
  } else if (AUTO_YES) {
404
433
  selectedMode = recommendedMode
405
434
  } else {
406
- const answer = request_user_input({
435
+ const answer = functions.request_user_input({
407
436
  questions: [{
408
- header: "Strategy",
409
- id: "strategy",
410
- question: `Decomposition strategy:\nUncertainty: ${uncertaintyLevel}\nRecommended: ${recommendedMode}`,
437
+ header: "Strategy", // max 12 chars
438
+ question: `Decomposition strategy: Uncertainty=${uncertaintyLevel}, Recommended=${recommendedMode}`,
439
+ multiSelect: false,
411
440
  options: [
412
- { label: recommendedMode === 'progressive' ? "Progressive (Recommended)" : "Progressive" },
413
- { label: recommendedMode === 'direct' ? "Direct (Recommended)" : "Direct" }
441
+ { label: recommendedMode === 'progressive' ? "Progressive (Recommended)" : "Progressive", description: "MVP → Usable → Refined → Optimized layers" },
442
+ { label: recommendedMode === 'direct' ? "Direct (Recommended)" : "Direct", description: "Topological task sequence" }
414
443
  ]
415
444
  }]
416
- }) // BLOCKS (wait for user response)
445
+ })
417
446
 
418
- selectedMode = answer.answers.strategy.answers[0]
447
+ selectedMode = answer // parsed from user selection
419
448
  }
420
449
  ```
421
450
 
@@ -489,7 +518,10 @@ Bash(`mkdir -p ${sessionFolder}`)
489
518
 
490
519
  1. **Optional Codebase Exploration** (if codebase detected)
491
520
  ```javascript
492
- const hasCodebase = Bash(`
521
+ // Update progress
522
+ functions.update_plan([{ id: "phase-2", title: "Phase 2: Decomposition & Issue Creation", status: "in_progress" }])
523
+
524
+ const hasCodebase = functions.exec_command(`
493
525
  test -f package.json && echo "nodejs" ||
494
526
  test -f go.mod && echo "golang" ||
495
527
  test -f Cargo.toml && echo "rust" ||
@@ -655,6 +687,17 @@ ${selectedMode === 'progressive' ? `**Progressive Mode**:
655
687
 
656
688
  **Objective**: Multi-round user feedback to refine roadmap.
657
689
 
690
+ **Cumulative Context Rule**: Each round's presentation MUST include ALL prior feedback and changes. Never present in isolation — always show cumulative state.
691
+
692
+ **Decision Recording**: Every user feedback choice and resulting change MUST be recorded in Iteration History with Decision Record format:
693
+ ```markdown
694
+ > **Decision**: [Description]
695
+ > - **Context**: [What triggered this]
696
+ > - **Options**: [What was considered]
697
+ > - **Chosen**: [Selected] — **Reason**: [Why]
698
+ > - **Impact**: [What changed in roadmap]
699
+ ```
700
+
658
701
  **Steps**:
659
702
 
660
703
  1. **Display Current Roadmap**
@@ -663,96 +706,67 @@ ${selectedMode === 'progressive' ? `**Progressive Mode**:
663
706
 
664
707
  2. **Feedback Loop** (skip if AUTO_YES)
665
708
  ```javascript
709
+ // Update progress
710
+ functions.update_plan([{ id: "phase-3", title: "Phase 3: Iterative Refinement", status: "in_progress" }])
711
+
666
712
  let round = 0
667
713
  let approved = false
668
714
 
669
715
  while (!approved && round < 5) {
670
716
  round++
671
717
 
672
- const feedback = request_user_input({
718
+ // Dynamic options — include research if not yet done
719
+ const baseOptions = [
720
+ { label: "Approve", description: "Proceed to handoff" },
721
+ { label: "Adjust Scope", description: "Modify issue scopes" },
722
+ { label: "Refine Criteria", description: "Improve convergence criteria/verification" }
723
+ ]
724
+
725
+ // Add research option if architecture decisions need external validation
726
+ if (!researchDone) {
727
+ baseOptions.push({ label: "Research", description: "Search for architecture patterns and best practices" })
728
+ } else {
729
+ baseOptions.push({ label: "Re-decompose", description: "Change strategy/layering" })
730
+ }
731
+
732
+ const feedback = functions.request_user_input({
673
733
  questions: [{
674
- header: "Validate",
675
- id: "feedback",
676
- question: `Roadmap validation (round ${round}):\n${issueIds.length} issues across ${waveCount} waves. Feedback?`,
677
- options: [
678
- { label: "Approve", description: "Proceed to handoff" },
679
- { label: "Adjust Scope", description: "Modify issue scopes" },
680
- { label: "Modify Convergence", description: "Refine criteria/verification" },
681
- { label: "Re-decompose", description: "Change strategy/layering" }
682
- ]
734
+ header: "Validate", // max 12 chars
735
+ question: `Roadmap round ${round}: ${issueIds.length} issues across ${waveCount} waves. Your decision:`,
736
+ multiSelect: false,
737
+ options: baseOptions
683
738
  }]
684
- }) // BLOCKS (wait for user response)
739
+ })
685
740
 
686
- const feedbackChoice = feedback.answers.feedback.answers[0]
687
- if (feedbackChoice === 'Approve') {
741
+ if (feedback === 'Approve') {
688
742
  approved = true
743
+ } else if (feedback === 'Research') {
744
+ // Execute web.run for architecture patterns and best practices
745
+ const researchQueries = generateResearchQueries(requirement, selectedMode)
746
+ researchQueries.forEach(query => {
747
+ const results = web.run({ search_query: query })
748
+ // Extract: architecture patterns, best practices, risk mitigations
749
+ })
750
+ researchDone = true
751
+ // Record research findings in roadmap.md Iteration History
689
752
  } else {
690
- // CONSTRAINT: All modifications below ONLY touch roadmap.md and issues.jsonl
753
+ // For Adjust Scope, Refine Criteria, Re-decompose:
754
+ // Collect details via functions.request_user_input or free text
755
+ // CONSTRAINT: All modifications ONLY touch roadmap.md and issues.jsonl
691
756
  // NEVER modify source code or project files during interactive rounds
692
- switch (feedbackChoice) {
693
- case 'Adjust Scope':
694
- // Collect scope adjustments
695
- const scopeAdjustments = request_user_input({
696
- questions: [{
697
- header: "Scope",
698
- id: "adjustments",
699
- question: "Describe scope adjustments needed:"
700
- }]
701
- }) // BLOCKS
702
-
703
- // Update ONLY roadmap.md Roadmap table + Convergence sections
704
- Edit({ path: `${sessionFolder}/roadmap.md`, /* scope changes */ })
705
- // Update ONLY issues.jsonl entries (scope/context fields)
706
-
707
- break
708
-
709
- case 'Modify Convergence':
710
- // Collect convergence refinements
711
- const convergenceRefinements = request_user_input({
712
- questions: [{
713
- header: "Convergence",
714
- id: "refinements",
715
- question: "Describe convergence refinements needed:"
716
- }]
717
- }) // BLOCKS
718
-
719
- // Update ONLY roadmap.md Convergence Criteria section
720
- Edit({ path: `${sessionFolder}/roadmap.md`, /* convergence changes */ })
721
-
722
- break
723
-
724
- case 'Re-decompose':
725
- // Return to Phase 2 with new strategy
726
- const newStrategy = request_user_input({
727
- questions: [{
728
- header: "Strategy",
729
- id: "strategy",
730
- question: "Select new decomposition strategy:",
731
- options: [
732
- { label: "Progressive" },
733
- { label: "Direct" }
734
- ]
735
- }]
736
- }) // BLOCKS
737
-
738
- selectedMode = newStrategy.answers.strategy.answers[0]
739
- // Re-execute Phase 2 (updates roadmap.md + issues.jsonl only)
740
- break
741
- }
742
-
743
- // Update Iteration History in roadmap.md
744
- const iterationEntry = `
757
+
758
+ // Record decision in Iteration History using Decision Record format
759
+ }
760
+
761
+ // Update Iteration History in roadmap.md (Record-Before-Continue)
762
+ const iterationEntry = `
745
763
  ### Round ${round} - ${getUtc8ISOString()}
746
- **User Feedback**: ${feedback.feedback}
764
+ **User Feedback**: ${feedback}
747
765
  **Changes Made**: ${changesMade}
748
- **Status**: continue iteration
766
+ **Decision**: ${decisionRecord}
767
+ **Status**: ${approved ? 'approved' : 'continue iteration'}
749
768
  `
750
- Edit({
751
- path: `${sessionFolder}/roadmap.md`,
752
- old_string: "## Iteration History\n\n> To be populated during Phase 3 refinement",
753
- new_string: `## Iteration History\n${iterationEntry}`
754
- })
755
- }
769
+ // Append to Iteration History section in roadmap.md
756
770
  }
757
771
  ```
758
772
 
@@ -775,7 +789,7 @@ ${selectedMode === 'progressive' ? `**Progressive Mode**:
775
789
 
776
790
  ### Phase 4: Handoff
777
791
 
778
- **Objective**: Present final roadmap, offer execution options.
792
+ **Objective**: Present final roadmap, execute MANDATORY terminal gate for next step selection.
779
793
 
780
794
  **Steps**:
781
795
 
@@ -794,50 +808,42 @@ ${selectedMode === 'progressive' ? `**Progressive Mode**:
794
808
  | 2 | 3 | Usable / feature |
795
809
  ```
796
810
 
797
- 2. **Offer Options** (skip if AUTO_YES)
811
+ 2. **MANDATORY Terminal Gate** (CRITICAL MUST execute, workflow MUST NOT end without this)
798
812
  ```javascript
799
- let nextStep
800
-
801
- if (AUTO_YES) {
802
- nextStep = "done" // Default to done in auto mode
803
- } else {
804
- const answer = request_user_input({
805
- questions: [{
806
- header: "Next Step",
807
- id: "next_step",
808
- question: `${issueIds.length} issues ready. Next step:`,
809
- options: [
810
- { label: "View issues", description: "Display issue details" },
811
- { label: "Done", description: "Planning complete show next-step commands" }
812
- ]
813
- }]
814
- }) // BLOCKS (wait for user response)
813
+ // Update progress
814
+ functions.update_plan([
815
+ { id: "phase-4", title: "Phase 4: Handoff", status: "completed" },
816
+ { id: "next-step", title: "GATE: Post-Completion Next Step", status: "in_progress" }
817
+ ])
818
+
819
+ const nextStep = functions.request_user_input({
820
+ questions: [{
821
+ header: "Next Step", // max 12 chars
822
+ question: `${issueIds.length} issues ready in roadmap. What would you like to do next?`,
823
+ multiSelect: false,
824
+ options: [
825
+ { label: "Execute Plan", description: "Hand off to execution pipeline (csv-wave-pipeline)" },
826
+ { label: "View Issues", description: "Display issue details before deciding" },
827
+ { label: "Done", description: "Planning complete, all artifacts saved" }
828
+ ]
829
+ }]
830
+ })
815
831
 
816
- nextStep = answer.answers.next_step.answers[0]
832
+ // Handle next step
833
+ if (nextStep === "Execute Plan") {
834
+ // Display execution command for user to run manually
835
+ // "Run: $csv-wave-pipeline '${requirement}'" or "/issue:execute"
836
+ // This skill is planning-only — NEVER auto-launch execution
837
+ } else if (nextStep === "View Issues") {
838
+ functions.exec_command(`ccw issue list --session ${sessionId}`)
839
+ // After viewing, show execution commands
817
840
  }
818
- ```
841
+ // "Done" → end workflow
819
842
 
820
- 3. **Execute Selection**
821
- ```javascript
822
- switch (nextStep) {
823
- case 'view':
824
- // Display issues from issues.jsonl
825
- Bash(`ccw issue list --session ${sessionId}`)
826
- // Fall through to show next-step commands
827
- // STOP — do not execute anything
828
-
829
- case 'done':
830
- // Output paths and end — this skill is planning-only
831
- console.log([
832
- `Roadmap saved: ${sessionFolder}/roadmap.md`,
833
- `Issues created: ${issueIds.length}`,
834
- '',
835
- 'Planning complete. To execute, run:',
836
- ` $csv-wave-pipeline "${requirement}"`,
837
- ` ccw issue list --session ${sessionId}`
838
- ].join('\n'))
839
- return // STOP — this skill is planning-only, NEVER proceed to execution
840
- }
843
+ // Mark terminal gate complete
844
+ functions.update_plan([
845
+ { id: "next-step", title: "GATE: Post-Completion Next Step", status: "completed" }
846
+ ])
841
847
  ```
842
848
 
843
849
  **Success Criteria**:
@@ -854,6 +860,8 @@ ${selectedMode === 'progressive' ? `**Progressive Mode**:
854
860
  | cli-explore-agent fails | Skip code exploration, proceed with pure requirement decomposition |
855
861
  | cli-roadmap-plan-agent fails | Retry once, fallback to manual decomposition prompt |
856
862
  | No codebase | Normal flow, skip exploration step |
863
+ | Web research fails | Continue without external findings, rely on inline analysis |
864
+ | Research conflicts with plan | Present as competing evidence, let user decide direction |
857
865
  | Circular dependency detected | Prompt user, re-decompose |
858
866
  | User timeout in feedback loop | Save roadmap.md, show `--continue` command |
859
867
  | Max rounds reached | Force proceed with current roadmap |