maestro-flow 0.4.6 → 0.4.7
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/.codex/skills/maestro-collab/SKILL.md +218 -117
- package/.codex/skills/maestro-execute/SKILL.md +13 -11
- package/.codex/skills/maestro-milestone-audit/SKILL.md +12 -10
- package/.codex/skills/maestro-ui-codify/SKILL.md +18 -16
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +20 -13
- package/.codex/skills/manage-issue-discover/SKILL.md +19 -17
- package/.codex/skills/quality-debug/SKILL.md +35 -31
- package/.codex/skills/quality-refactor/SKILL.md +20 -12
- package/.codex/skills/quality-review/SKILL.md +21 -17
- package/.codex/skills/team-coordinate/SKILL.md +462 -235
- package/.codex/skills/team-coordinate/specs/role-catalog.md +132 -0
- package/.codex/skills/team-lifecycle-v4/SKILL.md +445 -191
- package/.codex/skills/team-quality-assurance/SKILL.md +205 -161
- package/.codex/skills/team-review/SKILL.md +198 -159
- package/.codex/skills/team-tech-debt/SKILL.md +214 -144
- package/.codex/skills/team-testing/SKILL.md +210 -158
- package/package.json +1 -1
- package/.codex/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +0 -247
- package/.codex/skills/team-coordinate/roles/coordinator/commands/dispatch.md +0 -126
- package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +0 -265
- package/.codex/skills/team-coordinate/roles/coordinator/role.md +0 -403
- package/.codex/skills/team-coordinate/specs/knowledge-transfer.md +0 -113
- package/.codex/skills/team-coordinate/specs/pipelines.md +0 -97
- package/.codex/skills/team-coordinate/specs/quality-gates.md +0 -112
- package/.codex/skills/team-coordinate/specs/role-spec-template.md +0 -192
- package/.codex/skills/team-executor/SKILL.md +0 -116
- package/.codex/skills/team-executor/roles/executor/commands/monitor.md +0 -213
- package/.codex/skills/team-executor/roles/executor/role.md +0 -173
- package/.codex/skills/team-executor/specs/session-schema.md +0 -230
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +0 -56
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +0 -61
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +0 -113
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +0 -189
- package/.codex/skills/team-lifecycle-v4/schemas/tasks-schema.md +0 -100
- package/.codex/skills/team-lifecycle-v4/specs/knowledge-transfer.md +0 -204
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +0 -72
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +0 -108
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +0 -163
- package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +0 -177
- package/.codex/skills/team-review/roles/coordinator/commands/analyze.md +0 -71
- package/.codex/skills/team-review/roles/coordinator/commands/dispatch.md +0 -90
- package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +0 -135
- package/.codex/skills/team-review/roles/coordinator/role.md +0 -176
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/analyze.md +0 -47
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +0 -163
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +0 -133
- package/.codex/skills/team-tech-debt/roles/coordinator/role.md +0 -173
- package/.codex/skills/team-testing/roles/coordinator/commands/analyze.md +0 -70
- package/.codex/skills/team-testing/roles/coordinator/commands/dispatch.md +0 -106
- package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +0 -156
- package/.codex/skills/team-testing/roles/coordinator/role.md +0 -185
|
@@ -1,235 +1,462 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: team-coordinate
|
|
3
|
-
description: Universal team coordination with dynamic role generation
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
|
41
|
-
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
|
106
|
-
|
|
107
|
-
| `
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
###
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
-
|
|
235
|
-
|
|
1
|
+
---
|
|
2
|
+
name: team-coordinate
|
|
3
|
+
description: Universal team coordination with dynamic role generation
|
|
4
|
+
argument-hint: "[task description] [-y|--yes] [-c|--concurrency N] [--continue]"
|
|
5
|
+
allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request_user_input
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<purpose>
|
|
9
|
+
Wave-based multi-role coordination via `spawn_agents_on_csv`. Dynamic role generation + linear wave execution with per-wave evaluation gates.
|
|
10
|
+
|
|
11
|
+
**Core difference from other team skills**: Roles are NOT predefined — they are dynamically generated from task analysis at runtime. Each role's behavioral instructions are encoded directly into the CSV `description` column, eliminating the need for role-spec files.
|
|
12
|
+
|
|
13
|
+
**Core workflow**: Analyze Task → Generate Dynamic Roles → Build CSV → Wave-by-Wave Execution with Evaluation → Aggregate Results
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
+-------------------------------------------------------------------+
|
|
17
|
+
| TEAM-COORDINATE CSV WAVE WORKFLOW |
|
|
18
|
+
+-------------------------------------------------------------------+
|
|
19
|
+
| |
|
|
20
|
+
| Phase 1: Task Analysis + CSV Generation |
|
|
21
|
+
| +-- Parse task description (text-level only) |
|
|
22
|
+
| +-- Signal detection → capability inference |
|
|
23
|
+
| +-- Dynamic role generation (max 5 roles) |
|
|
24
|
+
| +-- Wave assignment (4-tier linear topology) |
|
|
25
|
+
| +-- Evaluation criteria per task |
|
|
26
|
+
| +-- Build tasks.csv with role instructions in description |
|
|
27
|
+
| +-- User validates (skip if -y) |
|
|
28
|
+
| |
|
|
29
|
+
| Phase 2: Wave Execution Engine |
|
|
30
|
+
| +-- For each wave N (sequential): |
|
|
31
|
+
| | +-- EVALUATE: check evaluation_criteria vs findings |
|
|
32
|
+
| | +-- Skip wave if all tasks evaluated out |
|
|
33
|
+
| | +-- Build prev_context from upstream findings |
|
|
34
|
+
| | +-- spawn_agents_on_csv(wave-N.csv) |
|
|
35
|
+
| | +-- Merge results → master tasks.csv |
|
|
36
|
+
| | +-- Cascading skip on failure |
|
|
37
|
+
| | +-- Cleanup temp files |
|
|
38
|
+
| +-- discoveries.ndjson shared across all waves |
|
|
39
|
+
| |
|
|
40
|
+
| Phase 3: Results Aggregation |
|
|
41
|
+
| +-- Export results.csv |
|
|
42
|
+
| +-- Generate context.md |
|
|
43
|
+
| +-- Display summary with deliverables |
|
|
44
|
+
| |
|
|
45
|
+
+-------------------------------------------------------------------+
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
</purpose>
|
|
49
|
+
|
|
50
|
+
<context>
|
|
51
|
+
```bash
|
|
52
|
+
$team-coordinate "design and implement auth module"
|
|
53
|
+
$team-coordinate -y -c 3 "analyze performance bottlenecks"
|
|
54
|
+
$team-coordinate --continue "20260518-team-auth-system"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Flags**:
|
|
58
|
+
- `-y, --yes`: Skip all confirmations (auto mode)
|
|
59
|
+
- `-c, --concurrency N`: Max concurrent agents within each wave (default: 5)
|
|
60
|
+
- `--continue`: Resume existing session
|
|
61
|
+
|
|
62
|
+
**Session**: `.workflow/.csv-wave/{YYYYMMDD}-team-{slug}/`
|
|
63
|
+
**Output**: tasks.csv, results.csv, discoveries.ndjson, context.md
|
|
64
|
+
|
|
65
|
+
### Pre-load specs (optional)
|
|
66
|
+
|
|
67
|
+
1. `maestro spec load --category arch` — architecture constraints
|
|
68
|
+
2. `maestro wiki search "<topic>"` — relevant knowhow
|
|
69
|
+
3. Proceed without if unavailable.
|
|
70
|
+
|
|
71
|
+
### Specs Reference
|
|
72
|
+
|
|
73
|
+
| Spec | Purpose |
|
|
74
|
+
|------|---------|
|
|
75
|
+
| [specs/role-catalog.md](specs/role-catalog.md) | Signal detection, role definitions, wave tiers, evaluation criteria, quality gates |
|
|
76
|
+
</context>
|
|
77
|
+
|
|
78
|
+
<csv_schema>
|
|
79
|
+
|
|
80
|
+
### tasks.csv (Master State)
|
|
81
|
+
|
|
82
|
+
```csv
|
|
83
|
+
id,title,description,role,deps,context_from,wave,evaluation_criteria
|
|
84
|
+
"RESEARCH-001","Explore auth patterns","PURPOSE: Investigate authentication patterns in codebase | Success: Documented patterns with file references\nTASK:\n - Scan src/ for existing auth implementations\n - Identify JWT/session/OAuth patterns\n - Document integration points\nCONTEXT:\n - Key files: src/auth/**, src/middleware/**\nEXPECTED: Research findings with evidence\nCONSTRAINTS: Read-only analysis","researcher","","","1","always"
|
|
85
|
+
"DESIGN-001","Design auth architecture","PURPOSE: Design authentication module architecture | Success: Architecture doc with data model and API design\nTASK:\n - Design token lifecycle\n - Define middleware chain\n - Specify error handling\nCONTEXT:\n - Upstream: RESEARCH-001 findings\nEXPECTED: Architecture document\nCONSTRAINTS: Follow existing patterns","designer","RESEARCH-001","RESEARCH-001","2","if wave_1 findings indicate architecture decisions needed"
|
|
86
|
+
"IMPL-001","Implement auth module","PURPOSE: Implement authentication module | Success: Working auth with tests\nTASK:\n - Create auth middleware\n - Implement JWT utilities\n - Add integration tests\nCONTEXT:\n - Upstream: DESIGN-001 architecture\nEXPECTED: Source files + test coverage\nCONSTRAINTS: Follow design spec","developer","DESIGN-001","DESIGN-001","3","if wave_2 produced design artifacts"
|
|
87
|
+
"TEST-001","Validate auth implementation","PURPOSE: Validate auth module quality | Success: All tests pass, security checks clear\nTASK:\n - Run full test suite\n - Security audit on auth paths\n - Verify error handling\nCONTEXT:\n - Upstream: IMPL-001 files_modified\nEXPECTED: Test report + security findings\nCONSTRAINTS: No code modifications","tester","IMPL-001","IMPL-001","4","if wave_3 produced testable artifacts (files_modified non-empty)"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Input columns** (present in initial tasks.csv and wave-N.csv):
|
|
91
|
+
|
|
92
|
+
| Column | Description |
|
|
93
|
+
|--------|-------------|
|
|
94
|
+
| `id` | Task ID: `{PREFIX}-{NNN}` (dynamic prefix from role catalog) |
|
|
95
|
+
| `title` | Short task title |
|
|
96
|
+
| `description` | **Full role-specific instructions** — PURPOSE, TASK steps, CONTEXT, EXPECTED, CONSTRAINTS. This replaces role-spec files. |
|
|
97
|
+
| `role` | Dynamic role name (from Phase 1 signal detection) |
|
|
98
|
+
| `deps` | Semicolon-separated dependency task IDs |
|
|
99
|
+
| `context_from` | Semicolon-separated task IDs whose findings needed as context |
|
|
100
|
+
| `wave` | Wave number (1-4) |
|
|
101
|
+
| `evaluation_criteria` | Condition: `always` or conditional expression |
|
|
102
|
+
|
|
103
|
+
**Lifecycle columns** (initialized in tasks.csv Phase 1, updated during execution):
|
|
104
|
+
|
|
105
|
+
| Column | Initial Value | Description |
|
|
106
|
+
|--------|--------------|-------------|
|
|
107
|
+
| `status` | `pending` | Task lifecycle: pending → completed/failed/blocked/skipped |
|
|
108
|
+
| `findings` | `""` | Populated from output_schema `result_status` merge |
|
|
109
|
+
| `files_modified` | `""` | Populated from output_schema merge |
|
|
110
|
+
| `error` | `""` | Populated from output_schema merge |
|
|
111
|
+
|
|
112
|
+
**Output columns** (returned exclusively via `output_schema`, NOT in wave CSV):
|
|
113
|
+
|
|
114
|
+
| Column | Description |
|
|
115
|
+
|--------|-------------|
|
|
116
|
+
| `result_status` | completed / failed / blocked (maps to master `status` during merge) |
|
|
117
|
+
| `findings` | Key findings summary (max 500 chars) |
|
|
118
|
+
| `files_modified` | Semicolon-separated file paths |
|
|
119
|
+
| `error` | Error message if failed |
|
|
120
|
+
|
|
121
|
+
**Column separation rule**: Input columns and output_schema MUST NOT share names. Wave CSV contains Input columns + `prev_context` (dynamic, built from upstream findings). Output columns returned via `output_schema` using `result_status` (not `status`). Merge mapping: `result_status` → master `status`.
|
|
122
|
+
|
|
123
|
+
**prev_context format** (added to wave-N.csv only):
|
|
124
|
+
```
|
|
125
|
+
--- TASK-ID: RESEARCH-001 ---
|
|
126
|
+
{findings from RESEARCH-001}
|
|
127
|
+
--- TASK-ID: DESIGN-001 ---
|
|
128
|
+
{findings from DESIGN-001}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Per-Wave CSV (Temporary)
|
|
132
|
+
|
|
133
|
+
Each wave generates `wave-{N}.csv` with Input columns + `prev_context` (populated from upstream task findings).
|
|
134
|
+
|
|
135
|
+
### Output Artifacts
|
|
136
|
+
|
|
137
|
+
| File | Purpose | Lifecycle |
|
|
138
|
+
|------|---------|-----------|
|
|
139
|
+
| `tasks.csv` | Master state — all tasks with status/findings | Updated after each wave |
|
|
140
|
+
| `wave-{N}.csv` | Per-wave input (temporary) | Created before wave, deleted after |
|
|
141
|
+
| `wave-{N}-results.csv` | Per-wave output (uses `result_status`) | Created by spawn_agents_on_csv, deleted after merge |
|
|
142
|
+
| `results.csv` | Final export of all task results | Created in Phase 3 |
|
|
143
|
+
| `discoveries.ndjson` | Shared exploration board | Append-only across waves |
|
|
144
|
+
| `context.md` | Human-readable report | Created in Phase 3 |
|
|
145
|
+
|
|
146
|
+
### Session Structure
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
.workflow/.csv-wave/{YYYYMMDD}-team-{slug}/
|
|
150
|
+
+-- tasks.csv
|
|
151
|
+
+-- results.csv
|
|
152
|
+
+-- discoveries.ndjson
|
|
153
|
+
+-- context.md
|
|
154
|
+
+-- wave-{N}.csv (temporary)
|
|
155
|
+
+-- wave-{N}-results.csv (temporary)
|
|
156
|
+
```
|
|
157
|
+
</csv_schema>
|
|
158
|
+
|
|
159
|
+
<invariants>
|
|
160
|
+
1. **Start Immediately**: First action is session initialization, then Phase 1
|
|
161
|
+
2. **Wave Order is Sacred**: Never execute wave N+1 before wave N completes and results merge
|
|
162
|
+
3. **CSV is Source of Truth**: Master tasks.csv holds all execution state
|
|
163
|
+
4. **Column Separation Rule**: Input columns and output_schema MUST NOT share names
|
|
164
|
+
5. **Context Propagation**: prev_context built from master CSV findings, not from memory
|
|
165
|
+
6. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson
|
|
166
|
+
7. **Evaluate Before Execute**: Wave 2+ tasks MUST pass evaluation gate before inclusion
|
|
167
|
+
8. **Cascading Skip on Failure**: Failed/blocked tasks cascade skip to all dependents
|
|
168
|
+
9. **Cleanup Temp Files**: Delete `wave-{N}.csv` AND `wave-{N}-results.csv` after merge
|
|
169
|
+
10. **DO NOT STOP**: Continuous execution until all waves complete or user stops
|
|
170
|
+
11. **Max 5 Roles**: Dynamic role count capped at 5; merge overlapping if exceeded
|
|
171
|
+
12. **Dynamic Roles in CSV**: Role instructions encoded in `description` column, not in separate files
|
|
172
|
+
</invariants>
|
|
173
|
+
|
|
174
|
+
<state_machine>
|
|
175
|
+
|
|
176
|
+
<states>
|
|
177
|
+
S_PARSE — Parse arguments, detect mode (new/continue) PERSIST: —
|
|
178
|
+
S_ANALYZE — Signal detection, role generation, task decomp PERSIST: —
|
|
179
|
+
S_CSV_GEN — Generate tasks.csv with dynamic roles PERSIST: tasks.csv
|
|
180
|
+
S_EVAL_W1 — Evaluate Wave 1 (always passes) PERSIST: —
|
|
181
|
+
S_WAVE_1 — Execute Wave 1 (Analysis/Research) PERSIST: findings in master CSV
|
|
182
|
+
S_EVAL_W2 — Evaluate Wave 2 participation PERSIST: skipped tasks if any
|
|
183
|
+
S_WAVE_2 — Execute Wave 2 (Design/Planning) PERSIST: findings in master CSV
|
|
184
|
+
S_EVAL_W3 — Evaluate Wave 3 participation PERSIST: skipped tasks if any
|
|
185
|
+
S_WAVE_3 — Execute Wave 3 (Implementation) PERSIST: findings in master CSV
|
|
186
|
+
S_EVAL_W4 — Evaluate Wave 4 participation PERSIST: skipped tasks if any
|
|
187
|
+
S_WAVE_4 — Execute Wave 4 (Validation/Testing) PERSIST: findings in master CSV
|
|
188
|
+
S_AGGREGATE — Generate report, export results PERSIST: context.md, results.csv
|
|
189
|
+
</states>
|
|
190
|
+
|
|
191
|
+
<transitions>
|
|
192
|
+
S_PARSE → S_ANALYZE WHEN: new session
|
|
193
|
+
S_PARSE → S_EVAL_W{N} WHEN: --continue (resume at first pending wave)
|
|
194
|
+
S_ANALYZE → S_CSV_GEN
|
|
195
|
+
S_CSV_GEN → S_EVAL_W1
|
|
196
|
+
|
|
197
|
+
S_EVAL_W{N} → S_WAVE_{N} WHEN: tasks qualify after evaluation
|
|
198
|
+
S_EVAL_W{N} → S_EVAL_W{N+1} WHEN: all tasks skipped or no tasks in wave
|
|
199
|
+
S_WAVE_{N} → S_EVAL_W{N+1} WHEN: wave complete, N < 4
|
|
200
|
+
|
|
201
|
+
S_EVAL_W4 → S_AGGREGATE WHEN: after Wave 4 eval (regardless of skip)
|
|
202
|
+
S_WAVE_4 → S_AGGREGATE WHEN: Wave 4 complete
|
|
203
|
+
</transitions>
|
|
204
|
+
|
|
205
|
+
<actions>
|
|
206
|
+
|
|
207
|
+
### Session Initialization (S_PARSE)
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
Parse from $ARGUMENTS:
|
|
211
|
+
AUTO_YES ← --yes | -y
|
|
212
|
+
continueMode ← --continue
|
|
213
|
+
maxConcurrency ← --concurrency | -c N (default: 5)
|
|
214
|
+
taskDescription ← remaining text after flag removal
|
|
215
|
+
|
|
216
|
+
Derive:
|
|
217
|
+
dateStr ← UTC+8 YYYYMMDD
|
|
218
|
+
slug ← first 3 meaningful words, kebab-case
|
|
219
|
+
sessionId ← "{dateStr}-team-{slug}"
|
|
220
|
+
sessionFolder ← ".workflow/.csv-wave/{sessionId}"
|
|
221
|
+
|
|
222
|
+
mkdir -p {sessionFolder}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Session Resume (S_PARSE → S_EVAL_W{N})
|
|
226
|
+
|
|
227
|
+
When `--continue`:
|
|
228
|
+
1. Scan `.workflow/.csv-wave/*-team-*/tasks.csv` for sessions with pending tasks
|
|
229
|
+
2. Single match → resume. Multiple → `request_user_input` for selection.
|
|
230
|
+
3. Read master tasks.csv → find first wave with pending tasks → jump to S_EVAL_W{N}
|
|
231
|
+
|
|
232
|
+
### Phase 1: Task Analysis + CSV Generation (S_ANALYZE → S_CSV_GEN)
|
|
233
|
+
|
|
234
|
+
**TEXT-LEVEL analysis only. No codebase reading.**
|
|
235
|
+
|
|
236
|
+
1. **Parse task description**
|
|
237
|
+
|
|
238
|
+
2. **Clarify if ambiguous** (skip if `-y`):
|
|
239
|
+
- Scope? (specific files, module, project-wide)
|
|
240
|
+
- Deliverables? (documents, code, reports)
|
|
241
|
+
- Constraints? (technology, style)
|
|
242
|
+
|
|
243
|
+
3. **Signal detection** — scan keywords against `specs/role-catalog.md` §1 Signal Detection Table:
|
|
244
|
+
- Match keywords → capabilities → roles
|
|
245
|
+
- No match → single `general` role
|
|
246
|
+
|
|
247
|
+
4. **Role minimization**:
|
|
248
|
+
- Merge overlapping capabilities (e.g., "research + analysis" → single analyst)
|
|
249
|
+
- Cap at 5 roles
|
|
250
|
+
- Compute complexity score (§9 of role-catalog.md)
|
|
251
|
+
|
|
252
|
+
5. **Task decomposition** — for each role, create 1-3 tasks:
|
|
253
|
+
- Generate structured `description` with PURPOSE/TASK/CONTEXT/EXPECTED/CONSTRAINTS
|
|
254
|
+
- This description IS the role instruction — no separate role-spec file
|
|
255
|
+
- Infer key files from keywords (§8 of role-catalog.md)
|
|
256
|
+
|
|
257
|
+
6. **Wave assignment** — map roles to waves via §2 Wave Tier Mapping
|
|
258
|
+
|
|
259
|
+
7. **Evaluation criteria** — assign per task:
|
|
260
|
+
- Wave 1: `"always"`
|
|
261
|
+
- Wave 2+: conditional from §3 Evaluation Criteria Templates
|
|
262
|
+
|
|
263
|
+
8. **Dependency + context_from** — tasks in wave N depend on relevant tasks in wave N-1
|
|
264
|
+
|
|
265
|
+
9. **Write `tasks.csv`** with all rows (Input columns only, no status/findings)
|
|
266
|
+
|
|
267
|
+
10. **Write empty `discoveries.ndjson`**
|
|
268
|
+
|
|
269
|
+
11. **User validation** (skip if `-y`):
|
|
270
|
+
- Display: role count, task count per wave, evaluation criteria summary
|
|
271
|
+
- `request_user_input`: Proceed / Revise / Abort
|
|
272
|
+
|
|
273
|
+
### Phase 2: Wave Execution Engine (S_EVAL_W{N} → S_WAVE_{N})
|
|
274
|
+
|
|
275
|
+
For each wave N in ascending order (1 through 4):
|
|
276
|
+
|
|
277
|
+
#### Step 1: Evaluate (S_EVAL_W{N})
|
|
278
|
+
|
|
279
|
+
For each task in wave N with status=pending:
|
|
280
|
+
1. **Cascading check first**: if any task in `deps` OR `context_from` is failed/blocked/skipped → skip this task too
|
|
281
|
+
2. Read `evaluation_criteria` from master tasks.csv
|
|
282
|
+
3. If `"always"` → include
|
|
283
|
+
4. If conditional → read accumulated `findings` + `files_modified` from completed tasks in master CSV:
|
|
284
|
+
- Evaluate condition as a natural language check against accumulated context
|
|
285
|
+
- The coordinator interprets conditions semantically (e.g., "if wave_1 findings indicate design needed" → check if Wave 1 findings mention design/architecture keywords)
|
|
286
|
+
- Condition met → include
|
|
287
|
+
- Not met → set `status=skipped`, `error="evaluation: {criteria} not met"`
|
|
288
|
+
|
|
289
|
+
If no tasks qualify → skip to S_EVAL_W{N+1}. If ALL wave 1 tasks fail → abort pipeline, jump to S_AGGREGATE.
|
|
290
|
+
|
|
291
|
+
#### Step 2: Build prev_context
|
|
292
|
+
|
|
293
|
+
For each qualifying task:
|
|
294
|
+
- Read `context_from` task IDs
|
|
295
|
+
- Extract their `findings` from master CSV
|
|
296
|
+
- Concatenate as `prev_context` string
|
|
297
|
+
|
|
298
|
+
#### Step 3: Write wave-{N}.csv
|
|
299
|
+
|
|
300
|
+
Extract qualifying rows from master CSV. Add `prev_context` column.
|
|
301
|
+
|
|
302
|
+
#### Step 4: Execute (S_WAVE_{N})
|
|
303
|
+
|
|
304
|
+
```javascript
|
|
305
|
+
spawn_agents_on_csv({
|
|
306
|
+
csv_path: `${sessionFolder}/wave-${N}.csv`,
|
|
307
|
+
id_column: "id",
|
|
308
|
+
instruction: /* see Instruction Builder section below */,
|
|
309
|
+
max_concurrency: maxConcurrency,
|
|
310
|
+
max_runtime_seconds: 3600,
|
|
311
|
+
output_csv_path: `${sessionFolder}/wave-${N}-results.csv`,
|
|
312
|
+
output_schema: {
|
|
313
|
+
id, // mandatory: links to master CSV
|
|
314
|
+
result_status, // mandatory: completed | failed | blocked
|
|
315
|
+
findings, // key findings (max 500 chars)
|
|
316
|
+
files_modified, // semicolon-separated paths
|
|
317
|
+
error // error message if not completed
|
|
318
|
+
}
|
|
319
|
+
})
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
#### Step 5: Merge results
|
|
323
|
+
|
|
324
|
+
1. Read `wave-{N}-results.csv`
|
|
325
|
+
2. For each row: map `result_status` → master `status`, copy `findings`, `files_modified`, `error`
|
|
326
|
+
3. Update master `tasks.csv`
|
|
327
|
+
|
|
328
|
+
#### Step 6: Cascading skip
|
|
329
|
+
|
|
330
|
+
For each failed/blocked task in this wave:
|
|
331
|
+
- Find all downstream tasks (any task with this task in `deps`)
|
|
332
|
+
- Set their `status=skipped`, `error="upstream {id} failed"`
|
|
333
|
+
|
|
334
|
+
#### Step 7: Cleanup
|
|
335
|
+
|
|
336
|
+
Delete `wave-{N}.csv` AND `wave-{N}-results.csv`.
|
|
337
|
+
|
|
338
|
+
#### Step 8: Continue
|
|
339
|
+
|
|
340
|
+
Proceed to S_EVAL_W{N+1} (or S_AGGREGATE if N=4).
|
|
341
|
+
|
|
342
|
+
### Phase 3: Results Aggregation (S_AGGREGATE)
|
|
343
|
+
|
|
344
|
+
1. **Export results.csv** — copy master tasks.csv as final results
|
|
345
|
+
|
|
346
|
+
2. **Generate context.md**:
|
|
347
|
+
```markdown
|
|
348
|
+
# Team Coordinate Report: {taskDescription}
|
|
349
|
+
|
|
350
|
+
## Summary
|
|
351
|
+
- Roles: {role list with prefixes}
|
|
352
|
+
- Tasks: {completed}/{total} ({percent}%)
|
|
353
|
+
- Waves executed: {list of non-skipped waves}
|
|
354
|
+
|
|
355
|
+
## Wave Results
|
|
356
|
+
### Wave {N}: {stage name}
|
|
357
|
+
| Task | Role | Status | Findings |
|
|
358
|
+
|------|------|--------|----------|
|
|
359
|
+
| {id} | {role} | {status} | {findings} |
|
|
360
|
+
|
|
361
|
+
## Files Modified
|
|
362
|
+
{aggregated files_modified across all tasks}
|
|
363
|
+
|
|
364
|
+
## Discovery Board Summary
|
|
365
|
+
{key entries from discoveries.ndjson}
|
|
366
|
+
|
|
367
|
+
## Next Steps
|
|
368
|
+
{suggestions based on findings}
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
3. **Display completion report** with session path and deliverable locations
|
|
372
|
+
|
|
373
|
+
### Instruction Builder
|
|
374
|
+
|
|
375
|
+
The `instruction` parameter for `spawn_agents_on_csv` — shared behavioral contract:
|
|
376
|
+
|
|
377
|
+
```
|
|
378
|
+
You are a team-coordinate agent. Your role is specified in your CSV row's 'role' column.
|
|
379
|
+
|
|
380
|
+
## Your Task
|
|
381
|
+
Read your CSV row's 'description' column for full task instructions (PURPOSE, TASK, CONTEXT, EXPECTED, CONSTRAINTS).
|
|
382
|
+
|
|
383
|
+
## Context
|
|
384
|
+
- Session: {sessionFolder}
|
|
385
|
+
- Discovery board: {sessionFolder}/discoveries.ndjson (read before work, append findings)
|
|
386
|
+
- Previous wave context: read your CSV row's 'prev_context' column
|
|
387
|
+
|
|
388
|
+
## Role Behavior
|
|
389
|
+
Adopt the perspective and expertise matching your role:
|
|
390
|
+
- researcher: systematic investigation, evidence-based findings, hypothesis testing
|
|
391
|
+
- developer: implementation, code modification, testing, convergence verification
|
|
392
|
+
- analyst: multi-dimensional evaluation, scoring, gap identification
|
|
393
|
+
- designer: architecture, data models, interface design, component structure
|
|
394
|
+
- tester: validation, test creation, regression checking, security scanning
|
|
395
|
+
- planner: decomposition, sequencing, risk assessment, prioritization
|
|
396
|
+
- writer: documentation, content creation, clarity, consistency
|
|
397
|
+
- general: adapt to task requirements
|
|
398
|
+
|
|
399
|
+
## Quality Contract
|
|
400
|
+
1. Files claimed as created → verify they exist (Read)
|
|
401
|
+
2. Files claimed as modified → verify content changed (Read)
|
|
402
|
+
3. Verification fails → retry execution (max 2 retries)
|
|
403
|
+
4. Still fails → report result_status=blocked with error details
|
|
404
|
+
5. NEVER report completed without verification
|
|
405
|
+
|
|
406
|
+
## Discovery Board Protocol
|
|
407
|
+
Read {sessionFolder}/discoveries.ndjson before starting work.
|
|
408
|
+
Append findings as NDJSON lines:
|
|
409
|
+
{"ts":"<ISO>","worker":"<TASK-ID>","type":"<TYPE>","data":{...}}
|
|
410
|
+
Types: code_pattern, integration_point, convention, blocker, key_finding, decision
|
|
411
|
+
|
|
412
|
+
## Output
|
|
413
|
+
Return via output_schema:
|
|
414
|
+
- result_status: completed | failed | blocked
|
|
415
|
+
- findings: key findings summary (max 500 chars, be specific and actionable)
|
|
416
|
+
- files_modified: semicolon-separated paths of created/modified files
|
|
417
|
+
- error: error message if result_status is not completed
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
</actions>
|
|
421
|
+
</state_machine>
|
|
422
|
+
|
|
423
|
+
<discovery_board>
|
|
424
|
+
|
|
425
|
+
| Type | Dedup Key | Data |
|
|
426
|
+
|------|-----------|------|
|
|
427
|
+
| code_pattern | pattern_name | {name, location, description, usage} |
|
|
428
|
+
| integration_point | endpoint | {endpoint, consumers[], producers[], protocol} |
|
|
429
|
+
| convention | name | {name, description, examples[], scope} |
|
|
430
|
+
| blocker | issue | {issue, severity, affected_tasks[], workaround} |
|
|
431
|
+
| key_finding | topic | {topic, evidence, implications, confidence} |
|
|
432
|
+
| decision | subject | {subject, choice, rationale, alternatives[]} |
|
|
433
|
+
|
|
434
|
+
Protocol: read before work, append-only, dedup by type+key.
|
|
435
|
+
</discovery_board>
|
|
436
|
+
|
|
437
|
+
<error_codes>
|
|
438
|
+
|
|
439
|
+
| Condition | Recovery |
|
|
440
|
+
|-----------|----------|
|
|
441
|
+
| No capabilities detected | Default to single `general` role in wave 1 |
|
|
442
|
+
| All wave 1 tasks failed | Abort pipeline (downstream has no context) |
|
|
443
|
+
| All tasks in wave N failed | Skip subsequent waves, proceed to aggregation |
|
|
444
|
+
| Evaluation skipped all tasks in wave | Normal — skip wave, continue to next |
|
|
445
|
+
| Task timeout | Mark failed, cascade skip dependents |
|
|
446
|
+
| Session not found (--continue) | Error with available session list |
|
|
447
|
+
| tasks.csv corrupted | Error, suggest manual recovery or new session |
|
|
448
|
+
| Role count exceeds 5 | Auto-merge overlapping roles |
|
|
449
|
+
</error_codes>
|
|
450
|
+
|
|
451
|
+
<success_criteria>
|
|
452
|
+
- [ ] Dynamic roles generated from task description keywords
|
|
453
|
+
- [ ] tasks.csv created with role instructions in description column
|
|
454
|
+
- [ ] Wave 1 executed with at least 1 task
|
|
455
|
+
- [ ] Wave 2-4 evaluation gates applied (tasks included, skipped, or wave skipped)
|
|
456
|
+
- [ ] prev_context built from upstream findings for each wave
|
|
457
|
+
- [ ] Column separation rule maintained (no shared names between input and output)
|
|
458
|
+
- [ ] wave-N.csv and wave-N-results.csv deleted after merge
|
|
459
|
+
- [ ] discoveries.ndjson append-only throughout
|
|
460
|
+
- [ ] results.csv and context.md generated in Phase 3
|
|
461
|
+
- [ ] Session resumable via --continue
|
|
462
|
+
</success_criteria>
|