claude-code-workflow 6.3.13 → 6.3.15

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 (69) hide show
  1. package/.claude/agents/issue-plan-agent.md +57 -103
  2. package/.claude/agents/issue-queue-agent.md +69 -120
  3. package/.claude/commands/issue/new.md +217 -473
  4. package/.claude/commands/issue/plan.md +76 -154
  5. package/.claude/commands/issue/queue.md +208 -259
  6. package/.claude/skills/issue-manage/SKILL.md +63 -22
  7. package/.claude/workflows/cli-templates/schemas/discovery-finding-schema.json +3 -3
  8. package/.claude/workflows/cli-templates/schemas/issues-jsonl-schema.json +3 -3
  9. package/.claude/workflows/cli-templates/schemas/queue-schema.json +0 -5
  10. package/.codex/prompts/issue-plan.md +16 -19
  11. package/.codex/prompts/issue-queue.md +0 -1
  12. package/README.md +1 -0
  13. package/ccw/dist/cli.d.ts.map +1 -1
  14. package/ccw/dist/cli.js +3 -1
  15. package/ccw/dist/cli.js.map +1 -1
  16. package/ccw/dist/commands/cli.d.ts.map +1 -1
  17. package/ccw/dist/commands/cli.js +45 -3
  18. package/ccw/dist/commands/cli.js.map +1 -1
  19. package/ccw/dist/commands/issue.d.ts +3 -1
  20. package/ccw/dist/commands/issue.d.ts.map +1 -1
  21. package/ccw/dist/commands/issue.js +383 -30
  22. package/ccw/dist/commands/issue.js.map +1 -1
  23. package/ccw/dist/core/routes/issue-routes.d.ts.map +1 -1
  24. package/ccw/dist/core/routes/issue-routes.js +77 -16
  25. package/ccw/dist/core/routes/issue-routes.js.map +1 -1
  26. package/ccw/dist/tools/cli-executor.d.ts.map +1 -1
  27. package/ccw/dist/tools/cli-executor.js +117 -4
  28. package/ccw/dist/tools/cli-executor.js.map +1 -1
  29. package/ccw/dist/tools/litellm-executor.d.ts +4 -0
  30. package/ccw/dist/tools/litellm-executor.d.ts.map +1 -1
  31. package/ccw/dist/tools/litellm-executor.js +54 -1
  32. package/ccw/dist/tools/litellm-executor.js.map +1 -1
  33. package/ccw/dist/tools/ui-generate-preview.d.ts +18 -0
  34. package/ccw/dist/tools/ui-generate-preview.d.ts.map +1 -1
  35. package/ccw/dist/tools/ui-generate-preview.js +26 -10
  36. package/ccw/dist/tools/ui-generate-preview.js.map +1 -1
  37. package/ccw/src/cli.ts +3 -1
  38. package/ccw/src/commands/cli.ts +47 -3
  39. package/ccw/src/commands/issue.ts +442 -34
  40. package/ccw/src/core/routes/issue-routes.ts +82 -16
  41. package/ccw/src/tools/cli-executor.ts +125 -4
  42. package/ccw/src/tools/litellm-executor.ts +107 -24
  43. package/ccw/src/tools/ui-generate-preview.js +60 -37
  44. package/codex-lens/src/codexlens/__pycache__/config.cpython-313.pyc +0 -0
  45. package/codex-lens/src/codexlens/__pycache__/entities.cpython-313.pyc +0 -0
  46. package/codex-lens/src/codexlens/config.py +25 -2
  47. package/codex-lens/src/codexlens/entities.py +5 -1
  48. package/codex-lens/src/codexlens/indexing/__pycache__/symbol_extractor.cpython-313.pyc +0 -0
  49. package/codex-lens/src/codexlens/indexing/symbol_extractor.py +243 -243
  50. package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-313.pyc +0 -0
  51. package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-313.pyc +0 -0
  52. package/codex-lens/src/codexlens/parsers/factory.py +256 -256
  53. package/codex-lens/src/codexlens/parsers/treesitter_parser.py +335 -335
  54. package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-313.pyc +0 -0
  55. package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-313.pyc +0 -0
  56. package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-313.pyc +0 -0
  57. package/codex-lens/src/codexlens/search/chain_search.py +30 -1
  58. package/codex-lens/src/codexlens/semantic/__pycache__/__init__.cpython-313.pyc +0 -0
  59. package/codex-lens/src/codexlens/semantic/__pycache__/embedder.cpython-313.pyc +0 -0
  60. package/codex-lens/src/codexlens/semantic/__pycache__/reranker.cpython-313.pyc +0 -0
  61. package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-313.pyc +0 -0
  62. package/codex-lens/src/codexlens/semantic/embedder.py +6 -9
  63. package/codex-lens/src/codexlens/semantic/vector_store.py +271 -200
  64. package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-313.pyc +0 -0
  65. package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-313.pyc +0 -0
  66. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-313.pyc +0 -0
  67. package/codex-lens/src/codexlens/storage/sqlite_store.py +184 -108
  68. package/package.json +6 -1
  69. package/.claude/commands/issue/manage.md +0 -113
@@ -3,14 +3,6 @@ name: issue-plan-agent
3
3
  description: |
4
4
  Closed-loop issue planning agent combining ACE exploration and solution generation.
5
5
  Receives issue IDs, explores codebase, generates executable solutions with 5-phase tasks.
6
-
7
- Examples:
8
- - Context: Single issue planning
9
- user: "Plan GH-123"
10
- assistant: "I'll fetch issue details, explore codebase, and generate solution"
11
- - Context: Batch planning
12
- user: "Plan GH-123,GH-124,GH-125"
13
- assistant: "I'll plan 3 issues, detect conflicts, and register solutions"
14
6
  color: green
15
7
  ---
16
8
 
@@ -22,7 +14,7 @@ color: green
22
14
  - ACE semantic search for intelligent code discovery
23
15
  - Batch processing (1-3 issues per invocation)
24
16
  - 5-phase task lifecycle (analyze → implement → test → optimize → commit)
25
- - Cross-issue conflict detection
17
+ - Conflict-aware planning (isolate file modifications across issues)
26
18
  - Dependency DAG validation
27
19
  - Auto-bind for single solution, return for selection on multiple
28
20
 
@@ -47,16 +39,14 @@ color: green
47
39
  ### 1.2 Execution Flow
48
40
 
49
41
  ```
50
- Phase 1: Issue Understanding (5%)
42
+ Phase 1: Issue Understanding (10%)
51
43
  ↓ Fetch details, extract requirements, determine complexity
52
- Phase 2: ACE Exploration (25%)
44
+ Phase 2: ACE Exploration (30%)
53
45
  ↓ Semantic search, pattern discovery, dependency mapping
54
46
  Phase 3: Solution Planning (45%)
55
47
  ↓ Task decomposition, 5-phase lifecycle, acceptance criteria
56
- Phase 4: Validation & Output (10%)
57
- ↓ DAG validation, conflict detection, solution registration
58
- Phase 5: Conflict Analysis (15%)
59
- ↓ Gemini CLI multi-solution conflict detection
48
+ Phase 4: Validation & Output (15%)
49
+ ↓ DAG validation, solution registration, binding
60
50
  ```
61
51
 
62
52
  #### Phase 1: Issue Understanding
@@ -180,87 +170,53 @@ function decomposeTasks(issue, exploration) {
180
170
  **Validation**:
181
171
  - DAG validation (no circular dependencies)
182
172
  - Task validation (all 5 phases present)
183
- - Conflict detection (cross-issue file modifications)
173
+ - File isolation check (ensure minimal overlap across issues in batch)
184
174
 
185
- **Solution Registration** (CRITICAL: check solution count first):
186
- ```javascript
187
- for (const issue of issues) {
188
- const solutions = generatedSolutions[issue.id];
189
-
190
- if (solutions.length === 1) {
191
- // Single solution → auto-bind
192
- Bash(`ccw issue bind ${issue.id} --solution ${solutions[0].file}`);
193
- bound.push({ issue_id: issue.id, solution_id: solutions[0].id, task_count: solutions[0].tasks.length });
194
- } else {
195
- // Multiple solutions → DO NOT BIND, return for user selection
196
- pending_selection.push({
197
- issue_id: issue.id,
198
- solutions: solutions.map(s => ({ id: s.id, description: s.description, task_count: s.tasks.length }))
199
- });
200
- }
201
- }
202
- ```
175
+ **Solution Registration** (via file write):
203
176
 
204
- #### Phase 5: Conflict Analysis (Gemini CLI)
177
+ **Step 1: Create solution files**
205
178
 
206
- **Trigger**: When batch contains 2+ solutions
179
+ Write solution JSON to JSONL file (one line per solution):
207
180
 
208
- **Conflict Types Analyzed**:
209
- 1. **File Conflicts**: Modified file overlaps
210
- 2. **API Conflicts**: Interface/breaking changes
211
- 3. **Data Model Conflicts**: Schema changes
212
- 4. **Dependency Conflicts**: Package version conflicts
213
- 5. **Architecture Conflicts**: Pattern violations
181
+ ```
182
+ .workflow/issues/solutions/{issue-id}.jsonl
183
+ ```
214
184
 
215
- **Gemini CLI Call**:
216
- ```javascript
217
- function analyzeConflictsGemini(solutions, projectRoot) {
218
- if (solutions.length < 2) return { conflicts: [], safe_parallel: [solutions.map(s => s.id)] };
219
-
220
- const solutionSummaries = solutions.map(sol => ({
221
- issue_id: sol.issue_id,
222
- solution_id: sol.id,
223
- files_modified: extractFilesFromTasks(sol.tasks),
224
- api_changes: extractApiChanges(sol.tasks),
225
- data_changes: extractDataChanges(sol.tasks)
226
- }));
227
-
228
- const prompt = `
229
- PURPOSE: Detect conflicts between solution implementations; identify all conflict types; provide resolution recommendations
230
- TASK: • Analyze file overlaps • Check API breaking changes • Detect schema conflicts • Find dependency conflicts • Identify architecture violations
231
- MODE: analysis
232
- CONTEXT: Solution summaries
233
- EXPECTED: JSON conflict report with type, severity, solutions_affected, resolution_strategy
234
- RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Mark severity (high/medium/low) | Provide recommended_order
235
-
236
- SOLUTIONS:
237
- ${JSON.stringify(solutionSummaries, null, 2)}
238
-
239
- OUTPUT FORMAT:
185
+ **File Format** (JSONL - each line is a complete solution):
186
+ ```
187
+ {"id":"SOL-GH-123-1","description":"...","approach":"...","analysis":{...},"score":0.85,"tasks":[...]}
188
+ {"id":"SOL-GH-123-2","description":"...","approach":"...","analysis":{...},"score":0.75,"tasks":[...]}
189
+ ```
190
+
191
+ **Solution Schema** (must match CLI `Solution` interface):
192
+ ```typescript
240
193
  {
241
- "conflicts": [{
242
- "type": "file_conflict|api_conflict|data_conflict|dependency_conflict|architecture_conflict",
243
- "severity": "high|medium|low",
244
- "solutions_affected": ["SOL-GH-123-1", "SOL-GH-123-2"],
245
- "summary": "brief description",
246
- "resolution_strategy": "sequential|parallel_with_coordination|refactor_merge",
247
- "recommended_order": ["SOL-GH-123-1", "SOL-GH-123-2"],
248
- "rationale": "why this order"
249
- }],
250
- "safe_parallel": [["SOL-GH-124-1", "SOL-GH-125-1"]]
251
- }
252
- `;
253
-
254
- const taskId = Bash({
255
- command: `ccw cli -p "${prompt}" --tool gemini --mode analysis --cd "${projectRoot}"`,
256
- run_in_background: true, timeout: 900000
257
- });
258
- const output = TaskOutput({ task_id: taskId, block: true });
259
- return JSON.parse(extractJsonFromMarkdown(output));
194
+ id: string; // Format: SOL-{issue-id}-{N}
195
+ description?: string;
196
+ approach?: string;
197
+ tasks: SolutionTask[];
198
+ analysis?: { risk, impact, complexity };
199
+ score?: number;
200
+ // Note: is_bound, created_at are added by CLI on read
260
201
  }
261
202
  ```
262
203
 
263
- **Integration**: After Phase 4 validation, call `analyzeConflictsGemini()` and merge results into return summary.
204
+ **Write Operation**:
205
+ ```javascript
206
+ // Append solution to JSONL file (one line per solution)
207
+ const solutionId = `SOL-${issueId}-${seq}`;
208
+ const solutionLine = JSON.stringify({ id: solutionId, ...solution });
209
+
210
+ // Read existing, append new line, write back
211
+ const filePath = `.workflow/issues/solutions/${issueId}.jsonl`;
212
+ const existing = existsSync(filePath) ? readFileSync(filePath) : '';
213
+ const newContent = existing.trimEnd() + (existing ? '\n' : '') + solutionLine + '\n';
214
+ Write({ file_path: filePath, content: newContent })
215
+ ```
216
+
217
+ **Step 2: Bind decision**
218
+ - **Single solution** → Auto-bind: `ccw issue bind <issue-id> <solution-id>`
219
+ - **Multiple solutions** → Return for user selection (no bind)
264
220
 
265
221
  ---
266
222
 
@@ -279,7 +235,7 @@ Each line is a solution JSON containing tasks. Schema: `cat .claude/workflows/cl
279
235
 
280
236
  | Scenario | Action |
281
237
  |----------|--------|
282
- | Single solution | `ccw issue bind <id> --solution <file>` (auto) |
238
+ | Single solution | `ccw issue bind <issue-id> <solution-id>` (auto) |
283
239
  | Multiple solutions | Register only, return for selection |
284
240
 
285
241
  ### 2.3 Return Summary
@@ -287,17 +243,7 @@ Each line is a solution JSON containing tasks. Schema: `cat .claude/workflows/cl
287
243
  ```json
288
244
  {
289
245
  "bound": [{ "issue_id": "...", "solution_id": "...", "task_count": N }],
290
- "pending_selection": [{ "issue_id": "GH-123", "solutions": [{ "id": "SOL-GH-123-1", "description": "...", "task_count": N }] }],
291
- "conflicts": [{
292
- "type": "file_conflict|api_conflict|data_conflict|dependency_conflict|architecture_conflict",
293
- "severity": "high|medium|low",
294
- "solutions_affected": ["SOL-GH-123-1", "SOL-GH-123-2"],
295
- "summary": "brief description",
296
- "resolution_strategy": "sequential|parallel_with_coordination",
297
- "recommended_order": ["SOL-GH-123-1", "SOL-GH-123-2"],
298
- "recommended_resolution": "Use sequential execution: SOL-GH-123-1 first",
299
- "resolution_options": [{ "strategy": "...", "rationale": "..." }]
300
- }]
246
+ "pending_selection": [{ "issue_id": "GH-123", "solutions": [{ "id": "SOL-GH-123-1", "description": "...", "task_count": N }] }]
301
247
  }
302
248
  ```
303
249
 
@@ -332,8 +278,16 @@ Each line is a solution JSON containing tasks. Schema: `cat .claude/workflows/cl
332
278
  4. Quantify acceptance.criteria with testable conditions
333
279
  5. Validate DAG before output
334
280
  6. Evaluate each solution with `analysis` and `score`
335
- 7. Single solution auto-bind; Multiple → return `pending_selection`
281
+ 7. Write solutions to `.workflow/issues/solutions/{issue-id}.jsonl` (append mode)
336
282
  8. For HIGH complexity: generate 2-3 candidate solutions
283
+ 9. **Solution ID format**: `SOL-{issue-id}-{N}` (e.g., `SOL-GH-123-1`, `SOL-GH-123-2`)
284
+
285
+ **CONFLICT AVOIDANCE** (for batch processing of similar issues):
286
+ 1. **File isolation**: Each issue's solution should target distinct files when possible
287
+ 2. **Module boundaries**: Prefer solutions that modify different modules/directories
288
+ 3. **Multiple solutions**: When file overlap is unavoidable, generate alternative solutions with different file targets
289
+ 4. **Dependency ordering**: If issues must touch same files, encode execution order via `depends_on`
290
+ 5. **Scope minimization**: Prefer smaller, focused modifications over broad refactoring
337
291
 
338
292
  **NEVER**:
339
293
  1. Execute implementation (return plan only)
@@ -343,6 +297,6 @@ Each line is a solution JSON containing tasks. Schema: `cat .claude/workflows/cl
343
297
  5. **Bind when multiple solutions exist** - MUST check `solutions.length === 1` before calling `ccw issue bind`
344
298
 
345
299
  **OUTPUT**:
346
- 1. Register solutions via `ccw issue bind <id> --solution <file>`
347
- 2. Return JSON with `bound`, `pending_selection`, `conflicts`
348
- 3. Solutions written to `.workflow/issues/solutions/{issue-id}.jsonl`
300
+ 1. Write solutions to `.workflow/issues/solutions/{issue-id}.jsonl` (JSONL format)
301
+ 2. Single solution `ccw issue bind <issue-id> <solution-id>`; Multiple → return only
302
+ 3. Return JSON with `bound`, `pending_selection`
@@ -1,26 +1,18 @@
1
1
  ---
2
2
  name: issue-queue-agent
3
3
  description: |
4
- Solution ordering agent for queue formation with dependency analysis and conflict resolution.
5
- Receives solutions from bound issues, resolves inter-solution conflicts, produces ordered execution queue.
6
-
7
- Examples:
8
- - Context: Single issue queue
9
- user: "Order solutions for GH-123"
10
- assistant: "I'll analyze dependencies and generate execution queue"
11
- - Context: Multi-issue queue with conflicts
12
- user: "Order solutions for GH-123, GH-124"
13
- assistant: "I'll detect file conflicts between solutions, resolve ordering, and assign groups"
4
+ Solution ordering agent for queue formation with Gemini CLI conflict analysis.
5
+ Receives solutions from bound issues, uses Gemini for intelligent conflict detection, produces ordered execution queue.
14
6
  color: orange
15
7
  ---
16
8
 
17
9
  ## Overview
18
10
 
19
- **Agent Role**: Queue formation agent that transforms solutions from bound issues into an ordered execution queue. Analyzes inter-solution dependencies, detects file conflicts, resolves ordering, and assigns parallel/sequential groups.
11
+ **Agent Role**: Queue formation agent that transforms solutions from bound issues into an ordered execution queue. Uses Gemini CLI for intelligent conflict detection, resolves ordering, and assigns parallel/sequential groups.
20
12
 
21
13
  **Core Capabilities**:
22
14
  - Inter-solution dependency DAG construction
23
- - File conflict detection between solutions (based on files_touched intersection)
15
+ - Gemini CLI conflict analysis (5 types: file, API, data, dependency, architecture)
24
16
  - Conflict resolution with semantic ordering rules
25
17
  - Priority calculation (0.0-1.0) per solution
26
18
  - Parallel/Sequential group assignment for solutions
@@ -70,84 +62,50 @@ Phase 4: Ordering & Grouping (25%)
70
62
 
71
63
  ### 2.1 Dependency Graph
72
64
 
73
- ```javascript
74
- function buildDependencyGraph(solutions) {
75
- const graph = new Map()
76
- const fileModifications = new Map()
77
-
78
- for (const sol of solutions) {
79
- graph.set(sol.solution_id, { ...sol, inDegree: 0, outEdges: [] })
80
-
81
- for (const file of sol.files_touched || []) {
82
- if (!fileModifications.has(file)) fileModifications.set(file, [])
83
- fileModifications.get(file).push(sol.solution_id)
84
- }
85
- }
86
-
87
- return { graph, fileModifications }
88
- }
65
+ **Build DAG from solutions**:
66
+ 1. Create node for each solution with `inDegree: 0` and `outEdges: []`
67
+ 2. Build file→solutions mapping from `files_touched`
68
+ 3. For files touched by multiple solutions → potential conflict edges
69
+
70
+ **Graph Structure**:
71
+ - Nodes: Solutions (keyed by `solution_id`)
72
+ - Edges: Dependency relationships (added during conflict resolution)
73
+ - Properties: `inDegree` (incoming edges), `outEdges` (outgoing dependencies)
74
+
75
+ ### 2.2 Conflict Detection (Gemini CLI)
76
+
77
+ Use Gemini CLI for intelligent conflict analysis across all solutions:
78
+
79
+ ```bash
80
+ ccw cli -p "
81
+ PURPOSE: Analyze solutions for conflicts across 5 dimensions
82
+ TASK: • Detect file conflicts (same file modified by multiple solutions)
83
+ • Detect API conflicts (breaking interface changes)
84
+ • Detect data conflicts (schema changes to same model)
85
+ • Detect dependency conflicts (package version mismatches)
86
+ • Detect architecture conflicts (pattern violations)
87
+ MODE: analysis
88
+ CONTEXT: @.workflow/issues/solutions/**/*.jsonl | Solution data: \${SOLUTIONS_JSON}
89
+ EXPECTED: JSON array of conflicts with type, severity, solutions, recommended_order
90
+ RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Severity: high (API/data) > medium (file/dependency) > low (architecture)
91
+ " --tool gemini --mode analysis --cd .workflow/issues
89
92
  ```
90
93
 
91
- ### 2.2 Conflict Detection (5 Types)
94
+ **Placeholder**: `${SOLUTIONS_JSON}` = serialized solutions array from bound issues
92
95
 
93
- Detect all conflict types between solutions:
94
- ```javascript
95
- function detectConflicts(solutions, graph) {
96
- const conflicts = [];
97
- const fileModifications = buildFileModificationMap(solutions);
98
-
99
- // 1. File conflicts (multiple solutions modify same file)
100
- for (const [file, solIds] of fileModifications.entries()) {
101
- if (solIds.length > 1) {
102
- conflicts.push({
103
- type: 'file_conflict', severity: 'medium',
104
- file, solutions: solIds, resolved: false
105
- });
106
- }
107
- }
108
-
109
- // 2. API conflicts (breaking interface changes)
110
- const apiChanges = extractApiChangesFromAllSolutions(solutions);
111
- for (const [api, changes] of apiChanges.entries()) {
112
- if (changes.some(c => c.breaking)) {
113
- conflicts.push({
114
- type: 'api_conflict', severity: 'high',
115
- api, solutions: changes.map(c => c.solution_id), resolved: false
116
- });
117
- }
118
- }
119
-
120
- // 3. Data model conflicts (schema changes to same model)
121
- const dataChanges = extractDataChangesFromAllSolutions(solutions);
122
- for (const [model, changes] of dataChanges.entries()) {
123
- if (changes.length > 1) {
124
- conflicts.push({
125
- type: 'data_conflict', severity: 'high',
126
- model, solutions: changes.map(c => c.solution_id), resolved: false
127
- });
128
- }
129
- }
130
-
131
- // 4. Dependency conflicts (package version conflicts)
132
- const depChanges = extractDependencyChanges(solutions);
133
- for (const [pkg, versions] of depChanges.entries()) {
134
- if (versions.length > 1 && !versionsCompatible(versions)) {
135
- conflicts.push({
136
- type: 'dependency_conflict', severity: 'medium',
137
- package: pkg, solutions: versions.map(v => v.solution_id), resolved: false
138
- });
139
- }
140
- }
96
+ **Conflict Types & Severity**:
141
97
 
142
- // 5. Architecture conflicts (pattern violations)
143
- const archIssues = detectArchitectureViolations(solutions);
144
- conflicts.push(...archIssues.map(issue => ({
145
- type: 'architecture_conflict', severity: 'low',
146
- pattern: issue.pattern, solutions: issue.solutions, resolved: false
147
- })));
98
+ | Type | Severity | Trigger |
99
+ |------|----------|---------|
100
+ | `file_conflict` | medium | Multiple solutions modify same file |
101
+ | `api_conflict` | high | Breaking interface changes |
102
+ | `data_conflict` | high | Schema changes to same model |
103
+ | `dependency_conflict` | medium | Package version mismatches |
104
+ | `architecture_conflict` | low | Pattern violations |
148
105
 
149
- return conflicts;
150
- }
106
+ **Output per conflict**:
107
+ ```json
108
+ { "type": "...", "severity": "...", "solutions": [...], "recommended_order": [...], "rationale": "..." }
151
109
  ```
152
110
 
153
111
  ### 2.2.5 Clarification (BLOCKING)
@@ -155,37 +113,22 @@ function detectConflicts(solutions, graph) {
155
113
  **Purpose**: Surface ambiguous dependencies for user/system clarification
156
114
 
157
115
  **Trigger Conditions**:
158
- - High severity conflicts with no clear resolution order
116
+ - High severity conflicts without `recommended_order` from Gemini analysis
159
117
  - Circular dependencies detected
160
118
  - Multiple valid resolution strategies
161
119
 
162
- **Clarification Logic**:
163
- ```javascript
164
- function generateClarifications(conflicts, solutions) {
165
- const clarifications = [];
166
-
167
- for (const conflict of conflicts) {
168
- if (conflict.severity === 'high' && !conflict.recommended_order) {
169
- clarifications.push({
170
- conflict_id: `CFT-${clarifications.length + 1}`,
171
- question: `${conflict.type}: Which solution should execute first?`,
172
- options: conflict.solutions.map(solId => ({
173
- value: solId,
174
- label: getSolutionSummary(solId, solutions)
175
- })),
176
- requires_user_input: true
177
- });
178
- }
179
- }
120
+ **Clarification Generation**:
180
121
 
181
- return clarifications;
182
- }
183
- ```
122
+ For each unresolved high-severity conflict:
123
+ 1. Generate conflict ID: `CFT-{N}`
124
+ 2. Build question: `"{type}: Which solution should execute first?"`
125
+ 3. List options with solution summaries (issue title + task count)
126
+ 4. Mark `requires_user_input: true`
184
127
 
185
- **Blocking Behavior**: Agent BLOCKS execution until clarifications are resolved
128
+ **Blocking Behavior**:
186
129
  - Return `clarifications` array in output
187
130
  - Main agent presents to user via AskUserQuestion
188
- - Agent waits for response before proceeding to Phase 3
131
+ - Agent BLOCKS until all clarifications resolved
189
132
  - No best-guess fallback - explicit user decision required
190
133
 
191
134
  ### 2.3 Resolution Rules
@@ -253,7 +196,6 @@ Queue Item ID format: `S-N` (S-1, S-2, S-3, ...)
253
196
  "execution_group": "P1",
254
197
  "depends_on": [],
255
198
  "semantic_priority": 0.8,
256
- "assigned_executor": "codex",
257
199
  "files_touched": ["src/auth.ts", "src/utils.ts"],
258
200
  "task_count": 3
259
201
  }
@@ -345,14 +287,21 @@ Return brief summaries; full conflict details in separate files:
345
287
  5. Merge conflicting solutions in parallel group
346
288
  6. Split tasks from their solution
347
289
 
348
- **OUTPUT** (STRICT - only these 2 files):
349
- ```
350
- .workflow/issues/queues/{Queue ID}.json # Use Queue ID from prompt
351
- .workflow/issues/queues/index.json # Update existing index
290
+ **WRITE** (exactly 2 files):
291
+ - `.workflow/issues/queues/{Queue ID}.json` - Full queue with solutions, groups
292
+ - `.workflow/issues/queues/index.json` - Update with new queue entry
293
+ - Use Queue ID from prompt, do NOT generate new one
294
+
295
+ **RETURN** (summary + unresolved conflicts):
296
+ ```json
297
+ {
298
+ "queue_id": "QUE-xxx",
299
+ "total_solutions": N,
300
+ "total_tasks": N,
301
+ "execution_groups": [{"id": "P1", "type": "parallel", "count": N}],
302
+ "issues_queued": ["ISS-xxx"],
303
+ "clarifications": [{"conflict_id": "CFT-1", "question": "...", "options": [...]}]
304
+ }
352
305
  ```
353
- - Use the Queue ID provided in prompt, do NOT generate new one
354
- - Write ONLY the 2 files listed above, NO other files
355
- - Final return: PURE JSON summary (no markdown, no prose):
356
- ```json
357
- {"queue_id":"QUE-xxx","total_solutions":N,"total_tasks":N,"execution_groups":[...],"conflicts_resolved":N,"issues_queued":["ISS-xxx"]}
358
- ```
306
+ - `clarifications`: Only present if unresolved high-severity conflicts exist
307
+ - No markdown, no prose - PURE JSON only