maestro-flow 0.3.38 → 0.3.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/.claude/agents/workflow-analyzer.md +2 -0
  2. package/.claude/agents/workflow-debugger.md +2 -0
  3. package/.claude/agents/workflow-executor.md +2 -0
  4. package/.claude/agents/workflow-integration-checker.md +1 -0
  5. package/.claude/agents/workflow-nyquist-auditor.md +1 -0
  6. package/.claude/agents/workflow-planner.md +2 -0
  7. package/.claude/agents/workflow-reviewer.md +2 -0
  8. package/.claude/agents/workflow-verifier.md +2 -0
  9. package/.claude/commands/learn-decompose.md +176 -176
  10. package/.claude/commands/learn-follow.md +167 -167
  11. package/.claude/commands/learn-investigate.md +221 -221
  12. package/.claude/commands/learn-retro.md +303 -303
  13. package/.claude/commands/learn-second-opinion.md +167 -167
  14. package/.claude/commands/maestro-amend.md +300 -300
  15. package/.claude/commands/maestro-analyze.md +126 -126
  16. package/.claude/commands/maestro-brainstorm.md +100 -100
  17. package/.claude/commands/maestro-composer.md +354 -354
  18. package/.claude/commands/maestro-execute.md +120 -114
  19. package/.claude/commands/maestro-fork.md +86 -86
  20. package/.claude/commands/maestro-init.md +78 -78
  21. package/.claude/commands/maestro-learn.md +140 -140
  22. package/.claude/commands/maestro-link-coordinate.md +1 -1
  23. package/.claude/commands/maestro-merge.md +61 -61
  24. package/.claude/commands/maestro-milestone-release.md +96 -96
  25. package/.claude/commands/maestro-overlay.md +178 -178
  26. package/.claude/commands/maestro-plan.md +150 -138
  27. package/.claude/commands/maestro-player.md +404 -404
  28. package/.claude/commands/maestro-quick.md +56 -56
  29. package/.claude/commands/maestro-ralph-execute.md +7 -18
  30. package/.claude/commands/maestro-ralph.md +9 -3
  31. package/.claude/commands/maestro-roadmap.md +1 -1
  32. package/.claude/commands/maestro-ui-design.md +93 -93
  33. package/.claude/commands/maestro-update.md +176 -176
  34. package/.claude/commands/maestro-verify.md +96 -90
  35. package/.claude/commands/maestro.md +121 -121
  36. package/.claude/commands/manage-codebase-rebuild.md +75 -75
  37. package/.claude/commands/manage-codebase-refresh.md +57 -57
  38. package/.claude/commands/manage-harvest.md +94 -94
  39. package/.claude/commands/manage-issue-discover.md +77 -77
  40. package/.claude/commands/manage-issue.md +73 -73
  41. package/.claude/commands/manage-knowhow-capture.md +193 -193
  42. package/.claude/commands/manage-knowhow.md +77 -77
  43. package/.claude/commands/manage-learn.md +67 -67
  44. package/.claude/commands/manage-status.md +51 -51
  45. package/.claude/commands/manage-wiki.md +62 -62
  46. package/.claude/commands/quality-auto-test.md +1 -1
  47. package/.claude/commands/quality-debug.md +121 -115
  48. package/.claude/commands/quality-refactor.md +55 -55
  49. package/.claude/commands/quality-retrospective.md +78 -78
  50. package/.claude/commands/quality-review.md +114 -108
  51. package/.claude/commands/quality-sync.md +51 -51
  52. package/.claude/commands/quality-test.md +103 -103
  53. package/.claude/commands/spec-add.md +49 -49
  54. package/.claude/commands/spec-load.md +51 -51
  55. package/.claude/commands/spec-remove.md +51 -51
  56. package/.claude/commands/spec-setup.md +51 -51
  57. package/.claude/commands/wiki-connect.md +62 -62
  58. package/.claude/commands/wiki-digest.md +69 -69
  59. package/.codex/skills/learn-decompose/SKILL.md +113 -113
  60. package/.codex/skills/learn-follow/SKILL.md +1 -1
  61. package/.codex/skills/learn-investigate/SKILL.md +83 -83
  62. package/.codex/skills/learn-retro/SKILL.md +83 -83
  63. package/.codex/skills/learn-second-opinion/SKILL.md +86 -86
  64. package/.codex/skills/maestro/SKILL.md +304 -304
  65. package/.codex/skills/maestro-analyze/SKILL.md +4 -3
  66. package/.codex/skills/maestro-brainstorm/SKILL.md +442 -397
  67. package/.codex/skills/maestro-composer/SKILL.md +213 -213
  68. package/.codex/skills/maestro-execute/SKILL.md +346 -318
  69. package/.codex/skills/maestro-fork/SKILL.md +56 -2
  70. package/.codex/skills/maestro-init/SKILL.md +40 -16
  71. package/.codex/skills/maestro-learn/SKILL.md +80 -80
  72. package/.codex/skills/maestro-link-coordinate/SKILL.md +257 -257
  73. package/.codex/skills/maestro-merge/SKILL.md +1 -1
  74. package/.codex/skills/maestro-milestone-audit/SKILL.md +1 -1
  75. package/.codex/skills/maestro-milestone-complete/SKILL.md +40 -9
  76. package/.codex/skills/maestro-milestone-release/SKILL.md +70 -70
  77. package/.codex/skills/maestro-overlay/SKILL.md +1 -1
  78. package/.codex/skills/maestro-plan/SKILL.md +19 -4
  79. package/.codex/skills/maestro-player/SKILL.md +323 -323
  80. package/.codex/skills/maestro-quick/SKILL.md +1 -1
  81. package/.codex/skills/maestro-ralph/SKILL.md +681 -578
  82. package/.codex/skills/maestro-roadmap/SKILL.md +518 -468
  83. package/.codex/skills/maestro-ui-design/SKILL.md +109 -12
  84. package/.codex/skills/maestro-verify/SKILL.md +27 -9
  85. package/.codex/skills/manage-codebase-rebuild/SKILL.md +3 -2
  86. package/.codex/skills/manage-codebase-refresh/SKILL.md +1 -1
  87. package/.codex/skills/manage-harvest/SKILL.md +91 -91
  88. package/.codex/skills/manage-issue/SKILL.md +19 -6
  89. package/.codex/skills/manage-issue-discover/SKILL.md +1 -1
  90. package/.codex/skills/manage-knowhow/SKILL.md +95 -95
  91. package/.codex/skills/manage-knowhow-capture/SKILL.md +110 -110
  92. package/.codex/skills/manage-learn/SKILL.md +1 -1
  93. package/.codex/skills/manage-status/SKILL.md +1 -1
  94. package/.codex/skills/manage-wiki/SKILL.md +55 -55
  95. package/.codex/skills/quality-auto-test/SKILL.md +547 -547
  96. package/.codex/skills/quality-debug/SKILL.md +339 -334
  97. package/.codex/skills/quality-refactor/SKILL.md +1 -1
  98. package/.codex/skills/quality-retrospective/SKILL.md +292 -292
  99. package/.codex/skills/quality-review/SKILL.md +365 -364
  100. package/.codex/skills/quality-sync/SKILL.md +1 -1
  101. package/.codex/skills/quality-test/SKILL.md +498 -498
  102. package/.codex/skills/spec-add/SKILL.md +101 -101
  103. package/.codex/skills/spec-load/SKILL.md +77 -77
  104. package/.codex/skills/spec-map/SKILL.md +1 -1
  105. package/.codex/skills/spec-remove/SKILL.md +69 -69
  106. package/.codex/skills/spec-setup/SKILL.md +1 -1
  107. package/.codex/skills/team-coordinate/SKILL.md +2 -1
  108. package/.codex/skills/team-executor/SKILL.md +116 -115
  109. package/.codex/skills/team-lifecycle-v4/SKILL.md +2 -1
  110. package/.codex/skills/team-lifecycle-v4/instructions/agent-instruction.md +14 -6
  111. package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +16 -4
  112. package/.codex/skills/team-lifecycle-v4/roles/executor/commands/implement.md +7 -1
  113. package/.codex/skills/team-lifecycle-v4/roles/planner/role.md +16 -4
  114. package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +8 -2
  115. package/.codex/skills/team-quality-assurance/SKILL.md +2 -1
  116. package/.codex/skills/team-quality-assurance/roles/scout/role.md +9 -2
  117. package/.codex/skills/team-review/SKILL.md +2 -1
  118. package/.codex/skills/team-review/roles/reviewer/role.md +10 -1
  119. package/.codex/skills/team-review/roles/scanner/role.md +10 -1
  120. package/.codex/skills/team-tech-debt/SKILL.md +144 -143
  121. package/.codex/skills/team-tech-debt/roles/executor/role.md +9 -5
  122. package/.codex/skills/team-tech-debt/roles/scanner/role.md +10 -0
  123. package/.codex/skills/team-tech-debt/roles/validator/role.md +8 -2
  124. package/.codex/skills/team-testing/SKILL.md +2 -1
  125. package/.codex/skills/team-testing/roles/executor/role.md +8 -2
  126. package/.codex/skills/team-testing/roles/generator/role.md +8 -2
  127. package/.codex/skills/wiki-connect/SKILL.md +73 -73
  128. package/.codex/skills/wiki-digest/SKILL.md +87 -87
  129. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +4 -0
  130. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
  131. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +6 -0
  132. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
  133. package/dashboard/dist-server/shared/agent-types.d.ts +2 -0
  134. package/dashboard/dist-server/src/agents/cli-agent-runner.d.ts +2 -0
  135. package/dashboard/dist-server/src/agents/cli-agent-runner.js +4 -0
  136. package/dashboard/dist-server/src/agents/cli-agent-runner.js.map +1 -1
  137. package/dashboard/dist-server/src/commands/delegate.d.ts +2 -0
  138. package/dashboard/dist-server/src/commands/delegate.js +18 -0
  139. package/dashboard/dist-server/src/commands/delegate.js.map +1 -1
  140. package/dashboard/dist-server/src/config/cli-tools-config.d.ts +6 -0
  141. package/dashboard/dist-server/src/config/cli-tools-config.js +2 -0
  142. package/dashboard/dist-server/src/config/cli-tools-config.js.map +1 -1
  143. package/dist/shared/agent-types.d.ts +2 -0
  144. package/dist/shared/agent-types.d.ts.map +1 -1
  145. package/dist/src/agents/cli-agent-runner.d.ts +2 -0
  146. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  147. package/dist/src/agents/cli-agent-runner.js +4 -0
  148. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  149. package/dist/src/commands/config.d.ts.map +1 -1
  150. package/dist/src/commands/config.js +29 -1
  151. package/dist/src/commands/config.js.map +1 -1
  152. package/dist/src/commands/delegate.d.ts +2 -0
  153. package/dist/src/commands/delegate.d.ts.map +1 -1
  154. package/dist/src/commands/delegate.js +18 -0
  155. package/dist/src/commands/delegate.js.map +1 -1
  156. package/dist/src/commands/launcher.d.ts.map +1 -1
  157. package/dist/src/commands/launcher.js +27 -4
  158. package/dist/src/commands/launcher.js.map +1 -1
  159. package/dist/src/config/cli-tools-config.d.ts +6 -0
  160. package/dist/src/config/cli-tools-config.d.ts.map +1 -1
  161. package/dist/src/config/cli-tools-config.js +2 -0
  162. package/dist/src/config/cli-tools-config.js.map +1 -1
  163. package/dist/src/core/overlay/applier.d.ts.map +1 -1
  164. package/dist/src/core/overlay/applier.js +65 -5
  165. package/dist/src/core/overlay/applier.js.map +1 -1
  166. package/dist/src/core/overlay/loader.d.ts.map +1 -1
  167. package/dist/src/core/overlay/loader.js +9 -4
  168. package/dist/src/core/overlay/loader.js.map +1 -1
  169. package/dist/src/core/overlay/types.d.ts +2 -0
  170. package/dist/src/core/overlay/types.d.ts.map +1 -1
  171. package/dist/src/core/overlay/types.js +2 -0
  172. package/dist/src/core/overlay/types.js.map +1 -1
  173. package/dist/src/tui/tools-ui/ToolsDashboard.d.ts.map +1 -1
  174. package/dist/src/tui/tools-ui/ToolsDashboard.js +1 -1
  175. package/dist/src/tui/tools-ui/ToolsDashboard.js.map +1 -1
  176. package/dist/src/tui/tools-ui/ToolsOverview.d.ts.map +1 -1
  177. package/dist/src/tui/tools-ui/ToolsOverview.js +51 -4
  178. package/dist/src/tui/tools-ui/ToolsOverview.js.map +1 -1
  179. package/package.json +1 -1
  180. package/shared/agent-types.ts +2 -0
  181. package/workflows/delegate-protocol.codex.md +65 -0
@@ -1,364 +1,365 @@
1
- ---
2
- name: quality-review
3
- description: Tiered code review via CSV wave pipeline. Decomposes into 6 dimension agents running in parallel, with optional deep-dive aggregation wave. Replaces quality-review command.
4
- argument-hint: "[-y|--yes] [-c|--concurrency N] [--continue] \"<phase> [--level quick|standard|deep] [--dimensions list]\""
5
- allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
- ---
7
-
8
- <purpose>
9
- Wave-based multi-dimensional code review using `spawn_agents_on_csv`. Decomposes review into independent dimension agents (Wave 1), then aggregates findings into a unified report with verdict (Wave 2).
10
-
11
- **Core workflow**: Collect Files -> Decompose Dimensions -> Parallel Review -> Aggregate + Verdict
12
-
13
- ```
14
- +---------------------------------------------------------------------------+
15
- | CODE REVIEW CSV WAVE WORKFLOW |
16
- +---------------------------------------------------------------------------+
17
- | |
18
- | Phase 1: Phase Resolution -> CSV |
19
- | +-- Resolve phase directory from arguments |
20
- | +-- Collect changed files from task summaries |
21
- | +-- Auto-detect review level (quick/standard/deep) |
22
- | +-- Determine active dimensions |
23
- | +-- Generate tasks.csv with one row per dimension |
24
- | +-- User validates dimension breakdown (skip if -y) |
25
- | |
26
- | Phase 2: Wave Execution Engine |
27
- | +-- Wave 1: Dimension Review (parallel) |
28
- | | +-- Each dimension agent reviews all changed files |
29
- | | +-- Agent classifies findings by severity |
30
- | | +-- Discoveries shared via board (patterns, conventions) |
31
- | | +-- Results: severity_counts + top_issues per dimension |
32
- | +-- Wave 2: Aggregation + Deep-Dive (if needed) |
33
- | | +-- Aggregate all dimension findings |
34
- | | +-- If criticals > 0 (standard) or always (deep): deep-dive |
35
- | | +-- Cross-dimension impact analysis |
36
- | | +-- Generate verdict: PASS / WARN / BLOCK |
37
- | +-- discoveries.ndjson shared across all waves (append-only) |
38
- | |
39
- | Phase 3: Results Aggregation |
40
- | +-- Export results.csv + review.json |
41
- | +-- Generate context.md with all findings |
42
- | +-- Auto-create issues for qualifying findings |
43
- | +-- Update phase index.json with review status |
44
- | +-- Display summary with verdict + next steps |
45
- | |
46
- +---------------------------------------------------------------------------+
47
- ```
48
- </purpose>
49
-
50
- <context>
51
- ```bash
52
- $quality-review "3"
53
- $quality-review -c 6 "3 --level deep"
54
- $quality-review -y "3 --dimensions security,performance"
55
- $quality-review --continue "20260318-review-P3-auth"
56
- ```
57
-
58
- **Flags**:
59
- - `-y, --yes`: Skip all confirmations (auto mode)
60
- - `-c, --concurrency N`: Max concurrent agents within each wave (default: 6)
61
- - `--continue`: Resume existing session
62
-
63
- When `--yes` or `-y`: Auto-confirm dimension selection, skip interactive validation, use defaults for level detection.
64
-
65
- **Output Directory**: `.workflow/.csv-wave/{session-id}/`
66
- **Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `context.md` (human-readable report) + `review.json` (structured review output)
67
- </context>
68
-
69
- <csv_schema>
70
-
71
- ### tasks.csv (Master State)
72
-
73
- ```csv
74
- id,title,description,dimension,changed_files,project_specs,review_level,deps,context_from,wave,status,findings,severity_counts,top_issues,error
75
- "1","Correctness Review","Review all changed files for correctness: logic errors, missing edge cases, incorrect return values, null/undefined handling, off-by-one errors. Classify each finding as critical/high/medium/low with file:line references.","correctness","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","Existing patterns use Result type for error handling","standard","","","1","","","","",""
76
- "2","Security Review","Review all changed files for security vulnerabilities: injection flaws, XSS, CSRF, auth bypass, sensitive data exposure, insecure crypto. Reference OWASP Top 10. Classify each finding.","security","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","Auth uses bcrypt + JWT","standard","","","1","","","","",""
77
- "3","Performance Review","Review all changed files for performance issues: N+1 queries, unnecessary re-renders, memory leaks, blocking operations, unoptimized algorithms.","performance","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","","standard","","","1","","","","",""
78
- "4","Architecture Review","Review all changed files for architecture issues: layer violations, circular dependencies, inappropriate coupling, missing abstractions, SRP violations.","architecture","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","ESM modules, strict TypeScript","standard","","","1","","","","",""
79
- "5","Maintainability Review","Review all changed files for maintainability: code duplication, overly complex functions, poor naming, missing types, unclear control flow.","maintainability","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","","standard","","","1","","","","",""
80
- "6","Best Practices Review","Review all changed files for best-practice violations: error handling gaps, missing validation, hardcoded values, deprecated API usage, inconsistent patterns.","best-practices","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","","standard","","","1","","","","",""
81
- "7","Aggregate + Deep-Dive","Aggregate all dimension findings. Calculate severity distribution. Determine verdict (PASS/WARN/BLOCK). If critical findings exist, perform deep-dive with cross-file impact analysis.","aggregation","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","","standard","1;2;3;4;5;6","1;2;3;4;5;6","2","","","","",""
82
- ```
83
-
84
- **Columns**:
85
-
86
- | Column | Phase | Description |
87
- |--------|-------|-------------|
88
- | `id` | Input | Unique task identifier (string) |
89
- | `title` | Input | Short task title |
90
- | `description` | Input | Detailed review instructions for this dimension |
91
- | `dimension` | Input | Review dimension: correctness/security/performance/architecture/maintainability/best-practices/aggregation |
92
- | `changed_files` | Input | Semicolon-separated file paths to review |
93
- | `project_specs` | Input | Relevant project specs/conventions context |
94
- | `review_level` | Input | quick/standard/deep -- controls depth |
95
- | `deps` | Input | Semicolon-separated dependency task IDs |
96
- | `context_from` | Input | Semicolon-separated task IDs whose findings this task needs |
97
- | `wave` | Computed | Wave number (1 = dimension review, 2 = aggregation) |
98
- | `status` | Output | `pending` -> `completed` / `failed` / `skipped` |
99
- | `findings` | Output | Key review findings summary (max 500 chars) |
100
- | `severity_counts` | Output | JSON: `{"critical":N,"high":N,"medium":N,"low":N}` |
101
- | `top_issues` | Output | Top 5 issues with `[severity] description (file:line)` format |
102
- | `error` | Output | Error message if failed |
103
-
104
- ### Per-Wave CSV (Temporary)
105
-
106
- Each wave generates `wave-{N}.csv` with extra `prev_context` column.
107
-
108
- ### Output Artifacts
109
-
110
- | File | Purpose | Lifecycle |
111
- |------|---------|-----------|
112
- | `tasks.csv` | Master state -- all tasks with status/findings | Updated after each wave |
113
- | `wave-{N}.csv` | Per-wave input (temporary) | Created before wave, deleted after |
114
- | `results.csv` | Final export of all task results | Created in Phase 3 |
115
- | `discoveries.ndjson` | Shared exploration board | Append-only, carries across waves |
116
- | `context.md` | Human-readable review report | Created in Phase 3 |
117
- | `review.json` | Structured review output for downstream | Created in Phase 3 |
118
-
119
- ### Session Structure
120
-
121
- ```
122
- .workflow/.csv-wave/{YYYYMMDD}-review-P{N}-{slug}/
123
- +-- tasks.csv
124
- +-- results.csv
125
- +-- discoveries.ndjson
126
- +-- context.md
127
- +-- review.json
128
- +-- wave-{N}.csv (temporary)
129
- ```
130
- </csv_schema>
131
-
132
- <invariants>
133
- 1. **Start Immediately**: First action is session initialization, then Phase 1
134
- 2. **Wave Order is Sacred**: Never execute wave 2 before wave 1 completes and results are merged
135
- 3. **CSV is Source of Truth**: Master tasks.csv holds all state
136
- 4. **Context Propagation**: prev_context built from master CSV, not from memory
137
- 5. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson
138
- 6. **Skip on Failure**: If all dimension agents failed, skip aggregation
139
- 7. **Cleanup Temp Files**: Remove wave-{N}.csv after results are merged
140
- 8. **DO NOT STOP**: Continuous execution until all waves complete
141
- </invariants>
142
-
143
- <execution>
144
-
145
- ### Session Initialization
146
-
147
- Parse `$ARGUMENTS` to extract:
148
- - `AUTO_YES` from `--yes` / `-y`
149
- - `continueMode` from `--continue`
150
- - `maxConcurrency` from `--concurrency N` / `-c N` (default: 6)
151
- - `levelMatch` from `--level quick|standard|deep`
152
- - `dimsMatch` from `--dimensions <list>`
153
- - `phaseArg` = remaining text after stripping all flags
154
-
155
- Session ID: `{YYYYMMDD}-review-P{phaseArg}-{phaseSlug}` (phaseSlug from index.json or roadmap)
156
- Session folder: `.workflow/.csv-wave/{sessionId}/` create via `mkdir -p`
157
-
158
- ### Phase 1: Phase Resolution -> CSV
159
-
160
- **Objective**: Resolve phase, collect changed files, determine review level, generate tasks.csv.
161
-
162
- **Decomposition Rules**:
163
-
164
- 1. **Phase resolution**: Resolve `{phaseArg}` via `state.json` artifact registry to `.workflow/scratch/{YYYYMMDD}-{type}-{slug}/`
165
- 2. **Related session discovery**: Query `state.json.artifacts[]` for matching phase + milestone. Extract prior quality context (verdicts, root causes, UAT gaps) from artifact outputs by type (execute → .summaries/.task/, review → review.json, debug → understanding.md, test → uat.md)
166
- 3. **File collection**: Read `.task/TASK-*.json` → collect `files[].path` where action != "read"
167
- 4. **Level detection**:
168
-
169
- | Condition | Level |
170
- |-----------|-------|
171
- | `--level` flag provided | Use explicit level |
172
- | <=3 changed files | quick |
173
- | 4-19 changed files | standard |
174
- | >=20 files OR phase marked critical | deep |
175
-
176
- 5. **Dimension selection**:
177
-
178
- | Level | Dimensions |
179
- |-------|------------|
180
- | quick | correctness, security |
181
- | standard | correctness, security, performance, architecture, maintainability, best-practices |
182
- | deep | all 6 + forced deep-dive in aggregation |
183
-
184
- If `--dimensions` flag provided, override with explicit list.
185
-
186
- 6. **Specs loading**: Read `.workflow/specs/` for project conventions (unless `--skip-specs`)
187
- 7. **CSV generation**: One row per dimension + one aggregation row
188
-
189
- **Wave computation**: Simple 2-wave -- all dimension tasks = wave 1, aggregation = wave 2.
190
-
191
- **User validation**: Display task breakdown (skip if AUTO_YES).
192
-
193
- ### Phase 2: Wave Execution Engine
194
-
195
- **Objective**: Execute dimension reviews wave-by-wave via spawn_agents_on_csv.
196
-
197
- #### Wave 1: Dimension Reviews (Parallel)
198
-
199
- Filter master `tasks.csv` for `wave == 1 AND status == pending` → write `wave-1.csv` (no prev_context needed).
200
-
201
- ```javascript
202
- spawn_agents_on_csv({
203
- csv_path: `${sessionFolder}/wave-1.csv`,
204
- id_column: "id",
205
- instruction: buildReviewInstruction(sessionFolder),
206
- max_concurrency: maxConcurrency,
207
- max_runtime_seconds: 3600,
208
- output_csv_path: `${sessionFolder}/wave-1-results.csv`,
209
- output_schema: {
210
- type: "object",
211
- properties: {
212
- id: { type: "string" },
213
- status: { type: "string", enum: ["completed", "failed"] },
214
- findings: { type: "string" },
215
- severity_counts: { type: "string" },
216
- top_issues: { type: "string" },
217
- error: { type: "string" }
218
- },
219
- required: ["id", "status", "findings"]
220
- }
221
- })
222
- ```
223
-
224
- Merge `wave-1-results.csv` into master `tasks.csv`, delete `wave-1.csv`.
225
-
226
- #### Wave 2: Aggregation + Deep-Dive
227
-
228
- Filter master `tasks.csv` for `wave == 2 AND status == pending`. If all wave 1 tasks failed, skip aggregation.
229
-
230
- Build `prev_context` from wave 1 findings (format: `[Task N: Title] summary...` per task).
231
- Write `wave-2.csv` with `prev_context` column execute `spawn_agents_on_csv` merge results delete `wave-2.csv`.
232
-
233
- ### Phase 3: Results Aggregation
234
-
235
- **Objective**: Generate final results and human-readable report.
236
-
237
- Export master `tasks.csv` as `results.csv`. Build `review.json`:
238
-
239
- ```json
240
- {
241
- "phase": "<phase>",
242
- "level": "<level>",
243
- "verdict": "PASS|WARN|BLOCK",
244
- "severity_distribution": { "critical": 0, "high": 0, "medium": 0, "low": 0 },
245
- "dimensions": [
246
- { "dimension": "correctness", "status": "completed", "severity_counts": {...}, "top_issues": [...] }
247
- ],
248
- "deep_dive": { "performed": true/false, "iterations": N, "impact_analysis": "..." },
249
- "issues_created": [],
250
- "timestamp": "<ISO>"
251
- }
252
- ```
253
-
254
- Generate `context.md`:
255
-
256
- ```markdown
257
- # Code Review Report -- Phase {phase}
258
-
259
- ## Summary
260
- - Level: {level}
261
- - Files reviewed: {file_count}
262
- - Dimensions: {dimension_count}
263
- - Verdict: **{verdict}**
264
-
265
- ## Severity Distribution
266
- | Severity | Count |
267
- |----------|-------|
268
- | Critical | {N} |
269
- | High | {N} |
270
- | Medium | {N} |
271
- | Low | {N} |
272
-
273
- ## Dimension Results
274
- ### {dimension_name}
275
- {findings}
276
-
277
- **Top Issues:**
278
- {top_issues}
279
-
280
- ## Deep-Dive Analysis
281
- {if performed: impact analysis results}
282
-
283
- ## Issues Created
284
- {list of created issue IDs}
285
- ```
286
-
287
- **Verdict determination**:
288
-
289
- | Condition | Verdict |
290
- |-----------|---------|
291
- | Any critical findings | BLOCK |
292
- | High findings > 3 | BLOCK |
293
- | Any high findings | WARN |
294
- | Medium findings > 5 | WARN |
295
- | Otherwise | PASS |
296
-
297
- **Issue creation** by level threshold:
298
-
299
- | Level | Create Issues For |
300
- |-------|------------------|
301
- | quick | critical only |
302
- | standard | critical + high |
303
- | deep | critical + high + medium |
304
-
305
- **Phase index update**: Update `{artifact_dir}/index.json` with review status.
306
-
307
- **Register artifact**: Append to `state.json.artifacts[]` with `type: "review"`, `id: REV-NNN`, `path: "scratch/{YYYYMMDD}-review-P{N}-{slug}"`, `depends_on: exec_art.id`. Output directory is independent scratch, not shared with plan.
308
-
309
- Display summary.
310
-
311
- ### Shared Discovery Board Protocol
312
-
313
- #### Standard Discovery Types
314
-
315
- | Type | Dedup Key | Data Schema | Description |
316
- |------|-----------|-------------|-------------|
317
- | `code_pattern` | `data.name` | `{name, file, description}` | Reusable code pattern found |
318
- | `integration_point` | `data.file` | `{file, description, exports[]}` | Module connection point |
319
- | `convention` | singleton | `{naming, imports, formatting}` | Project code conventions |
320
- | `blocker` | `data.issue` | `{issue, severity, impact}` | Blocking issue found |
321
- | `tech_stack` | singleton | `{framework, language, tools[]}` | Technology stack info |
322
-
323
- #### Domain Discovery Types
324
-
325
- | Type | Dedup Key | Data Schema | Description |
326
- |------|-----------|-------------|-------------|
327
- | `vulnerability` | `data.location` | `{location, type, severity, cwe}` | Security vulnerability |
328
- | `code_smell` | `data.location` | `{location, type, severity, description}` | Code quality issue |
329
- | `performance_hotspot` | `data.location` | `{location, type, impact}` | Performance issue |
330
- | `architecture_violation` | `data.location` | `{location, rule, description}` | Architecture rule violation |
331
-
332
- #### Protocol
333
-
334
- Read `{session_folder}/discoveries.ndjson` before own review. Deduplicate by type + dedup key before writing. Append-only — never modify or delete.
335
-
336
- ```bash
337
- echo '{"ts":"<ISO>","worker":"{id}","type":"vulnerability","data":{"location":"src/auth/login.ts:42","type":"sql_injection","severity":"critical","cwe":"CWE-89"}}' >> {session_folder}/discoveries.ndjson
338
- ```
339
- </execution>
340
-
341
- <error_codes>
342
-
343
- | Error | Resolution |
344
- |-------|------------|
345
- | Phase directory not found | Abort with error: "Phase {N} not found" |
346
- | No task summaries found | Abort with error: "No execution results -- run execute first" |
347
- | No changed files | Abort with error: "No changed files detected" |
348
- | Dimension agent timeout | Mark as failed, skip dependent aggregation if all failed |
349
- | Aggregation agent failed | Use wave 1 results directly, verdict based on raw counts |
350
- | CSV parse error | Validate format, show line number |
351
- | discoveries.ndjson corrupt | Ignore malformed lines |
352
- | Continue mode: no session found | List available sessions |
353
- </error_codes>
354
-
355
- <success_criteria>
356
- - [ ] Session folder created with valid tasks.csv
357
- - [ ] All dimension reviews executed in parallel (wave 1)
358
- - [ ] Aggregation + deep-dive executed (wave 2)
359
- - [ ] review.json produced with verdict and severity distribution
360
- - [ ] context.md produced with full review report
361
- - [ ] Issues auto-created for qualifying severity findings
362
- - [ ] Phase index.json updated with review status
363
- - [ ] discoveries.ndjson append-only throughout
364
- </success_criteria>
1
+ ---
2
+ name: quality-review
3
+ description: Tiered code review with severity classification
4
+ argument-hint: "[-y|--yes] [-c|--concurrency N] [--continue] \"<phase> [--level quick|standard|deep] [--dimensions list]\""
5
+ allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
+ ---
7
+
8
+ <purpose>
9
+ Wave-based multi-dimensional code review using `spawn_agents_on_csv`. Decomposes review into independent dimension agents (Wave 1), then aggregates findings into a unified report with verdict (Wave 2).
10
+
11
+ **Core workflow**: Collect Files -> Decompose Dimensions -> Parallel Review -> Aggregate + Verdict
12
+
13
+ ```
14
+ +---------------------------------------------------------------------------+
15
+ | CODE REVIEW CSV WAVE WORKFLOW |
16
+ +---------------------------------------------------------------------------+
17
+ | |
18
+ | Phase 1: Phase Resolution -> CSV |
19
+ | +-- Resolve phase directory from arguments |
20
+ | +-- Collect changed files from task summaries |
21
+ | +-- Auto-detect review level (quick/standard/deep) |
22
+ | +-- Determine active dimensions |
23
+ | +-- Generate tasks.csv with one row per dimension |
24
+ | +-- User validates dimension breakdown (skip if -y) |
25
+ | |
26
+ | Phase 2: Wave Execution Engine |
27
+ | +-- Wave 1: Dimension Review (parallel) |
28
+ | | +-- Each dimension agent reviews all changed files |
29
+ | | +-- Agent classifies findings by severity |
30
+ | | +-- Discoveries shared via board (patterns, conventions) |
31
+ | | +-- Results: severity_counts + top_issues per dimension |
32
+ | +-- Wave 2: Aggregation + Deep-Dive (if needed) |
33
+ | | +-- Aggregate all dimension findings |
34
+ | | +-- If criticals > 0 (standard) or always (deep): deep-dive |
35
+ | | +-- Cross-dimension impact analysis |
36
+ | | +-- Generate verdict: PASS / WARN / BLOCK |
37
+ | +-- discoveries.ndjson shared across all waves (append-only) |
38
+ | |
39
+ | Phase 3: Results Aggregation |
40
+ | +-- Export results.csv + review.json |
41
+ | +-- Generate context.md with all findings |
42
+ | +-- Auto-create issues for qualifying findings |
43
+ | +-- Update phase index.json with review status |
44
+ | +-- Display summary with verdict + next steps |
45
+ | |
46
+ +---------------------------------------------------------------------------+
47
+ ```
48
+
49
+ </purpose>
50
+
51
+ <context>
52
+ ```bash
53
+ $quality-review "3"
54
+ $quality-review -c 6 "3 --level deep"
55
+ $quality-review -y "3 --dimensions security,performance"
56
+ $quality-review --continue "20260318-review-P3-auth"
57
+ ```
58
+
59
+ **Flags**:
60
+ - `-y, --yes`: Skip all confirmations (auto mode)
61
+ - `-c, --concurrency N`: Max concurrent agents within each wave (default: 6)
62
+ - `--continue`: Resume existing session
63
+
64
+ When `--yes` or `-y`: Auto-confirm dimension selection, skip interactive validation, use defaults for level detection.
65
+
66
+ **Output Directory**: `.workflow/.csv-wave/{session-id}/`
67
+ **Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `context.md` (human-readable report) + `review.json` (structured review output)
68
+ </context>
69
+
70
+ <csv_schema>
71
+
72
+ ### tasks.csv (Master State)
73
+
74
+ ```csv
75
+ id,title,description,dimension,changed_files,project_specs,review_level,deps,context_from,wave,status,findings,severity_counts,top_issues,error
76
+ "1","Correctness Review","Review all changed files for correctness: logic errors, missing edge cases, incorrect return values, null/undefined handling, off-by-one errors. Classify each finding as critical/high/medium/low with file:line references.","correctness","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","Existing patterns use Result type for error handling","standard","","","1","","","","",""
77
+ "2","Security Review","Review all changed files for security vulnerabilities: injection flaws, XSS, CSRF, auth bypass, sensitive data exposure, insecure crypto. Reference OWASP Top 10. Classify each finding.","security","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","Auth uses bcrypt + JWT","standard","","","1","","","","",""
78
+ "3","Performance Review","Review all changed files for performance issues: N+1 queries, unnecessary re-renders, memory leaks, blocking operations, unoptimized algorithms.","performance","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","","standard","","","1","","","","",""
79
+ "4","Architecture Review","Review all changed files for architecture issues: layer violations, circular dependencies, inappropriate coupling, missing abstractions, SRP violations.","architecture","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","ESM modules, strict TypeScript","standard","","","1","","","","",""
80
+ "5","Maintainability Review","Review all changed files for maintainability: code duplication, overly complex functions, poor naming, missing types, unclear control flow.","maintainability","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","","standard","","","1","","","","",""
81
+ "6","Best Practices Review","Review all changed files for best-practice violations: error handling gaps, missing validation, hardcoded values, deprecated API usage, inconsistent patterns.","best-practices","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","","standard","","","1","","","","",""
82
+ "7","Aggregate + Deep-Dive","Aggregate all dimension findings. Calculate severity distribution. Determine verdict (PASS/WARN/BLOCK). If critical findings exist, perform deep-dive with cross-file impact analysis.","aggregation","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","","standard","1;2;3;4;5;6","1;2;3;4;5;6","2","","","","",""
83
+ ```
84
+
85
+ **Columns**:
86
+
87
+ | Column | Phase | Description |
88
+ |--------|-------|-------------|
89
+ | `id` | Input | Unique task identifier (string) |
90
+ | `title` | Input | Short task title |
91
+ | `description` | Input | Detailed review instructions for this dimension |
92
+ | `dimension` | Input | Review dimension: correctness/security/performance/architecture/maintainability/best-practices/aggregation |
93
+ | `changed_files` | Input | Semicolon-separated file paths to review |
94
+ | `project_specs` | Input | Relevant project specs/conventions context |
95
+ | `review_level` | Input | quick/standard/deep -- controls depth |
96
+ | `deps` | Input | Semicolon-separated dependency task IDs |
97
+ | `context_from` | Input | Semicolon-separated task IDs whose findings this task needs |
98
+ | `wave` | Computed | Wave number (1 = dimension review, 2 = aggregation) |
99
+ | `status` | Output | `pending` -> `completed` / `failed` / `skipped` |
100
+ | `findings` | Output | Key review findings summary (max 500 chars) |
101
+ | `severity_counts` | Output | JSON: `{"critical":N,"high":N,"medium":N,"low":N}` |
102
+ | `top_issues` | Output | Top 5 issues with `[severity] description (file:line)` format |
103
+ | `error` | Output | Error message if failed |
104
+
105
+ ### Per-Wave CSV (Temporary)
106
+
107
+ Each wave generates `wave-{N}.csv` with extra `prev_context` column.
108
+
109
+ ### Output Artifacts
110
+
111
+ | File | Purpose | Lifecycle |
112
+ |------|---------|-----------|
113
+ | `tasks.csv` | Master state -- all tasks with status/findings | Updated after each wave |
114
+ | `wave-{N}.csv` | Per-wave input (temporary) | Created before wave, deleted after |
115
+ | `results.csv` | Final export of all task results | Created in Phase 3 |
116
+ | `discoveries.ndjson` | Shared exploration board | Append-only, carries across waves |
117
+ | `context.md` | Human-readable review report | Created in Phase 3 |
118
+ | `review.json` | Structured review output for downstream | Created in Phase 3 |
119
+
120
+ ### Session Structure
121
+
122
+ ```
123
+ .workflow/.csv-wave/{YYYYMMDD}-review-P{N}-{slug}/
124
+ +-- tasks.csv
125
+ +-- results.csv
126
+ +-- discoveries.ndjson
127
+ +-- context.md
128
+ +-- review.json
129
+ +-- wave-{N}.csv (temporary)
130
+ ```
131
+ </csv_schema>
132
+
133
+ <invariants>
134
+ 1. **Start Immediately**: First action is session initialization, then Phase 1
135
+ 2. **Wave Order is Sacred**: Never execute wave 2 before wave 1 completes and results are merged
136
+ 3. **CSV is Source of Truth**: Master tasks.csv holds all state
137
+ 4. **Context Propagation**: prev_context built from master CSV, not from memory
138
+ 5. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson
139
+ 6. **Skip on Failure**: If all dimension agents failed, skip aggregation
140
+ 7. **Cleanup Temp Files**: Remove wave-{N}.csv after results are merged
141
+ 8. **DO NOT STOP**: Continuous execution until all waves complete
142
+ </invariants>
143
+
144
+ <execution>
145
+
146
+ ### Session Initialization
147
+
148
+ Parse `$ARGUMENTS` to extract:
149
+ - `AUTO_YES` from `--yes` / `-y`
150
+ - `continueMode` from `--continue`
151
+ - `maxConcurrency` from `--concurrency N` / `-c N` (default: 6)
152
+ - `levelMatch` from `--level quick|standard|deep`
153
+ - `dimsMatch` from `--dimensions <list>`
154
+ - `phaseArg` = remaining text after stripping all flags
155
+
156
+ Session ID: `{YYYYMMDD}-review-P{phaseArg}-{phaseSlug}` (phaseSlug from index.json or roadmap)
157
+ Session folder: `.workflow/.csv-wave/{sessionId}/` — create via `mkdir -p`
158
+
159
+ ### Phase 1: Phase Resolution -> CSV
160
+
161
+ **Objective**: Resolve phase, collect changed files, determine review level, generate tasks.csv.
162
+
163
+ **Decomposition Rules**:
164
+
165
+ 1. **Phase resolution**: Resolve `{phaseArg}` via `state.json` artifact registry to `.workflow/scratch/{YYYYMMDD}-{type}-{slug}/`
166
+ 2. **Related session discovery**: Query `state.json.artifacts[]` for matching phase + milestone. Extract prior quality context (verdicts, root causes, UAT gaps) from artifact outputs by type (execute .summaries/.task/, review → review.json, debug understanding.md, test → uat.md)
167
+ 3. **File collection**: Read `.task/TASK-*.json` → collect `files[].path` where action != "read"
168
+ 4. **Level detection**:
169
+
170
+ | Condition | Level |
171
+ |-----------|-------|
172
+ | `--level` flag provided | Use explicit level |
173
+ | <=3 changed files | quick |
174
+ | 4-19 changed files | standard |
175
+ | >=20 files OR phase marked critical | deep |
176
+
177
+ 5. **Dimension selection**:
178
+
179
+ | Level | Dimensions |
180
+ |-------|------------|
181
+ | quick | correctness, security |
182
+ | standard | correctness, security, performance, architecture, maintainability, best-practices |
183
+ | deep | all 6 + forced deep-dive in aggregation |
184
+
185
+ If `--dimensions` flag provided, override with explicit list.
186
+
187
+ 6. **Specs loading**: Read `.workflow/specs/` for project conventions (unless `--skip-specs`)
188
+ 7. **CSV generation**: One row per dimension + one aggregation row
189
+
190
+ **Wave computation**: Simple 2-wave -- all dimension tasks = wave 1, aggregation = wave 2.
191
+
192
+ **User validation**: Display task breakdown (skip if AUTO_YES).
193
+
194
+ ### Phase 2: Wave Execution Engine
195
+
196
+ **Objective**: Execute dimension reviews wave-by-wave via spawn_agents_on_csv.
197
+
198
+ #### Wave 1: Dimension Reviews (Parallel)
199
+
200
+ Filter master `tasks.csv` for `wave == 1 AND status == pending` → write `wave-1.csv` (no prev_context needed).
201
+
202
+ ```javascript
203
+ spawn_agents_on_csv({
204
+ csv_path: `${sessionFolder}/wave-1.csv`,
205
+ id_column: "id",
206
+ instruction: buildReviewInstruction(sessionFolder), // agent: ~/.codex/agents/workflow-reviewer.toml
207
+ max_concurrency: maxConcurrency,
208
+ max_runtime_seconds: 3600,
209
+ output_csv_path: `${sessionFolder}/wave-1-results.csv`,
210
+ output_schema: {
211
+ type: "object",
212
+ properties: {
213
+ id: { type: "string" },
214
+ status: { type: "string", enum: ["completed", "failed"] },
215
+ findings: { type: "string" },
216
+ severity_counts: { type: "string" },
217
+ top_issues: { type: "string" },
218
+ error: { type: "string" }
219
+ },
220
+ required: ["id", "status", "findings"]
221
+ }
222
+ })
223
+ ```
224
+
225
+ Merge `wave-1-results.csv` into master `tasks.csv`, delete `wave-1.csv`.
226
+
227
+ #### Wave 2: Aggregation + Deep-Dive
228
+
229
+ Filter master `tasks.csv` for `wave == 2 AND status == pending`. If all wave 1 tasks failed, skip aggregation.
230
+
231
+ Build `prev_context` from wave 1 findings (format: `[Task N: Title] summary...` per task).
232
+ Write `wave-2.csv` with `prev_context` column → execute `spawn_agents_on_csv` → merge results → delete `wave-2.csv`.
233
+
234
+ ### Phase 3: Results Aggregation
235
+
236
+ **Objective**: Generate final results and human-readable report.
237
+
238
+ Export master `tasks.csv` as `results.csv`. Build `review.json`:
239
+
240
+ ```json
241
+ {
242
+ "phase": "<phase>",
243
+ "level": "<level>",
244
+ "verdict": "PASS|WARN|BLOCK",
245
+ "severity_distribution": { "critical": 0, "high": 0, "medium": 0, "low": 0 },
246
+ "dimensions": [
247
+ { "dimension": "correctness", "status": "completed", "severity_counts": {...}, "top_issues": [...] }
248
+ ],
249
+ "deep_dive": { "performed": true/false, "iterations": N, "impact_analysis": "..." },
250
+ "issues_created": [],
251
+ "timestamp": "<ISO>"
252
+ }
253
+ ```
254
+
255
+ Generate `context.md`:
256
+
257
+ ```markdown
258
+ # Code Review Report -- Phase {phase}
259
+
260
+ ## Summary
261
+ - Level: {level}
262
+ - Files reviewed: {file_count}
263
+ - Dimensions: {dimension_count}
264
+ - Verdict: **{verdict}**
265
+
266
+ ## Severity Distribution
267
+ | Severity | Count |
268
+ |----------|-------|
269
+ | Critical | {N} |
270
+ | High | {N} |
271
+ | Medium | {N} |
272
+ | Low | {N} |
273
+
274
+ ## Dimension Results
275
+ ### {dimension_name}
276
+ {findings}
277
+
278
+ **Top Issues:**
279
+ {top_issues}
280
+
281
+ ## Deep-Dive Analysis
282
+ {if performed: impact analysis results}
283
+
284
+ ## Issues Created
285
+ {list of created issue IDs}
286
+ ```
287
+
288
+ **Verdict determination**:
289
+
290
+ | Condition | Verdict |
291
+ |-----------|---------|
292
+ | Any critical findings | BLOCK |
293
+ | High findings > 3 | BLOCK |
294
+ | Any high findings | WARN |
295
+ | Medium findings > 5 | WARN |
296
+ | Otherwise | PASS |
297
+
298
+ **Issue creation** by level threshold:
299
+
300
+ | Level | Create Issues For |
301
+ |-------|------------------|
302
+ | quick | critical only |
303
+ | standard | critical + high |
304
+ | deep | critical + high + medium |
305
+
306
+ **Phase index update**: Update `{artifact_dir}/index.json` with review status.
307
+
308
+ **Register artifact**: Append to `state.json.artifacts[]` with `type: "review"`, `id: REV-NNN`, `path: "scratch/{YYYYMMDD}-review-P{N}-{slug}"`, `depends_on: exec_art.id`. Output directory is independent scratch, not shared with plan.
309
+
310
+ Display summary.
311
+
312
+ ### Shared Discovery Board Protocol
313
+
314
+ #### Standard Discovery Types
315
+
316
+ | Type | Dedup Key | Data Schema | Description |
317
+ |------|-----------|-------------|-------------|
318
+ | `code_pattern` | `data.name` | `{name, file, description}` | Reusable code pattern found |
319
+ | `integration_point` | `data.file` | `{file, description, exports[]}` | Module connection point |
320
+ | `convention` | singleton | `{naming, imports, formatting}` | Project code conventions |
321
+ | `blocker` | `data.issue` | `{issue, severity, impact}` | Blocking issue found |
322
+ | `tech_stack` | singleton | `{framework, language, tools[]}` | Technology stack info |
323
+
324
+ #### Domain Discovery Types
325
+
326
+ | Type | Dedup Key | Data Schema | Description |
327
+ |------|-----------|-------------|-------------|
328
+ | `vulnerability` | `data.location` | `{location, type, severity, cwe}` | Security vulnerability |
329
+ | `code_smell` | `data.location` | `{location, type, severity, description}` | Code quality issue |
330
+ | `performance_hotspot` | `data.location` | `{location, type, impact}` | Performance issue |
331
+ | `architecture_violation` | `data.location` | `{location, rule, description}` | Architecture rule violation |
332
+
333
+ #### Protocol
334
+
335
+ Read `{session_folder}/discoveries.ndjson` before own review. Deduplicate by type + dedup key before writing. Append-only — never modify or delete.
336
+
337
+ ```bash
338
+ echo '{"ts":"<ISO>","worker":"{id}","type":"vulnerability","data":{"location":"src/auth/login.ts:42","type":"sql_injection","severity":"critical","cwe":"CWE-89"}}' >> {session_folder}/discoveries.ndjson
339
+ ```
340
+ </execution>
341
+
342
+ <error_codes>
343
+
344
+ | Error | Resolution |
345
+ |-------|------------|
346
+ | Phase directory not found | Abort with error: "Phase {N} not found" |
347
+ | No task summaries found | Abort with error: "No execution results -- run execute first" |
348
+ | No changed files | Abort with error: "No changed files detected" |
349
+ | Dimension agent timeout | Mark as failed, skip dependent aggregation if all failed |
350
+ | Aggregation agent failed | Use wave 1 results directly, verdict based on raw counts |
351
+ | CSV parse error | Validate format, show line number |
352
+ | discoveries.ndjson corrupt | Ignore malformed lines |
353
+ | Continue mode: no session found | List available sessions |
354
+ </error_codes>
355
+
356
+ <success_criteria>
357
+ - [ ] Session folder created with valid tasks.csv
358
+ - [ ] All dimension reviews executed in parallel (wave 1)
359
+ - [ ] Aggregation + deep-dive executed (wave 2)
360
+ - [ ] review.json produced with verdict and severity distribution
361
+ - [ ] context.md produced with full review report
362
+ - [ ] Issues auto-created for qualifying severity findings
363
+ - [ ] Phase index.json updated with review status
364
+ - [ ] discoveries.ndjson append-only throughout
365
+ </success_criteria>