claude-code-workflow 6.3.12 → 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 (72) hide show
  1. package/.claude/agents/issue-plan-agent.md +62 -36
  2. package/.claude/agents/issue-queue-agent.md +110 -57
  3. package/.claude/commands/issue/execute.md +53 -40
  4. package/.claude/commands/issue/new.md +226 -380
  5. package/.claude/commands/issue/plan.md +122 -125
  6. package/.claude/commands/issue/queue.md +198 -321
  7. package/.claude/skills/issue-manage/SKILL.md +63 -22
  8. package/.claude/workflows/cli-templates/schemas/discovery-finding-schema.json +3 -3
  9. package/.claude/workflows/cli-templates/schemas/issues-jsonl-schema.json +141 -168
  10. package/.claude/workflows/cli-templates/schemas/queue-schema.json +0 -5
  11. package/.claude/workflows/cli-templates/schemas/solution-schema.json +3 -2
  12. package/.codex/prompts/issue-execute.md +3 -3
  13. package/.codex/prompts/issue-plan.md +16 -19
  14. package/.codex/prompts/issue-queue.md +3 -4
  15. package/README.md +1 -0
  16. package/ccw/dist/cli.d.ts.map +1 -1
  17. package/ccw/dist/cli.js +3 -1
  18. package/ccw/dist/cli.js.map +1 -1
  19. package/ccw/dist/commands/cli.d.ts.map +1 -1
  20. package/ccw/dist/commands/cli.js +45 -3
  21. package/ccw/dist/commands/cli.js.map +1 -1
  22. package/ccw/dist/commands/issue.d.ts +3 -1
  23. package/ccw/dist/commands/issue.d.ts.map +1 -1
  24. package/ccw/dist/commands/issue.js +383 -30
  25. package/ccw/dist/commands/issue.js.map +1 -1
  26. package/ccw/dist/core/routes/issue-routes.d.ts.map +1 -1
  27. package/ccw/dist/core/routes/issue-routes.js +77 -16
  28. package/ccw/dist/core/routes/issue-routes.js.map +1 -1
  29. package/ccw/dist/tools/cli-executor.d.ts.map +1 -1
  30. package/ccw/dist/tools/cli-executor.js +117 -4
  31. package/ccw/dist/tools/cli-executor.js.map +1 -1
  32. package/ccw/dist/tools/litellm-executor.d.ts +4 -0
  33. package/ccw/dist/tools/litellm-executor.d.ts.map +1 -1
  34. package/ccw/dist/tools/litellm-executor.js +54 -1
  35. package/ccw/dist/tools/litellm-executor.js.map +1 -1
  36. package/ccw/dist/tools/ui-generate-preview.d.ts +18 -0
  37. package/ccw/dist/tools/ui-generate-preview.d.ts.map +1 -1
  38. package/ccw/dist/tools/ui-generate-preview.js +26 -10
  39. package/ccw/dist/tools/ui-generate-preview.js.map +1 -1
  40. package/ccw/src/cli.ts +3 -1
  41. package/ccw/src/commands/cli.ts +47 -3
  42. package/ccw/src/commands/issue.ts +442 -34
  43. package/ccw/src/core/routes/issue-routes.ts +82 -16
  44. package/ccw/src/tools/cli-executor.ts +125 -4
  45. package/ccw/src/tools/litellm-executor.ts +107 -24
  46. package/ccw/src/tools/ui-generate-preview.js +60 -37
  47. package/codex-lens/src/codexlens/__pycache__/config.cpython-313.pyc +0 -0
  48. package/codex-lens/src/codexlens/__pycache__/entities.cpython-313.pyc +0 -0
  49. package/codex-lens/src/codexlens/config.py +25 -2
  50. package/codex-lens/src/codexlens/entities.py +5 -1
  51. package/codex-lens/src/codexlens/indexing/__pycache__/symbol_extractor.cpython-313.pyc +0 -0
  52. package/codex-lens/src/codexlens/indexing/symbol_extractor.py +243 -243
  53. package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-313.pyc +0 -0
  54. package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-313.pyc +0 -0
  55. package/codex-lens/src/codexlens/parsers/factory.py +256 -256
  56. package/codex-lens/src/codexlens/parsers/treesitter_parser.py +335 -335
  57. package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-313.pyc +0 -0
  58. package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-313.pyc +0 -0
  59. package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-313.pyc +0 -0
  60. package/codex-lens/src/codexlens/search/chain_search.py +30 -1
  61. package/codex-lens/src/codexlens/semantic/__pycache__/__init__.cpython-313.pyc +0 -0
  62. package/codex-lens/src/codexlens/semantic/__pycache__/embedder.cpython-313.pyc +0 -0
  63. package/codex-lens/src/codexlens/semantic/__pycache__/reranker.cpython-313.pyc +0 -0
  64. package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-313.pyc +0 -0
  65. package/codex-lens/src/codexlens/semantic/embedder.py +6 -9
  66. package/codex-lens/src/codexlens/semantic/vector_store.py +271 -200
  67. package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-313.pyc +0 -0
  68. package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-313.pyc +0 -0
  69. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-313.pyc +0 -0
  70. package/codex-lens/src/codexlens/storage/sqlite_store.py +184 -108
  71. package/package.json +88 -83
  72. 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,14 +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
44
  Phase 2: ACE Exploration (30%)
53
45
  ↓ Semantic search, pattern discovery, dependency mapping
54
- Phase 3: Solution Planning (50%)
46
+ Phase 3: Solution Planning (45%)
55
47
  ↓ Task decomposition, 5-phase lifecycle, acceptance criteria
56
48
  Phase 4: Validation & Output (15%)
57
- ↓ DAG validation, conflict detection, solution registration
49
+ ↓ DAG validation, solution registration, binding
58
50
  ```
59
51
 
60
52
  #### Phase 1: Issue Understanding
@@ -178,27 +170,54 @@ function decomposeTasks(issue, exploration) {
178
170
  **Validation**:
179
171
  - DAG validation (no circular dependencies)
180
172
  - Task validation (all 5 phases present)
181
- - Conflict detection (cross-issue file modifications)
173
+ - File isolation check (ensure minimal overlap across issues in batch)
182
174
 
183
- **Solution Registration** (CRITICAL: check solution count first):
184
- ```javascript
185
- for (const issue of issues) {
186
- const solutions = generatedSolutions[issue.id];
187
-
188
- if (solutions.length === 1) {
189
- // Single solution → auto-bind
190
- Bash(`ccw issue bind ${issue.id} --solution ${solutions[0].file}`);
191
- bound.push({ issue_id: issue.id, solution_id: solutions[0].id, task_count: solutions[0].tasks.length });
192
- } else {
193
- // Multiple solutions DO NOT BIND, return for user selection
194
- pending_selection.push({
195
- issue_id: issue.id,
196
- solutions: solutions.map(s => ({ id: s.id, description: s.description, task_count: s.tasks.length }))
197
- });
198
- }
175
+ **Solution Registration** (via file write):
176
+
177
+ **Step 1: Create solution files**
178
+
179
+ Write solution JSON to JSONL file (one line per solution):
180
+
181
+ ```
182
+ .workflow/issues/solutions/{issue-id}.jsonl
183
+ ```
184
+
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
193
+ {
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
199
201
  }
200
202
  ```
201
203
 
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)
220
+
202
221
  ---
203
222
 
204
223
  ## 2. Output Requirements
@@ -216,7 +235,7 @@ Each line is a solution JSON containing tasks. Schema: `cat .claude/workflows/cl
216
235
 
217
236
  | Scenario | Action |
218
237
  |----------|--------|
219
- | Single solution | `ccw issue bind <id> --solution <file>` (auto) |
238
+ | Single solution | `ccw issue bind <issue-id> <solution-id>` (auto) |
220
239
  | Multiple solutions | Register only, return for selection |
221
240
 
222
241
  ### 2.3 Return Summary
@@ -224,8 +243,7 @@ Each line is a solution JSON containing tasks. Schema: `cat .claude/workflows/cl
224
243
  ```json
225
244
  {
226
245
  "bound": [{ "issue_id": "...", "solution_id": "...", "task_count": N }],
227
- "pending_selection": [{ "issue_id": "...", "solutions": [{ "id": "SOL-001", "description": "...", "task_count": N }] }],
228
- "conflicts": [{ "file": "...", "issues": [...] }]
246
+ "pending_selection": [{ "issue_id": "GH-123", "solutions": [{ "id": "SOL-GH-123-1", "description": "...", "task_count": N }] }]
229
247
  }
230
248
  ```
231
249
 
@@ -260,8 +278,16 @@ Each line is a solution JSON containing tasks. Schema: `cat .claude/workflows/cl
260
278
  4. Quantify acceptance.criteria with testable conditions
261
279
  5. Validate DAG before output
262
280
  6. Evaluate each solution with `analysis` and `score`
263
- 7. Single solution auto-bind; Multiple → return `pending_selection`
281
+ 7. Write solutions to `.workflow/issues/solutions/{issue-id}.jsonl` (append mode)
264
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
265
291
 
266
292
  **NEVER**:
267
293
  1. Execute implementation (return plan only)
@@ -271,6 +297,6 @@ Each line is a solution JSON containing tasks. Schema: `cat .claude/workflows/cl
271
297
  5. **Bind when multiple solutions exist** - MUST check `solutions.length === 1` before calling `ccw issue bind`
272
298
 
273
299
  **OUTPUT**:
274
- 1. Register solutions via `ccw issue bind <id> --solution <file>`
275
- 2. Return JSON with `bound`, `pending_selection`, `conflicts`
276
- 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
@@ -37,7 +29,7 @@ color: orange
37
29
  {
38
30
  solutions: [{
39
31
  issue_id: string, // e.g., "ISS-20251227-001"
40
- solution_id: string, // e.g., "SOL-20251227-001"
32
+ solution_id: string, // e.g., "SOL-ISS-20251227-001-1"
41
33
  task_count: number, // Number of tasks in this solution
42
34
  files_touched: string[], // All files modified by this solution
43
35
  priority: string // Issue priority: critical | high | medium | low
@@ -52,11 +44,13 @@ color: orange
52
44
  ### 1.2 Execution Flow
53
45
 
54
46
  ```
55
- Phase 1: Solution Analysis (20%)
47
+ Phase 1: Solution Analysis (15%)
56
48
  | Parse solutions, collect files_touched, build DAG
57
- Phase 2: Conflict Detection (30%)
58
- | Identify file overlaps between solutions
59
- Phase 3: Conflict Resolution (25%)
49
+ Phase 2: Conflict Detection (25%)
50
+ | Identify all conflict types (file, API, data, dependency, architecture)
51
+ Phase 2.5: Clarification (15%)
52
+ | Surface ambiguous dependencies, BLOCK until resolved
53
+ Phase 3: Conflict Resolution (20%)
60
54
  | Apply ordering rules, update DAG
61
55
  Phase 4: Ordering & Grouping (25%)
62
56
  | Topological sort, assign parallel/sequential groups
@@ -68,39 +62,74 @@ Phase 4: Ordering & Grouping (25%)
68
62
 
69
63
  ### 2.1 Dependency Graph
70
64
 
71
- ```javascript
72
- function buildDependencyGraph(solutions) {
73
- const graph = new Map()
74
- const fileModifications = new Map()
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
92
+ ```
75
93
 
76
- for (const sol of solutions) {
77
- graph.set(sol.solution_id, { ...sol, inDegree: 0, outEdges: [] })
94
+ **Placeholder**: `${SOLUTIONS_JSON}` = serialized solutions array from bound issues
78
95
 
79
- for (const file of sol.files_touched || []) {
80
- if (!fileModifications.has(file)) fileModifications.set(file, [])
81
- fileModifications.get(file).push(sol.solution_id)
82
- }
83
- }
96
+ **Conflict Types & Severity**:
84
97
 
85
- return { graph, fileModifications }
86
- }
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 |
105
+
106
+ **Output per conflict**:
107
+ ```json
108
+ { "type": "...", "severity": "...", "solutions": [...], "recommended_order": [...], "rationale": "..." }
87
109
  ```
88
110
 
89
- ### 2.2 Conflict Detection
111
+ ### 2.2.5 Clarification (BLOCKING)
90
112
 
91
- Conflict when multiple solutions modify same file:
92
- ```javascript
93
- function detectConflicts(fileModifications, graph) {
94
- return [...fileModifications.entries()]
95
- .filter(([_, solutions]) => solutions.length > 1)
96
- .map(([file, solutions]) => ({
97
- type: 'file_conflict',
98
- file,
99
- solutions,
100
- resolved: false
101
- }))
102
- }
103
- ```
113
+ **Purpose**: Surface ambiguous dependencies for user/system clarification
114
+
115
+ **Trigger Conditions**:
116
+ - High severity conflicts without `recommended_order` from Gemini analysis
117
+ - Circular dependencies detected
118
+ - Multiple valid resolution strategies
119
+
120
+ **Clarification Generation**:
121
+
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`
127
+
128
+ **Blocking Behavior**:
129
+ - Return `clarifications` array in output
130
+ - Main agent presents to user via AskUserQuestion
131
+ - Agent BLOCKS until all clarifications resolved
132
+ - No best-guess fallback - explicit user decision required
104
133
 
105
134
  ### 2.3 Resolution Rules
106
135
 
@@ -161,13 +190,12 @@ Queue Item ID format: `S-N` (S-1, S-2, S-3, ...)
161
190
  {
162
191
  "item_id": "S-1",
163
192
  "issue_id": "ISS-20251227-003",
164
- "solution_id": "SOL-20251227-003",
193
+ "solution_id": "SOL-ISS-20251227-003-1",
165
194
  "status": "pending",
166
195
  "execution_order": 1,
167
196
  "execution_group": "P1",
168
197
  "depends_on": [],
169
198
  "semantic_priority": 0.8,
170
- "assigned_executor": "codex",
171
199
  "files_touched": ["src/auth.ts", "src/utils.ts"],
172
200
  "task_count": 3
173
201
  }
@@ -189,7 +217,9 @@ Queue Item ID format: `S-N` (S-1, S-2, S-3, ...)
189
217
  }
190
218
  ```
191
219
 
192
- ### 3.3 Return Summary
220
+ ### 3.3 Return Summary (Brief)
221
+
222
+ Return brief summaries; full conflict details in separate files:
193
223
 
194
224
  ```json
195
225
  {
@@ -197,11 +227,27 @@ Queue Item ID format: `S-N` (S-1, S-2, S-3, ...)
197
227
  "total_solutions": N,
198
228
  "total_tasks": N,
199
229
  "execution_groups": [{ "id": "P1", "type": "parallel", "count": N }],
230
+ "conflicts_summary": [{
231
+ "id": "CFT-001",
232
+ "type": "api_conflict",
233
+ "severity": "high",
234
+ "summary": "Brief 1-line description",
235
+ "resolution": "sequential",
236
+ "details_path": ".workflow/issues/conflicts/CFT-001.json"
237
+ }],
238
+ "clarifications": [{
239
+ "conflict_id": "CFT-002",
240
+ "question": "Which solution should execute first?",
241
+ "options": [{ "value": "S-1", "label": "Solution summary" }],
242
+ "requires_user_input": true
243
+ }],
200
244
  "conflicts_resolved": N,
201
245
  "issues_queued": ["ISS-xxx", "ISS-yyy"]
202
246
  }
203
247
  ```
204
248
 
249
+ **Full Conflict Details**: Write to `.workflow/issues/conflicts/{conflict-id}.json`
250
+
205
251
  ---
206
252
 
207
253
  ## 4. Quality Standards
@@ -241,14 +287,21 @@ Queue Item ID format: `S-N` (S-1, S-2, S-3, ...)
241
287
  5. Merge conflicting solutions in parallel group
242
288
  6. Split tasks from their solution
243
289
 
244
- **OUTPUT** (STRICT - only these 2 files):
245
- ```
246
- .workflow/issues/queues/{Queue ID}.json # Use Queue ID from prompt
247
- .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
+ }
248
305
  ```
249
- - Use the Queue ID provided in prompt, do NOT generate new one
250
- - Write ONLY the 2 files listed above, NO other files
251
- - Final return: PURE JSON summary (no markdown, no prose):
252
- ```json
253
- {"queue_id":"QUE-xxx","total_solutions":N,"total_tasks":N,"execution_groups":[...],"conflicts_resolved":N,"issues_queued":["ISS-xxx"]}
254
- ```
306
+ - `clarifications`: Only present if unresolved high-severity conflicts exist
307
+ - No markdown, no prose - PURE JSON only
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: execute
3
3
  description: Execute queue with codex using DAG-based parallel orchestration (solution-level)
4
- argument-hint: "[--parallel <n>] [--executor codex|gemini|agent]"
4
+ argument-hint: ""
5
5
  allowed-tools: TodoWrite(*), Bash(*), Read(*), AskUserQuestion(*)
6
6
  ---
7
7
 
@@ -21,27 +21,22 @@ Minimal orchestrator that dispatches **solution IDs** to executors. Each executo
21
21
  ## Usage
22
22
 
23
23
  ```bash
24
- /issue:execute [FLAGS]
25
-
26
- # Examples
27
- /issue:execute # Execute with default parallelism
28
- /issue:execute --parallel 4 # Execute up to 4 tasks in parallel
29
- /issue:execute --executor agent # Use agent instead of codex
30
-
31
- # Flags
32
- --parallel <n> Max parallel executors (default: 3)
33
- --executor <type> Force executor: codex|gemini|agent (default: codex)
34
- --dry-run Show DAG and batches without executing
24
+ /issue:execute
35
25
  ```
36
26
 
27
+ **Parallelism**: Determined automatically by task dependency DAG (no manual control)
28
+ **Executor & Dry-run**: Selected via interactive prompt (AskUserQuestion)
29
+
37
30
  ## Execution Flow
38
31
 
39
32
  ```
40
- Phase 1: Get DAG
41
- └─ ccw issue queue dag → { parallel_batches: [["S-1","S-2"], ["S-3"]] }
33
+ Phase 1: Get DAG & User Selection
34
+ ├─ ccw issue queue dag → { parallel_batches: [["S-1","S-2"], ["S-3"]] }
35
+ └─ AskUserQuestion → executor type (codex|gemini|agent), dry-run mode
42
36
 
43
- Phase 2: Dispatch Parallel Batch
44
- ├─ For each solution ID in batch (parallel):
37
+ Phase 2: Dispatch Parallel Batch (DAG-driven)
38
+ ├─ Parallelism determined by DAG (no manual limit)
39
+ ├─ For each solution ID in batch (parallel - all at once):
45
40
  │ ├─ Executor calls: ccw issue detail <id> (READ-ONLY)
46
41
  │ ├─ Executor gets FULL SOLUTION with all tasks
47
42
  │ ├─ Executor implements all tasks sequentially (T1 → T2 → T3)
@@ -55,7 +50,7 @@ Phase 3: Next Batch
55
50
 
56
51
  ## Implementation
57
52
 
58
- ### Phase 1: Get DAG
53
+ ### Phase 1: Get DAG & User Selection
59
54
 
60
55
  ```javascript
61
56
  // Get dependency graph and parallel batches
@@ -77,9 +72,37 @@ console.log(`
77
72
  - Parallel in batch 1: ${dag.parallel_batches[0]?.length || 0}
78
73
  `);
79
74
 
75
+ // Interactive selection via AskUserQuestion
76
+ const answer = AskUserQuestion({
77
+ questions: [
78
+ {
79
+ question: 'Select executor type:',
80
+ header: 'Executor',
81
+ multiSelect: false,
82
+ options: [
83
+ { label: 'Codex (Recommended)', description: 'Autonomous coding with full write access' },
84
+ { label: 'Gemini', description: 'Large context analysis and implementation' },
85
+ { label: 'Agent', description: 'Claude Code sub-agent for complex tasks' }
86
+ ]
87
+ },
88
+ {
89
+ question: 'Execution mode:',
90
+ header: 'Mode',
91
+ multiSelect: false,
92
+ options: [
93
+ { label: 'Execute (Recommended)', description: 'Run all ready solutions' },
94
+ { label: 'Dry-run', description: 'Show DAG and batches without executing' }
95
+ ]
96
+ }
97
+ ]
98
+ });
99
+
100
+ const executor = answer['Executor'].toLowerCase().split(' ')[0]; // codex|gemini|agent
101
+ const isDryRun = answer['Mode'].includes('Dry-run');
102
+
80
103
  // Dry run mode
81
- if (flags.dryRun) {
82
- console.log('### Parallel Batches:\n');
104
+ if (isDryRun) {
105
+ console.log('### Parallel Batches (Dry-run):\n');
83
106
  dag.parallel_batches.forEach((batch, i) => {
84
107
  console.log(`Batch ${i + 1}: ${batch.join(', ')}`);
85
108
  });
@@ -87,13 +110,11 @@ if (flags.dryRun) {
87
110
  }
88
111
  ```
89
112
 
90
- ### Phase 2: Dispatch Parallel Batch
113
+ ### Phase 2: Dispatch Parallel Batch (DAG-driven)
91
114
 
92
115
  ```javascript
93
- const parallelLimit = flags.parallel || 3;
94
- const executor = flags.executor || 'codex';
95
-
96
- // Process first batch (all solutions can run in parallel)
116
+ // Parallelism determined by DAG - no manual limit
117
+ // All solutions in same batch have NO file conflicts and can run in parallel
97
118
  const batch = dag.parallel_batches[0] || [];
98
119
 
99
120
  // Initialize TodoWrite
@@ -105,24 +126,16 @@ TodoWrite({
105
126
  }))
106
127
  });
107
128
 
108
- // Dispatch all in parallel (up to limit)
109
- const chunks = [];
110
- for (let i = 0; i < batch.length; i += parallelLimit) {
111
- chunks.push(batch.slice(i, i + parallelLimit));
112
- }
113
-
114
- for (const chunk of chunks) {
115
- console.log(`\n### Executing Solutions: ${chunk.join(', ')}`);
129
+ console.log(`\n### Executing Solutions (DAG batch 1): ${batch.join(', ')}`);
116
130
 
117
- // Launch all in parallel
118
- const executions = chunk.map(solutionId => {
119
- updateTodo(solutionId, 'in_progress');
120
- return dispatchExecutor(solutionId, executor);
121
- });
131
+ // Launch ALL solutions in batch in parallel (DAG guarantees no conflicts)
132
+ const executions = batch.map(solutionId => {
133
+ updateTodo(solutionId, 'in_progress');
134
+ return dispatchExecutor(solutionId, executor);
135
+ });
122
136
 
123
- await Promise.all(executions);
124
- chunk.forEach(id => updateTodo(id, 'completed'));
125
- }
137
+ await Promise.all(executions);
138
+ batch.forEach(id => updateTodo(id, 'completed'));
126
139
  ```
127
140
 
128
141
  ### Executor Dispatch