claude-code-workflow 6.3.50 → 6.3.52

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 (71) hide show
  1. package/.claude/commands/view.md +367 -0
  2. package/.claude/commands/workflow/merge-plans-with-file.md +807 -0
  3. package/.claude/commands/workflow/quick-plan-with-file.md +808 -0
  4. package/.claude/commands/workflow/unified-execute-with-file.md +807 -0
  5. package/.claude/skills/ccw-help/SKILL.md +72 -12
  6. package/.claude/skills/ccw-help/command.json +922 -520
  7. package/.claude/skills/ccw-help/index/all-agents.json +97 -0
  8. package/.claude/skills/ccw-help/index/all-commands.json +805 -0
  9. package/.claude/skills/ccw-help/index/by-category.json +833 -0
  10. package/.claude/skills/ccw-help/index/by-use-case.json +819 -0
  11. package/.claude/skills/ccw-help/index/command-relationships.json +160 -0
  12. package/.claude/skills/ccw-help/index/essential-commands.json +90 -0
  13. package/.claude/skills/ccw-help/scripts/auto-update.py +34 -0
  14. package/.claude/skills/skill-generator/SKILL.md +255 -208
  15. package/.claude/skills/skill-generator/phases/01-requirements-discovery.md +238 -228
  16. package/.claude/skills/skill-generator/phases/02-structure-generation.md +261 -262
  17. package/.claude/skills/skill-generator/phases/03-phase-generation.md +976 -969
  18. package/.claude/skills/skill-generator/phases/04-specs-templates.md +398 -398
  19. package/.claude/skills/skill-generator/phases/05-validation.md +417 -417
  20. package/.claude/skills/skill-generator/specs/cli-integration.md +131 -131
  21. package/.claude/skills/skill-generator/specs/execution-modes.md +399 -396
  22. package/.claude/skills/skill-generator/specs/reference-docs-spec.md +271 -0
  23. package/.claude/skills/skill-generator/specs/scripting-integration.md +265 -265
  24. package/.claude/skills/skill-generator/specs/skill-requirements.md +466 -466
  25. package/.claude/skills/skill-generator/templates/autonomous-action.md +91 -88
  26. package/.claude/skills/skill-generator/templates/autonomous-orchestrator.md +89 -89
  27. package/.claude/skills/skill-generator/templates/code-analysis-action.md +148 -149
  28. package/.claude/skills/skill-generator/templates/llm-action.md +367 -367
  29. package/.claude/skills/skill-generator/templates/script-template.md +79 -79
  30. package/.claude/skills/skill-generator/templates/sequential-phase.md +129 -129
  31. package/.claude/skills/skill-generator/templates/skill-md.md +134 -75
  32. package/.codex/prompts/brainstorm-with-file.md +99 -32
  33. package/.codex/prompts/merge-plans-with-file.md +530 -0
  34. package/.codex/prompts/quick-plan-with-file.md +450 -0
  35. package/.codex/prompts/unified-execute-with-file.md +722 -0
  36. package/.codex/skills/codex-issue-plan-execute/SKILL.md +214 -0
  37. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-complete.md +173 -0
  38. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-execute.md +220 -0
  39. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-init.md +86 -0
  40. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-list.md +165 -0
  41. package/.codex/skills/codex-issue-plan-execute/phases/actions/action-plan.md +170 -0
  42. package/.codex/skills/codex-issue-plan-execute/phases/orchestrator.md +212 -0
  43. package/.codex/skills/codex-issue-plan-execute/phases/state-schema.md +136 -0
  44. package/.codex/skills/codex-issue-plan-execute/prompts/execution-agent-system.md +32 -0
  45. package/.codex/skills/codex-issue-plan-execute/prompts/execution-agent.md +323 -0
  46. package/.codex/skills/codex-issue-plan-execute/prompts/planning-agent-system.md +32 -0
  47. package/.codex/skills/codex-issue-plan-execute/prompts/planning-agent.md +224 -0
  48. package/.codex/skills/codex-issue-plan-execute/specs/agent-roles.md +468 -0
  49. package/.codex/skills/codex-issue-plan-execute/specs/issue-handling.md +187 -0
  50. package/.codex/skills/codex-issue-plan-execute/specs/quality-standards.md +231 -0
  51. package/.codex/skills/codex-issue-plan-execute/specs/solution-schema.md +270 -0
  52. package/.codex/skills/codex-issue-plan-execute/specs/subagent-roles.md +32 -0
  53. package/ccw/dist/commands/cli.d.ts.map +1 -1
  54. package/ccw/dist/commands/cli.js +23 -2
  55. package/ccw/dist/commands/cli.js.map +1 -1
  56. package/ccw/dist/core/routes/help-routes.d.ts.map +1 -1
  57. package/ccw/dist/core/routes/help-routes.js +51 -1
  58. package/ccw/dist/core/routes/help-routes.js.map +1 -1
  59. package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -1
  60. package/ccw/dist/tools/cli-executor-core.js +5 -3
  61. package/ccw/dist/tools/cli-executor-core.js.map +1 -1
  62. package/ccw/dist/tools/cli-executor-utils.d.ts +1 -0
  63. package/ccw/dist/tools/cli-executor-utils.d.ts.map +1 -1
  64. package/ccw/dist/tools/cli-executor-utils.js +9 -1
  65. package/ccw/dist/tools/cli-executor-utils.js.map +1 -1
  66. package/ccw/src/commands/cli.ts +26 -2
  67. package/ccw/src/core/routes/help-routes.ts +60 -1
  68. package/ccw/src/templates/dashboard-js/views/help.js +423 -1
  69. package/ccw/src/tools/cli-executor-core.ts +6 -3
  70. package/ccw/src/tools/cli-executor-utils.ts +11 -2
  71. package/package.json +1 -1
@@ -0,0 +1,530 @@
1
+ ---
2
+ description: Merge multiple planning/brainstorm/analysis outputs, resolve conflicts, and synthesize unified plan. Multi-team input aggregation and plan crystallization
3
+ argument-hint: "PATTERN=\"<plan pattern or topic>\" [--rule=consensus|priority|hierarchy] [--output=<path>] [--auto] [--verbose]"
4
+ ---
5
+
6
+ # Codex Merge-Plans-With-File Prompt
7
+
8
+ ## Overview
9
+
10
+ Plan aggregation and conflict resolution workflow. Takes multiple planning artifacts (brainstorm conclusions, analysis recommendations, quick-plans, implementation plans) and synthesizes them into a unified, conflict-resolved execution plan.
11
+
12
+ **Core workflow**: Load Sources → Parse Plans → Conflict Analysis → Arbitration → Unified Plan
13
+
14
+ **Key features**:
15
+ - **Multi-Source Support**: brainstorm, analysis, quick-plan, IMPL_PLAN, task JSONs
16
+ - **Conflict Detection**: Identify contradictions across all input plans
17
+ - **Resolution Rules**: consensus, priority-based, or hierarchical resolution
18
+ - **Unified Synthesis**: Single authoritative plan from multiple perspectives
19
+ - **Decision Tracking**: Full audit trail of conflicts and resolutions
20
+
21
+ ## Target Pattern
22
+
23
+ **$PATTERN**
24
+
25
+ - `--rule`: Conflict resolution (consensus | priority | hierarchy) - consensus by default
26
+ - `--output`: Output directory (default: .workflow/.merged/{pattern})
27
+ - `--auto`: Auto-resolve conflicts using rule, skip confirmations
28
+ - `--verbose`: Include detailed conflict analysis
29
+
30
+ ## Execution Process
31
+
32
+ ```
33
+ Phase 1: Discovery & Loading
34
+ ├─ Search for artifacts matching pattern
35
+ ├─ Load synthesis.json, conclusions.json, IMPL_PLAN.md, task JSONs
36
+ ├─ Parse into normalized task structure
37
+ └─ Validate completeness
38
+
39
+ Phase 2: Plan Normalization
40
+ ├─ Convert all formats to common task representation
41
+ ├─ Extract: tasks, dependencies, effort, risks
42
+ ├─ Identify scope and boundaries
43
+ └─ Aggregate recommendations
44
+
45
+ Phase 3: Conflict Detection (Parallel)
46
+ ├─ Architecture conflicts: different design approaches
47
+ ├─ Task conflicts: overlapping or duplicated tasks
48
+ ├─ Effort conflicts: different estimates
49
+ ├─ Risk conflicts: different risk assessments
50
+ ├─ Scope conflicts: different feature sets
51
+ └─ Generate conflict matrix
52
+
53
+ Phase 4: Conflict Resolution
54
+ ├─ Analyze source rationale for each conflict
55
+ ├─ Apply resolution rule (consensus / priority / hierarchy)
56
+ ├─ Escalate unresolvable conflicts to user (unless --auto)
57
+ ├─ Document decision rationale
58
+ └─ Generate resolutions.json
59
+
60
+ Phase 5: Plan Synthesis
61
+ ├─ Merge task lists (deduplicate, combine insights)
62
+ ├─ Integrate dependencies
63
+ ├─ Consolidate effort and risk estimates
64
+ ├─ Generate execution sequence
65
+ └─ Output unified-plan.json
66
+
67
+ Output:
68
+ ├─ .workflow/.merged/{sessionId}/merge.md (process log)
69
+ ├─ .workflow/.merged/{sessionId}/source-index.json (input sources)
70
+ ├─ .workflow/.merged/{sessionId}/conflicts.json (conflict matrix)
71
+ ├─ .workflow/.merged/{sessionId}/resolutions.json (decisions)
72
+ ├─ .workflow/.merged/{sessionId}/unified-plan.json (for execution)
73
+ └─ .workflow/.merged/{sessionId}/unified-plan.md (human-readable)
74
+ ```
75
+
76
+ ## Implementation Details
77
+
78
+ ### Phase 1: Discover & Load Sources
79
+
80
+ ```javascript
81
+ const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
82
+
83
+ const mergeSlug = "$PATTERN".toLowerCase()
84
+ .replace(/[*?]/g, '-')
85
+ .replace(/[^a-z0-9\u4e00-\u9fa5-]+/g, '-')
86
+ .substring(0, 30)
87
+ const sessionId = `MERGE-${mergeSlug}-${getUtc8ISOString().substring(0, 10)}`
88
+ const sessionFolder = `.workflow/.merged/${sessionId}`
89
+
90
+ bash(`mkdir -p ${sessionFolder}`)
91
+
92
+ // Search paths for matching artifacts
93
+ const searchPaths = [
94
+ `.workflow/.brainstorm/*${$PATTERN}*/synthesis.json`,
95
+ `.workflow/.analysis/*${$PATTERN}*/conclusions.json`,
96
+ `.workflow/.planning/*${$PATTERN}*/synthesis.json`,
97
+ `.workflow/.plan/*${$PATTERN}*IMPL_PLAN.md`,
98
+ `.workflow/**/*${$PATTERN}*.json`
99
+ ]
100
+
101
+ // Load and validate each source
102
+ const sourcePlans = []
103
+ for (const pattern of searchPaths) {
104
+ const matches = glob(pattern)
105
+ for (const path of matches) {
106
+ const plan = loadAndParsePlan(path)
107
+ if (plan?.tasks?.length > 0) {
108
+ sourcePlans.push({ path, type: inferType(path), plan })
109
+ }
110
+ }
111
+ }
112
+ ```
113
+
114
+ ### Phase 2: Normalize Plans
115
+
116
+ Convert all source formats to common structure:
117
+
118
+ ```javascript
119
+ const normalizedPlans = sourcePlans.map((src, idx) => ({
120
+ index: idx,
121
+ source: src.path,
122
+ type: src.type,
123
+
124
+ metadata: {
125
+ title: src.plan.title || `Plan ${idx + 1}`,
126
+ topic: src.plan.topic,
127
+ complexity: src.plan.complexity_level || 'unknown'
128
+ },
129
+
130
+ tasks: src.plan.tasks.map(task => ({
131
+ id: `T${idx}-${task.id || task.title.substring(0, 20)}`,
132
+ title: task.title,
133
+ description: task.description,
134
+ type: task.type || inferTaskType(task),
135
+ priority: task.priority || 'normal',
136
+
137
+ effort: { estimated: task.effort_estimate, from_plan: idx },
138
+ risk: { level: task.risk_level || 'medium', from_plan: idx },
139
+ dependencies: task.dependencies || [],
140
+
141
+ source_plan_index: idx
142
+ }))
143
+ }))
144
+ ```
145
+
146
+ ### Phase 3: Parallel Conflict Detection
147
+
148
+ Launch parallel agents to detect and analyze conflicts:
149
+
150
+ ```javascript
151
+ // Parallel conflict detection with CLI agents
152
+ const conflictPromises = []
153
+
154
+ // Agent 1: Detect effort and task conflicts
155
+ conflictPromises.push(
156
+ Bash({
157
+ command: `ccw cli -p "
158
+ PURPOSE: Detect effort conflicts and task duplicates across multiple plans
159
+ Success: Complete identification of conflicting estimates and duplicate tasks
160
+
161
+ TASK:
162
+ • Identify tasks with significantly different effort estimates (>50% variance)
163
+ • Detect duplicate/similar tasks across plans
164
+ • Analyze effort estimation reasoning
165
+ • Suggest resolution for each conflict
166
+
167
+ MODE: analysis
168
+
169
+ CONTEXT:
170
+ - Plan 1: ${JSON.stringify(normalizedPlans[0]?.tasks?.slice(0,3) || [], null, 2)}
171
+ - Plan 2: ${JSON.stringify(normalizedPlans[1]?.tasks?.slice(0,3) || [], null, 2)}
172
+ - [Additional plans...]
173
+
174
+ EXPECTED:
175
+ - Effort conflicts detected (task name, estimate in each plan, variance %)
176
+ - Duplicate task analysis (similar tasks, scope differences)
177
+ - Resolution recommendation for each conflict
178
+ - Confidence level for each detection
179
+
180
+ CONSTRAINTS: Focus on significant conflicts (>30% effort variance)
181
+ " --tool gemini --mode analysis`,
182
+ run_in_background: true
183
+ })
184
+ )
185
+
186
+ // Agent 2: Analyze architecture and scope conflicts
187
+ conflictPromises.push(
188
+ Bash({
189
+ command: \`ccw cli -p "
190
+ PURPOSE: Analyze architecture and scope conflicts across plans
191
+ Success: Clear identification of design approach differences and scope gaps
192
+
193
+ TASK:
194
+ • Identify different architectural approaches in plans
195
+ • Detect scope differences (features included/excluded)
196
+ • Analyze design philosophy conflicts
197
+ • Suggest approach to reconcile different visions
198
+
199
+ MODE: analysis
200
+
201
+ CONTEXT:
202
+ - Plan 1 architecture: \${normalizedPlans[0]?.metadata?.complexity || 'unknown'}
203
+ - Plan 2 architecture: \${normalizedPlans[1]?.metadata?.complexity || 'unknown'}
204
+ - Different design approaches detected: \${JSON.stringify(['approach1', 'approach2'])}
205
+
206
+ EXPECTED:
207
+ - Architecture conflicts identified (approach names and trade-offs)
208
+ - Scope conflicts (features/components in plan A but not B, vice versa)
209
+ - Design philosophy alignment/misalignment
210
+ - Recommendation for unified approach
211
+ - Pros/cons of each architectural approach
212
+
213
+ CONSTRAINTS: Consider both perspectives objectively
214
+ " --tool codex --mode analysis\`,
215
+ run_in_background: true
216
+ })
217
+ )
218
+
219
+ // Agent 3: Analyze risk assessment conflicts
220
+ conflictPromises.push(
221
+ Bash({
222
+ command: \`ccw cli -p "
223
+ PURPOSE: Analyze risk assessment conflicts across plans
224
+ Success: Unified risk assessment with conflict resolution
225
+
226
+ TASK:
227
+ • Identify tasks/areas with significantly different risk ratings
228
+ • Analyze risk assessment reasoning
229
+ • Detect missing risks in some plans
230
+ • Propose unified risk assessment
231
+
232
+ MODE: analysis
233
+
234
+ CONTEXT:
235
+ - Risk areas with disagreement: [list areas]
236
+ - Plan 1 risk ratings: [risk matrix]
237
+ - Plan 2 risk ratings: [risk matrix]
238
+
239
+ EXPECTED:
240
+ - Risk conflicts identified (area, plan A rating, plan B rating)
241
+ - Explanation of why assessments differ
242
+ - Missing risks analysis (important in one plan but not others)
243
+ - Unified risk rating recommendation
244
+ - Confidence level for each assessment
245
+
246
+ CONSTRAINTS: Be realistic in risk assessment, not pessimistic
247
+ " --tool claude --mode analysis\`,
248
+ run_in_background: true
249
+ })
250
+ )
251
+
252
+ // Agent 4: Synthesize conflicts into resolution strategy
253
+ conflictPromises.push(
254
+ Bash({
255
+ command: \`ccw cli -p "
256
+ PURPOSE: Synthesize all conflicts into unified resolution strategy
257
+ Success: Clear path to merge plans with informed trade-off decisions
258
+
259
+ TASK:
260
+ • Analyze all detected conflicts holistically
261
+ • Identify which conflicts are critical vs. non-critical
262
+ • Propose resolution for each conflict type
263
+ • Suggest unified approach that honors valid insights from all plans
264
+
265
+ MODE: analysis
266
+
267
+ CONTEXT:
268
+ - Total conflicts detected: [number]
269
+ - Conflict types: effort, architecture, scope, risk
270
+ - Resolution rule: \${resolutionRule}
271
+ - Plan importance: \${normalizedPlans.map(p => p.metadata.title).join(', ')}
272
+
273
+ EXPECTED:
274
+ - Conflict priority ranking (critical, important, minor)
275
+ - Recommended resolution for each conflict
276
+ - Rationale for each recommendation
277
+ - Potential issues with proposed resolution
278
+ - Fallback options if recommendation not accepted
279
+ - Overall merge strategy and sequencing
280
+
281
+ CONSTRAINTS: Aim for solution that maximizes learning from all perspectives
282
+ " --tool gemini --mode analysis\`,
283
+ run_in_background: true
284
+ })
285
+ )
286
+
287
+ // Wait for all conflict detection agents to complete
288
+ const [effortConflicts, archConflicts, riskConflicts, resolutionStrategy] =
289
+ await Promise.all(conflictPromises)
290
+
291
+ // Parse and consolidate all conflict findings
292
+ const allConflicts = {
293
+ effort: parseEffortConflicts(effortConflicts),
294
+ architecture: parseArchConflicts(archConflicts),
295
+ risk: parseRiskConflicts(riskConflicts),
296
+ strategy: parseResolutionStrategy(resolutionStrategy),
297
+ timestamp: getUtc8ISOString()
298
+ }
299
+
300
+ Write(\`\${sessionFolder}/conflicts.json\`, JSON.stringify(allConflicts, null, 2))
301
+ ```
302
+
303
+ **Conflict Detection Workflow**:
304
+
305
+ | Agent | Conflict Type | Focus | Output |
306
+ |-------|--------------|--------|--------|
307
+ | Gemini | Effort & Tasks | Duplicate detection, estimate variance | Conflicts with variance %, resolution suggestions |
308
+ | Codex | Architecture & Scope | Design approach differences | Design conflicts, scope gaps, recommendations |
309
+ | Claude | Risk Assessment | Risk rating disagreements | Risk conflicts, missing risks, unified assessment |
310
+ | Gemini | Resolution Strategy | Holistic synthesis | Priority ranking, resolution path, trade-offs |
311
+
312
+ ### Phase 4: Resolve Conflicts
313
+
314
+ **Rule: Consensus (default)**
315
+ - Use median/average of conflicting estimates
316
+ - Merge scope differences
317
+ - Document minority viewpoints
318
+
319
+ **Rule: Priority**
320
+ - First plan has highest authority
321
+ - Later plans supplement but don't override
322
+
323
+ **Rule: Hierarchy**
324
+ - User ranks plan importance
325
+ - Higher-ranked plan wins conflicts
326
+
327
+ ```javascript
328
+ const resolutions = {}
329
+
330
+ if (rule === 'consensus') {
331
+ for (const conflict of conflicts.effort) {
332
+ resolutions[conflict.task] = {
333
+ resolved: calculateMedian(conflict.estimates),
334
+ method: 'consensus-median',
335
+ rationale: 'Used median of all estimates'
336
+ }
337
+ }
338
+ } else if (rule === 'priority') {
339
+ for (const conflict of conflicts.effort) {
340
+ const primary = conflict.estimates[0] // First plan
341
+ resolutions[conflict.task] = {
342
+ resolved: primary.value,
343
+ method: 'priority-based',
344
+ rationale: `Selected from plan ${primary.from_plan} (highest priority)`
345
+ }
346
+ }
347
+ } else if (rule === 'hierarchy') {
348
+ // Request user ranking if not --auto
349
+ const ranking = getUserPlanRanking(normalizedPlans)
350
+ // Apply hierarchy-based resolution
351
+ }
352
+
353
+ Write(`${sessionFolder}/resolutions.json`, JSON.stringify(resolutions, null, 2))
354
+ ```
355
+
356
+ ### Phase 5: Generate Unified Plan
357
+
358
+ ```javascript
359
+ const unifiedPlan = {
360
+ session_id: sessionId,
361
+ merge_timestamp: getUtc8ISOString(),
362
+
363
+ summary: {
364
+ total_source_plans: sourcePlans.length,
365
+ original_tasks: allTasks.length,
366
+ merged_tasks: deduplicatedTasks.length,
367
+ conflicts_resolved: Object.keys(resolutions).length,
368
+ resolution_rule: rule
369
+ },
370
+
371
+ tasks: deduplicatedTasks.map(task => ({
372
+ id: task.id,
373
+ title: task.title,
374
+ description: task.description,
375
+ effort: task.resolved_effort,
376
+ risk: task.resolved_risk,
377
+ dependencies: task.merged_dependencies,
378
+ source_plans: task.contributing_plans
379
+ })),
380
+
381
+ execution_sequence: topologicalSort(tasks),
382
+ critical_path: identifyCriticalPath(tasks),
383
+
384
+ risks: aggregateRisks(tasks),
385
+ success_criteria: aggregateCriteria(tasks)
386
+ }
387
+
388
+ Write(`${sessionFolder}/unified-plan.json`, JSON.stringify(unifiedPlan, null, 2))
389
+ ```
390
+
391
+ ### Phase 6: Generate Human-Readable Plan
392
+
393
+ ```markdown
394
+ # Merged Planning Session
395
+
396
+ **Session ID**: ${sessionId}
397
+ **Pattern**: $PATTERN
398
+ **Created**: ${timestamp}
399
+
400
+ ---
401
+
402
+ ## Merge Summary
403
+
404
+ **Source Plans**: ${summary.total_source_plans}
405
+ **Original Tasks**: ${summary.original_tasks}
406
+ **Merged Tasks**: ${summary.merged_tasks}
407
+ **Conflicts Resolved**: ${summary.conflicts_resolved}
408
+ **Resolution Method**: ${summary.resolution_rule}
409
+
410
+ ---
411
+
412
+ ## Unified Task List
413
+
414
+ ${tasks.map((task, i) => `
415
+ ${i+1}. **${task.id}: ${task.title}**
416
+ - Effort: ${task.effort}
417
+ - Risk: ${task.risk}
418
+ - From plans: ${task.source_plans.join(', ')}
419
+ `).join('\n')}
420
+
421
+ ---
422
+
423
+ ## Execution Sequence
424
+
425
+ **Critical Path**: ${critical_path.join(' → ')}
426
+
427
+ ---
428
+
429
+ ## Conflict Resolution Report
430
+
431
+ ${Object.entries(resolutions).map(([key, res]) => `
432
+ - **${key}**: ${res.rationale}
433
+ `).join('\n')}
434
+
435
+ ---
436
+
437
+ ## Next Steps
438
+
439
+ **Execute**:
440
+ \`\`\`
441
+ /workflow:unified-execute-with-file -p ${sessionFolder}/unified-plan.json
442
+ \`\`\`
443
+ ```
444
+
445
+ ## Session Folder Structure
446
+
447
+ ```
448
+ .workflow/.merged/{sessionId}/
449
+ ├── merge.md # Process log
450
+ ├── source-index.json # All input sources
451
+ ├── conflicts.json # Detected conflicts
452
+ ├── resolutions.json # How resolved
453
+ ├── unified-plan.json # Merged plan (for execution)
454
+ └── unified-plan.md # Human-readable
455
+ ```
456
+
457
+ ## Resolution Rules Comparison
458
+
459
+ | Rule | Method | Best For | Tradeoff |
460
+ |------|--------|----------|----------|
461
+ | **Consensus** | Median/average | Similar-quality inputs | May miss extremes |
462
+ | **Priority** | First wins | Clear authority order | Discards alternatives |
463
+ | **Hierarchy** | User-ranked | Mixed stakeholders | Needs user input |
464
+
465
+ ## Input Format Support
466
+
467
+ | Source Type | Detection Pattern | Parsing |
468
+ |-------------|-------------------|---------|
469
+ | Brainstorm | `.brainstorm/*/synthesis.json` | Top ideas → tasks |
470
+ | Analysis | `.analysis/*/conclusions.json` | Recommendations → tasks |
471
+ | Quick-Plan | `.planning/*/synthesis.json` | Direct task list |
472
+ | IMPL_PLAN | `*IMPL_PLAN.md` | Markdown → tasks |
473
+ | Task JSON | `*.json` with `tasks` | Direct mapping |
474
+
475
+ ## Error Handling
476
+
477
+ | Situation | Action |
478
+ |-----------|--------|
479
+ | No plans found | List available plans, suggest search terms |
480
+ | Incompatible format | Skip, continue with others |
481
+ | Circular dependencies | Alert user, suggest manual review |
482
+ | Unresolvable conflict | Require user decision (unless --auto) |
483
+
484
+ ## Integration Flow
485
+
486
+ ```
487
+ Brainstorm Sessions / Analyses / Plans
488
+
489
+ ├─ synthesis.json (session 1)
490
+ ├─ conclusions.json (session 2)
491
+ ├─ synthesis.json (session 3)
492
+
493
+
494
+ merge-plans-with-file
495
+
496
+ ├─ unified-plan.json
497
+
498
+
499
+ unified-execute-with-file
500
+
501
+
502
+ Implementation
503
+ ```
504
+
505
+ ## Usage Patterns
506
+
507
+ **Pattern 1: Merge all auth-related plans**
508
+ ```
509
+ PATTERN="authentication" --rule=consensus --auto
510
+ → Finds all auth plans
511
+ → Merges with consensus method
512
+ ```
513
+
514
+ **Pattern 2: Prioritized merge**
515
+ ```
516
+ PATTERN="payment" --rule=priority
517
+ → First plan has authority
518
+ → Others supplement
519
+ ```
520
+
521
+ **Pattern 3: Team input merge**
522
+ ```
523
+ PATTERN="feature-*" --rule=hierarchy
524
+ → Asks for plan ranking
525
+ → Applies hierarchy resolution
526
+ ```
527
+
528
+ ---
529
+
530
+ **Now execute merge-plans-with-file for pattern**: $PATTERN