claude-code-workflow 7.2.14 → 7.2.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/commands/workflow/analyze-with-file.md +7 -0
- package/.codex/skills/analyze-with-file/SKILL.md +1181 -1182
- package/.codex/skills/brainstorm/SKILL.md +723 -725
- package/.codex/skills/brainstorm-with-file/SKILL.md +10 -5
- package/.codex/skills/clean/SKILL.md +33 -26
- package/.codex/skills/collaborative-plan-with-file/SKILL.md +830 -831
- package/.codex/skills/csv-wave-pipeline/SKILL.md +906 -906
- package/.codex/skills/issue-discover/SKILL.md +57 -50
- package/.codex/skills/issue-discover/phases/01-issue-new.md +18 -11
- package/.codex/skills/issue-discover/phases/02-discover.md +31 -26
- package/.codex/skills/issue-discover/phases/03-discover-by-prompt.md +13 -11
- package/.codex/skills/issue-discover/phases/04-quick-execute.md +32 -27
- package/.codex/skills/parallel-dev-cycle/SKILL.md +402 -402
- package/.codex/skills/project-documentation-workflow/SKILL.md +13 -3
- package/.codex/skills/roadmap-with-file/SKILL.md +901 -897
- package/.codex/skills/session-sync/SKILL.md +222 -212
- package/.codex/skills/spec-add/SKILL.md +620 -613
- package/.codex/skills/spec-generator/SKILL.md +2 -2
- package/.codex/skills/spec-generator/phases/01-5-requirement-clarification.md +10 -10
- package/.codex/skills/spec-generator/phases/01-discovery.md +11 -18
- package/.codex/skills/spec-generator/phases/02-product-brief.md +5 -5
- package/.codex/skills/spec-generator/phases/03-requirements.md +7 -7
- package/.codex/skills/spec-generator/phases/04-architecture.md +4 -4
- package/.codex/skills/spec-generator/phases/05-epics-stories.md +5 -6
- package/.codex/skills/spec-generator/phases/06-readiness-check.md +10 -17
- package/.codex/skills/spec-generator/phases/07-issue-export.md +326 -329
- package/.codex/skills/spec-setup/SKILL.md +669 -657
- package/.codex/skills/team-arch-opt/SKILL.md +50 -50
- package/.codex/skills/team-arch-opt/agents/completion-handler.md +3 -3
- package/.codex/skills/team-brainstorm/SKILL.md +724 -725
- package/.codex/skills/team-coordinate/SKILL.md +51 -51
- package/.codex/skills/team-coordinate/agents/completion-handler.md +3 -3
- package/.codex/skills/team-coordinate/agents/plan-reviewer.md +4 -4
- package/.codex/skills/team-designer/SKILL.md +691 -691
- package/.codex/skills/team-designer/agents/requirement-clarifier.md +11 -12
- package/.codex/skills/team-executor/SKILL.md +45 -45
- package/.codex/skills/team-frontend/SKILL.md +45 -45
- package/.codex/skills/team-frontend/agents/completion-handler.md +3 -3
- package/.codex/skills/team-frontend/agents/qa-gate-reviewer.md +4 -4
- package/.codex/skills/team-frontend-debug/SKILL.md +50 -50
- package/.codex/skills/team-frontend-debug/agents/completion-handler.md +3 -3
- package/.codex/skills/team-frontend-debug/agents/conditional-skip-gate.md +4 -4
- package/.codex/skills/team-issue/SKILL.md +751 -740
- package/.codex/skills/team-iterdev/SKILL.md +825 -826
- package/.codex/skills/team-lifecycle-v4/SKILL.md +775 -775
- package/.codex/skills/team-lifecycle-v4/agents/quality-gate.md +165 -165
- package/.codex/skills/team-lifecycle-v4/agents/requirement-clarifier.md +163 -163
- package/.codex/skills/team-perf-opt/SKILL.md +50 -50
- package/.codex/skills/team-perf-opt/agents/completion-handler.md +3 -3
- package/.codex/skills/team-planex-v2/SKILL.md +652 -637
- package/.codex/skills/team-quality-assurance/SKILL.md +51 -52
- package/.codex/skills/team-review/SKILL.md +40 -40
- package/.codex/skills/team-roadmap-dev/SKILL.md +51 -51
- package/.codex/skills/team-roadmap-dev/agents/roadmap-discusser.md +8 -8
- package/.codex/skills/team-tech-debt/SKILL.md +50 -50
- package/.codex/skills/team-tech-debt/agents/plan-approver.md +5 -5
- package/.codex/skills/team-testing/SKILL.md +51 -52
- package/.codex/skills/team-uidesign/SKILL.md +40 -40
- package/.codex/skills/team-uidesign/agents/completion-handler.md +177 -177
- package/.codex/skills/team-ultra-analyze/SKILL.md +786 -787
- package/.codex/skills/team-ultra-analyze/agents/discussion-feedback.md +8 -8
- package/.codex/skills/team-ux-improve/SKILL.md +51 -52
- package/.codex/skills/team-ux-improve/agents/ux-designer.md +2 -2
- package/.codex/skills/team-ux-improve/agents/ux-explorer.md +1 -1
- package/.codex/skills/unified-execute-with-file/SKILL.md +797 -796
- package/.codex/skills/workflow-execute/SKILL.md +1117 -1118
- package/.codex/skills/workflow-lite-planex/SKILL.md +1144 -1141
- package/.codex/skills/workflow-plan/SKILL.md +631 -636
- package/.codex/skills/workflow-tdd-plan/SKILL.md +753 -759
- package/.codex/skills/workflow-test-fix-cycle/SKILL.md +402 -392
- package/README.md +25 -0
- package/ccw/dist/commands/install.d.ts.map +1 -1
- package/ccw/dist/commands/install.js +12 -0
- package/ccw/dist/commands/install.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,740 +1,751 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: team-issue
|
|
3
|
-
description: Hybrid team skill for issue resolution. CSV wave primary for exploration, planning, integration, and implementation. Interactive agents for review gates with fix cycles. Supports Quick, Full, and Batch pipelines.
|
|
4
|
-
argument-hint: "[-y|--yes] [-c|--concurrency N] [--continue] [--mode=quick|full|batch] \"issue-ids or --all-pending\""
|
|
5
|
-
allowed-tools: spawn_agents_on_csv, spawn_agent, wait, send_input, close_agent, Read, Write, Edit, Bash, Glob, Grep,
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Auto Mode
|
|
9
|
-
|
|
10
|
-
When `--yes` or `-y`: Auto-confirm task decomposition, skip interactive validation, use defaults.
|
|
11
|
-
|
|
12
|
-
# Team Issue Resolution
|
|
13
|
-
|
|
14
|
-
## Usage
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
$team-issue "ISS-20260308-120000 ISS-20260308-120001"
|
|
18
|
-
$team-issue -c 4 "ISS-20260308-120000 --mode=full"
|
|
19
|
-
$team-issue -y "--all-pending"
|
|
20
|
-
$team-issue --continue "issue-auth-fix-20260308"
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
**Flags**:
|
|
24
|
-
- `-y, --yes`: Skip all confirmations (auto mode)
|
|
25
|
-
- `-c, --concurrency N`: Max concurrent agents within each wave (default: 3)
|
|
26
|
-
- `--continue`: Resume existing session
|
|
27
|
-
- `--mode=quick|full|batch`: Force pipeline mode (default: auto-detect)
|
|
28
|
-
|
|
29
|
-
**Output Directory**: `.workflow/.csv-wave/{session-id}/`
|
|
30
|
-
**Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `context.md` (human-readable report)
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Overview
|
|
35
|
-
|
|
36
|
-
Orchestrate issue resolution pipeline: explore context, plan solution, review (optional), marshal queue, implement. Supports Quick, Full, and Batch pipelines with review-fix cycle.
|
|
37
|
-
|
|
38
|
-
**Execution Model**: Hybrid -- CSV wave pipeline (primary) + individual agent spawn (secondary)
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
+---------------------------------------------------------------------------+
|
|
42
|
-
| TEAM ISSUE RESOLUTION WORKFLOW |
|
|
43
|
-
+---------------------------------------------------------------------------+
|
|
44
|
-
| |
|
|
45
|
-
| Phase 1: Requirement Parsing + Pipeline Selection |
|
|
46
|
-
| +-- Parse issue IDs (GH-\d+, ISS-\d{8}-\d{6}, --all-pending) |
|
|
47
|
-
| +-- Auto-detect pipeline mode (quick/full/batch) |
|
|
48
|
-
| +-- Determine execution method (codex/gemini/auto) |
|
|
49
|
-
| +-- Generate tasks.csv with wave + exec_mode columns |
|
|
50
|
-
| +-- User validates task breakdown (skip if -y) |
|
|
51
|
-
| |
|
|
52
|
-
| Phase 2: Wave Execution Engine (Extended) |
|
|
53
|
-
| +-- For each wave (1..N): |
|
|
54
|
-
| | +-- Execute pre-wave interactive tasks (if any) |
|
|
55
|
-
| | +-- Build wave CSV (filter csv-wave tasks for this wave) |
|
|
56
|
-
| | +-- Inject previous findings into prev_context column |
|
|
57
|
-
| | +-- spawn_agents_on_csv(wave CSV) |
|
|
58
|
-
| | +-- Execute post-wave interactive tasks (if any) |
|
|
59
|
-
| | +-- Merge all results into master tasks.csv |
|
|
60
|
-
| | +-- Check: any failed? -> skip dependents |
|
|
61
|
-
| +-- discoveries.ndjson shared across all modes (append-only) |
|
|
62
|
-
| |
|
|
63
|
-
| Phase 3: Post-Wave Interactive (Review Gate) |
|
|
64
|
-
| +-- Reviewer agent: multi-dimensional review with verdict |
|
|
65
|
-
| +-- Fix cycle: rejected -> revise solution -> re-review (max 2) |
|
|
66
|
-
| +-- Final aggregation / report |
|
|
67
|
-
| |
|
|
68
|
-
| Phase 4: Results Aggregation |
|
|
69
|
-
| +-- Export final results.csv |
|
|
70
|
-
| +-- Generate context.md with all findings |
|
|
71
|
-
| +-- Display summary: completed/failed/skipped per wave |
|
|
72
|
-
| +-- Offer: view results | retry failed | done |
|
|
73
|
-
| |
|
|
74
|
-
+---------------------------------------------------------------------------+
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## Task Classification Rules
|
|
80
|
-
|
|
81
|
-
Each task is classified by `exec_mode`:
|
|
82
|
-
|
|
83
|
-
| exec_mode | Mechanism | Criteria |
|
|
84
|
-
|-----------|-----------|----------|
|
|
85
|
-
| `csv-wave` | `spawn_agents_on_csv` | One-shot, structured I/O, no multi-round interaction |
|
|
86
|
-
| `interactive` | `spawn_agent`/`wait`/`send_input`/`close_agent` | Multi-round, clarification, review gates |
|
|
87
|
-
|
|
88
|
-
**Classification Decision**:
|
|
89
|
-
|
|
90
|
-
| Task Property | Classification |
|
|
91
|
-
|---------------|---------------|
|
|
92
|
-
| Codebase exploration (EXPLORE-*) | `csv-wave` |
|
|
93
|
-
| Solution planning (SOLVE-*) | `csv-wave` |
|
|
94
|
-
| Queue formation / integration (MARSHAL-*) | `csv-wave` |
|
|
95
|
-
| Code implementation (BUILD-*) | `csv-wave` |
|
|
96
|
-
| Technical review with verdict (AUDIT-*) | `interactive` |
|
|
97
|
-
| Solution revision after rejection (SOLVE-fix-*) | `csv-wave` |
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
## CSV Schema
|
|
102
|
-
|
|
103
|
-
### tasks.csv (Master State)
|
|
104
|
-
|
|
105
|
-
```csv
|
|
106
|
-
id,title,description,role,issue_ids,exec_mode,execution_method,deps,context_from,wave,status,findings,artifact_path,error
|
|
107
|
-
"EXPLORE-001","Context analysis","Analyze issue context and map codebase impact for ISS-20260308-120000","explorer","ISS-20260308-120000","csv-wave","","","","1","pending","","","",""
|
|
108
|
-
"SOLVE-001","Solution design","Design solution and decompose into implementation tasks","planner","ISS-20260308-120000","csv-wave","","EXPLORE-001","EXPLORE-001","2","pending","","","",""
|
|
109
|
-
"AUDIT-001","Technical review","Review solution for feasibility, risk, and completeness","reviewer","ISS-20260308-120000","interactive","","SOLVE-001","SOLVE-001","3","pending","","","",""
|
|
110
|
-
"MARSHAL-001","Queue formation","Form execution queue with conflict detection","integrator","ISS-20260308-120000","csv-wave","","AUDIT-001","SOLVE-001","4","pending","","","",""
|
|
111
|
-
"BUILD-001","Implementation","Implement solution plan and verify with tests","implementer","ISS-20260308-120000","csv-wave","gemini","MARSHAL-001","EXPLORE-001;SOLVE-001","5","pending","","","",""
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
**Columns**:
|
|
115
|
-
|
|
116
|
-
| Column | Phase | Description |
|
|
117
|
-
|--------|-------|-------------|
|
|
118
|
-
| `id` | Input | Unique task identifier (EXPLORE-NNN, SOLVE-NNN, AUDIT-NNN, MARSHAL-NNN, BUILD-NNN) |
|
|
119
|
-
| `title` | Input | Short task title |
|
|
120
|
-
| `description` | Input | Detailed task description |
|
|
121
|
-
| `role` | Input | Worker role: explorer, planner, reviewer, integrator, implementer |
|
|
122
|
-
| `issue_ids` | Input | Semicolon-separated issue IDs this task covers |
|
|
123
|
-
| `exec_mode` | Input | `csv-wave` or `interactive` |
|
|
124
|
-
| `execution_method` | Input | codex, gemini, qwen, or empty (for non-BUILD tasks) |
|
|
125
|
-
| `deps` | Input | Semicolon-separated dependency task IDs |
|
|
126
|
-
| `context_from` | Input | Semicolon-separated task IDs whose findings this task needs |
|
|
127
|
-
| `wave` | Computed | Wave number (computed by topological sort, 1-based) |
|
|
128
|
-
| `status` | Output | `pending` -> `completed` / `failed` / `skipped` |
|
|
129
|
-
| `findings` | Output | Key discoveries or implementation notes (max 500 chars) |
|
|
130
|
-
| `artifact_path` | Output | Path to generated artifact (context report, solution, queue, etc.) |
|
|
131
|
-
| `error` | Output | Error message if failed (empty if success) |
|
|
132
|
-
|
|
133
|
-
### Per-Wave CSV (Temporary)
|
|
134
|
-
|
|
135
|
-
Each wave generates a temporary `wave-{N}.csv` with extra `prev_context` column (csv-wave tasks only).
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
## Agent Registry (Interactive Agents)
|
|
140
|
-
|
|
141
|
-
| Agent | Role File | Pattern | Responsibility | Position |
|
|
142
|
-
|-------|-----------|---------|----------------|----------|
|
|
143
|
-
| reviewer | agents/reviewer.md | 2.3 (structured review) | Multi-dimensional solution review with verdict | post-wave (after SOLVE wave) |
|
|
144
|
-
|
|
145
|
-
> **COMPACT PROTECTION**: Agent files are execution documents. When context compression occurs, **you MUST immediately `Read` the corresponding agent.md** to reload.
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
## Output Artifacts
|
|
150
|
-
|
|
151
|
-
| File | Purpose | Lifecycle |
|
|
152
|
-
|------|---------|-----------|
|
|
153
|
-
| `tasks.csv` | Master state -- all tasks with status/findings | Updated after each wave |
|
|
154
|
-
| `wave-{N}.csv` | Per-wave input (temporary, csv-wave tasks only) | Created before wave, deleted after |
|
|
155
|
-
| `results.csv` | Final export of all task results | Created in Phase 4 |
|
|
156
|
-
| `discoveries.ndjson` | Shared exploration board (all agents, both modes) | Append-only, carries across waves |
|
|
157
|
-
| `context.md` | Human-readable execution report | Created in Phase 4 |
|
|
158
|
-
| `explorations/context-{issueId}.json` | Explorer context reports | Created by explorer agents |
|
|
159
|
-
| `solutions/solution-{issueId}.json` | Planner solution plans | Created by planner agents |
|
|
160
|
-
| `audits/audit-report.json` | Reviewer audit report | Created by reviewer agent |
|
|
161
|
-
| `queue/execution-queue.json` | Integrator execution queue | Created by integrator agent |
|
|
162
|
-
| `builds/build-{issueId}.json` | Implementer build results | Created by implementer agents |
|
|
163
|
-
| `interactive/{id}-result.json` | Results from interactive tasks | Created per interactive task |
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
## Session Structure
|
|
168
|
-
|
|
169
|
-
```
|
|
170
|
-
.workflow/.csv-wave/{session-id}/
|
|
171
|
-
+-- tasks.csv # Master state (all tasks, both modes)
|
|
172
|
-
+-- results.csv # Final results export
|
|
173
|
-
+-- discoveries.ndjson # Shared discovery board (all agents)
|
|
174
|
-
+-- context.md # Human-readable report
|
|
175
|
-
+-- wave-{N}.csv # Temporary per-wave input (csv-wave only)
|
|
176
|
-
+-- explorations/ # Explorer output
|
|
177
|
-
| +-- context-{issueId}.json
|
|
178
|
-
+-- solutions/ # Planner output
|
|
179
|
-
| +-- solution-{issueId}.json
|
|
180
|
-
+-- audits/ # Reviewer output
|
|
181
|
-
| +-- audit-report.json
|
|
182
|
-
+-- queue/ # Integrator output
|
|
183
|
-
| +-- execution-queue.json
|
|
184
|
-
+-- builds/ # Implementer output
|
|
185
|
-
| +-- build-{issueId}.json
|
|
186
|
-
+-- interactive/ # Interactive task artifacts
|
|
187
|
-
| +-- {id}-result.json
|
|
188
|
-
+-- wisdom/ # Cross-task knowledge
|
|
189
|
-
+-- learnings.md
|
|
190
|
-
+-- decisions.md
|
|
191
|
-
+-- conventions.md
|
|
192
|
-
+-- issues.md
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
|
|
197
|
-
## Implementation
|
|
198
|
-
|
|
199
|
-
### Session Initialization
|
|
200
|
-
|
|
201
|
-
```javascript
|
|
202
|
-
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
|
|
203
|
-
|
|
204
|
-
const AUTO_YES = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
|
|
205
|
-
const continueMode = $ARGUMENTS.includes('--continue')
|
|
206
|
-
const concurrencyMatch = $ARGUMENTS.match(/(?:--concurrency|-c)\s+(\d+)/)
|
|
207
|
-
const maxConcurrency = concurrencyMatch ? parseInt(concurrencyMatch[1]) : 3
|
|
208
|
-
|
|
209
|
-
const requirement = $ARGUMENTS
|
|
210
|
-
.replace(/--yes|-y|--continue|--concurrency\s+\d+|-c\s+\d+/g, '')
|
|
211
|
-
.trim()
|
|
212
|
-
|
|
213
|
-
// Parse issue IDs
|
|
214
|
-
const issueIdPattern = /(?:GH-\d+|ISS-\d{8}-\d{6})/g
|
|
215
|
-
let issueIds = requirement.match(issueIdPattern) || []
|
|
216
|
-
|
|
217
|
-
// Parse mode override
|
|
218
|
-
const modeMatch = requirement.match(/--mode=(\w+)/)
|
|
219
|
-
let pipelineMode = modeMatch ? modeMatch[1] : null
|
|
220
|
-
|
|
221
|
-
// Handle --all-pending
|
|
222
|
-
if (requirement.includes('--all-pending')) {
|
|
223
|
-
const result = Bash("ccw issue list --status registered,pending --json")
|
|
224
|
-
issueIds = JSON.parse(result).map(i => i.id)
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// If no issue IDs, ask user
|
|
228
|
-
if (issueIds.length === 0) {
|
|
229
|
-
const answer =
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
|
301
|
-
|
|
302
|
-
|
|
|
303
|
-
|
|
|
304
|
-
|
|
|
305
|
-
|
|
306
|
-
**
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
//
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
//
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
${
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
const
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
contextMd +=
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
contextMd +=
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
contextMd +=
|
|
626
|
-
contextMd +=
|
|
627
|
-
contextMd +=
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
`
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
|
675
|
-
|
|
676
|
-
|
|
|
677
|
-
|
|
|
678
|
-
|
|
|
679
|
-
|
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
|
686
|
-
|
|
687
|
-
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
**
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
-
|
|
725
|
-
-
|
|
726
|
-
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
-
|
|
731
|
-
-
|
|
732
|
-
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
-
|
|
738
|
-
-
|
|
739
|
-
|
|
740
|
-
|
|
1
|
+
---
|
|
2
|
+
name: team-issue
|
|
3
|
+
description: Hybrid team skill for issue resolution. CSV wave primary for exploration, planning, integration, and implementation. Interactive agents for review gates with fix cycles. Supports Quick, Full, and Batch pipelines.
|
|
4
|
+
argument-hint: "[-y|--yes] [-c|--concurrency N] [--continue] [--mode=quick|full|batch] \"issue-ids or --all-pending\""
|
|
5
|
+
allowed-tools: spawn_agents_on_csv, spawn_agent, wait, send_input, close_agent, Read, Write, Edit, Bash, Glob, Grep, request_user_input
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Auto Mode
|
|
9
|
+
|
|
10
|
+
When `--yes` or `-y`: Auto-confirm task decomposition, skip interactive validation, use defaults.
|
|
11
|
+
|
|
12
|
+
# Team Issue Resolution
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
$team-issue "ISS-20260308-120000 ISS-20260308-120001"
|
|
18
|
+
$team-issue -c 4 "ISS-20260308-120000 --mode=full"
|
|
19
|
+
$team-issue -y "--all-pending"
|
|
20
|
+
$team-issue --continue "issue-auth-fix-20260308"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Flags**:
|
|
24
|
+
- `-y, --yes`: Skip all confirmations (auto mode)
|
|
25
|
+
- `-c, --concurrency N`: Max concurrent agents within each wave (default: 3)
|
|
26
|
+
- `--continue`: Resume existing session
|
|
27
|
+
- `--mode=quick|full|batch`: Force pipeline mode (default: auto-detect)
|
|
28
|
+
|
|
29
|
+
**Output Directory**: `.workflow/.csv-wave/{session-id}/`
|
|
30
|
+
**Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `context.md` (human-readable report)
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Overview
|
|
35
|
+
|
|
36
|
+
Orchestrate issue resolution pipeline: explore context, plan solution, review (optional), marshal queue, implement. Supports Quick, Full, and Batch pipelines with review-fix cycle.
|
|
37
|
+
|
|
38
|
+
**Execution Model**: Hybrid -- CSV wave pipeline (primary) + individual agent spawn (secondary)
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
+---------------------------------------------------------------------------+
|
|
42
|
+
| TEAM ISSUE RESOLUTION WORKFLOW |
|
|
43
|
+
+---------------------------------------------------------------------------+
|
|
44
|
+
| |
|
|
45
|
+
| Phase 1: Requirement Parsing + Pipeline Selection |
|
|
46
|
+
| +-- Parse issue IDs (GH-\d+, ISS-\d{8}-\d{6}, --all-pending) |
|
|
47
|
+
| +-- Auto-detect pipeline mode (quick/full/batch) |
|
|
48
|
+
| +-- Determine execution method (codex/gemini/auto) |
|
|
49
|
+
| +-- Generate tasks.csv with wave + exec_mode columns |
|
|
50
|
+
| +-- User validates task breakdown (skip if -y) |
|
|
51
|
+
| |
|
|
52
|
+
| Phase 2: Wave Execution Engine (Extended) |
|
|
53
|
+
| +-- For each wave (1..N): |
|
|
54
|
+
| | +-- Execute pre-wave interactive tasks (if any) |
|
|
55
|
+
| | +-- Build wave CSV (filter csv-wave tasks for this wave) |
|
|
56
|
+
| | +-- Inject previous findings into prev_context column |
|
|
57
|
+
| | +-- spawn_agents_on_csv(wave CSV) |
|
|
58
|
+
| | +-- Execute post-wave interactive tasks (if any) |
|
|
59
|
+
| | +-- Merge all results into master tasks.csv |
|
|
60
|
+
| | +-- Check: any failed? -> skip dependents |
|
|
61
|
+
| +-- discoveries.ndjson shared across all modes (append-only) |
|
|
62
|
+
| |
|
|
63
|
+
| Phase 3: Post-Wave Interactive (Review Gate) |
|
|
64
|
+
| +-- Reviewer agent: multi-dimensional review with verdict |
|
|
65
|
+
| +-- Fix cycle: rejected -> revise solution -> re-review (max 2) |
|
|
66
|
+
| +-- Final aggregation / report |
|
|
67
|
+
| |
|
|
68
|
+
| Phase 4: Results Aggregation |
|
|
69
|
+
| +-- Export final results.csv |
|
|
70
|
+
| +-- Generate context.md with all findings |
|
|
71
|
+
| +-- Display summary: completed/failed/skipped per wave |
|
|
72
|
+
| +-- Offer: view results | retry failed | done |
|
|
73
|
+
| |
|
|
74
|
+
+---------------------------------------------------------------------------+
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Task Classification Rules
|
|
80
|
+
|
|
81
|
+
Each task is classified by `exec_mode`:
|
|
82
|
+
|
|
83
|
+
| exec_mode | Mechanism | Criteria |
|
|
84
|
+
|-----------|-----------|----------|
|
|
85
|
+
| `csv-wave` | `spawn_agents_on_csv` | One-shot, structured I/O, no multi-round interaction |
|
|
86
|
+
| `interactive` | `spawn_agent`/`wait`/`send_input`/`close_agent` | Multi-round, clarification, review gates |
|
|
87
|
+
|
|
88
|
+
**Classification Decision**:
|
|
89
|
+
|
|
90
|
+
| Task Property | Classification |
|
|
91
|
+
|---------------|---------------|
|
|
92
|
+
| Codebase exploration (EXPLORE-*) | `csv-wave` |
|
|
93
|
+
| Solution planning (SOLVE-*) | `csv-wave` |
|
|
94
|
+
| Queue formation / integration (MARSHAL-*) | `csv-wave` |
|
|
95
|
+
| Code implementation (BUILD-*) | `csv-wave` |
|
|
96
|
+
| Technical review with verdict (AUDIT-*) | `interactive` |
|
|
97
|
+
| Solution revision after rejection (SOLVE-fix-*) | `csv-wave` |
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## CSV Schema
|
|
102
|
+
|
|
103
|
+
### tasks.csv (Master State)
|
|
104
|
+
|
|
105
|
+
```csv
|
|
106
|
+
id,title,description,role,issue_ids,exec_mode,execution_method,deps,context_from,wave,status,findings,artifact_path,error
|
|
107
|
+
"EXPLORE-001","Context analysis","Analyze issue context and map codebase impact for ISS-20260308-120000","explorer","ISS-20260308-120000","csv-wave","","","","1","pending","","","",""
|
|
108
|
+
"SOLVE-001","Solution design","Design solution and decompose into implementation tasks","planner","ISS-20260308-120000","csv-wave","","EXPLORE-001","EXPLORE-001","2","pending","","","",""
|
|
109
|
+
"AUDIT-001","Technical review","Review solution for feasibility, risk, and completeness","reviewer","ISS-20260308-120000","interactive","","SOLVE-001","SOLVE-001","3","pending","","","",""
|
|
110
|
+
"MARSHAL-001","Queue formation","Form execution queue with conflict detection","integrator","ISS-20260308-120000","csv-wave","","AUDIT-001","SOLVE-001","4","pending","","","",""
|
|
111
|
+
"BUILD-001","Implementation","Implement solution plan and verify with tests","implementer","ISS-20260308-120000","csv-wave","gemini","MARSHAL-001","EXPLORE-001;SOLVE-001","5","pending","","","",""
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Columns**:
|
|
115
|
+
|
|
116
|
+
| Column | Phase | Description |
|
|
117
|
+
|--------|-------|-------------|
|
|
118
|
+
| `id` | Input | Unique task identifier (EXPLORE-NNN, SOLVE-NNN, AUDIT-NNN, MARSHAL-NNN, BUILD-NNN) |
|
|
119
|
+
| `title` | Input | Short task title |
|
|
120
|
+
| `description` | Input | Detailed task description |
|
|
121
|
+
| `role` | Input | Worker role: explorer, planner, reviewer, integrator, implementer |
|
|
122
|
+
| `issue_ids` | Input | Semicolon-separated issue IDs this task covers |
|
|
123
|
+
| `exec_mode` | Input | `csv-wave` or `interactive` |
|
|
124
|
+
| `execution_method` | Input | codex, gemini, qwen, or empty (for non-BUILD tasks) |
|
|
125
|
+
| `deps` | Input | Semicolon-separated dependency task IDs |
|
|
126
|
+
| `context_from` | Input | Semicolon-separated task IDs whose findings this task needs |
|
|
127
|
+
| `wave` | Computed | Wave number (computed by topological sort, 1-based) |
|
|
128
|
+
| `status` | Output | `pending` -> `completed` / `failed` / `skipped` |
|
|
129
|
+
| `findings` | Output | Key discoveries or implementation notes (max 500 chars) |
|
|
130
|
+
| `artifact_path` | Output | Path to generated artifact (context report, solution, queue, etc.) |
|
|
131
|
+
| `error` | Output | Error message if failed (empty if success) |
|
|
132
|
+
|
|
133
|
+
### Per-Wave CSV (Temporary)
|
|
134
|
+
|
|
135
|
+
Each wave generates a temporary `wave-{N}.csv` with extra `prev_context` column (csv-wave tasks only).
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Agent Registry (Interactive Agents)
|
|
140
|
+
|
|
141
|
+
| Agent | Role File | Pattern | Responsibility | Position |
|
|
142
|
+
|-------|-----------|---------|----------------|----------|
|
|
143
|
+
| reviewer | agents/reviewer.md | 2.3 (structured review) | Multi-dimensional solution review with verdict | post-wave (after SOLVE wave) |
|
|
144
|
+
|
|
145
|
+
> **COMPACT PROTECTION**: Agent files are execution documents. When context compression occurs, **you MUST immediately `Read` the corresponding agent.md** to reload.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Output Artifacts
|
|
150
|
+
|
|
151
|
+
| File | Purpose | Lifecycle |
|
|
152
|
+
|------|---------|-----------|
|
|
153
|
+
| `tasks.csv` | Master state -- all tasks with status/findings | Updated after each wave |
|
|
154
|
+
| `wave-{N}.csv` | Per-wave input (temporary, csv-wave tasks only) | Created before wave, deleted after |
|
|
155
|
+
| `results.csv` | Final export of all task results | Created in Phase 4 |
|
|
156
|
+
| `discoveries.ndjson` | Shared exploration board (all agents, both modes) | Append-only, carries across waves |
|
|
157
|
+
| `context.md` | Human-readable execution report | Created in Phase 4 |
|
|
158
|
+
| `explorations/context-{issueId}.json` | Explorer context reports | Created by explorer agents |
|
|
159
|
+
| `solutions/solution-{issueId}.json` | Planner solution plans | Created by planner agents |
|
|
160
|
+
| `audits/audit-report.json` | Reviewer audit report | Created by reviewer agent |
|
|
161
|
+
| `queue/execution-queue.json` | Integrator execution queue | Created by integrator agent |
|
|
162
|
+
| `builds/build-{issueId}.json` | Implementer build results | Created by implementer agents |
|
|
163
|
+
| `interactive/{id}-result.json` | Results from interactive tasks | Created per interactive task |
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Session Structure
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
.workflow/.csv-wave/{session-id}/
|
|
171
|
+
+-- tasks.csv # Master state (all tasks, both modes)
|
|
172
|
+
+-- results.csv # Final results export
|
|
173
|
+
+-- discoveries.ndjson # Shared discovery board (all agents)
|
|
174
|
+
+-- context.md # Human-readable report
|
|
175
|
+
+-- wave-{N}.csv # Temporary per-wave input (csv-wave only)
|
|
176
|
+
+-- explorations/ # Explorer output
|
|
177
|
+
| +-- context-{issueId}.json
|
|
178
|
+
+-- solutions/ # Planner output
|
|
179
|
+
| +-- solution-{issueId}.json
|
|
180
|
+
+-- audits/ # Reviewer output
|
|
181
|
+
| +-- audit-report.json
|
|
182
|
+
+-- queue/ # Integrator output
|
|
183
|
+
| +-- execution-queue.json
|
|
184
|
+
+-- builds/ # Implementer output
|
|
185
|
+
| +-- build-{issueId}.json
|
|
186
|
+
+-- interactive/ # Interactive task artifacts
|
|
187
|
+
| +-- {id}-result.json
|
|
188
|
+
+-- wisdom/ # Cross-task knowledge
|
|
189
|
+
+-- learnings.md
|
|
190
|
+
+-- decisions.md
|
|
191
|
+
+-- conventions.md
|
|
192
|
+
+-- issues.md
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Implementation
|
|
198
|
+
|
|
199
|
+
### Session Initialization
|
|
200
|
+
|
|
201
|
+
```javascript
|
|
202
|
+
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
|
|
203
|
+
|
|
204
|
+
const AUTO_YES = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
|
|
205
|
+
const continueMode = $ARGUMENTS.includes('--continue')
|
|
206
|
+
const concurrencyMatch = $ARGUMENTS.match(/(?:--concurrency|-c)\s+(\d+)/)
|
|
207
|
+
const maxConcurrency = concurrencyMatch ? parseInt(concurrencyMatch[1]) : 3
|
|
208
|
+
|
|
209
|
+
const requirement = $ARGUMENTS
|
|
210
|
+
.replace(/--yes|-y|--continue|--concurrency\s+\d+|-c\s+\d+/g, '')
|
|
211
|
+
.trim()
|
|
212
|
+
|
|
213
|
+
// Parse issue IDs
|
|
214
|
+
const issueIdPattern = /(?:GH-\d+|ISS-\d{8}-\d{6})/g
|
|
215
|
+
let issueIds = requirement.match(issueIdPattern) || []
|
|
216
|
+
|
|
217
|
+
// Parse mode override
|
|
218
|
+
const modeMatch = requirement.match(/--mode=(\w+)/)
|
|
219
|
+
let pipelineMode = modeMatch ? modeMatch[1] : null
|
|
220
|
+
|
|
221
|
+
// Handle --all-pending
|
|
222
|
+
if (requirement.includes('--all-pending')) {
|
|
223
|
+
const result = Bash("ccw issue list --status registered,pending --json")
|
|
224
|
+
issueIds = JSON.parse(result).map(i => i.id)
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// If no issue IDs, ask user
|
|
228
|
+
if (issueIds.length === 0) {
|
|
229
|
+
const answer = request_user_input({
|
|
230
|
+
questions: [{
|
|
231
|
+
question: "No issue IDs found. Please provide issue IDs.",
|
|
232
|
+
header: "Issue IDs",
|
|
233
|
+
id: "issue_input",
|
|
234
|
+
options: [
|
|
235
|
+
{ label: "Enter IDs", description: "Provide issue IDs (e.g., ISS-20260308-120000)" },
|
|
236
|
+
{ label: "Cancel", description: "Abort the pipeline" }
|
|
237
|
+
]
|
|
238
|
+
}]
|
|
239
|
+
})
|
|
240
|
+
if (answer.answers.issue_input.answers[0] === "Cancel") return
|
|
241
|
+
issueIds = answer.answers.issue_input.answers[0].match(issueIdPattern) || []
|
|
242
|
+
if (issueIds.length === 0) return // abort
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Auto-detect pipeline mode
|
|
246
|
+
if (!pipelineMode) {
|
|
247
|
+
// Load issue priorities
|
|
248
|
+
const priorities = []
|
|
249
|
+
for (const id of issueIds) {
|
|
250
|
+
const info = JSON.parse(Bash(`ccw issue status ${id} --json`))
|
|
251
|
+
priorities.push(info.priority || 0)
|
|
252
|
+
}
|
|
253
|
+
const hasHighPriority = priorities.some(p => p >= 4)
|
|
254
|
+
|
|
255
|
+
if (issueIds.length <= 2 && !hasHighPriority) pipelineMode = 'quick'
|
|
256
|
+
else if (issueIds.length <= 4) pipelineMode = 'full'
|
|
257
|
+
else pipelineMode = 'batch'
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// Execution method selection
|
|
261
|
+
let executionMethod = 'gemini' // default
|
|
262
|
+
const execMatch = requirement.match(/--exec=(\w+)/)
|
|
263
|
+
if (execMatch) executionMethod = execMatch[1]
|
|
264
|
+
|
|
265
|
+
const slug = issueIds[0].toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 30)
|
|
266
|
+
const dateStr = getUtc8ISOString().substring(0, 10).replace(/-/g, '')
|
|
267
|
+
const sessionId = `issue-${slug}-${dateStr}`
|
|
268
|
+
const sessionFolder = `.workflow/.csv-wave/${sessionId}`
|
|
269
|
+
|
|
270
|
+
Bash(`mkdir -p ${sessionFolder}/{explorations,solutions,audits,queue,builds,interactive,wisdom}`)
|
|
271
|
+
|
|
272
|
+
Write(`${sessionFolder}/discoveries.ndjson`, `# Discovery Board - ${sessionId}\n# Format: NDJSON\n`)
|
|
273
|
+
|
|
274
|
+
// Initialize wisdom files
|
|
275
|
+
Write(`${sessionFolder}/wisdom/learnings.md`, `# Learnings\n\nAccumulated during ${sessionId}\n`)
|
|
276
|
+
Write(`${sessionFolder}/wisdom/decisions.md`, `# Decisions\n\n`)
|
|
277
|
+
Write(`${sessionFolder}/wisdom/conventions.md`, `# Conventions\n\n`)
|
|
278
|
+
Write(`${sessionFolder}/wisdom/issues.md`, `# Issues\n\n`)
|
|
279
|
+
|
|
280
|
+
// Store session metadata
|
|
281
|
+
Write(`${sessionFolder}/session.json`, JSON.stringify({
|
|
282
|
+
session_id: sessionId,
|
|
283
|
+
pipeline_mode: pipelineMode,
|
|
284
|
+
issue_ids: issueIds,
|
|
285
|
+
execution_method: executionMethod,
|
|
286
|
+
fix_cycles: 0,
|
|
287
|
+
max_fix_cycles: 2,
|
|
288
|
+
created_at: getUtc8ISOString()
|
|
289
|
+
}, null, 2))
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
### Phase 1: Requirement -> CSV + Classification
|
|
295
|
+
|
|
296
|
+
**Objective**: Parse issue IDs, determine pipeline mode, generate tasks.csv with wave and exec_mode assignments.
|
|
297
|
+
|
|
298
|
+
**Decomposition Rules**:
|
|
299
|
+
|
|
300
|
+
| Pipeline | Tasks Generated |
|
|
301
|
+
|----------|----------------|
|
|
302
|
+
| quick | EXPLORE-001, SOLVE-001, MARSHAL-001, BUILD-001 (4 tasks, waves 1-4) |
|
|
303
|
+
| full | EXPLORE-001, SOLVE-001, AUDIT-001, MARSHAL-001, BUILD-001 (5 tasks, waves 1-5) |
|
|
304
|
+
| batch | EXPLORE-001..N, SOLVE-001..N, AUDIT-001, MARSHAL-001, BUILD-001..M (N+N+1+1+M tasks) |
|
|
305
|
+
|
|
306
|
+
**Classification Rules**:
|
|
307
|
+
|
|
308
|
+
| Task Prefix | Role | exec_mode | Rationale |
|
|
309
|
+
|-------------|------|-----------|-----------|
|
|
310
|
+
| EXPLORE-* | explorer | csv-wave | One-shot codebase analysis |
|
|
311
|
+
| SOLVE-* | planner | csv-wave | One-shot solution design via CLI |
|
|
312
|
+
| SOLVE-fix-* | planner | csv-wave | One-shot revision addressing feedback |
|
|
313
|
+
| AUDIT-* | reviewer | interactive | Multi-round review with verdict routing |
|
|
314
|
+
| MARSHAL-* | integrator | csv-wave | One-shot queue formation |
|
|
315
|
+
| BUILD-* | implementer | csv-wave | One-shot implementation via CLI |
|
|
316
|
+
|
|
317
|
+
**Wave Computation**: Kahn's BFS topological sort with depth tracking (csv-wave tasks only).
|
|
318
|
+
|
|
319
|
+
**User Validation**: Display task breakdown with wave + exec_mode assignment (skip if AUTO_YES).
|
|
320
|
+
|
|
321
|
+
**Task Generation by Pipeline Mode**:
|
|
322
|
+
|
|
323
|
+
Quick pipeline:
|
|
324
|
+
```csv
|
|
325
|
+
id,title,description,role,issue_ids,exec_mode,execution_method,deps,context_from,wave,status,findings,artifact_path,error
|
|
326
|
+
"EXPLORE-001","Context analysis","Analyze issue context and map codebase impact","explorer","<issue-ids>","csv-wave","","","","1","pending","","",""
|
|
327
|
+
"SOLVE-001","Solution design","Design solution and decompose into implementation tasks","planner","<issue-ids>","csv-wave","","EXPLORE-001","EXPLORE-001","2","pending","","",""
|
|
328
|
+
"MARSHAL-001","Queue formation","Form execution queue with conflict detection and ordering","integrator","<issue-ids>","csv-wave","","SOLVE-001","SOLVE-001","3","pending","","",""
|
|
329
|
+
"BUILD-001","Implementation","Implement solution plan and verify with tests","implementer","<issue-ids>","csv-wave","<exec-method>","MARSHAL-001","EXPLORE-001;SOLVE-001","4","pending","","",""
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
Full pipeline (adds AUDIT-001 as interactive between SOLVE and MARSHAL):
|
|
333
|
+
```csv
|
|
334
|
+
"AUDIT-001","Technical review","Review solution for feasibility, risk, and completeness","reviewer","<issue-ids>","interactive","","SOLVE-001","SOLVE-001","3","pending","","",""
|
|
335
|
+
"MARSHAL-001","Queue formation","...","integrator","<issue-ids>","csv-wave","","AUDIT-001","SOLVE-001","4","pending","","",""
|
|
336
|
+
"BUILD-001","Implementation","...","implementer","<issue-ids>","csv-wave","<exec-method>","MARSHAL-001","EXPLORE-001;SOLVE-001","5","pending","","",""
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
Batch pipeline (parallel EXPLORE, sequential SOLVE, then AUDIT, MARSHAL, deferred BUILD):
|
|
340
|
+
- EXPLORE-001..N with wave=1, no deps
|
|
341
|
+
- SOLVE-001..N with wave=2, deps on all EXPLORE-*
|
|
342
|
+
- AUDIT-001 with wave=3, deps on all SOLVE-*, interactive
|
|
343
|
+
- MARSHAL-001 with wave=4, deps on AUDIT-001
|
|
344
|
+
- BUILD-001..M created after MARSHAL completes (deferred)
|
|
345
|
+
|
|
346
|
+
**Success Criteria**:
|
|
347
|
+
- tasks.csv created with valid schema, wave, and exec_mode assignments
|
|
348
|
+
- No circular dependencies
|
|
349
|
+
- User approved (or AUTO_YES)
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
### Phase 2: Wave Execution Engine (Extended)
|
|
354
|
+
|
|
355
|
+
**Objective**: Execute tasks wave-by-wave with hybrid mechanism support and cross-wave context propagation.
|
|
356
|
+
|
|
357
|
+
```javascript
|
|
358
|
+
const masterCsv = Read(`${sessionFolder}/tasks.csv`)
|
|
359
|
+
let tasks = parseCsv(masterCsv)
|
|
360
|
+
const maxWave = Math.max(...tasks.map(t => parseInt(t.wave)))
|
|
361
|
+
let fixCycles = 0
|
|
362
|
+
|
|
363
|
+
for (let wave = 1; wave <= maxWave; wave++) {
|
|
364
|
+
console.log(`\nWave ${wave}/${maxWave}`)
|
|
365
|
+
|
|
366
|
+
// 1. Separate tasks by exec_mode
|
|
367
|
+
const waveTasks = tasks.filter(t => parseInt(t.wave) === wave)
|
|
368
|
+
const csvTasks = waveTasks.filter(t => t.exec_mode === 'csv-wave' && t.status === 'pending')
|
|
369
|
+
const interactiveTasks = waveTasks.filter(t => t.exec_mode === 'interactive' && t.status === 'pending')
|
|
370
|
+
|
|
371
|
+
// 2. Check dependencies - skip if upstream failed
|
|
372
|
+
for (const task of waveTasks) {
|
|
373
|
+
const depIds = (task.deps || '').split(';').filter(Boolean)
|
|
374
|
+
const depStatuses = depIds.map(id => tasks.find(t => t.id === id)?.status)
|
|
375
|
+
if (depStatuses.some(s => s === 'failed' || s === 'skipped')) {
|
|
376
|
+
task.status = 'skipped'
|
|
377
|
+
task.error = `Dependency failed: ${depIds.filter((id, i) =>
|
|
378
|
+
['failed','skipped'].includes(depStatuses[i])).join(', ')}`
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// 3. Execute csv-wave tasks
|
|
383
|
+
const pendingCsv = csvTasks.filter(t => t.status === 'pending')
|
|
384
|
+
if (pendingCsv.length > 0) {
|
|
385
|
+
// Build prev_context for each task
|
|
386
|
+
for (const task of pendingCsv) {
|
|
387
|
+
const contextIds = (task.context_from || '').split(';').filter(Boolean)
|
|
388
|
+
const prevFindings = contextIds.map(id => {
|
|
389
|
+
const src = tasks.find(t => t.id === id)
|
|
390
|
+
if (!src?.findings) return ''
|
|
391
|
+
return `## [${src.id}] ${src.title}\n${src.findings}`
|
|
392
|
+
}).filter(Boolean).join('\n\n')
|
|
393
|
+
task.prev_context = prevFindings
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// Write wave CSV
|
|
397
|
+
Write(`${sessionFolder}/wave-${wave}.csv`, toCsv(pendingCsv))
|
|
398
|
+
|
|
399
|
+
// Execute
|
|
400
|
+
spawn_agents_on_csv({
|
|
401
|
+
csv_path: `${sessionFolder}/wave-${wave}.csv`,
|
|
402
|
+
id_column: "id",
|
|
403
|
+
instruction: Read("~ or <project>/.codex/skills/team-issue/instructions/agent-instruction.md"),
|
|
404
|
+
max_concurrency: maxConcurrency,
|
|
405
|
+
max_runtime_seconds: 1200,
|
|
406
|
+
output_csv_path: `${sessionFolder}/wave-${wave}-results.csv`,
|
|
407
|
+
output_schema: {
|
|
408
|
+
type: "object",
|
|
409
|
+
properties: {
|
|
410
|
+
id: { type: "string" },
|
|
411
|
+
status: { type: "string", enum: ["completed", "failed"] },
|
|
412
|
+
findings: { type: "string" },
|
|
413
|
+
artifact_path: { type: "string" },
|
|
414
|
+
error: { type: "string" }
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
})
|
|
418
|
+
|
|
419
|
+
// Merge results
|
|
420
|
+
const results = parseCsv(Read(`${sessionFolder}/wave-${wave}-results.csv`))
|
|
421
|
+
for (const r of results) {
|
|
422
|
+
const t = tasks.find(t => t.id === r.id)
|
|
423
|
+
if (t) Object.assign(t, r)
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// Cleanup temp files
|
|
427
|
+
Bash(`rm -f ${sessionFolder}/wave-${wave}.csv ${sessionFolder}/wave-${wave}-results.csv`)
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// 4. Execute interactive tasks (post-wave)
|
|
431
|
+
const pendingInteractive = interactiveTasks.filter(t => t.status === 'pending')
|
|
432
|
+
for (const task of pendingInteractive) {
|
|
433
|
+
// Read agent definition
|
|
434
|
+
const agentDef = Read(`~ or <project>/.codex/skills/team-issue/agents/reviewer.md`)
|
|
435
|
+
|
|
436
|
+
// Build context from upstream tasks
|
|
437
|
+
const contextIds = (task.context_from || '').split(';').filter(Boolean)
|
|
438
|
+
const prevContext = contextIds.map(id => {
|
|
439
|
+
const src = tasks.find(t => t.id === id)
|
|
440
|
+
if (!src?.findings) return ''
|
|
441
|
+
return `## [${src.id}] ${src.title}\n${src.findings}\nArtifact: ${src.artifact_path || 'N/A'}`
|
|
442
|
+
}).filter(Boolean).join('\n\n')
|
|
443
|
+
|
|
444
|
+
const agent = spawn_agent({
|
|
445
|
+
message: `## TASK ASSIGNMENT
|
|
446
|
+
|
|
447
|
+
### MANDATORY FIRST STEPS (Agent Execute)
|
|
448
|
+
1. **Read role definition**: ~ or <project>/.codex/skills/team-issue/agents/reviewer.md (MUST read first)
|
|
449
|
+
2. Read: ${sessionFolder}/discoveries.ndjson (shared discoveries)
|
|
450
|
+
3. Read: .workflow/project-tech.json (if exists)
|
|
451
|
+
|
|
452
|
+
---
|
|
453
|
+
|
|
454
|
+
Goal: ${task.description}
|
|
455
|
+
Issue IDs: ${task.issue_ids}
|
|
456
|
+
Session: ${sessionFolder}
|
|
457
|
+
Scope: Review all solutions in ${sessionFolder}/solutions/ for technical feasibility, risk, and completeness
|
|
458
|
+
|
|
459
|
+
Deliverables:
|
|
460
|
+
- Audit report at ${sessionFolder}/audits/audit-report.json
|
|
461
|
+
- Per-issue verdict: approved (>=80), concerns (60-79), rejected (<60)
|
|
462
|
+
- Overall verdict
|
|
463
|
+
|
|
464
|
+
### Previous Context
|
|
465
|
+
${prevContext}`
|
|
466
|
+
})
|
|
467
|
+
|
|
468
|
+
const result = wait({ ids: [agent], timeout_ms: 600000 })
|
|
469
|
+
|
|
470
|
+
if (result.timed_out) {
|
|
471
|
+
send_input({ id: agent, message: "Please finalize and output current findings immediately." })
|
|
472
|
+
const retry = wait({ ids: [agent], timeout_ms: 120000 })
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
// Store interactive result
|
|
476
|
+
Write(`${sessionFolder}/interactive/${task.id}-result.json`, JSON.stringify({
|
|
477
|
+
task_id: task.id,
|
|
478
|
+
status: "completed",
|
|
479
|
+
findings: "Review completed",
|
|
480
|
+
timestamp: getUtc8ISOString()
|
|
481
|
+
}))
|
|
482
|
+
|
|
483
|
+
close_agent({ id: agent })
|
|
484
|
+
|
|
485
|
+
// Parse review verdict from audit report
|
|
486
|
+
let verdict = 'approved'
|
|
487
|
+
try {
|
|
488
|
+
const auditReport = JSON.parse(Read(`${sessionFolder}/audits/audit-report.json`))
|
|
489
|
+
verdict = auditReport.overall_verdict || 'approved'
|
|
490
|
+
} catch (e) { /* default to approved */ }
|
|
491
|
+
|
|
492
|
+
task.status = 'completed'
|
|
493
|
+
task.findings = `Review verdict: ${verdict}`
|
|
494
|
+
|
|
495
|
+
// Handle review-fix cycle
|
|
496
|
+
if (verdict === 'rejected' && fixCycles < 2) {
|
|
497
|
+
fixCycles++
|
|
498
|
+
// Create SOLVE-fix and AUDIT re-review tasks
|
|
499
|
+
const fixTask = {
|
|
500
|
+
id: `SOLVE-fix-${String(fixCycles).padStart(3, '0')}`,
|
|
501
|
+
title: `Revise solution (fix cycle ${fixCycles})`,
|
|
502
|
+
description: `Revise solution addressing reviewer feedback. Read audit report for rejection reasons.`,
|
|
503
|
+
role: 'planner',
|
|
504
|
+
issue_ids: task.issue_ids,
|
|
505
|
+
exec_mode: 'csv-wave',
|
|
506
|
+
execution_method: '',
|
|
507
|
+
deps: task.id,
|
|
508
|
+
context_from: task.id,
|
|
509
|
+
wave: String(parseInt(task.wave) + 1),
|
|
510
|
+
status: 'pending',
|
|
511
|
+
findings: '', artifact_path: '', error: ''
|
|
512
|
+
}
|
|
513
|
+
const reReviewTask = {
|
|
514
|
+
id: `AUDIT-${String(fixCycles + 1).padStart(3, '0')}`,
|
|
515
|
+
title: `Re-review revised solution (cycle ${fixCycles})`,
|
|
516
|
+
description: `Re-review revised solution focusing on previously rejected dimensions.`,
|
|
517
|
+
role: 'reviewer',
|
|
518
|
+
issue_ids: task.issue_ids,
|
|
519
|
+
exec_mode: 'interactive',
|
|
520
|
+
execution_method: '',
|
|
521
|
+
deps: fixTask.id,
|
|
522
|
+
context_from: fixTask.id,
|
|
523
|
+
wave: String(parseInt(task.wave) + 2),
|
|
524
|
+
status: 'pending',
|
|
525
|
+
findings: '', artifact_path: '', error: ''
|
|
526
|
+
}
|
|
527
|
+
tasks.push(fixTask, reReviewTask)
|
|
528
|
+
// Adjust MARSHAL and BUILD waves
|
|
529
|
+
for (const t of tasks) {
|
|
530
|
+
if (t.id.startsWith('MARSHAL') || t.id.startsWith('BUILD')) {
|
|
531
|
+
t.wave = String(parseInt(reReviewTask.wave) + (t.id.startsWith('MARSHAL') ? 1 : 2))
|
|
532
|
+
if (t.id.startsWith('MARSHAL')) t.deps = reReviewTask.id
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
} else if (verdict === 'rejected' && fixCycles >= 2) {
|
|
536
|
+
// Force proceed with warning
|
|
537
|
+
console.log(`WARNING: Fix cycle limit (${fixCycles}) reached. Forcing proceed to MARSHAL.`)
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// 5. Merge all results into master CSV
|
|
542
|
+
Write(`${sessionFolder}/tasks.csv`, toCsv(tasks))
|
|
543
|
+
|
|
544
|
+
// 6. Handle deferred BUILD task creation (batch mode after MARSHAL)
|
|
545
|
+
const completedMarshal = tasks.find(t => t.id === 'MARSHAL-001' && t.status === 'completed')
|
|
546
|
+
if (completedMarshal && pipelineMode === 'batch') {
|
|
547
|
+
try {
|
|
548
|
+
const queue = JSON.parse(Read(`${sessionFolder}/queue/execution-queue.json`))
|
|
549
|
+
const buildCount = queue.parallel_groups?.length || 1
|
|
550
|
+
for (let b = 1; b <= Math.min(buildCount, 3); b++) {
|
|
551
|
+
const buildIssues = queue.parallel_groups[b-1]?.issues || issueIds
|
|
552
|
+
tasks.push({
|
|
553
|
+
id: `BUILD-${String(b).padStart(3, '0')}`,
|
|
554
|
+
title: `Implementation group ${b}`,
|
|
555
|
+
description: `Implement solutions for issues in parallel group ${b}`,
|
|
556
|
+
role: 'implementer',
|
|
557
|
+
issue_ids: buildIssues.join(';'),
|
|
558
|
+
exec_mode: 'csv-wave',
|
|
559
|
+
execution_method: executionMethod,
|
|
560
|
+
deps: 'MARSHAL-001',
|
|
561
|
+
context_from: 'EXPLORE-001;SOLVE-001',
|
|
562
|
+
wave: String(parseInt(completedMarshal.wave) + 1),
|
|
563
|
+
status: 'pending',
|
|
564
|
+
findings: '', artifact_path: '', error: ''
|
|
565
|
+
})
|
|
566
|
+
}
|
|
567
|
+
Write(`${sessionFolder}/tasks.csv`, toCsv(tasks))
|
|
568
|
+
} catch (e) { /* single BUILD fallback */ }
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
**Success Criteria**:
|
|
574
|
+
- All waves executed in order
|
|
575
|
+
- Both csv-wave and interactive tasks handled per wave
|
|
576
|
+
- Each wave's results merged into master CSV before next wave starts
|
|
577
|
+
- Dependent tasks skipped when predecessor failed
|
|
578
|
+
- discoveries.ndjson accumulated across all waves and mechanisms
|
|
579
|
+
- Review-fix cycles handled (max 2)
|
|
580
|
+
- Deferred BUILD tasks created after MARSHAL (batch mode)
|
|
581
|
+
|
|
582
|
+
---
|
|
583
|
+
|
|
584
|
+
### Phase 3: Post-Wave Interactive
|
|
585
|
+
|
|
586
|
+
**Objective**: Handle any remaining interactive tasks after all waves complete. In most cases, the review gate is handled inline during Phase 2 wave execution.
|
|
587
|
+
|
|
588
|
+
If any interactive tasks remain unprocessed (e.g., from dynamically added fix cycles), execute them using the same spawn_agent protocol as Phase 2.
|
|
589
|
+
|
|
590
|
+
**Success Criteria**:
|
|
591
|
+
- All interactive tasks completed or skipped
|
|
592
|
+
- Fix cycle limit respected
|
|
593
|
+
|
|
594
|
+
---
|
|
595
|
+
|
|
596
|
+
### Phase 4: Results Aggregation
|
|
597
|
+
|
|
598
|
+
**Objective**: Generate final results and human-readable report.
|
|
599
|
+
|
|
600
|
+
```javascript
|
|
601
|
+
const tasks = parseCsv(Read(`${sessionFolder}/tasks.csv`))
|
|
602
|
+
const completed = tasks.filter(t => t.status === 'completed')
|
|
603
|
+
const failed = tasks.filter(t => t.status === 'failed')
|
|
604
|
+
const skipped = tasks.filter(t => t.status === 'skipped')
|
|
605
|
+
|
|
606
|
+
// Export results.csv
|
|
607
|
+
Bash(`cp ${sessionFolder}/tasks.csv ${sessionFolder}/results.csv`)
|
|
608
|
+
|
|
609
|
+
// Generate context.md
|
|
610
|
+
let contextMd = `# Issue Resolution Report\n\n`
|
|
611
|
+
contextMd += `**Session**: ${sessionId}\n`
|
|
612
|
+
contextMd += `**Pipeline**: ${pipelineMode}\n`
|
|
613
|
+
contextMd += `**Issues**: ${issueIds.join(', ')}\n`
|
|
614
|
+
contextMd += `**Fix Cycles**: ${fixCycles}/${2}\n\n`
|
|
615
|
+
|
|
616
|
+
contextMd += `## Summary\n\n`
|
|
617
|
+
contextMd += `| Status | Count |\n|--------|-------|\n`
|
|
618
|
+
contextMd += `| Completed | ${completed.length} |\n`
|
|
619
|
+
contextMd += `| Failed | ${failed.length} |\n`
|
|
620
|
+
contextMd += `| Skipped | ${skipped.length} |\n\n`
|
|
621
|
+
|
|
622
|
+
contextMd += `## Task Details\n\n`
|
|
623
|
+
for (const t of tasks) {
|
|
624
|
+
const icon = t.status === 'completed' ? '[OK]' : t.status === 'failed' ? '[FAIL]' : '[SKIP]'
|
|
625
|
+
contextMd += `${icon} **${t.id}**: ${t.title} (${t.role})\n`
|
|
626
|
+
if (t.findings) contextMd += ` Findings: ${t.findings.substring(0, 200)}\n`
|
|
627
|
+
if (t.artifact_path) contextMd += ` Artifact: ${t.artifact_path}\n`
|
|
628
|
+
if (t.error) contextMd += ` Error: ${t.error}\n`
|
|
629
|
+
contextMd += `\n`
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
contextMd += `## Deliverables\n\n`
|
|
633
|
+
contextMd += `| Artifact | Path |\n|----------|------|\n`
|
|
634
|
+
contextMd += `| Context Reports | ${sessionFolder}/explorations/ |\n`
|
|
635
|
+
contextMd += `| Solution Plans | ${sessionFolder}/solutions/ |\n`
|
|
636
|
+
contextMd += `| Audit Report | ${sessionFolder}/audits/audit-report.json |\n`
|
|
637
|
+
contextMd += `| Execution Queue | ${sessionFolder}/queue/execution-queue.json |\n`
|
|
638
|
+
contextMd += `| Build Results | ${sessionFolder}/builds/ |\n`
|
|
639
|
+
|
|
640
|
+
Write(`${sessionFolder}/context.md`, contextMd)
|
|
641
|
+
|
|
642
|
+
// Display summary
|
|
643
|
+
console.log(`
|
|
644
|
+
Issue Resolution Complete
|
|
645
|
+
Pipeline: ${pipelineMode}
|
|
646
|
+
Completed: ${completed.length} | Failed: ${failed.length} | Skipped: ${skipped.length}
|
|
647
|
+
Fix Cycles Used: ${fixCycles}/2
|
|
648
|
+
Output: ${sessionFolder}
|
|
649
|
+
`)
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
**Success Criteria**:
|
|
653
|
+
- results.csv exported (all tasks, both modes)
|
|
654
|
+
- context.md generated
|
|
655
|
+
- Summary displayed to user
|
|
656
|
+
|
|
657
|
+
---
|
|
658
|
+
|
|
659
|
+
## Shared Discovery Board Protocol
|
|
660
|
+
|
|
661
|
+
Both csv-wave and interactive agents share the same discoveries.ndjson file:
|
|
662
|
+
|
|
663
|
+
```jsonl
|
|
664
|
+
{"ts":"2026-03-08T10:00:00Z","worker":"EXPLORE-001","type":"file_found","data":{"path":"src/auth/handler.ts","relevance":"high","purpose":"Main auth handler"}}
|
|
665
|
+
{"ts":"2026-03-08T10:01:00Z","worker":"EXPLORE-001","type":"pattern_found","data":{"pattern":"middleware-chain","location":"src/middleware/","description":"Express middleware chain pattern"}}
|
|
666
|
+
{"ts":"2026-03-08T10:05:00Z","worker":"SOLVE-001","type":"solution_approach","data":{"issue_id":"ISS-20260308-120000","approach":"refactor","estimated_files":5}}
|
|
667
|
+
{"ts":"2026-03-08T10:10:00Z","worker":"BUILD-001","type":"impl_result","data":{"issue_id":"ISS-20260308-120000","files_changed":3,"tests_pass":true}}
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
**Discovery Types**:
|
|
671
|
+
|
|
672
|
+
| Type | Dedup Key | Data Schema | Description |
|
|
673
|
+
|------|-----------|-------------|-------------|
|
|
674
|
+
| `file_found` | `path` | `{path, relevance, purpose}` | Relevant file discovered |
|
|
675
|
+
| `pattern_found` | `pattern+location` | `{pattern, location, description}` | Code pattern identified |
|
|
676
|
+
| `dependency_found` | `from+to` | `{from, to, type}` | Dependency relationship |
|
|
677
|
+
| `solution_approach` | `issue_id` | `{issue_id, approach, estimated_files}` | Solution strategy |
|
|
678
|
+
| `conflict_found` | `files` | `{issues, files, resolution}` | File conflict between issues |
|
|
679
|
+
| `impl_result` | `issue_id` | `{issue_id, files_changed, tests_pass}` | Implementation outcome |
|
|
680
|
+
|
|
681
|
+
---
|
|
682
|
+
|
|
683
|
+
## Error Handling
|
|
684
|
+
|
|
685
|
+
| Error | Resolution |
|
|
686
|
+
|-------|------------|
|
|
687
|
+
| Circular dependency | Detect in wave computation, abort with error message |
|
|
688
|
+
| CSV agent timeout | Mark as failed in results, continue with wave |
|
|
689
|
+
| CSV agent failed | Mark as failed, skip dependent tasks in later waves |
|
|
690
|
+
| Interactive agent timeout | Urge convergence via send_input, then close if still timed out |
|
|
691
|
+
| Interactive agent failed | Mark as failed, skip dependents |
|
|
692
|
+
| All agents in wave failed | Log error, offer retry or abort |
|
|
693
|
+
| CSV parse error | Validate CSV format before execution, show line number |
|
|
694
|
+
| discoveries.ndjson corrupt | Ignore malformed lines, continue with valid entries |
|
|
695
|
+
| Review rejection exceeds 2 rounds | Force convergence to MARSHAL with warning |
|
|
696
|
+
| No issues found for given IDs | Report error, ask user for valid IDs |
|
|
697
|
+
| Deferred BUILD count unknown | Read execution-queue.json after MARSHAL completes |
|
|
698
|
+
| Continue mode: no session found | List available sessions, prompt user to select |
|
|
699
|
+
|
|
700
|
+
---
|
|
701
|
+
|
|
702
|
+
## Core Rules
|
|
703
|
+
|
|
704
|
+
1. **Start Immediately**: First action is session initialization, then Phase 1
|
|
705
|
+
2. **Wave Order is Sacred**: Never execute wave N before wave N-1 completes and results are merged
|
|
706
|
+
3. **CSV is Source of Truth**: Master tasks.csv holds all state (both csv-wave and interactive)
|
|
707
|
+
4. **CSV First**: Default to csv-wave for tasks; only use interactive when interaction pattern requires it
|
|
708
|
+
5. **Context Propagation**: prev_context built from master CSV, not from memory
|
|
709
|
+
6. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson -- both mechanisms share it
|
|
710
|
+
7. **Skip on Failure**: If a dependency failed, skip the dependent task (regardless of mechanism)
|
|
711
|
+
8. **Lifecycle Balance**: Every spawn_agent MUST have a matching close_agent
|
|
712
|
+
9. **Cleanup Temp Files**: Remove wave-{N}.csv after results are merged
|
|
713
|
+
10. **DO NOT STOP**: Continuous execution until all waves complete or all remaining tasks are skipped
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
---
|
|
717
|
+
|
|
718
|
+
## Coordinator Role Constraints (Main Agent)
|
|
719
|
+
|
|
720
|
+
**CRITICAL**: The coordinator (main agent executing this skill) is responsible for **orchestration only**, NOT implementation.
|
|
721
|
+
|
|
722
|
+
15. **Coordinator Does NOT Execute Code**: The main agent MUST NOT write, modify, or implement any code directly. All implementation work is delegated to spawned team agents. The coordinator only:
|
|
723
|
+
- Spawns agents with task assignments
|
|
724
|
+
- Waits for agent callbacks
|
|
725
|
+
- Merges results and coordinates workflow
|
|
726
|
+
- Manages workflow transitions between phases
|
|
727
|
+
|
|
728
|
+
16. **Patient Waiting is Mandatory**: Agent execution takes significant time (typically 10-30 minutes per phase, sometimes longer). The coordinator MUST:
|
|
729
|
+
- Wait patiently for `wait()` calls to complete
|
|
730
|
+
- NOT skip workflow steps due to perceived delays
|
|
731
|
+
- NOT assume agents have failed just because they're taking time
|
|
732
|
+
- Trust the timeout mechanisms defined in the skill
|
|
733
|
+
|
|
734
|
+
17. **Use send_input for Clarification**: When agents need guidance or appear stuck, the coordinator MUST:
|
|
735
|
+
- Use `send_input()` to ask questions or provide clarification
|
|
736
|
+
- NOT skip the agent or move to next phase prematurely
|
|
737
|
+
- Give agents opportunity to respond before escalating
|
|
738
|
+
- Example: `send_input({ id: agent_id, message: "Please provide status update or clarify blockers" })`
|
|
739
|
+
|
|
740
|
+
18. **No Workflow Shortcuts**: The coordinator MUST NOT:
|
|
741
|
+
- Skip phases or stages defined in the workflow
|
|
742
|
+
- Bypass required approval or review steps
|
|
743
|
+
- Execute dependent tasks before prerequisites complete
|
|
744
|
+
- Assume task completion without explicit agent callback
|
|
745
|
+
- Make up or fabricate agent results
|
|
746
|
+
|
|
747
|
+
19. **Respect Long-Running Processes**: This is a complex multi-agent workflow that requires patience:
|
|
748
|
+
- Total execution time may range from 30-90 minutes or longer
|
|
749
|
+
- Each phase may take 10-30 minutes depending on complexity
|
|
750
|
+
- The coordinator must remain active and attentive throughout the entire process
|
|
751
|
+
- Do not terminate or skip steps due to time concerns
|