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.
- package/.claude/agents/issue-plan-agent.md +62 -36
- package/.claude/agents/issue-queue-agent.md +110 -57
- package/.claude/commands/issue/execute.md +53 -40
- package/.claude/commands/issue/new.md +226 -380
- package/.claude/commands/issue/plan.md +122 -125
- package/.claude/commands/issue/queue.md +198 -321
- package/.claude/skills/issue-manage/SKILL.md +63 -22
- package/.claude/workflows/cli-templates/schemas/discovery-finding-schema.json +3 -3
- package/.claude/workflows/cli-templates/schemas/issues-jsonl-schema.json +141 -168
- package/.claude/workflows/cli-templates/schemas/queue-schema.json +0 -5
- package/.claude/workflows/cli-templates/schemas/solution-schema.json +3 -2
- package/.codex/prompts/issue-execute.md +3 -3
- package/.codex/prompts/issue-plan.md +16 -19
- package/.codex/prompts/issue-queue.md +3 -4
- package/README.md +1 -0
- package/ccw/dist/cli.d.ts.map +1 -1
- package/ccw/dist/cli.js +3 -1
- package/ccw/dist/cli.js.map +1 -1
- package/ccw/dist/commands/cli.d.ts.map +1 -1
- package/ccw/dist/commands/cli.js +45 -3
- package/ccw/dist/commands/cli.js.map +1 -1
- package/ccw/dist/commands/issue.d.ts +3 -1
- package/ccw/dist/commands/issue.d.ts.map +1 -1
- package/ccw/dist/commands/issue.js +383 -30
- package/ccw/dist/commands/issue.js.map +1 -1
- package/ccw/dist/core/routes/issue-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/issue-routes.js +77 -16
- package/ccw/dist/core/routes/issue-routes.js.map +1 -1
- package/ccw/dist/tools/cli-executor.d.ts.map +1 -1
- package/ccw/dist/tools/cli-executor.js +117 -4
- package/ccw/dist/tools/cli-executor.js.map +1 -1
- package/ccw/dist/tools/litellm-executor.d.ts +4 -0
- package/ccw/dist/tools/litellm-executor.d.ts.map +1 -1
- package/ccw/dist/tools/litellm-executor.js +54 -1
- package/ccw/dist/tools/litellm-executor.js.map +1 -1
- package/ccw/dist/tools/ui-generate-preview.d.ts +18 -0
- package/ccw/dist/tools/ui-generate-preview.d.ts.map +1 -1
- package/ccw/dist/tools/ui-generate-preview.js +26 -10
- package/ccw/dist/tools/ui-generate-preview.js.map +1 -1
- package/ccw/src/cli.ts +3 -1
- package/ccw/src/commands/cli.ts +47 -3
- package/ccw/src/commands/issue.ts +442 -34
- package/ccw/src/core/routes/issue-routes.ts +82 -16
- package/ccw/src/tools/cli-executor.ts +125 -4
- package/ccw/src/tools/litellm-executor.ts +107 -24
- package/ccw/src/tools/ui-generate-preview.js +60 -37
- package/codex-lens/src/codexlens/__pycache__/config.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/__pycache__/entities.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/config.py +25 -2
- package/codex-lens/src/codexlens/entities.py +5 -1
- package/codex-lens/src/codexlens/indexing/__pycache__/symbol_extractor.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/indexing/symbol_extractor.py +243 -243
- package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/parsers/factory.py +256 -256
- package/codex-lens/src/codexlens/parsers/treesitter_parser.py +335 -335
- package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/chain_search.py +30 -1
- package/codex-lens/src/codexlens/semantic/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/embedder.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/reranker.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/embedder.py +6 -9
- package/codex-lens/src/codexlens/semantic/vector_store.py +271 -200
- package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/sqlite_store.py +184 -108
- package/package.json +88 -83
- 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
|
-
-
|
|
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 (
|
|
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 (
|
|
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,
|
|
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
|
-
-
|
|
173
|
+
- File isolation check (ensure minimal overlap across issues in batch)
|
|
182
174
|
|
|
183
|
-
**Solution Registration** (
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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>
|
|
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": "
|
|
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.
|
|
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.
|
|
275
|
-
2.
|
|
276
|
-
3.
|
|
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
|
|
5
|
-
Receives solutions from bound issues,
|
|
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.
|
|
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
|
-
-
|
|
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 (
|
|
47
|
+
Phase 1: Solution Analysis (15%)
|
|
56
48
|
| Parse solutions, collect files_touched, build DAG
|
|
57
|
-
Phase 2: Conflict Detection (
|
|
58
|
-
| Identify file
|
|
59
|
-
Phase
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
77
|
-
graph.set(sol.solution_id, { ...sol, inDegree: 0, outEdges: [] })
|
|
94
|
+
**Placeholder**: `${SOLUTIONS_JSON}` = serialized solutions array from bound issues
|
|
78
95
|
|
|
79
|
-
|
|
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
|
-
|
|
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
|
|
111
|
+
### 2.2.5 Clarification (BLOCKING)
|
|
90
112
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
**
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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
|
-
-
|
|
250
|
-
-
|
|
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: "
|
|
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
|
|
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
|
-
|
|
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
|
-
├─
|
|
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 (
|
|
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
|
-
|
|
94
|
-
|
|
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
|
-
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
137
|
+
await Promise.all(executions);
|
|
138
|
+
batch.forEach(id => updateTodo(id, 'completed'));
|
|
126
139
|
```
|
|
127
140
|
|
|
128
141
|
### Executor Dispatch
|