claude-code-workflow 6.3.44 → 6.3.46

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 (35) hide show
  1. package/.claude/commands/ccw-coordinator.md +1042 -0
  2. package/.claude/commands/ccw.md +486 -0
  3. package/ccw/dist/tools/command-registry.d.ts +77 -0
  4. package/ccw/dist/tools/command-registry.d.ts.map +1 -0
  5. package/ccw/dist/tools/command-registry.js +265 -0
  6. package/ccw/dist/tools/command-registry.js.map +1 -0
  7. package/ccw/dist/tools/command-registry.test.d.ts +14 -0
  8. package/ccw/dist/tools/command-registry.test.d.ts.map +1 -0
  9. package/ccw/dist/tools/command-registry.test.js.map +1 -0
  10. package/ccw/dist/tools/index.d.ts +2 -0
  11. package/ccw/dist/tools/index.d.ts.map +1 -1
  12. package/ccw/dist/tools/index.js +2 -0
  13. package/ccw/dist/tools/index.js.map +1 -1
  14. package/ccw/src/tools/command-registry.test.ts +669 -0
  15. package/ccw/src/tools/command-registry.ts +308 -0
  16. package/ccw/src/tools/index.ts +4 -0
  17. package/package.json +1 -1
  18. package/.claude/skills/ccw/SKILL.md +0 -522
  19. package/.claude/skills/ccw/command.json +0 -641
  20. package/.claude/skills/ccw-coordinator/README.md +0 -45
  21. package/.claude/skills/ccw-coordinator/SKILL.md +0 -320
  22. package/.claude/skills/ccw-coordinator/phases/actions/action-abort.md +0 -9
  23. package/.claude/skills/ccw-coordinator/phases/actions/action-command-build.md +0 -40
  24. package/.claude/skills/ccw-coordinator/phases/actions/action-command-execute.md +0 -124
  25. package/.claude/skills/ccw-coordinator/phases/actions/action-command-selection.md +0 -48
  26. package/.claude/skills/ccw-coordinator/phases/actions/action-complete.md +0 -25
  27. package/.claude/skills/ccw-coordinator/phases/actions/action-init.md +0 -26
  28. package/.claude/skills/ccw-coordinator/phases/orchestrator.md +0 -59
  29. package/.claude/skills/ccw-coordinator/phases/state-schema.md +0 -66
  30. package/.claude/skills/ccw-coordinator/skill-config.json +0 -66
  31. package/.claude/skills/ccw-coordinator/specs/command-library.md +0 -169
  32. package/.claude/skills/ccw-coordinator/specs/specs.md +0 -362
  33. package/.claude/skills/ccw-coordinator/tools/README.md +0 -95
  34. package/.claude/skills/ccw-coordinator/tools/chain-validate.cjs +0 -320
  35. package/.claude/skills/ccw-coordinator/tools/command-registry.cjs +0 -255
@@ -0,0 +1,1042 @@
1
+ ---
2
+ name: ccw-coordinator
3
+ description: Command orchestration tool - analyze requirements, recommend chain, execute sequentially with state persistence
4
+ argument-hint: "[task description]"
5
+ allowed-tools: Task(*), AskUserQuestion(*), Read(*), Write(*), Bash(*), Glob(*), Grep(*)
6
+ ---
7
+
8
+ # CCW Coordinator Command
9
+
10
+ Interactive orchestration tool: analyze task → discover commands → recommend chain → execute sequentially → track state.
11
+
12
+ **Execution Model**: Pseudocode guidance. Claude intelligently executes each phase based on context.
13
+
14
+ ## Core Concept: Minimum Execution Units (最小执行单元)
15
+
16
+ ### What is a Minimum Execution Unit?
17
+
18
+ **Definition**: A set of commands that must execute together as an atomic group to achieve a meaningful workflow milestone. Splitting these commands breaks the logical flow and creates incomplete states.
19
+
20
+ **Why This Matters**:
21
+ - **Prevents Incomplete States**: Avoid stopping after task generation without execution
22
+ - **User Experience**: User gets complete results, not intermediate artifacts requiring manual follow-up
23
+ - **Workflow Integrity**: Maintains logical coherence of multi-step operations
24
+
25
+ ### Minimum Execution Units
26
+
27
+ **Planning + Execution Units** (规划+执行单元):
28
+
29
+ | Unit Name | Commands | Purpose | Output |
30
+ |-----------|----------|---------|--------|
31
+ | **Quick Implementation** | lite-plan → lite-execute | Lightweight plan and immediate execution | Working code |
32
+ | **Multi-CLI Planning** | multi-cli-plan → lite-execute | Multi-perspective analysis and execution | Working code |
33
+ | **Bug Fix** | lite-fix → lite-execute | Quick bug diagnosis and fix execution | Fixed code |
34
+ | **Full Planning + Execution** | plan → execute | Detailed planning and execution | Working code |
35
+ | **Verified Planning + Execution** | plan → plan-verify → execute | Planning with verification and execution | Working code |
36
+ | **Replanning + Execution** | replan → execute | Update plan and execute changes | Working code |
37
+ | **TDD Planning + Execution** | tdd-plan → execute | Test-driven development planning and execution | Working code |
38
+ | **Test Generation + Execution** | test-gen → execute | Generate test suite and execute | Generated tests |
39
+
40
+ **Testing Units** (测试单元):
41
+
42
+ | Unit Name | Commands | Purpose | Output |
43
+ |-----------|----------|---------|--------|
44
+ | **Test Validation** | test-fix-gen → test-cycle-execute | Generate test tasks and execute test-fix cycle | Tests passed |
45
+
46
+ **Review Units** (审查单元):
47
+
48
+ | Unit Name | Commands | Purpose | Output |
49
+ |-----------|----------|---------|--------|
50
+ | **Code Review (Session)** | review-session-cycle → review-fix | Complete review cycle and apply fixes | Fixed code |
51
+ | **Code Review (Module)** | review-module-cycle → review-fix | Module review cycle and apply fixes | Fixed code |
52
+
53
+ ### Command-to-Unit Mapping (命令与最小单元的映射)
54
+
55
+ | Command | Can Precede | Atomic Units |
56
+ |---------|-----------|--------------|
57
+ | lite-plan | lite-execute | Quick Implementation |
58
+ | multi-cli-plan | lite-execute | Multi-CLI Planning |
59
+ | lite-fix | lite-execute | Bug Fix |
60
+ | plan | plan-verify, execute | Full Planning + Execution, Verified Planning + Execution |
61
+ | plan-verify | execute | Verified Planning + Execution |
62
+ | replan | execute | Replanning + Execution |
63
+ | test-gen | execute | Test Generation + Execution |
64
+ | tdd-plan | execute | TDD Planning + Execution |
65
+ | review-session-cycle | review-fix | Code Review (Session) |
66
+ | review-module-cycle | review-fix | Code Review (Module) |
67
+ | test-fix-gen | test-cycle-execute | Test Validation |
68
+
69
+ ### Atomic Group Rules
70
+
71
+ 1. **Never Split Units**: Coordinator must recommend complete units, not partial chains
72
+ 2. **Multi-Unit Participation**: Some commands can participate in multiple units (e.g., plan → execute or plan → plan-verify → execute)
73
+ 3. **User Override**: User can explicitly request partial execution (advanced mode)
74
+ 4. **Visualization**: Pipeline view shows unit boundaries with `【 】` markers
75
+ 5. **Validation**: Before execution, verify all unit commands are included
76
+
77
+ **Example Pipeline with Units**:
78
+ ```
79
+ 需求 → 【lite-plan → lite-execute】→ 代码 → 【test-fix-gen → test-cycle-execute】→ 测试通过
80
+ └──── Quick Implementation ────┘ └────── Test Validation ──────┘
81
+ ```
82
+
83
+ ## 3-Phase Workflow
84
+
85
+ ### Phase 1: Analyze Requirements
86
+
87
+ Parse task to extract: goal, scope, constraints, complexity, and task type.
88
+
89
+ ```javascript
90
+ function analyzeRequirements(taskDescription) {
91
+ return {
92
+ goal: extractMainGoal(taskDescription), // e.g., "Implement user registration"
93
+ scope: extractScope(taskDescription), // e.g., ["auth", "user_management"]
94
+ constraints: extractConstraints(taskDescription), // e.g., ["no breaking changes"]
95
+ complexity: determineComplexity(taskDescription), // 'simple' | 'medium' | 'complex'
96
+ task_type: detectTaskType(taskDescription) // See task type patterns below
97
+ };
98
+ }
99
+
100
+ // Task Type Detection Patterns
101
+ function detectTaskType(text) {
102
+ // Priority order (first match wins)
103
+ if (/fix|bug|error|crash|fail|debug|diagnose/.test(text)) return 'bugfix';
104
+ if (/tdd|test-driven|先写测试|test first/.test(text)) return 'tdd';
105
+ if (/测试失败|test fail|fix test|failing test/.test(text)) return 'test-fix';
106
+ if (/generate test|写测试|add test|补充测试/.test(text)) return 'test-gen';
107
+ if (/review|审查|code review/.test(text)) return 'review';
108
+ if (/不确定|explore|研究|what if|brainstorm|权衡/.test(text)) return 'brainstorm';
109
+ if (/多视角|比较方案|cross-verify|multi-cli/.test(text)) return 'multi-cli';
110
+ return 'feature'; // Default
111
+ }
112
+
113
+ // Complexity Assessment
114
+ function determineComplexity(text) {
115
+ let score = 0;
116
+ if (/refactor|重构|migrate|迁移|architect|架构|system|系统/.test(text)) score += 2;
117
+ if (/multiple|多个|across|跨|all|所有|entire|整个/.test(text)) score += 2;
118
+ if (/integrate|集成|api|database|数据库/.test(text)) score += 1;
119
+ if (/security|安全|performance|性能|scale|扩展/.test(text)) score += 1;
120
+ return score >= 4 ? 'complex' : score >= 2 ? 'medium' : 'simple';
121
+ }
122
+ ```
123
+
124
+ **Display to user**:
125
+ ```
126
+ Analysis Complete:
127
+ Goal: [extracted goal]
128
+ Scope: [identified areas]
129
+ Constraints: [identified constraints]
130
+ Complexity: [level]
131
+ Task Type: [detected type]
132
+ ```
133
+
134
+ ### Phase 2: Discover Commands & Recommend Chain
135
+
136
+ Dynamic command chain assembly using port-based matching.
137
+
138
+ #### Command Port Definition
139
+
140
+ Each command has input/output ports (tags) for pipeline composition:
141
+
142
+ ```javascript
143
+ // Port labels represent data types flowing through the pipeline
144
+ const commandPorts = {
145
+ 'lite-plan': {
146
+ name: 'lite-plan',
147
+ input: ['requirement'], // 输入端口:需求
148
+ output: ['plan'], // 输出端口:计划
149
+ tags: ['planning'],
150
+ atomic_group: 'quick-implementation' // 最小单元:与 lite-execute 绑定
151
+ },
152
+ 'lite-execute': {
153
+ name: 'lite-execute',
154
+ input: ['plan', 'multi-cli-plan', 'lite-fix'], // 输入端口:可接受多种规划输出
155
+ output: ['code'], // 输出端口:代码
156
+ tags: ['execution'],
157
+ atomic_groups: [ // 可参与多个最小单元
158
+ 'quick-implementation', // lite-plan → lite-execute
159
+ 'multi-cli-planning', // multi-cli-plan → lite-execute
160
+ 'bug-fix' // lite-fix → lite-execute
161
+ ]
162
+ },
163
+ 'plan': {
164
+ name: 'plan',
165
+ input: ['requirement'],
166
+ output: ['detailed-plan'],
167
+ tags: ['planning'],
168
+ atomic_groups: [ // 可参与多个最小单元
169
+ 'full-planning-execution', // plan → execute
170
+ 'verified-planning-execution' // plan → plan-verify → execute
171
+ ]
172
+ },
173
+ 'plan-verify': {
174
+ name: 'plan-verify',
175
+ input: ['detailed-plan'],
176
+ output: ['verified-plan'],
177
+ tags: ['planning'],
178
+ atomic_group: 'verified-planning-execution' // 最小单元:plan → plan-verify → execute
179
+ },
180
+ 'replan': {
181
+ name: 'replan',
182
+ input: ['session', 'feedback'], // 输入端口:会话或反馈
183
+ output: ['replan'], // 输出端口:更新后的计划(供 execute 执行)
184
+ tags: ['planning'],
185
+ atomic_group: 'replanning-execution' // 最小单元:与 execute 绑定
186
+ },
187
+ 'execute': {
188
+ name: 'execute',
189
+ input: ['detailed-plan', 'verified-plan', 'replan', 'test-tasks', 'tdd-tasks'], // 可接受多种规划输出
190
+ output: ['code'],
191
+ tags: ['execution'],
192
+ atomic_groups: [ // 可参与多个最小单元
193
+ 'full-planning-execution', // plan → execute
194
+ 'verified-planning-execution', // plan → plan-verify → execute
195
+ 'replanning-execution', // replan → execute
196
+ 'test-generation-execution', // test-gen → execute
197
+ 'tdd-planning-execution' // tdd-plan → execute
198
+ ]
199
+ },
200
+ 'test-cycle-execute': {
201
+ name: 'test-cycle-execute',
202
+ input: ['test-tasks'], // 输入端口:测试任务(需先test-fix-gen生成)
203
+ output: ['test-passed'], // 输出端口:测试通过
204
+ tags: ['testing'],
205
+ atomic_group: 'test-validation', // 最小单元:与 test-fix-gen 绑定
206
+ note: '需要先执行test-fix-gen生成测试任务,再由此命令执行测试周期'
207
+ },
208
+ 'tdd-plan': {
209
+ name: 'tdd-plan',
210
+ input: ['requirement'],
211
+ output: ['tdd-tasks'], // TDD 任务(供 execute 执行)
212
+ tags: ['planning', 'tdd'],
213
+ atomic_group: 'tdd-planning-execution' // 最小单元:与 execute 绑定
214
+ },
215
+ 'tdd-verify': {
216
+ name: 'tdd-verify',
217
+ input: ['code'],
218
+ output: ['tdd-verified'],
219
+ tags: ['testing']
220
+ },
221
+ 'lite-fix': {
222
+ name: 'lite-fix',
223
+ input: ['bug-report'], // 输入端口:bug 报告
224
+ output: ['lite-fix'], // 输出端口:修复计划(供 lite-execute 执行)
225
+ tags: ['bugfix'],
226
+ atomic_group: 'bug-fix' // 最小单元:与 lite-execute 绑定
227
+ },
228
+ 'debug': {
229
+ name: 'debug',
230
+ input: ['bug-report'],
231
+ output: ['debug-log'],
232
+ tags: ['bugfix']
233
+ },
234
+ 'test-gen': {
235
+ name: 'test-gen',
236
+ input: ['code', 'session'], // 可接受代码或会话
237
+ output: ['test-tasks'], // 输出测试任务(IMPL-001,IMPL-002),供 execute 执行
238
+ tags: ['testing'],
239
+ atomic_group: 'test-generation-execution' // 最小单元:与 execute 绑定
240
+ },
241
+ 'test-fix-gen': {
242
+ name: 'test-fix-gen',
243
+ input: ['failing-tests', 'session'],
244
+ output: ['test-tasks'], // 输出测试任务,针对特定问题生成测试并在测试中修正
245
+ tags: ['testing'],
246
+ atomic_group: 'test-validation', // 最小单元:与 test-cycle-execute 绑定
247
+ note: '生成测试任务供test-cycle-execute执行'
248
+ },
249
+ 'review': {
250
+ name: 'review',
251
+ input: ['code', 'session'],
252
+ output: ['review-findings'],
253
+ tags: ['review']
254
+ },
255
+ 'review-fix': {
256
+ name: 'review-fix',
257
+ input: ['review-findings', 'review-verified'], // Accept output from review-session-cycle or review-module-cycle
258
+ output: ['fixed-code'],
259
+ tags: ['review'],
260
+ atomic_group: 'code-review' // 最小单元:与 review-session-cycle/review-module-cycle 绑定
261
+ },
262
+ 'brainstorm:auto-parallel': {
263
+ name: 'brainstorm:auto-parallel',
264
+ input: ['exploration-topic'], // 输入端口:探索主题
265
+ output: ['brainstorm-analysis'],
266
+ tags: ['brainstorm']
267
+ },
268
+ 'multi-cli-plan': {
269
+ name: 'multi-cli-plan',
270
+ input: ['requirement'],
271
+ output: ['multi-cli-plan'], // 对比分析计划(供 lite-execute 执行)
272
+ tags: ['planning', 'multi-cli'],
273
+ atomic_group: 'multi-cli-planning' // 最小单元:与 lite-execute 绑定
274
+ },
275
+ 'review-session-cycle': {
276
+ name: 'review-session-cycle',
277
+ input: ['code', 'session'], // 可接受代码或会话
278
+ output: ['review-verified'], // 输出端口:审查通过
279
+ tags: ['review'],
280
+ atomic_group: 'code-review' // 最小单元:与 review-fix 绑定
281
+ },
282
+ 'review-module-cycle': {
283
+ name: 'review-module-cycle',
284
+ input: ['module-pattern'], // 输入端口:模块模式
285
+ output: ['review-verified'], // 输出端口:审查通过
286
+ tags: ['review'],
287
+ atomic_group: 'code-review' // 最小单元:与 review-fix 绑定
288
+ }
289
+ };
290
+ ```
291
+
292
+ #### Recommendation Algorithm
293
+
294
+ ```javascript
295
+ async function recommendCommandChain(analysis) {
296
+ // Step 1: 根据任务类型确定起始端口和目标端口
297
+ const { inputPort, outputPort } = determinePortFlow(analysis.task_type, analysis.constraints);
298
+
299
+ // Step 2: Claude 根据命令端口定义和任务特征,智能选择命令序列
300
+ // 优先级:简单任务 → lite-* 命令,复杂任务 → 完整命令,特殊约束 → 调整流程
301
+ const chain = selectChainByPorts(inputPort, outputPort, analysis);
302
+
303
+ return chain;
304
+ }
305
+
306
+ // 任务类型对应的端口流
307
+ function determinePortFlow(taskType, constraints) {
308
+ const flows = {
309
+ 'bugfix': { inputPort: 'bug-report', outputPort: constraints?.includes('skip-tests') ? 'fixed-code' : 'test-passed' },
310
+ 'tdd': { inputPort: 'requirement', outputPort: 'tdd-verified' },
311
+ 'test-fix': { inputPort: 'failing-tests', outputPort: 'test-passed' },
312
+ 'test-gen': { inputPort: 'code', outputPort: 'test-passed' },
313
+ 'review': { inputPort: 'code', outputPort: 'review-verified' },
314
+ 'brainstorm': { inputPort: 'exploration-topic', outputPort: 'test-passed' },
315
+ 'multi-cli': { inputPort: 'requirement', outputPort: 'test-passed' },
316
+ 'feature': { inputPort: 'requirement', outputPort: constraints?.includes('skip-tests') ? 'code' : 'test-passed' }
317
+ };
318
+ return flows[taskType] || flows['feature'];
319
+ }
320
+
321
+ // Claude 根据端口流选择命令链
322
+ function selectChainByPorts(inputPort, outputPort, analysis) {
323
+ // 参考下面的命令端口定义表和执行示例,Claude 智能选择合适的命令序列
324
+ // 返回值示例: [lite-plan, lite-execute, test-cycle-execute]
325
+ }
326
+ ```
327
+
328
+ #### Display to User
329
+
330
+ ```
331
+ Recommended Command Chain:
332
+
333
+ Pipeline (管道视图):
334
+ 需求 → lite-plan → 计划 → lite-execute → 代码 → test-cycle-execute → 测试通过
335
+
336
+ Commands (命令列表):
337
+ 1. /workflow:lite-plan
338
+ 2. /workflow:lite-execute
339
+ 3. /workflow:test-cycle-execute
340
+
341
+ Proceed? [Confirm / Show Details / Adjust / Cancel]
342
+ ```
343
+
344
+ ### Phase 2b: Get User Confirmation
345
+
346
+ ```javascript
347
+ async function getUserConfirmation(chain) {
348
+ const response = await AskUserQuestion({
349
+ questions: [{
350
+ question: 'Proceed with this command chain?',
351
+ header: 'Confirm',
352
+ options: [
353
+ { label: 'Confirm and execute', description: 'Proceed with commands' },
354
+ { label: 'Show details', description: 'View each command' },
355
+ { label: 'Adjust chain', description: 'Remove or reorder' },
356
+ { label: 'Cancel', description: 'Abort' }
357
+ ]
358
+ }]
359
+ });
360
+
361
+ if (response.confirm === 'Cancel') throw new Error('Cancelled');
362
+ if (response.confirm === 'Show details') {
363
+ displayCommandDetails(chain);
364
+ return getUserConfirmation(chain);
365
+ }
366
+ if (response.confirm === 'Adjust chain') {
367
+ return await adjustChain(chain);
368
+ }
369
+ return chain;
370
+ }
371
+ ```
372
+
373
+ ### Phase 3: Execute Sequential Command Chain
374
+
375
+ ```javascript
376
+ async function executeCommandChain(chain, analysis) {
377
+ const sessionId = `ccw-coord-${Date.now()}`;
378
+ const stateDir = `.workflow/.ccw-coordinator/${sessionId}`;
379
+ Bash(`mkdir -p "${stateDir}"`);
380
+
381
+ const state = {
382
+ session_id: sessionId,
383
+ status: 'running',
384
+ created_at: new Date().toISOString(),
385
+ updated_at: new Date().toISOString(),
386
+ analysis: analysis,
387
+ command_chain: chain.map((cmd, idx) => ({ ...cmd, index: idx, status: 'pending' })),
388
+ execution_results: [],
389
+ prompts_used: []
390
+ };
391
+
392
+ // Save initial state immediately after confirmation
393
+ Write(`${stateDir}/state.json`, JSON.stringify(state, null, 2));
394
+
395
+ for (let i = 0; i < chain.length; i++) {
396
+ const cmd = chain[i];
397
+ console.log(`[${i+1}/${chain.length}] ${cmd.command}`);
398
+
399
+ // Update command_chain status to running
400
+ state.command_chain[i].status = 'running';
401
+ state.updated_at = new Date().toISOString();
402
+ Write(`${stateDir}/state.json`, JSON.stringify(state, null, 2));
403
+
404
+ // Assemble prompt with previous results
405
+ let prompt = `Task: ${analysis.goal}\n`;
406
+ if (state.execution_results.length > 0) {
407
+ prompt += '\nPrevious results:\n';
408
+ state.execution_results.forEach(r => {
409
+ if (r.session_id) {
410
+ prompt += `- ${r.command}: ${r.session_id} (${r.artifacts?.join(', ') || 'completed'})\n`;
411
+ }
412
+ });
413
+ }
414
+ prompt += `\n${formatCommand(cmd, state.execution_results, analysis)}\n`;
415
+
416
+ // Record prompt used
417
+ state.prompts_used.push({
418
+ index: i,
419
+ command: cmd.command,
420
+ prompt: prompt
421
+ });
422
+
423
+ // Execute CLI command in background and stop
424
+ try {
425
+ const taskId = Bash(
426
+ `ccw cli -p "${escapePrompt(prompt)}" --tool claude --mode write -y`,
427
+ { run_in_background: true }
428
+ ).task_id;
429
+
430
+ // Save checkpoint
431
+ state.execution_results.push({
432
+ index: i,
433
+ command: cmd.command,
434
+ status: 'in-progress',
435
+ task_id: taskId,
436
+ session_id: null,
437
+ artifacts: [],
438
+ timestamp: new Date().toISOString()
439
+ });
440
+ state.command_chain[i].status = 'running';
441
+ state.updated_at = new Date().toISOString();
442
+ Write(`${stateDir}/state.json`, JSON.stringify(state, null, 2));
443
+
444
+ console.log(`[${i+1}/${chain.length}] ${cmd.command}\n`);
445
+ break; // Stop, wait for hook callback
446
+
447
+ } catch (error) {
448
+ state.command_chain[i].status = 'failed';
449
+ state.updated_at = new Date().toISOString();
450
+ Write(`${stateDir}/state.json`, JSON.stringify(state, null, 2));
451
+
452
+ const action = await AskUserQuestion({
453
+ questions: [{
454
+ question: `${cmd.command} failed to start: ${error.message}. What to do?`,
455
+ header: 'Error',
456
+ options: [
457
+ { label: 'Retry', description: 'Try again' },
458
+ { label: 'Skip', description: 'Continue next command' },
459
+ { label: 'Abort', description: 'Stop execution' }
460
+ ]
461
+ }]
462
+ });
463
+
464
+ if (action.error === 'Retry') {
465
+ state.command_chain[i].status = 'pending';
466
+ state.execution_results.pop();
467
+ i--;
468
+ } else if (action.error === 'Skip') {
469
+ state.execution_results[state.execution_results.length - 1].status = 'skipped';
470
+ } else if (action.error === 'Abort') {
471
+ state.status = 'failed';
472
+ break;
473
+ }
474
+ }
475
+
476
+ Write(`${stateDir}/state.json`, JSON.stringify(state, null, 2));
477
+ }
478
+
479
+ // Hook callbacks handle completion
480
+ if (state.status !== 'failed') state.status = 'waiting';
481
+ state.updated_at = new Date().toISOString();
482
+ Write(`${stateDir}/state.json`, JSON.stringify(state, null, 2));
483
+
484
+ console.log(`\n📋 Orchestrator paused: ${state.session_id}\n`);
485
+ return state;
486
+ }
487
+
488
+ // Smart parameter assembly
489
+ function formatCommand(cmd, previousResults, analysis) {
490
+ let line = cmd.command + ' --yes';
491
+ const name = cmd.name;
492
+
493
+ // Planning commands - take task description
494
+ if (['lite-plan', 'plan', 'tdd-plan', 'multi-cli-plan'].includes(name)) {
495
+ line += ` "${analysis.goal}"`;
496
+
497
+ // Lite execution - use --in-memory if plan exists
498
+ } else if (name === 'lite-execute') {
499
+ const hasPlan = previousResults.some(r => r.command.includes('plan'));
500
+ line += hasPlan ? ' --in-memory' : ` "${analysis.goal}"`;
501
+
502
+ // Standard execution - resume from planning session
503
+ } else if (name === 'execute') {
504
+ const plan = previousResults.find(r => r.command.includes('plan'));
505
+ if (plan?.session_id) line += ` --resume-session="${plan.session_id}"`;
506
+
507
+ // Bug fix commands - take bug description
508
+ } else if (['lite-fix', 'debug'].includes(name)) {
509
+ line += ` "${analysis.goal}"`;
510
+
511
+ // Brainstorm - take topic description
512
+ } else if (name === 'brainstorm:auto-parallel' || name === 'auto-parallel') {
513
+ line += ` "${analysis.goal}"`;
514
+
515
+ // Test generation from session - needs source session
516
+ } else if (name === 'test-gen') {
517
+ const impl = previousResults.find(r =>
518
+ r.command.includes('execute') || r.command.includes('lite-execute')
519
+ );
520
+ if (impl?.session_id) line += ` "${impl.session_id}"`;
521
+ else line += ` "${analysis.goal}"`;
522
+
523
+ // Test fix generation - session or description
524
+ } else if (name === 'test-fix-gen') {
525
+ const latest = previousResults.filter(r => r.session_id).pop();
526
+ if (latest?.session_id) line += ` "${latest.session_id}"`;
527
+ else line += ` "${analysis.goal}"`;
528
+
529
+ // Review commands - take session or use latest
530
+ } else if (name === 'review') {
531
+ const latest = previousResults.filter(r => r.session_id).pop();
532
+ if (latest?.session_id) line += ` --session="${latest.session_id}"`;
533
+
534
+ // Review fix - takes session from review
535
+ } else if (name === 'review-fix') {
536
+ const review = previousResults.find(r => r.command.includes('review'));
537
+ const latest = review || previousResults.filter(r => r.session_id).pop();
538
+ if (latest?.session_id) line += ` --session="${latest.session_id}"`;
539
+
540
+ // TDD verify - takes execution session
541
+ } else if (name === 'tdd-verify') {
542
+ const exec = previousResults.find(r => r.command.includes('execute'));
543
+ if (exec?.session_id) line += ` --session="${exec.session_id}"`;
544
+
545
+ // Session-based commands (test-cycle, review-session, plan-verify)
546
+ } else if (name.includes('test') || name.includes('review') || name.includes('verify')) {
547
+ const latest = previousResults.filter(r => r.session_id).pop();
548
+ if (latest?.session_id) line += ` --session="${latest.session_id}"`;
549
+ }
550
+
551
+ return line;
552
+ }
553
+
554
+ // Hook callback: Called when background CLI completes
555
+ async function handleCliCompletion(sessionId, taskId, output) {
556
+ const stateDir = `.workflow/.ccw-coordinator/${sessionId}`;
557
+ const state = JSON.parse(Read(`${stateDir}/state.json`));
558
+
559
+ const pendingIdx = state.execution_results.findIndex(r => r.task_id === taskId);
560
+ if (pendingIdx === -1) {
561
+ console.error(`Unknown task_id: ${taskId}`);
562
+ return;
563
+ }
564
+
565
+ const parsed = parseOutput(output);
566
+ const cmdIdx = state.execution_results[pendingIdx].index;
567
+
568
+ // Update result
569
+ state.execution_results[pendingIdx] = {
570
+ ...state.execution_results[pendingIdx],
571
+ status: parsed.sessionId ? 'completed' : 'failed',
572
+ session_id: parsed.sessionId,
573
+ artifacts: parsed.artifacts,
574
+ completed_at: new Date().toISOString()
575
+ };
576
+ state.command_chain[cmdIdx].status = parsed.sessionId ? 'completed' : 'failed';
577
+ state.updated_at = new Date().toISOString();
578
+ Write(`${stateDir}/state.json`, JSON.stringify(state, null, 2));
579
+
580
+ // Trigger next command or complete
581
+ const nextIdx = cmdIdx + 1;
582
+ if (nextIdx < state.command_chain.length) {
583
+ await resumeChainExecution(sessionId, nextIdx);
584
+ } else {
585
+ state.status = 'completed';
586
+ Write(`${stateDir}/state.json`, JSON.stringify(state, null, 2));
587
+ console.log(`✅ Completed: ${sessionId}\n`);
588
+ }
589
+ }
590
+
591
+ // Parse command output
592
+ function parseOutput(output) {
593
+ const sessionMatch = output.match(/WFS-[\w-]+/);
594
+ const artifacts = [];
595
+ output.matchAll(/\.workflow\/[^\s]+/g).forEach(m => artifacts.push(m[0]));
596
+ return { sessionId: sessionMatch?.[0] || null, artifacts };
597
+ }
598
+ ```
599
+
600
+ ## State File Structure
601
+
602
+ **Location**: `.workflow/.ccw-coordinator/{session_id}/state.json`
603
+
604
+ ```json
605
+ {
606
+ "session_id": "ccw-coord-20250124-143025",
607
+ "status": "running|waiting|completed|failed",
608
+ "created_at": "2025-01-24T14:30:25Z",
609
+ "updated_at": "2025-01-24T14:35:45Z",
610
+ "analysis": {
611
+ "goal": "Implement user registration",
612
+ "scope": ["authentication", "user_management"],
613
+ "constraints": ["no breaking changes"],
614
+ "complexity": "medium"
615
+ },
616
+ "command_chain": [
617
+ {
618
+ "index": 0,
619
+ "command": "/workflow:plan",
620
+ "name": "plan",
621
+ "description": "Detailed planning",
622
+ "argumentHint": "[--explore] \"task\"",
623
+ "status": "completed"
624
+ },
625
+ {
626
+ "index": 1,
627
+ "command": "/workflow:execute",
628
+ "name": "execute",
629
+ "description": "Execute with state resume",
630
+ "argumentHint": "[--resume-session=\"WFS-xxx\"]",
631
+ "status": "completed"
632
+ },
633
+ {
634
+ "index": 2,
635
+ "command": "/workflow:test-cycle-execute",
636
+ "name": "test-cycle-execute",
637
+ "status": "pending"
638
+ }
639
+ ],
640
+ "execution_results": [
641
+ {
642
+ "index": 0,
643
+ "command": "/workflow:plan",
644
+ "status": "completed",
645
+ "task_id": "task-001",
646
+ "session_id": "WFS-plan-20250124",
647
+ "artifacts": ["IMPL_PLAN.md", "exploration-architecture.json"],
648
+ "timestamp": "2025-01-24T14:30:25Z",
649
+ "completed_at": "2025-01-24T14:30:45Z"
650
+ },
651
+ {
652
+ "index": 1,
653
+ "command": "/workflow:execute",
654
+ "status": "in-progress",
655
+ "task_id": "task-002",
656
+ "session_id": null,
657
+ "artifacts": [],
658
+ "timestamp": "2025-01-24T14:32:00Z",
659
+ "completed_at": null
660
+ }
661
+ ],
662
+ "prompts_used": [
663
+ {
664
+ "index": 0,
665
+ "command": "/workflow:plan",
666
+ "prompt": "Task: Implement user registration...\n\n/workflow:plan --yes \"Implement user registration...\""
667
+ },
668
+ {
669
+ "index": 1,
670
+ "command": "/workflow:execute",
671
+ "prompt": "Task: Implement user registration...\n\nPrevious results:\n- /workflow:plan: WFS-plan-20250124 (IMPL_PLAN.md)\n\n/workflow:execute --yes --resume-session=\"WFS-plan-20250124\""
672
+ }
673
+ ]
674
+ }
675
+ ```
676
+
677
+ ### Status Flow
678
+
679
+ ```
680
+ running → waiting → [hook callback] → waiting → [hook callback] → completed
681
+ ↓ ↑
682
+ failed ←────────────────────────────────────────────────────────────┘
683
+ ```
684
+
685
+ **Status Values**:
686
+ - `running`: Orchestrator actively executing (launching CLI commands)
687
+ - `waiting`: Paused, waiting for hook callbacks to trigger continuation
688
+ - `completed`: All commands finished successfully
689
+ - `failed`: User aborted or unrecoverable error
690
+
691
+ ### Field Descriptions
692
+
693
+ **execution_results[] fields**:
694
+ - `index`: Command position in chain (0-indexed)
695
+ - `command`: Full command string (e.g., `/workflow:plan`)
696
+ - `status`: `in-progress` | `completed` | `skipped` | `failed`
697
+ - `task_id`: Background task identifier (from Bash tool)
698
+ - `session_id`: Workflow session ID (e.g., `WFS-*`) or null if failed
699
+ - `artifacts`: Generated files/directories
700
+ - `timestamp`: Command start time (ISO 8601)
701
+ - `completed_at`: Command completion time or null if pending
702
+
703
+ **command_chain[] status values**:
704
+ - `pending`: Not started yet
705
+ - `running`: Currently executing
706
+ - `completed`: Successfully finished
707
+ - `failed`: Failed to execute
708
+
709
+ ## CommandRegistry Integration
710
+
711
+ Sole CCW tool for command discovery:
712
+
713
+ ```javascript
714
+ import { CommandRegistry } from 'ccw/tools/command-registry';
715
+
716
+ const registry = new CommandRegistry();
717
+
718
+ // Get all commands
719
+ const allCommands = registry.getAllCommandsSummary();
720
+ // Map<"/workflow:lite-plan" => {name, description}>
721
+
722
+ // Get categorized
723
+ const byCategory = registry.getAllCommandsByCategory();
724
+ // {planning, execution, testing, review, other}
725
+
726
+ // Get single command metadata
727
+ const cmd = registry.getCommand('lite-plan');
728
+ // {name, command, description, argumentHint, allowedTools, filePath}
729
+ ```
730
+
731
+ ## Execution Examples
732
+
733
+ ### Simple Feature
734
+ ```
735
+ Goal: Add API endpoint for user profile
736
+ Scope: [api]
737
+ Complexity: simple
738
+ Constraints: []
739
+ Task Type: feature
740
+
741
+ Pipeline (with Minimum Execution Units):
742
+ 需求 →【lite-plan → lite-execute】→ 代码 →【test-fix-gen → test-cycle-execute】→ 测试通过
743
+
744
+ Chain:
745
+ # Unit 1: Quick Implementation
746
+ 1. /workflow:lite-plan --yes "Add API endpoint..."
747
+ 2. /workflow:lite-execute --yes --in-memory
748
+
749
+ # Unit 2: Test Validation
750
+ 3. /workflow:test-fix-gen --yes --session="WFS-xxx"
751
+ 4. /workflow:test-cycle-execute --yes --session="WFS-test-xxx"
752
+ ```
753
+
754
+ ### Complex Feature with Verification
755
+ ```
756
+ Goal: Implement OAuth2 authentication system
757
+ Scope: [auth, database, api, frontend]
758
+ Complexity: complex
759
+ Constraints: [no breaking changes]
760
+ Task Type: feature
761
+
762
+ Pipeline (with Minimum Execution Units):
763
+ 需求 →【plan → plan-verify】→ 验证计划 → execute → 代码
764
+ →【review-session-cycle → review-fix】→ 修复代码
765
+ →【test-fix-gen → test-cycle-execute】→ 测试通过
766
+
767
+ Chain:
768
+ # Unit 1: Full Planning (plan + plan-verify)
769
+ 1. /workflow:plan --yes "Implement OAuth2..."
770
+ 2. /workflow:plan-verify --yes --session="WFS-xxx"
771
+
772
+ # Execution phase
773
+ 3. /workflow:execute --yes --resume-session="WFS-xxx"
774
+
775
+ # Unit 2: Code Review (review-session-cycle + review-fix)
776
+ 4. /workflow:review-session-cycle --yes --session="WFS-xxx"
777
+ 5. /workflow:review-fix --yes --session="WFS-xxx"
778
+
779
+ # Unit 3: Test Validation (test-fix-gen + test-cycle-execute)
780
+ 6. /workflow:test-fix-gen --yes --session="WFS-xxx"
781
+ 7. /workflow:test-cycle-execute --yes --session="WFS-test-xxx"
782
+ ```
783
+
784
+ ### Quick Bug Fix
785
+ ```
786
+ Goal: Fix login timeout issue
787
+ Scope: [auth]
788
+ Complexity: simple
789
+ Constraints: [urgent]
790
+ Task Type: bugfix
791
+
792
+ Pipeline:
793
+ Bug报告 → lite-fix → 修复代码 → test-fix-gen → 测试任务 → test-cycle-execute → 测试通过
794
+
795
+ Chain:
796
+ 1. /workflow:lite-fix --yes "Fix login timeout..."
797
+ 2. /workflow:test-fix-gen --yes --session="WFS-xxx"
798
+ 3. /workflow:test-cycle-execute --yes --session="WFS-test-xxx"
799
+ ```
800
+
801
+ ### Skip Tests
802
+ ```
803
+ Goal: Update documentation
804
+ Scope: [docs]
805
+ Complexity: simple
806
+ Constraints: [skip-tests]
807
+ Task Type: feature
808
+
809
+ Pipeline:
810
+ 需求 → lite-plan → 计划 → lite-execute → 代码
811
+
812
+ Chain:
813
+ 1. /workflow:lite-plan --yes "Update documentation..."
814
+ 2. /workflow:lite-execute --yes --in-memory
815
+ ```
816
+
817
+ ### TDD Workflow
818
+ ```
819
+ Goal: Implement user authentication with test-first approach
820
+ Scope: [auth]
821
+ Complexity: medium
822
+ Constraints: [test-driven]
823
+ Task Type: tdd
824
+
825
+ Pipeline:
826
+ 需求 → tdd-plan → TDD任务 → execute → 代码 → tdd-verify → TDD验证通过
827
+
828
+ Chain:
829
+ 1. /workflow:tdd-plan --yes "Implement user authentication..."
830
+ 2. /workflow:execute --yes --resume-session="WFS-xxx"
831
+ 3. /workflow:tdd-verify --yes --session="WFS-xxx"
832
+ ```
833
+
834
+ ### Debug Workflow
835
+ ```
836
+ Goal: Fix memory leak in WebSocket handler
837
+ Scope: [websocket]
838
+ Complexity: medium
839
+ Constraints: [production-issue]
840
+ Task Type: bugfix
841
+
842
+ Pipeline (快速修复):
843
+ Bug报告 → lite-fix → 修复代码 → test-cycle-execute → 测试通过
844
+
845
+ Pipeline (系统调试):
846
+ Bug报告 → debug → 调试日志 → 分析定位 → 修复
847
+
848
+ Chain:
849
+ 1. /workflow:lite-fix --yes "Fix memory leak in WebSocket..."
850
+ 2. /workflow:test-cycle-execute --yes --session="WFS-xxx"
851
+
852
+ OR (for hypothesis-driven debugging):
853
+ 1. /workflow:debug --yes "Memory leak in WebSocket handler..."
854
+ ```
855
+
856
+ ### Test Fix Workflow
857
+ ```
858
+ Goal: Fix failing authentication tests
859
+ Scope: [auth, tests]
860
+ Complexity: simple
861
+ Constraints: []
862
+ Task Type: test-fix
863
+
864
+ Pipeline:
865
+ 失败测试 → test-fix-gen → 测试任务 → test-cycle-execute → 测试通过
866
+
867
+ Chain:
868
+ 1. /workflow:test-fix-gen --yes "WFS-auth-impl-001"
869
+ 2. /workflow:test-cycle-execute --yes --session="WFS-test-xxx"
870
+ ```
871
+
872
+ ### Test Generation from Implementation
873
+ ```
874
+ Goal: Generate comprehensive tests for completed user registration feature
875
+ Scope: [auth, tests]
876
+ Complexity: medium
877
+ Constraints: []
878
+ Task Type: test-gen
879
+
880
+ Pipeline (with Minimum Execution Units):
881
+ 代码/会话 →【test-gen → execute】→ 测试通过
882
+
883
+ Chain:
884
+ # Unit: Test Generation (test-gen + execute)
885
+ 1. /workflow:test-gen --yes "WFS-registration-20250124"
886
+ 2. /workflow:execute --yes --session="WFS-test-registration"
887
+
888
+ Note: test-gen creates IMPL-001 (test generation) and IMPL-002 (test execution & fix)
889
+ execute runs both tasks - this is a Minimum Execution Unit
890
+ ```
891
+
892
+ ### Review + Fix Workflow
893
+ ```
894
+ Goal: Code review of payment module
895
+ Scope: [payment]
896
+ Complexity: medium
897
+ Constraints: []
898
+ Task Type: review
899
+
900
+ Pipeline (with Minimum Execution Units):
901
+ 代码 →【review-session-cycle → review-fix】→ 修复代码
902
+ →【test-fix-gen → test-cycle-execute】→ 测试通过
903
+
904
+ Chain:
905
+ # Unit 1: Code Review (review-session-cycle + review-fix)
906
+ 1. /workflow:review-session-cycle --yes --session="WFS-payment-impl"
907
+ 2. /workflow:review-fix --yes --session="WFS-payment-impl"
908
+
909
+ # Unit 2: Test Validation (test-fix-gen + test-cycle-execute)
910
+ 3. /workflow:test-fix-gen --yes --session="WFS-payment-impl"
911
+ 4. /workflow:test-cycle-execute --yes --session="WFS-test-payment-impl"
912
+ ```
913
+
914
+ ### Brainstorm Workflow (Uncertain Requirements)
915
+ ```
916
+ Goal: Explore solutions for real-time notification system
917
+ Scope: [notifications, architecture]
918
+ Complexity: complex
919
+ Constraints: []
920
+ Task Type: brainstorm
921
+
922
+ Pipeline:
923
+ 探索主题 → brainstorm:auto-parallel → 分析结果 → plan → 详细计划
924
+ → plan-verify → 验证计划 → execute → 代码 → test-fix-gen → 测试任务 → test-cycle-execute → 测试通过
925
+
926
+ Chain:
927
+ 1. /workflow:brainstorm:auto-parallel --yes "Explore solutions for real-time..."
928
+ 2. /workflow:plan --yes "Implement chosen notification approach..."
929
+ 3. /workflow:plan-verify --yes --session="WFS-xxx"
930
+ 4. /workflow:execute --yes --resume-session="WFS-xxx"
931
+ 5. /workflow:test-fix-gen --yes --session="WFS-xxx"
932
+ 6. /workflow:test-cycle-execute --yes --session="WFS-test-xxx"
933
+ ```
934
+
935
+ ### Multi-CLI Plan (Multi-Perspective Analysis)
936
+ ```
937
+ Goal: Compare microservices vs monolith architecture
938
+ Scope: [architecture]
939
+ Complexity: complex
940
+ Constraints: []
941
+ Task Type: multi-cli
942
+
943
+ Pipeline:
944
+ 需求 → multi-cli-plan → 对比计划 → lite-execute → 代码 → test-fix-gen → 测试任务 → test-cycle-execute → 测试通过
945
+
946
+ Chain:
947
+ 1. /workflow:multi-cli-plan --yes "Compare microservices vs monolith..."
948
+ 2. /workflow:lite-execute --yes --in-memory
949
+ 3. /workflow:test-fix-gen --yes --session="WFS-xxx"
950
+ 4. /workflow:test-cycle-execute --yes --session="WFS-test-xxx"
951
+ ```
952
+
953
+ ## Execution Flow
954
+
955
+ ```javascript
956
+ // Main entry point
957
+ async function ccwCoordinator(taskDescription) {
958
+ // Phase 1
959
+ const analysis = await analyzeRequirements(taskDescription);
960
+
961
+ // Phase 2
962
+ const chain = await recommendCommandChain(analysis);
963
+ const confirmedChain = await getUserConfirmation(chain);
964
+
965
+ // Phase 3
966
+ const state = await executeCommandChain(confirmedChain, analysis);
967
+
968
+ console.log(`✅ Complete! Session: ${state.session_id}`);
969
+ console.log(`State: .workflow/.ccw-coordinator/${state.session_id}/state.json`);
970
+ }
971
+ ```
972
+
973
+ ## Key Design Principles
974
+
975
+ 1. **No Fixed Logic** - Claude intelligently decides based on analysis
976
+ 2. **Dynamic Discovery** - CommandRegistry retrieves available commands
977
+ 3. **Smart Parameters** - Command args assembled based on previous results
978
+ 4. **Full State Tracking** - All execution recorded to state.json
979
+ 5. **User Control** - Confirmation + error handling with user choice
980
+ 6. **Context Passing** - Each prompt includes previous results
981
+ 7. **Resumable** - Can load state.json to continue
982
+ 8. **Serial Blocking** - Commands execute one-by-one with hook-based continuation
983
+
984
+ ## CLI Execution Model
985
+
986
+ **Serial Blocking**: Commands execute one-by-one. After launching CLI in background, orchestrator stops immediately and waits for hook callback.
987
+
988
+ ```javascript
989
+ // Example: Execute command and stop
990
+ const taskId = Bash(`ccw cli -p "..." --tool claude --mode write -y`, { run_in_background: true }).task_id;
991
+ state.execution_results.push({ status: 'in-progress', task_id: taskId, ... });
992
+ Write(`${stateDir}/state.json`, JSON.stringify(state, null, 2));
993
+ break; // Stop, wait for hook callback
994
+
995
+ // Hook calls handleCliCompletion(sessionId, taskId, output) when done
996
+ // → Updates state → Triggers next command via resumeChainExecution()
997
+ ```
998
+
999
+ ## Available Commands
1000
+
1001
+ All from `~/.claude/commands/workflow/`:
1002
+
1003
+ **Planning**: lite-plan, plan, multi-cli-plan, plan-verify, tdd-plan
1004
+ **Execution**: lite-execute, execute, develop-with-file
1005
+ **Testing**: test-cycle-execute, test-gen, test-fix-gen, tdd-verify
1006
+ **Review**: review, review-session-cycle, review-module-cycle, review-fix
1007
+ **Bug Fixes**: lite-fix, debug, debug-with-file
1008
+ **Brainstorming**: brainstorm:auto-parallel, brainstorm:artifacts, brainstorm:synthesis
1009
+ **Design**: ui-design:*, animation-extract, layout-extract, style-extract, codify-style
1010
+ **Session Management**: session:start, session:resume, session:complete, session:solidify, session:list
1011
+ **Tools**: context-gather, test-context-gather, task-generate, conflict-resolution, action-plan-verify
1012
+ **Utility**: clean, init, replan
1013
+
1014
+ ### Testing Commands Distinction
1015
+
1016
+ | Command | Purpose | Output | Follow-up |
1017
+ |---------|---------|--------|-----------|
1018
+ | **test-gen** | 广泛测试示例生成并进行测试 | test-tasks (IMPL-001, IMPL-002) | `/workflow:execute` |
1019
+ | **test-fix-gen** | 针对特定问题生成测试并在测试中修正 | test-tasks | `/workflow:test-cycle-execute` |
1020
+ | **test-cycle-execute** | 执行测试周期(迭代测试和修复) | test-passed | N/A (终点) |
1021
+
1022
+ **流程说明**:
1023
+ - **test-gen → execute**: 生成全面的测试套件,execute 执行生成和测试
1024
+ - **test-fix-gen → test-cycle-execute**: 针对特定问题生成修复任务,test-cycle-execute 迭代测试和修复直到通过
1025
+
1026
+ ### Task Type Routing (Pipeline View)
1027
+
1028
+ **Note**: `【 】` marks Minimum Execution Units (最小执行单元) - these commands must execute together.
1029
+
1030
+ | Task Type | Pipeline |
1031
+ |-----------|----------|
1032
+ | **feature** (simple) | 需求 →【lite-plan → lite-execute】→ 代码 →【test-fix-gen → test-cycle-execute】→ 测试通过 |
1033
+ | **feature** (complex) | 需求 →【plan → plan-verify】→ 验证计划 → execute → 代码 →【review-session-cycle → review-fix】→ 修复代码 →【test-fix-gen → test-cycle-execute】→ 测试通过 |
1034
+ | **bugfix** | Bug报告 → lite-fix → 修复代码 →【test-fix-gen → test-cycle-execute】→ 测试通过 |
1035
+ | **tdd** | 需求 → tdd-plan → TDD任务 → execute → 代码 → tdd-verify → TDD验证通过 |
1036
+ | **test-fix** | 失败测试 →【test-fix-gen → test-cycle-execute】→ 测试通过 |
1037
+ | **test-gen** | 代码/会话 →【test-gen → execute】→ 测试通过 |
1038
+ | **review** | 代码 →【review-session-cycle/review-module-cycle → review-fix】→ 修复代码 →【test-fix-gen → test-cycle-execute】→ 测试通过 |
1039
+ | **brainstorm** | 探索主题 → brainstorm:auto-parallel → 分析结果 →【plan → plan-verify】→ 验证计划 → execute → 代码 →【test-fix-gen → test-cycle-execute】→ 测试通过 |
1040
+ | **multi-cli** | 需求 → multi-cli-plan → 对比计划 → lite-execute → 代码 →【test-fix-gen → test-cycle-execute】→ 测试通过 |
1041
+
1042
+ Use `CommandRegistry.getAllCommandsSummary()` to discover all commands dynamically.