claude-code-workflow 6.3.52 → 6.3.54

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 (43) hide show
  1. package/.claude/agents/action-planning-agent.md +26 -1
  2. package/.claude/agents/cli-lite-planning-agent.md +66 -2
  3. package/.claude/commands/codex-coordinator.md +513 -0
  4. package/.claude/commands/flow-create.md +675 -0
  5. package/.claude/commands/workflow/collaborative-plan-with-file.md +761 -0
  6. package/.claude/commands/workflow/lite-fix.md +49 -20
  7. package/.claude/commands/workflow/lite-plan.md +35 -8
  8. package/.claude/commands/workflow/plan.md +14 -1
  9. package/.claude/commands/workflow/tools/task-generate-agent.md +35 -24
  10. package/.claude/commands/workflow/unified-execute-with-file.md +101 -19
  11. package/.claude/skills/flow-coordinator/SKILL.md +394 -0
  12. package/.claude/skills/flow-coordinator/templates/analyze.json +16 -0
  13. package/.claude/skills/flow-coordinator/templates/brainstorm-to-issue.json +36 -0
  14. package/.claude/skills/flow-coordinator/templates/brainstorm.json +16 -0
  15. package/.claude/skills/flow-coordinator/templates/bugfix-hotfix.json +16 -0
  16. package/.claude/skills/flow-coordinator/templates/bugfix.json +47 -0
  17. package/.claude/skills/flow-coordinator/templates/coupled.json +71 -0
  18. package/.claude/skills/flow-coordinator/templates/debug.json +16 -0
  19. package/.claude/skills/flow-coordinator/templates/docs.json +27 -0
  20. package/.claude/skills/flow-coordinator/templates/full.json +61 -0
  21. package/.claude/skills/flow-coordinator/templates/issue.json +43 -0
  22. package/.claude/skills/flow-coordinator/templates/lite-lite-lite.json +16 -0
  23. package/.claude/skills/flow-coordinator/templates/multi-cli-plan.json +47 -0
  24. package/.claude/skills/flow-coordinator/templates/rapid-to-issue.json +46 -0
  25. package/.claude/skills/flow-coordinator/templates/rapid.json +47 -0
  26. package/.claude/skills/flow-coordinator/templates/review.json +43 -0
  27. package/.claude/skills/flow-coordinator/templates/tdd.json +34 -0
  28. package/.claude/skills/flow-coordinator/templates/test-fix.json +26 -0
  29. package/ccw/dist/tools/claude-cli-tools.d.ts +8 -0
  30. package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
  31. package/ccw/dist/tools/claude-cli-tools.js +13 -2
  32. package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
  33. package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -1
  34. package/ccw/dist/tools/cli-executor-core.js +24 -3
  35. package/ccw/dist/tools/cli-executor-core.js.map +1 -1
  36. package/ccw/src/templates/dashboard-js/components/cli-status.js +28 -0
  37. package/ccw/src/templates/dashboard-js/views/cli-manager.js +44 -0
  38. package/ccw/src/tools/claude-cli-tools.ts +20 -2
  39. package/ccw/src/tools/cli-executor-core.ts +23 -4
  40. package/package.json +92 -92
  41. package/.claude/commands/workflow/merge-plans-with-file.md +0 -807
  42. package/.claude/commands/workflow/quick-plan-with-file.md +0 -808
  43. package/.codex/prompts/quick-plan-with-file.md +0 -450
@@ -1,808 +0,0 @@
1
- ---
2
- name: quick-plan-with-file
3
- description: Multi-agent rapid planning with minimal documentation, conflict resolution, and actionable synthesis. Designed as a lightweight planning supplement between brainstorm and full implementation planning
4
- argument-hint: "[-y|--yes] [-c|--continue] [-f|--from <type>] \"planning topic or task description\""
5
- allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
6
- ---
7
-
8
- ## Auto Mode
9
-
10
- When `--yes` or `-y`: Auto-confirm planning decisions, use aggressive parallelization, minimal user interaction.
11
-
12
- # Workflow Quick-Plan-With-File Command (/workflow:quick-plan-with-file)
13
-
14
- ## Overview
15
-
16
- Multi-agent rapid planning workflow with **minimal documentation overhead**. Coordinates parallel agent analysis, synthesizes conflicting perspectives into actionable decisions, and generates a lightweight implementation-ready plan.
17
-
18
- **Core workflow**: Parse Input → Parallel Analysis → Conflict Resolution → Plan Synthesis → Output
19
-
20
- **Key features**:
21
- - **Plan Format Agnostic**: Consumes brainstorm conclusions, analysis recommendations, or raw task descriptions
22
- - **Minimal Docs**: Single `plan.md` (no lengthy brainstorm.md or discussion.md)
23
- - **Parallel Multi-Agent**: 3-4 concurrent agent perspectives (architecture, implementation, validation, risk)
24
- - **Conflict Resolution**: Automatic conflict detection and resolution via synthesis agent
25
- - **Actionable Output**: Direct task breakdown ready for execution
26
- - **Session Resumable**: Continue if interrupted, checkpoint at each phase
27
-
28
- ## Usage
29
-
30
- ```bash
31
- /workflow:quick-plan-with-file [FLAGS] <PLANNING_TOPIC>
32
-
33
- # Flags
34
- -y, --yes Auto-confirm decisions, use defaults
35
- -c, --continue Continue existing session (auto-detected)
36
- -f, --from <type> Input source type: brainstorm|analysis|task|raw
37
-
38
- # Arguments
39
- <planning-topic> Planning topic, task, or reference to planning artifact
40
-
41
- # Examples
42
- /workflow:quick-plan-with-file "实现分布式缓存层,支持Redis和内存后端"
43
- /workflow:quick-plan-with-file --continue "缓存层规划" # Continue
44
- /workflow:quick-plan-with-file -y -f analysis "从分析结论生成实施规划" # Auto mode
45
- /workflow:quick-plan-with-file --from brainstorm BS-rate-limiting-2025-01-28 # From artifact
46
- ```
47
-
48
- ## Execution Process
49
-
50
- ```
51
- Input Validation & Loading:
52
- ├─ Parse input (topic | artifact reference)
53
- ├─ Load artifact if referenced (synthesis.json | conclusions.json | etc.)
54
- ├─ Extract key constraints and requirements
55
- └─ Initialize session folder and plan.md
56
-
57
- Session Initialization:
58
- ├─ Create .workflow/.planning/{sessionId}/
59
- ├─ Initialize plan.md with input summary
60
- ├─ Parse existing output (if --from artifact)
61
- └─ Define planning dimensions & focus areas
62
-
63
- Phase 1: Parallel Multi-Agent Analysis (concurrent)
64
- ├─ Agent 1 (Architecture): High-level design & decomposition
65
- ├─ Agent 2 (Implementation): Technical approach & feasibility
66
- ├─ Agent 3 (Validation): Risk analysis & edge cases
67
- ├─ Agent 4 (Decision): Recommendations & tradeoffs
68
- └─ Aggregate findings into perspectives.json
69
-
70
- Phase 2: Conflict Detection & Resolution
71
- ├─ Analyze agent perspectives for contradictions
72
- ├─ Identify critical decision points
73
- ├─ Generate synthesis via arbitration agent
74
- ├─ Document conflicts and resolutions
75
- └─ Update plan.md with decisive recommendations
76
-
77
- Phase 3: Plan Synthesis
78
- ├─ Consolidate all insights
79
- ├─ Generate actionable task breakdown
80
- ├─ Create execution strategy
81
- ├─ Document assumptions & risks
82
- └─ Generate synthesis.md with ready-to-execute tasks
83
-
84
- Output:
85
- ├─ .workflow/.planning/{sessionId}/plan.md (minimal, actionable)
86
- ├─ .workflow/.planning/{sessionId}/perspectives.json (agent findings)
87
- ├─ .workflow/.planning/{sessionId}/conflicts.json (decision points)
88
- ├─ .workflow/.planning/{sessionId}/synthesis.md (task breakdown)
89
- └─ Optional: Feed to /workflow:unified-execute-with-file
90
- ```
91
-
92
- ## Implementation
93
-
94
- ### Session Setup & Input Loading
95
-
96
- ```javascript
97
- const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
98
-
99
- // Parse arguments
100
- const planningTopic = "$PLANNING_TOPIC"
101
- const inputType = $ARGUMENTS.match(/--from\s+(\w+)/)?.[1] || 'raw'
102
- const isAutoMode = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
103
- const isContinue = $ARGUMENTS.includes('--continue') || $ARGUMENTS.includes('-c')
104
-
105
- // Auto-detect artifact if referenced
106
- let artifact = null
107
- let artifactContent = null
108
-
109
- if (inputType === 'brainstorm' || planningTopic.startsWith('BS-')) {
110
- const sessionId = planningTopic
111
- const synthesisPath = `.workflow/.brainstorm/${sessionId}/synthesis.json`
112
- if (fs.existsSync(synthesisPath)) {
113
- artifact = { type: 'brainstorm', path: synthesisPath }
114
- artifactContent = JSON.parse(Read(synthesisPath))
115
- }
116
- } else if (inputType === 'analysis' || planningTopic.startsWith('ANL-')) {
117
- const sessionId = planningTopic
118
- const conclusionsPath = `.workflow/.analysis/${sessionId}/conclusions.json`
119
- if (fs.existsSync(conclusionsPath)) {
120
- artifact = { type: 'analysis', path: conclusionsPath }
121
- artifactContent = JSON.parse(Read(conclusionsPath))
122
- }
123
- }
124
-
125
- // Generate session ID
126
- const planSlug = planningTopic.toLowerCase()
127
- .replace(/[^a-z0-9\u4e00-\u9fa5]+/g, '-')
128
- .substring(0, 30)
129
- const dateStr = getUtc8ISOString().substring(0, 10)
130
- const sessionId = `PLAN-${planSlug}-${dateStr}`
131
- const sessionFolder = `.workflow/.planning/${sessionId}`
132
-
133
- // Session mode detection
134
- const sessionExists = fs.existsSync(sessionFolder)
135
- const hasPlan = sessionExists && fs.existsSync(`${sessionFolder}/plan.md`)
136
- const mode = (hasPlan || isContinue) ? 'continue' : 'new'
137
-
138
- if (!sessionExists) {
139
- bash(`mkdir -p ${sessionFolder}`)
140
- }
141
- ```
142
-
143
- ---
144
-
145
- ### Phase 1: Initialize plan.md (Minimal)
146
-
147
- ```markdown
148
- # Quick Planning Session
149
-
150
- **Session ID**: ${sessionId}
151
- **Topic**: ${planningTopic}
152
- **Started**: ${getUtc8ISOString()}
153
- **Mode**: ${mode}
154
-
155
- ---
156
-
157
- ## Input Context
158
-
159
- ${artifact ? `
160
- **Source**: ${artifact.type} artifact
161
- **Path**: ${artifact.path}
162
-
163
- **Artifact Summary**:
164
- ${artifact.type === 'brainstorm' ? `
165
- - Topic: ${artifactContent.topic}
166
- - Top Ideas: ${artifactContent.top_ideas?.length || 0}
167
- - Key Insights: ${artifactContent.key_insights?.slice(0, 2).join(', ') || 'N/A'}
168
- ` : artifact.type === 'analysis' ? `
169
- - Topic: ${artifactContent.topic}
170
- - Key Conclusions: ${artifactContent.key_conclusions?.length || 0}
171
- - Recommendations: ${artifactContent.recommendations?.length || 0}
172
- ` : ''}
173
- ` : `
174
- **User Input**: ${planningTopic}
175
- `}
176
-
177
- ---
178
-
179
- ## Planning Dimensions
180
-
181
- *To be populated after agent analysis*
182
-
183
- ---
184
-
185
- ## Key Decisions
186
-
187
- *Conflict resolution and recommendations - to be populated*
188
-
189
- ---
190
-
191
- ## Implementation Plan
192
-
193
- *Task breakdown - to be populated after synthesis*
194
-
195
- ---
196
-
197
- ## Progress
198
-
199
- - [ ] Multi-agent analysis
200
- - [ ] Conflict detection
201
- - [ ] Plan synthesis
202
- - [ ] Ready for execution
203
- ```
204
-
205
- ---
206
-
207
- ### Phase 2: Parallel Multi-Agent Analysis
208
-
209
- ```javascript
210
- const analysisPrompt = artifact
211
- ? `Convert ${artifact.type} artifact to planning requirements and execute parallel analysis`
212
- : `Create planning breakdown for: ${planningTopic}`
213
-
214
- // Prepare context for agents
215
- const agentContext = {
216
- topic: planningTopic,
217
- artifact: artifact ? {
218
- type: artifact.type,
219
- summary: extractArtifactSummary(artifactContent)
220
- } : null,
221
- planning_focus: determineFocusAreas(planningTopic),
222
- constraints: extractConstraints(planningTopic, artifactContent)
223
- }
224
-
225
- // Agent 1: Architecture & Design
226
- const archPromise = Bash({
227
- command: `ccw cli -p "
228
- PURPOSE: Architecture & high-level design planning for '${planningTopic}'
229
- Success: Clear component decomposition, interface design, and data flow
230
-
231
- TASK:
232
- • Decompose problem into major components/modules
233
- • Identify architectural patterns and integration points
234
- • Design interfaces and data models
235
- • Assess scalability and maintainability implications
236
- • Propose architectural approach with rationale
237
-
238
- MODE: analysis
239
-
240
- CONTEXT: @**/*
241
- ${artifact ? `| Source artifact: ${artifact.type}` : ''}
242
-
243
- EXPECTED:
244
- - Component decomposition (box diagram in text)
245
- - Module interfaces and responsibilities
246
- - Data flow between components
247
- - Architectural patterns applied
248
- - Scalability assessment (1-5 rating)
249
- - Risks from architectural perspective
250
-
251
- CONSTRAINTS: Focus on long-term maintainability
252
- " --tool gemini --mode analysis`,
253
- run_in_background: true
254
- })
255
-
256
- // Agent 2: Implementation & Feasibility
257
- const implPromise = Bash({
258
- command: `ccw cli -p "
259
- PURPOSE: Implementation approach & technical feasibility for '${planningTopic}'
260
- Success: Concrete implementation strategy with realistic resource estimates
261
-
262
- TASK:
263
- • Evaluate technical feasibility of approach
264
- • Identify required technologies and dependencies
265
- • Estimate effort: high/medium/low + rationale
266
- • Suggest implementation phases and milestones
267
- • Highlight technical blockers or challenges
268
-
269
- MODE: analysis
270
-
271
- CONTEXT: @**/*
272
- ${artifact ? `| Source artifact: ${artifact.type}` : ''}
273
-
274
- EXPECTED:
275
- - Technology stack recommendation
276
- - Implementation complexity: high|medium|low with justification
277
- - Estimated effort breakdown (analysis/design/coding/testing/deployment)
278
- - Key technical decisions with tradeoffs
279
- - Potential blockers and mitigations
280
- - Suggested implementation phases
281
- - Reusable components or libraries
282
-
283
- CONSTRAINTS: Realistic with current tech stack
284
- " --tool codex --mode analysis`,
285
- run_in_background: true
286
- })
287
-
288
- // Agent 3: Risk & Validation
289
- const riskPromise = Bash({
290
- command: `ccw cli -p "
291
- PURPOSE: Risk analysis and validation strategy for '${planningTopic}'
292
- Success: Comprehensive risk matrix with testing strategy
293
-
294
- TASK:
295
- • Identify technical risks and failure scenarios
296
- • Assess business/timeline risks
297
- • Define validation/testing strategy
298
- • Suggest monitoring and observability requirements
299
- • Rate overall risk level (low/medium/high)
300
-
301
- MODE: analysis
302
-
303
- CONTEXT: @**/*
304
- ${artifact ? `| Source artifact: ${artifact.type}` : ''}
305
-
306
- EXPECTED:
307
- - Risk matrix (likelihood × impact, 1-5 each)
308
- - Top 3 technical risks with mitigations
309
- - Top 3 timeline/resource risks with mitigations
310
- - Testing strategy (unit/integration/e2e/performance)
311
- - Deployment strategy and rollback plan
312
- - Monitoring/observability requirements
313
- - Overall risk rating with confidence (low/medium/high)
314
-
315
- CONSTRAINTS: Be realistic, not pessimistic
316
- " --tool claude --mode analysis`,
317
- run_in_background: true
318
- })
319
-
320
- // Agent 4: Decisions & Recommendations
321
- const decisionPromise = Bash({
322
- command: `ccw cli -p "
323
- PURPOSE: Strategic decisions and execution recommendations for '${planningTopic}'
324
- Success: Clear recommended approach with tradeoff analysis
325
-
326
- TASK:
327
- • Synthesize all considerations into recommendations
328
- • Clearly identify critical decision points
329
- • Outline key tradeoffs (speed vs quality, scope vs timeline, etc.)
330
- • Propose go/no-go decision criteria
331
- • Suggest execution strategy and sequencing
332
-
333
- MODE: analysis
334
-
335
- CONTEXT: @**/*
336
- ${artifact ? `| Source artifact: ${artifact.type}` : ''}
337
-
338
- EXPECTED:
339
- - Primary recommendation with strong rationale
340
- - Alternative approaches with pros/cons
341
- - 2-3 critical decision points with recommended choices
342
- - Key tradeoffs and what we're optimizing for
343
- - Success metrics and go/no-go criteria
344
- - Suggested execution sequencing
345
- - Resource requirements and dependencies
346
-
347
- CONSTRAINTS: Focus on actionable decisions, not analysis
348
- " --tool gemini --mode analysis`,
349
- run_in_background: true
350
- })
351
-
352
- // Wait for all parallel analyses
353
- const [archResult, implResult, riskResult, decisionResult] = await Promise.all([
354
- archPromise, implPromise, riskPromise, decisionPromise
355
- ])
356
- ```
357
-
358
- ---
359
-
360
- ### Phase 3: Aggregate Perspectives
361
-
362
- ```javascript
363
- // Parse and structure agent findings
364
- const perspectives = {
365
- session_id: sessionId,
366
- timestamp: getUtc8ISOString(),
367
- topic: planningTopic,
368
- source_artifact: artifact?.type || 'raw',
369
-
370
- architecture: {
371
- source: 'gemini (design)',
372
- components: extractComponents(archResult),
373
- interfaces: extractInterfaces(archResult),
374
- patterns: extractPatterns(archResult),
375
- scalability_rating: extractRating(archResult, 'scalability'),
376
- risks_from_design: extractRisks(archResult)
377
- },
378
-
379
- implementation: {
380
- source: 'codex (pragmatic)',
381
- technology_stack: extractStack(implResult),
382
- complexity: extractComplexity(implResult),
383
- effort_breakdown: extractEffort(implResult),
384
- blockers: extractBlockers(implResult),
385
- phases: extractPhases(implResult)
386
- },
387
-
388
- validation: {
389
- source: 'claude (systematic)',
390
- risk_matrix: extractRiskMatrix(riskResult),
391
- top_risks: extractTopRisks(riskResult),
392
- testing_strategy: extractTestingStrategy(riskResult),
393
- deployment_strategy: extractDeploymentStrategy(riskResult),
394
- monitoring_requirements: extractMonitoring(riskResult),
395
- overall_risk_rating: extractRiskRating(riskResult)
396
- },
397
-
398
- recommendation: {
399
- source: 'gemini (synthesis)',
400
- primary_approach: extractPrimaryApproach(decisionResult),
401
- alternatives: extractAlternatives(decisionResult),
402
- critical_decisions: extractDecisions(decisionResult),
403
- tradeoffs: extractTradeoffs(decisionResult),
404
- success_criteria: extractCriteria(decisionResult),
405
- execution_sequence: extractSequence(decisionResult)
406
- },
407
-
408
- analysis_timestamp: getUtc8ISOString()
409
- }
410
-
411
- Write(`${sessionFolder}/perspectives.json`, JSON.stringify(perspectives, null, 2))
412
- ```
413
-
414
- ---
415
-
416
- ### Phase 4: Conflict Detection & Resolution
417
-
418
- ```javascript
419
- // Analyze for conflicts and contradictions
420
- const conflicts = detectConflicts({
421
- arch_vs_impl: compareArchitectureAndImplementation(perspectives),
422
- design_vs_risk: compareDesignAndRisk(perspectives),
423
- effort_vs_scope: compareEffortAndScope(perspectives),
424
- timeline_implications: extractTimingConflicts(perspectives)
425
- })
426
-
427
- // If conflicts exist, invoke arbitration agent
428
- if (conflicts.critical.length > 0) {
429
- const arbitrationResult = await Bash({
430
- command: `ccw cli -p "
431
- PURPOSE: Resolve planning conflicts and generate unified recommendation
432
- Input: ${JSON.stringify(conflicts, null, 2)}
433
-
434
- TASK:
435
- • Review all conflicts presented
436
- • Recommend resolution for each critical conflict
437
- • Explain tradeoff choices
438
- • Identify what we're optimizing for (speed/quality/risk/resource)
439
- • Generate unified execution strategy
440
-
441
- MODE: analysis
442
-
443
- EXPECTED:
444
- - For each conflict: recommended resolution + rationale
445
- - Unified optimization criteria (what matters most?)
446
- - Final recommendation with confidence level
447
- - Any unresolved tensions that need user input
448
-
449
- CONSTRAINTS: Be decisive, not fence-sitting
450
- " --tool gemini --mode analysis`,
451
- run_in_background: false
452
- })
453
-
454
- const conflictResolution = {
455
- detected_conflicts: conflicts,
456
- arbitration_result: arbitrationResult,
457
- timestamp: getUtc8ISOString()
458
- }
459
-
460
- Write(`${sessionFolder}/conflicts.json`, JSON.stringify(conflictResolution, null, 2))
461
- }
462
- ```
463
-
464
- ---
465
-
466
- ### Phase 5: Plan Synthesis & Task Breakdown
467
-
468
- ```javascript
469
- const synthesisPrompt = `
470
- Given the planning context:
471
- - Topic: ${planningTopic}
472
- - Architecture: ${perspectives.architecture.components.map(c => c.name).join(', ')}
473
- - Implementation Complexity: ${perspectives.implementation.complexity}
474
- - Timeline Risk: ${perspectives.validation.overall_risk_rating}
475
- - Primary Recommendation: ${perspectives.recommendation.primary_approach.summary}
476
-
477
- Generate a minimal but complete implementation plan with:
478
- 1. Task breakdown (5-8 major tasks)
479
- 2. Dependencies between tasks
480
- 3. For each task: what needs to be done, why, and key considerations
481
- 4. Success criteria for the entire effort
482
- 5. Known risks and mitigation strategies
483
-
484
- Output as structured task list ready for execution.
485
- `
486
-
487
- const synthesisResult = await Bash({
488
- command: `ccw cli -p "${synthesisPrompt}" --tool gemini --mode analysis`,
489
- run_in_background: false
490
- })
491
-
492
- // Parse synthesis and generate task breakdown
493
- const tasks = parseTaskBreakdown(synthesisResult)
494
-
495
- const synthesis = {
496
- session_id: sessionId,
497
- planning_topic: planningTopic,
498
- completed: getUtc8ISOString(),
499
-
500
- // Summary
501
- executive_summary: perspectives.recommendation.primary_approach.summary,
502
- optimization_focus: extractOptimizationFocus(perspectives),
503
-
504
- // Architecture
505
- architecture_approach: perspectives.architecture.patterns[0] || 'TBD',
506
- key_components: perspectives.architecture.components.slice(0, 5),
507
-
508
- // Implementation
509
- technology_stack: perspectives.implementation.technology_stack,
510
- complexity_level: perspectives.implementation.complexity,
511
- estimated_effort: perspectives.implementation.effort_breakdown,
512
-
513
- // Risks & Validation
514
- top_risks: perspectives.validation.top_risks.slice(0, 3),
515
- testing_approach: perspectives.validation.testing_strategy,
516
-
517
- // Execution
518
- phases: perspectives.implementation.phases,
519
- critical_path_tasks: extractCriticalPath(tasks),
520
- total_tasks: tasks.length,
521
-
522
- // Task breakdown (ready for unified-execute-with-file)
523
- tasks: tasks.map(task => ({
524
- id: task.id,
525
- title: task.title,
526
- description: task.description,
527
- type: task.type,
528
- dependencies: task.dependencies,
529
- effort_estimate: task.effort,
530
- success_criteria: task.criteria
531
- }))
532
- }
533
-
534
- Write(`${sessionFolder}/synthesis.md`, formatSynthesisMarkdown(synthesis))
535
- Write(`${sessionFolder}/synthesis.json`, JSON.stringify(synthesis, null, 2))
536
- ```
537
-
538
- ---
539
-
540
- ### Phase 6: Update plan.md with Results
541
-
542
- ```markdown
543
- # Quick Planning Session
544
-
545
- **Session ID**: ${sessionId}
546
- **Topic**: ${planningTopic}
547
- **Started**: ${startTime}
548
- **Completed**: ${completionTime}
549
-
550
- ---
551
-
552
- ## Executive Summary
553
-
554
- ${synthesis.executive_summary}
555
-
556
- **Optimization Focus**: ${synthesis.optimization_focus}
557
- **Complexity**: ${synthesis.complexity_level}
558
- **Estimated Effort**: ${formatEffort(synthesis.estimated_effort)}
559
-
560
- ---
561
-
562
- ## Architecture
563
-
564
- **Primary Pattern**: ${synthesis.architecture_approach}
565
-
566
- **Key Components**:
567
- ${synthesis.key_components.map((c, i) => `${i+1}. ${c.name}: ${c.responsibility}`).join('\n')}
568
-
569
- ---
570
-
571
- ## Implementation Strategy
572
-
573
- **Technology Stack**:
574
- ${synthesis.technology_stack.map(t => `- ${t}`).join('\n')}
575
-
576
- **Phases**:
577
- ${synthesis.phases.map((p, i) => `${i+1}. ${p.name} (${p.effort})`).join('\n')}
578
-
579
- ---
580
-
581
- ## Risk Assessment
582
-
583
- **Overall Risk Level**: ${synthesis.top_risks[0].risk_level}
584
-
585
- **Top 3 Risks**:
586
- ${synthesis.top_risks.map((r, i) => `
587
- ${i+1}. **${r.title}** (Impact: ${r.impact})
588
- - Mitigation: ${r.mitigation}
589
- `).join('\n')}
590
-
591
- **Testing Approach**: ${synthesis.testing_approach}
592
-
593
- ---
594
-
595
- ## Execution Plan
596
-
597
- **Total Tasks**: ${synthesis.total_tasks}
598
- **Critical Path**: ${synthesis.critical_path_tasks.map(t => t.id).join(' → ')}
599
-
600
- ### Task Breakdown
601
-
602
- ${synthesis.tasks.map((task, i) => `
603
- ${i+1}. **${task.id}: ${task.title}** (Effort: ${task.effort_estimate})
604
- - ${task.description}
605
- - Depends on: ${task.dependencies.join(', ') || 'none'}
606
- - Success: ${task.success_criteria}
607
- `).join('\n')}
608
-
609
- ---
610
-
611
- ## Next Steps
612
-
613
- **Recommended**: Execute with \`/workflow:unified-execute-with-file\` using:
614
- \`\`\`
615
- /workflow:unified-execute-with-file -p ${sessionFolder}/synthesis.json
616
- \`\`\`
617
-
618
- ---
619
-
620
- ## Artifacts
621
-
622
- - **Perspectives**: ${sessionFolder}/perspectives.json (all agent findings)
623
- - **Conflicts**: ${sessionFolder}/conflicts.json (decision points and resolutions)
624
- - **Synthesis**: ${sessionFolder}/synthesis.json (task breakdown for execution)
625
- ```
626
-
627
- ---
628
-
629
- ## Session Folder Structure
630
-
631
- ```
632
- .workflow/.planning/{sessionId}/
633
- ├── plan.md # Minimal, actionable planning doc
634
- ├── perspectives.json # Multi-agent findings (architecture, impl, risk, decision)
635
- ├── conflicts.json # Detected conflicts and resolutions (if any)
636
- ├── synthesis.json # Task breakdown ready for execution
637
- └── synthesis.md # Human-readable execution plan
638
- ```
639
-
640
- ---
641
-
642
- ## Multi-Agent Roles
643
-
644
- | Agent | Focus | Input | Output |
645
- |-------|-------|-------|--------|
646
- | **Gemini (Design)** | Architecture & design patterns | Topic + constraints | Components, interfaces, patterns, scalability |
647
- | **Codex (Pragmatic)** | Implementation reality | Topic + architecture | Tech stack, effort, phases, blockers |
648
- | **Claude (Validation)** | Risk & testing | Architecture + impl | Risk matrix, test strategy, monitoring |
649
- | **Gemini (Decision)** | Synthesis & strategy | All findings | Recommendations, tradeoffs, execution plan |
650
-
651
- ---
652
-
653
- ## Conflict Resolution Strategy
654
-
655
- **Auto-Resolution for conflicts**:
656
- 1. **Architecture vs Implementation**: Recommend design-for-feasibility approach
657
- 2. **Scope vs Timeline**: Prioritize critical path, defer nice-to-haves
658
- 3. **Quality vs Speed**: Suggest iterative approach (MVP + iterations)
659
- 4. **Resource vs Effort**: Identify parallelizable tasks
660
-
661
- **Require User Input for**:
662
- - Strategic choices (which feature to prioritize?)
663
- - Tool/technology decisions with strong team preferences
664
- - Budget/resource constraints not stated in planning topic
665
-
666
- ---
667
-
668
- ## Continue & Resume
669
-
670
- ```bash
671
- /workflow:quick-plan-with-file --continue "planning-topic"
672
- ```
673
-
674
- When continuing:
675
- 1. Load existing plan.md and perspectives.json
676
- 2. Identify what's incomplete
677
- 3. Re-run affected agents (if planning has changed)
678
- 4. Update plan.md with new findings
679
- 5. Generate updated synthesis.json
680
-
681
- ---
682
-
683
- ## Integration Flow
684
-
685
- ```
686
- Input Source:
687
- ├─ Raw task description
688
- ├─ Brainstorm synthesis.json
689
- └─ Analysis conclusions.json
690
-
691
- /workflow:quick-plan-with-file
692
-
693
- plan.md + synthesis.json
694
-
695
- /workflow:unified-execute-with-file
696
-
697
- Implementation
698
- ```
699
-
700
- ---
701
-
702
- ## Usage Patterns
703
-
704
- ### Pattern 1: Quick Planning from Task
705
-
706
- ```bash
707
- # User has a task, needs rapid multi-perspective plan
708
- /workflow:quick-plan-with-file -y "实现实时通知系统,支持推送和WebSocket"
709
- # → Creates plan in ~5 minutes
710
- # → Ready for execution
711
- ```
712
-
713
- ### Pattern 2: Convert Brainstorm to Executable Plan
714
-
715
- ```bash
716
- # User completed brainstorm, wants to convert top idea to executable plan
717
- /workflow:quick-plan-with-file --from brainstorm BS-notifications-2025-01-28
718
- # → Reads synthesis.json from brainstorm
719
- # → Generates implementation plan
720
- # → Ready for unified-execute-with-file
721
- ```
722
-
723
- ### Pattern 3: From Analysis to Implementation
724
-
725
- ```bash
726
- # Analysis completed, now need execution plan
727
- /workflow:quick-plan-with-file --from analysis ANL-auth-architecture-2025-01-28
728
- # → Reads conclusions.json from analysis
729
- # → Generates planning with recommendations
730
- # → Output task breakdown
731
- ```
732
-
733
- ### Pattern 4: Planning with Interactive Conflict Resolution
734
-
735
- ```bash
736
- # Full planning with user involvement in decision-making
737
- /workflow:quick-plan-with-file "新的支付流程集成"
738
- # → Without -y flag
739
- # → After conflict detection, asks user about tradeoffs
740
- # → Generates plan based on user preferences
741
- ```
742
-
743
- ---
744
-
745
- ## Comparison with Other Workflows
746
-
747
- | Feature | brainstorm | analyze | quick-plan | plan |
748
- |---------|-----------|---------|-----------|------|
749
- | **Purpose** | Ideation | Investigation | Lightweight planning | Detailed planning |
750
- | **Multi-agent** | 3 perspectives | 2 CLI + explore | 4 concurrent agents | N/A (single) |
751
- | **Documentation** | Extensive | Extensive | Minimal | Standard |
752
- | **Output** | Ideas + synthesis | Conclusions | Executable tasks | IMPL_PLAN |
753
- | **Typical Duration** | 30-60 min | 20-30 min | 5-10 min | 15-20 min |
754
- | **User Interaction** | High (multi-round) | High (Q&A) | Low (decisions) | Medium |
755
-
756
- ---
757
-
758
- ## Error Handling
759
-
760
- | Situation | Action |
761
- |-----------|--------|
762
- | Agents conflict on approach | Arbitration agent decides, document in conflicts.json |
763
- | Missing critical files | Continue with available context, note limitations |
764
- | Insufficient task breakdown | Ask user for planning focus areas |
765
- | Effort estimate too high | Suggest MVP approach or phasing |
766
- | Unclear requirements | Ask clarifying questions via AskUserQuestion |
767
- | Agent timeout | Use last successful result, note partial analysis |
768
-
769
- ---
770
-
771
- ## Best Practices
772
-
773
- 1. **Use when**:
774
- - You have clarity on WHAT but not HOW
775
- - Need rapid multi-perspective planning
776
- - Converting brainstorm/analysis into execution
777
- - Want minimal planning overhead
778
-
779
- 2. **Avoid when**:
780
- - Requirements are highly ambiguous (use brainstorm instead)
781
- - Need deep investigation (use analyze instead)
782
- - Want extensive planning document (use plan instead)
783
- - No tech stack clarity (use analyze first)
784
-
785
- 3. **For best results**:
786
- - Provide complete task/requirement description
787
- - Include constraints and success criteria
788
- - Specify preferences (speed vs quality vs risk)
789
- - Review conflicts.json and make conscious tradeoff decisions
790
-
791
- ---
792
-
793
- ## Next Steps After Planning
794
-
795
- ### Feed to Execution
796
- ```bash
797
- /workflow:unified-execute-with-file -p .workflow/.planning/{sessionId}/synthesis.json
798
- ```
799
-
800
- ### Detailed Planning if Needed
801
- ```bash
802
- /workflow:plan "Based on quick-plan recommendations..."
803
- ```
804
-
805
- ### Continuous Refinement
806
- ```bash
807
- /workflow:quick-plan-with-file --continue "{topic}" # Update plan with new constraints
808
- ```