claude-code-workflow 6.3.27 → 6.3.29

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 (133) hide show
  1. package/.claude/CLAUDE.md +7 -1
  2. package/.claude/agents/action-planning-agent.md +1 -0
  3. package/.claude/agents/cli-discuss-agent.md +391 -0
  4. package/.claude/agents/cli-execution-agent.md +2 -0
  5. package/.claude/agents/cli-explore-agent.md +2 -1
  6. package/.claude/agents/cli-lite-planning-agent.md +1 -0
  7. package/.claude/agents/cli-planning-agent.md +1 -0
  8. package/.claude/agents/code-developer.md +1 -0
  9. package/.claude/agents/conceptual-planning-agent.md +2 -0
  10. package/.claude/agents/context-search-agent.md +1 -0
  11. package/.claude/agents/debug-explore-agent.md +2 -0
  12. package/.claude/agents/doc-generator.md +1 -0
  13. package/.claude/agents/issue-plan-agent.md +2 -1
  14. package/.claude/agents/issue-queue-agent.md +2 -1
  15. package/.claude/agents/memory-bridge.md +2 -0
  16. package/.claude/agents/test-context-search-agent.md +2 -0
  17. package/.claude/agents/test-fix-agent.md +1 -0
  18. package/.claude/agents/ui-design-agent.md +2 -0
  19. package/.claude/agents/universal-executor.md +1 -0
  20. package/.claude/commands/issue/execute.md +269 -176
  21. package/.claude/commands/workflow/debug.md +6 -0
  22. package/.claude/commands/workflow/execute.md +4 -0
  23. package/.claude/commands/workflow/lite-execute.md +4 -0
  24. package/.claude/commands/workflow/lite-lite-lite.md +433 -0
  25. package/.claude/commands/workflow/multi-cli-plan.md +510 -0
  26. package/.claude/commands/workflow/review-fix.md +4 -0
  27. package/.claude/commands/workflow/test-cycle-execute.md +4 -0
  28. package/.claude/skills/ccw/SKILL.md +262 -372
  29. package/.claude/skills/ccw/command.json +547 -0
  30. package/.claude/skills/ccw-help/SKILL.md +46 -107
  31. package/.claude/skills/ccw-help/command.json +511 -0
  32. package/.claude/skills/skill-tuning/SKILL.md +303 -0
  33. package/.claude/skills/skill-tuning/phases/actions/action-abort.md +164 -0
  34. package/.claude/skills/skill-tuning/phases/actions/action-analyze-requirements.md +406 -0
  35. package/.claude/skills/skill-tuning/phases/actions/action-apply-fix.md +206 -0
  36. package/.claude/skills/skill-tuning/phases/actions/action-complete.md +195 -0
  37. package/.claude/skills/skill-tuning/phases/actions/action-diagnose-agent.md +317 -0
  38. package/.claude/skills/skill-tuning/phases/actions/action-diagnose-context.md +243 -0
  39. package/.claude/skills/skill-tuning/phases/actions/action-diagnose-dataflow.md +318 -0
  40. package/.claude/skills/skill-tuning/phases/actions/action-diagnose-docs.md +299 -0
  41. package/.claude/skills/skill-tuning/phases/actions/action-diagnose-memory.md +269 -0
  42. package/.claude/skills/skill-tuning/phases/actions/action-diagnose-token-consumption.md +200 -0
  43. package/.claude/skills/skill-tuning/phases/actions/action-gemini-analysis.md +322 -0
  44. package/.claude/skills/skill-tuning/phases/actions/action-generate-report.md +228 -0
  45. package/.claude/skills/skill-tuning/phases/actions/action-init.md +149 -0
  46. package/.claude/skills/skill-tuning/phases/actions/action-propose-fixes.md +317 -0
  47. package/.claude/skills/skill-tuning/phases/actions/action-verify.md +222 -0
  48. package/.claude/skills/skill-tuning/phases/orchestrator.md +377 -0
  49. package/.claude/skills/skill-tuning/phases/state-schema.md +378 -0
  50. package/.claude/skills/skill-tuning/specs/category-mappings.json +284 -0
  51. package/.claude/skills/skill-tuning/specs/dimension-mapping.md +212 -0
  52. package/.claude/skills/skill-tuning/specs/problem-taxonomy.md +318 -0
  53. package/.claude/skills/skill-tuning/specs/quality-gates.md +263 -0
  54. package/.claude/skills/skill-tuning/specs/skill-authoring-principles.md +189 -0
  55. package/.claude/skills/skill-tuning/specs/tuning-strategies.md +1537 -0
  56. package/.claude/skills/skill-tuning/templates/diagnosis-report.md +153 -0
  57. package/.claude/skills/skill-tuning/templates/fix-proposal.md +204 -0
  58. package/.claude/workflows/cli-templates/schemas/multi-cli-discussion-schema.json +421 -0
  59. package/.claude/workflows/cli-tools-usage.md +0 -41
  60. package/.codex/prompts/issue-execute.md +72 -12
  61. package/README.md +3 -0
  62. package/ccw/dist/core/data-aggregator.d.ts +2 -0
  63. package/ccw/dist/core/data-aggregator.d.ts.map +1 -1
  64. package/ccw/dist/core/data-aggregator.js +5 -2
  65. package/ccw/dist/core/data-aggregator.js.map +1 -1
  66. package/ccw/dist/core/lite-scanner.d.ts +2 -1
  67. package/ccw/dist/core/lite-scanner.d.ts.map +1 -1
  68. package/ccw/dist/core/lite-scanner.js +348 -6
  69. package/ccw/dist/core/lite-scanner.js.map +1 -1
  70. package/ccw/dist/core/routes/session-routes.d.ts.map +1 -1
  71. package/ccw/dist/core/routes/session-routes.js +166 -48
  72. package/ccw/dist/core/routes/session-routes.js.map +1 -1
  73. package/ccw/dist/core/routes/system-routes.d.ts.map +1 -1
  74. package/ccw/dist/core/routes/system-routes.js +87 -0
  75. package/ccw/dist/core/routes/system-routes.js.map +1 -1
  76. package/ccw/dist/core/server.js +2 -2
  77. package/ccw/dist/core/server.js.map +1 -1
  78. package/ccw/dist/tools/memory-update-queue.d.ts.map +1 -1
  79. package/ccw/dist/tools/memory-update-queue.js +5 -11
  80. package/ccw/dist/tools/memory-update-queue.js.map +1 -1
  81. package/ccw/scripts/IMPLEMENTATION-SUMMARY.md +226 -0
  82. package/ccw/scripts/QUICK-REFERENCE.md +135 -0
  83. package/ccw/scripts/README-memory-embedder.md +157 -0
  84. package/ccw/scripts/__pycache__/memory_embedder.cpython-313.pyc +0 -0
  85. package/ccw/scripts/__pycache__/test_memory_embedder.cpython-313-pytest-8.4.2.pyc +0 -0
  86. package/ccw/scripts/memory-embedder-example.ts +184 -0
  87. package/ccw/scripts/memory_embedder.py +428 -0
  88. package/ccw/scripts/test_memory_embedder.py +245 -0
  89. package/ccw/src/core/data-aggregator.ts +7 -2
  90. package/ccw/src/core/lite-scanner.ts +495 -6
  91. package/ccw/src/core/routes/session-routes.ts +201 -48
  92. package/ccw/src/core/routes/system-routes.ts +102 -0
  93. package/ccw/src/core/server.ts +2 -2
  94. package/ccw/src/templates/dashboard-css/01-base.css +8 -0
  95. package/ccw/src/templates/dashboard-css/02-session.css +81 -0
  96. package/ccw/src/templates/dashboard-css/03-tasks.css +5 -0
  97. package/ccw/src/templates/dashboard-css/04-lite-tasks.css +3071 -0
  98. package/ccw/src/templates/dashboard-css/21-cli-toolmgmt.css +157 -0
  99. package/ccw/src/templates/dashboard-css/32-issue-manager.css +23 -0
  100. package/ccw/src/templates/dashboard-js/components/cli-stream-viewer.js +38 -4
  101. package/ccw/src/templates/dashboard-js/components/hook-manager.js +68 -34
  102. package/ccw/src/templates/dashboard-js/components/navigation.js +24 -4
  103. package/ccw/src/templates/dashboard-js/i18n.js +278 -4
  104. package/ccw/src/templates/dashboard-js/views/api-settings.js +32 -0
  105. package/ccw/src/templates/dashboard-js/views/claude-manager.js +44 -3
  106. package/ccw/src/templates/dashboard-js/views/cli-manager.js +303 -31
  107. package/ccw/src/templates/dashboard-js/views/history.js +44 -6
  108. package/ccw/src/templates/dashboard-js/views/home.js +1 -0
  109. package/ccw/src/templates/dashboard-js/views/issue-manager.js +54 -7
  110. package/ccw/src/templates/dashboard-js/views/lite-tasks.js +2621 -4
  111. package/ccw/src/templates/dashboard.html +5 -0
  112. package/ccw/src/tools/memory-update-queue.js +5 -11
  113. package/package.json +2 -1
  114. package/.claude/skills/ccw/index/command-capabilities.json +0 -127
  115. package/.claude/skills/ccw/index/intent-rules.json +0 -136
  116. package/.claude/skills/ccw/index/workflow-chains.json +0 -451
  117. package/.claude/skills/ccw/phases/actions/bugfix.md +0 -218
  118. package/.claude/skills/ccw/phases/actions/coupled.md +0 -194
  119. package/.claude/skills/ccw/phases/actions/docs.md +0 -93
  120. package/.claude/skills/ccw/phases/actions/full.md +0 -154
  121. package/.claude/skills/ccw/phases/actions/issue.md +0 -201
  122. package/.claude/skills/ccw/phases/actions/rapid.md +0 -104
  123. package/.claude/skills/ccw/phases/actions/review-fix.md +0 -84
  124. package/.claude/skills/ccw/phases/actions/tdd.md +0 -66
  125. package/.claude/skills/ccw/phases/actions/ui.md +0 -79
  126. package/.claude/skills/ccw/phases/orchestrator.md +0 -435
  127. package/.claude/skills/ccw/specs/intent-classification.md +0 -336
  128. package/.claude/skills/ccw-help/index/all-agents.json +0 -82
  129. package/.claude/skills/ccw-help/index/all-commands.json +0 -882
  130. package/.claude/skills/ccw-help/index/by-category.json +0 -914
  131. package/.claude/skills/ccw-help/index/by-use-case.json +0 -896
  132. package/.claude/skills/ccw-help/index/command-relationships.json +0 -160
  133. package/.claude/skills/ccw-help/index/essential-commands.json +0 -112
@@ -0,0 +1,433 @@
1
+ ---
2
+ name: workflow:lite-lite-lite
3
+ description: Ultra-lightweight multi-tool analysis and direct execution. No artifacts, auto tool selection based on task analysis, user-driven iteration via AskUser.
4
+ argument-hint: "<task description>"
5
+ allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Bash(*), mcp__ace-tool__search_context(*)
6
+ ---
7
+
8
+ # Ultra-Lite Multi-Tool Workflow
9
+
10
+ ## Quick Start
11
+
12
+ ```bash
13
+ /workflow:lite-lite-lite "Fix the login bug"
14
+ /workflow:lite-lite-lite "Refactor payment module for multi-gateway support"
15
+ ```
16
+
17
+ **Core Philosophy**: Minimal friction, maximum velocity. No files, no artifacts - just analyze and execute.
18
+
19
+ ## Overview
20
+
21
+ **Zero-artifact workflow**: Clarify → Select Tools → Multi-Mode Analysis → Decision → Direct Execution
22
+
23
+ **vs multi-cli-plan**: No IMPL_PLAN.md, plan.json, synthesis.json - all state in memory.
24
+
25
+ ## Execution Flow
26
+
27
+ ```
28
+ Phase 1: Clarify Requirements → AskUser for missing details
29
+ Phase 2: Select Tools (CLI → Mode → Agent) → 3-step selection
30
+ Phase 3: Multi-Mode Analysis → Execute with --resume chaining
31
+ Phase 4: User Decision → Execute / Refine / Change / Cancel
32
+ Phase 5: Direct Execution → No plan files, immediate implementation
33
+ ```
34
+
35
+ ## Phase 1: Clarify Requirements
36
+
37
+ ```javascript
38
+ const taskDescription = $ARGUMENTS
39
+
40
+ if (taskDescription.length < 20 || isAmbiguous(taskDescription)) {
41
+ AskUserQuestion({
42
+ questions: [{
43
+ question: "Please provide more details: target files/modules, expected behavior, constraints?",
44
+ header: "Details",
45
+ options: [
46
+ { label: "I'll provide more", description: "Add more context" },
47
+ { label: "Continue analysis", description: "Let tools explore autonomously" }
48
+ ],
49
+ multiSelect: false
50
+ }]
51
+ })
52
+ }
53
+
54
+ // Optional: Quick ACE Context for complex tasks
55
+ mcp__ace-tool__search_context({
56
+ project_root_path: process.cwd(),
57
+ query: `${taskDescription} implementation patterns`
58
+ })
59
+ ```
60
+
61
+ ## Phase 2: Select Tools
62
+
63
+ ### Tool Definitions
64
+
65
+ **CLI Tools** (from cli-tools.json):
66
+ ```javascript
67
+ const cliConfig = JSON.parse(Read("~/.claude/cli-tools.json"))
68
+ const cliTools = Object.entries(cliConfig.tools)
69
+ .filter(([_, config]) => config.enabled)
70
+ .map(([name, config]) => ({
71
+ name, type: 'cli',
72
+ tags: config.tags || [],
73
+ model: config.primaryModel,
74
+ toolType: config.type // builtin, cli-wrapper, api-endpoint
75
+ }))
76
+ ```
77
+
78
+ **Sub Agents**:
79
+
80
+ | Agent | Strengths | canExecute |
81
+ |-------|-----------|------------|
82
+ | **code-developer** | Code implementation, test writing | ✅ |
83
+ | **Explore** | Fast code exploration, pattern discovery | ❌ |
84
+ | **cli-explore-agent** | Dual-source analysis (Bash+CLI) | ❌ |
85
+ | **cli-discuss-agent** | Multi-CLI collaboration, cross-verification | ❌ |
86
+ | **debug-explore-agent** | Hypothesis-driven debugging | ❌ |
87
+ | **context-search-agent** | Multi-layer file discovery, dependency analysis | ❌ |
88
+ | **test-fix-agent** | Test execution, failure diagnosis, code fixing | ✅ |
89
+ | **universal-executor** | General execution, multi-domain adaptation | ✅ |
90
+
91
+ **Analysis Modes**:
92
+
93
+ | Mode | Pattern | Use Case | minCLIs |
94
+ |------|---------|----------|---------|
95
+ | **Parallel** | `A \|\| B \|\| C → Aggregate` | Fast multi-perspective | 1+ |
96
+ | **Sequential** | `A → B(resume) → C(resume)` | Incremental deepening | 2+ |
97
+ | **Collaborative** | `A → B → A → B → Synthesize` | Multi-round refinement | 2+ |
98
+ | **Debate** | `A(propose) → B(challenge) → A(defend)` | Adversarial validation | 2 |
99
+ | **Challenge** | `A(analyze) → B(challenge)` | Find flaws and risks | 2 |
100
+
101
+ ### Three-Step Selection Flow
102
+
103
+ ```javascript
104
+ // Step 1: Select CLIs (multiSelect)
105
+ AskUserQuestion({
106
+ questions: [{
107
+ question: "Select CLI tools for analysis (1-3 for collaboration modes)",
108
+ header: "CLI Tools",
109
+ options: cliTools.map(cli => ({
110
+ label: cli.name,
111
+ description: cli.tags.length > 0 ? cli.tags.join(', ') : cli.model || 'general'
112
+ })),
113
+ multiSelect: true
114
+ }]
115
+ })
116
+
117
+ // Step 2: Select Mode (filtered by CLI count)
118
+ const availableModes = analysisModes.filter(m => selectedCLIs.length >= m.minCLIs)
119
+ AskUserQuestion({
120
+ questions: [{
121
+ question: "Select analysis mode",
122
+ header: "Mode",
123
+ options: availableModes.map(m => ({
124
+ label: m.label,
125
+ description: `${m.description} [${m.pattern}]`
126
+ })),
127
+ multiSelect: false
128
+ }]
129
+ })
130
+
131
+ // Step 3: Select Agent for execution
132
+ AskUserQuestion({
133
+ questions: [{
134
+ question: "Select Sub Agent for execution",
135
+ header: "Agent",
136
+ options: agents.map(a => ({ label: a.name, description: a.strength })),
137
+ multiSelect: false
138
+ }]
139
+ })
140
+
141
+ // Confirm selection
142
+ AskUserQuestion({
143
+ questions: [{
144
+ question: "Confirm selection?",
145
+ header: "Confirm",
146
+ options: [
147
+ { label: "Confirm and continue", description: `${selectedMode.label} with ${selectedCLIs.length} CLIs` },
148
+ { label: "Re-select CLIs", description: "Choose different CLI tools" },
149
+ { label: "Re-select Mode", description: "Choose different analysis mode" },
150
+ { label: "Re-select Agent", description: "Choose different Sub Agent" }
151
+ ],
152
+ multiSelect: false
153
+ }]
154
+ })
155
+ ```
156
+
157
+ ## Phase 3: Multi-Mode Analysis
158
+
159
+ ### Universal CLI Prompt Template
160
+
161
+ ```javascript
162
+ // Unified prompt builder - used by all modes
163
+ function buildPrompt({ purpose, tasks, expected, rules, taskDescription }) {
164
+ return `
165
+ PURPOSE: ${purpose}: ${taskDescription}
166
+ TASK: ${tasks.map(t => `• ${t}`).join(' ')}
167
+ MODE: analysis
168
+ CONTEXT: @**/*
169
+ EXPECTED: ${expected}
170
+ RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | ${rules}
171
+ `
172
+ }
173
+
174
+ // Execute CLI with prompt
175
+ function execCLI(cli, prompt, options = {}) {
176
+ const { resume, background = false } = options
177
+ const resumeFlag = resume ? `--resume ${resume}` : ''
178
+ return Bash({
179
+ command: `ccw cli -p "${prompt}" --tool ${cli.name} --mode analysis ${resumeFlag}`,
180
+ run_in_background: background
181
+ })
182
+ }
183
+ ```
184
+
185
+ ### Prompt Presets by Role
186
+
187
+ | Role | PURPOSE | TASKS | EXPECTED | RULES |
188
+ |------|---------|-------|----------|-------|
189
+ | **initial** | Initial analysis | Identify files, Analyze approach, List changes | Root cause, files, changes, risks | Focus on actionable insights |
190
+ | **extend** | Build on previous | Review previous, Extend, Add insights | Extended analysis building on findings | Build incrementally, avoid repetition |
191
+ | **synthesize** | Refine and synthesize | Review, Identify gaps, Synthesize | Refined synthesis with new perspectives | Add value not repetition |
192
+ | **propose** | Propose comprehensive analysis | Analyze thoroughly, Propose solution, State assumptions | Well-reasoned proposal with trade-offs | Be clear about assumptions |
193
+ | **challenge** | Challenge and stress-test | Identify weaknesses, Question assumptions, Suggest alternatives | Critique with counter-arguments | Be adversarial but constructive |
194
+ | **defend** | Respond to challenges | Address challenges, Defend valid aspects, Propose refined solution | Refined proposal incorporating feedback | Be open to criticism, synthesize |
195
+ | **criticize** | Find flaws ruthlessly | Find logical flaws, Identify edge cases, Rate criticisms | Critique with severity: [CRITICAL]/[HIGH]/[MEDIUM]/[LOW] | Be ruthlessly critical |
196
+
197
+ ```javascript
198
+ const PROMPTS = {
199
+ initial: { purpose: 'Initial analysis', tasks: ['Identify affected files', 'Analyze implementation approach', 'List specific changes'], expected: 'Root cause, files to modify, key changes, risks', rules: 'Focus on actionable insights' },
200
+ extend: { purpose: 'Build on previous analysis', tasks: ['Review previous findings', 'Extend analysis', 'Add new insights'], expected: 'Extended analysis building on previous', rules: 'Build incrementally, avoid repetition' },
201
+ synthesize: { purpose: 'Refine and synthesize', tasks: ['Review previous', 'Identify gaps', 'Add insights', 'Synthesize findings'], expected: 'Refined synthesis with new perspectives', rules: 'Build collaboratively, add value' },
202
+ propose: { purpose: 'Propose comprehensive analysis', tasks: ['Analyze thoroughly', 'Propose solution', 'State assumptions clearly'], expected: 'Well-reasoned proposal with trade-offs', rules: 'Be clear about assumptions' },
203
+ challenge: { purpose: 'Challenge and stress-test', tasks: ['Identify weaknesses', 'Question assumptions', 'Suggest alternatives', 'Highlight overlooked risks'], expected: 'Constructive critique with counter-arguments', rules: 'Be adversarial but constructive' },
204
+ defend: { purpose: 'Respond to challenges', tasks: ['Address each challenge', 'Defend valid aspects', 'Acknowledge valid criticisms', 'Propose refined solution'], expected: 'Refined proposal incorporating alternatives', rules: 'Be open to criticism, synthesize best ideas' },
205
+ criticize: { purpose: 'Stress-test and find weaknesses', tasks: ['Find logical flaws', 'Identify missed edge cases', 'Propose alternatives', 'Rate criticisms (High/Medium/Low)'], expected: 'Detailed critique with severity ratings', rules: 'Be ruthlessly critical, find every flaw' }
206
+ }
207
+ ```
208
+
209
+ ### Mode Implementations
210
+
211
+ ```javascript
212
+ // Parallel: All CLIs run simultaneously
213
+ async function executeParallel(clis, task) {
214
+ return await Promise.all(clis.map(cli =>
215
+ execCLI(cli, buildPrompt({ ...PROMPTS.initial, taskDescription: task }), { background: true })
216
+ ))
217
+ }
218
+
219
+ // Sequential: Each CLI builds on previous via --resume
220
+ async function executeSequential(clis, task) {
221
+ const results = []
222
+ let prevId = null
223
+ for (const cli of clis) {
224
+ const preset = prevId ? PROMPTS.extend : PROMPTS.initial
225
+ const result = await execCLI(cli, buildPrompt({ ...preset, taskDescription: task }), { resume: prevId })
226
+ results.push(result)
227
+ prevId = extractSessionId(result)
228
+ }
229
+ return results
230
+ }
231
+
232
+ // Collaborative: Multi-round synthesis
233
+ async function executeCollaborative(clis, task, rounds = 2) {
234
+ const results = []
235
+ let prevId = null
236
+ for (let r = 0; r < rounds; r++) {
237
+ for (const cli of clis) {
238
+ const preset = !prevId ? PROMPTS.initial : PROMPTS.synthesize
239
+ const result = await execCLI(cli, buildPrompt({ ...preset, taskDescription: task }), { resume: prevId })
240
+ results.push({ cli: cli.name, round: r, result })
241
+ prevId = extractSessionId(result)
242
+ }
243
+ }
244
+ return results
245
+ }
246
+
247
+ // Debate: Propose → Challenge → Defend
248
+ async function executeDebate(clis, task) {
249
+ const [cliA, cliB] = clis
250
+ const results = []
251
+
252
+ const propose = await execCLI(cliA, buildPrompt({ ...PROMPTS.propose, taskDescription: task }))
253
+ results.push({ phase: 'propose', cli: cliA.name, result: propose })
254
+
255
+ const challenge = await execCLI(cliB, buildPrompt({ ...PROMPTS.challenge, taskDescription: task }), { resume: extractSessionId(propose) })
256
+ results.push({ phase: 'challenge', cli: cliB.name, result: challenge })
257
+
258
+ const defend = await execCLI(cliA, buildPrompt({ ...PROMPTS.defend, taskDescription: task }), { resume: extractSessionId(challenge) })
259
+ results.push({ phase: 'defend', cli: cliA.name, result: defend })
260
+
261
+ return results
262
+ }
263
+
264
+ // Challenge: Analyze → Criticize
265
+ async function executeChallenge(clis, task) {
266
+ const [cliA, cliB] = clis
267
+ const results = []
268
+
269
+ const analyze = await execCLI(cliA, buildPrompt({ ...PROMPTS.initial, taskDescription: task }))
270
+ results.push({ phase: 'analyze', cli: cliA.name, result: analyze })
271
+
272
+ const criticize = await execCLI(cliB, buildPrompt({ ...PROMPTS.criticize, taskDescription: task }), { resume: extractSessionId(analyze) })
273
+ results.push({ phase: 'challenge', cli: cliB.name, result: criticize })
274
+
275
+ return results
276
+ }
277
+ ```
278
+
279
+ ### Mode Router & Result Aggregation
280
+
281
+ ```javascript
282
+ async function executeAnalysis(mode, clis, taskDescription) {
283
+ switch (mode.name) {
284
+ case 'parallel': return await executeParallel(clis, taskDescription)
285
+ case 'sequential': return await executeSequential(clis, taskDescription)
286
+ case 'collaborative': return await executeCollaborative(clis, taskDescription)
287
+ case 'debate': return await executeDebate(clis, taskDescription)
288
+ case 'challenge': return await executeChallenge(clis, taskDescription)
289
+ }
290
+ }
291
+
292
+ function aggregateResults(mode, results) {
293
+ const base = { mode: mode.name, pattern: mode.pattern, tools_used: results.map(r => r.cli || 'unknown') }
294
+
295
+ switch (mode.name) {
296
+ case 'parallel':
297
+ return { ...base, findings: results.map(parseOutput), consensus: findCommonPoints(results), divergences: findDifferences(results) }
298
+ case 'sequential':
299
+ return { ...base, evolution: results.map((r, i) => ({ step: i + 1, analysis: parseOutput(r) })), finalAnalysis: parseOutput(results.at(-1)) }
300
+ case 'collaborative':
301
+ return { ...base, rounds: groupByRound(results), synthesis: extractSynthesis(results.at(-1)) }
302
+ case 'debate':
303
+ return { ...base, proposal: parseOutput(results.find(r => r.phase === 'propose')?.result),
304
+ challenges: parseOutput(results.find(r => r.phase === 'challenge')?.result),
305
+ resolution: parseOutput(results.find(r => r.phase === 'defend')?.result), confidence: calculateDebateConfidence(results) }
306
+ case 'challenge':
307
+ return { ...base, originalAnalysis: parseOutput(results.find(r => r.phase === 'analyze')?.result),
308
+ critiques: parseCritiques(results.find(r => r.phase === 'challenge')?.result), riskScore: calculateRiskScore(results) }
309
+ }
310
+ }
311
+ ```
312
+
313
+ ## Phase 4: User Decision
314
+
315
+ ```javascript
316
+ function presentSummary(analysis) {
317
+ console.log(`## Analysis Result\n**Mode**: ${analysis.mode} (${analysis.pattern})\n**Tools**: ${analysis.tools_used.join(' → ')}`)
318
+
319
+ switch (analysis.mode) {
320
+ case 'parallel':
321
+ console.log(`### Consensus\n${analysis.consensus.map(c => `- ${c}`).join('\n')}\n### Divergences\n${analysis.divergences.map(d => `- ${d}`).join('\n')}`)
322
+ break
323
+ case 'sequential':
324
+ console.log(`### Evolution\n${analysis.evolution.map(e => `**Step ${e.step}**: ${e.analysis.summary}`).join('\n')}\n### Final\n${analysis.finalAnalysis.summary}`)
325
+ break
326
+ case 'collaborative':
327
+ console.log(`### Rounds\n${Object.entries(analysis.rounds).map(([r, a]) => `**Round ${r}**: ${a.map(x => x.cli).join(' + ')}`).join('\n')}\n### Synthesis\n${analysis.synthesis}`)
328
+ break
329
+ case 'debate':
330
+ console.log(`### Debate\n**Proposal**: ${analysis.proposal.summary}\n**Challenges**: ${analysis.challenges.points?.length || 0} points\n**Resolution**: ${analysis.resolution.summary}\n**Confidence**: ${analysis.confidence}%`)
331
+ break
332
+ case 'challenge':
333
+ console.log(`### Challenge\n**Original**: ${analysis.originalAnalysis.summary}\n**Critiques**: ${analysis.critiques.length} issues\n${analysis.critiques.map(c => `- [${c.severity}] ${c.description}`).join('\n')}\n**Risk Score**: ${analysis.riskScore}/100`)
334
+ break
335
+ }
336
+ }
337
+
338
+ AskUserQuestion({
339
+ questions: [{
340
+ question: "How to proceed?",
341
+ header: "Next Step",
342
+ options: [
343
+ { label: "Execute directly", description: "Implement immediately" },
344
+ { label: "Refine analysis", description: "Add constraints, re-analyze" },
345
+ { label: "Change tools", description: "Different tool combination" },
346
+ { label: "Cancel", description: "End workflow" }
347
+ ],
348
+ multiSelect: false
349
+ }]
350
+ })
351
+ // Routing: Execute → Phase 5 | Refine → Phase 3 | Change → Phase 2 | Cancel → End
352
+ ```
353
+
354
+ ## Phase 5: Direct Execution
355
+
356
+ ```javascript
357
+ // No IMPL_PLAN.md, no plan.json - direct implementation
358
+ const executionAgents = agents.filter(a => a.canExecute)
359
+ const executionTool = selectedAgent.canExecute ? selectedAgent : selectedCLIs[0]
360
+
361
+ if (executionTool.type === 'agent') {
362
+ Task({
363
+ subagent_type: executionTool.name,
364
+ run_in_background: false,
365
+ description: `Execute: ${taskDescription.slice(0, 30)}`,
366
+ prompt: `## Task\n${taskDescription}\n\n## Analysis Results\n${JSON.stringify(aggregatedAnalysis, null, 2)}\n\n## Instructions\n1. Apply changes to identified files\n2. Follow recommended approach\n3. Handle identified risks\n4. Verify changes work correctly`
367
+ })
368
+ } else {
369
+ Bash({
370
+ command: `ccw cli -p "
371
+ PURPOSE: Implement solution: ${taskDescription}
372
+ TASK: ${extractedTasks.join(' • ')}
373
+ MODE: write
374
+ CONTEXT: @${affectedFiles.join(' @')}
375
+ EXPECTED: Working implementation with all changes applied
376
+ RULES: $(cat ~/.claude/workflows/cli-templates/protocols/write-protocol.md)
377
+ " --tool ${executionTool.name} --mode write`,
378
+ run_in_background: false
379
+ })
380
+ }
381
+ ```
382
+
383
+ ## TodoWrite Structure
384
+
385
+ ```javascript
386
+ TodoWrite({ todos: [
387
+ { content: "Phase 1: Clarify requirements", status: "in_progress", activeForm: "Clarifying requirements" },
388
+ { content: "Phase 2: Select tools", status: "pending", activeForm: "Selecting tools" },
389
+ { content: "Phase 3: Multi-mode analysis", status: "pending", activeForm: "Running analysis" },
390
+ { content: "Phase 4: User decision", status: "pending", activeForm: "Awaiting decision" },
391
+ { content: "Phase 5: Direct execution", status: "pending", activeForm: "Executing" }
392
+ ]})
393
+ ```
394
+
395
+ ## Iteration Patterns
396
+
397
+ | Pattern | Flow |
398
+ |---------|------|
399
+ | **Direct** | Phase 1 → 2 → 3 → 4(execute) → 5 |
400
+ | **Refinement** | Phase 3 → 4(refine) → 3 → 4 → 5 |
401
+ | **Tool Adjust** | Phase 2(adjust) → 3 → 4 → 5 |
402
+
403
+ ## Error Handling
404
+
405
+ | Error | Resolution |
406
+ |-------|------------|
407
+ | CLI timeout | Retry with secondary model |
408
+ | No enabled tools | Ask user to enable tools in cli-tools.json |
409
+ | Task unclear | Default to first CLI + code-developer |
410
+ | Ambiguous task | Force clarification via AskUser |
411
+ | Execution fails | Present error, ask user for direction |
412
+
413
+ ## Comparison with multi-cli-plan
414
+
415
+ | Aspect | lite-lite-lite | multi-cli-plan |
416
+ |--------|----------------|----------------|
417
+ | **Artifacts** | None | IMPL_PLAN.md, plan.json, synthesis.json |
418
+ | **Session** | Stateless (--resume chaining) | Persistent session folder |
419
+ | **Tool Selection** | 3-step (CLI → Mode → Agent) | Config-driven fixed tools |
420
+ | **Analysis Modes** | 5 modes with --resume | Fixed synthesis rounds |
421
+ | **Best For** | Quick analysis, adversarial validation | Complex multi-step implementations |
422
+
423
+ ## Post-Completion Expansion
424
+
425
+ 完成后询问用户是否扩展为issue(test/enhance/refactor/doc),选中项调用 `/issue:new "{summary} - {dimension}"`
426
+
427
+ ## Related Commands
428
+
429
+ ```bash
430
+ /workflow:multi-cli-plan "complex task" # Full planning workflow
431
+ /workflow:lite-plan "task" # Single CLI planning
432
+ /workflow:lite-execute --in-memory # Direct execution
433
+ ```