maestro-flow 0.3.37 → 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 (186) 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 +9 -8
  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/README.md +6 -0
  130. package/README.zh-CN.md +6 -0
  131. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +4 -0
  132. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
  133. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +118 -7
  134. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
  135. package/dashboard/dist-server/shared/agent-types.d.ts +2 -0
  136. package/dashboard/dist-server/src/agents/cli-agent-runner.d.ts +2 -0
  137. package/dashboard/dist-server/src/agents/cli-agent-runner.js +4 -0
  138. package/dashboard/dist-server/src/agents/cli-agent-runner.js.map +1 -1
  139. package/dashboard/dist-server/src/commands/delegate.d.ts +2 -0
  140. package/dashboard/dist-server/src/commands/delegate.js +18 -0
  141. package/dashboard/dist-server/src/commands/delegate.js.map +1 -1
  142. package/dashboard/dist-server/src/config/cli-tools-config.d.ts +6 -0
  143. package/dashboard/dist-server/src/config/cli-tools-config.js +2 -0
  144. package/dashboard/dist-server/src/config/cli-tools-config.js.map +1 -1
  145. package/dist/shared/agent-types.d.ts +2 -0
  146. package/dist/shared/agent-types.d.ts.map +1 -1
  147. package/dist/src/agents/cli-agent-runner.d.ts +2 -0
  148. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  149. package/dist/src/agents/cli-agent-runner.js +4 -0
  150. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  151. package/dist/src/commands/config.d.ts.map +1 -1
  152. package/dist/src/commands/config.js +29 -1
  153. package/dist/src/commands/config.js.map +1 -1
  154. package/dist/src/commands/delegate.d.ts +2 -0
  155. package/dist/src/commands/delegate.d.ts.map +1 -1
  156. package/dist/src/commands/delegate.js +18 -0
  157. package/dist/src/commands/delegate.js.map +1 -1
  158. package/dist/src/commands/launcher.d.ts.map +1 -1
  159. package/dist/src/commands/launcher.js +27 -4
  160. package/dist/src/commands/launcher.js.map +1 -1
  161. package/dist/src/config/cli-tools-config.d.ts +6 -0
  162. package/dist/src/config/cli-tools-config.d.ts.map +1 -1
  163. package/dist/src/config/cli-tools-config.js +2 -0
  164. package/dist/src/config/cli-tools-config.js.map +1 -1
  165. package/dist/src/core/overlay/applier.d.ts.map +1 -1
  166. package/dist/src/core/overlay/applier.js +65 -5
  167. package/dist/src/core/overlay/applier.js.map +1 -1
  168. package/dist/src/core/overlay/loader.d.ts.map +1 -1
  169. package/dist/src/core/overlay/loader.js +9 -4
  170. package/dist/src/core/overlay/loader.js.map +1 -1
  171. package/dist/src/core/overlay/types.d.ts +2 -0
  172. package/dist/src/core/overlay/types.d.ts.map +1 -1
  173. package/dist/src/core/overlay/types.js +2 -0
  174. package/dist/src/core/overlay/types.js.map +1 -1
  175. package/dist/src/tui/tools-ui/ToolsDashboard.d.ts.map +1 -1
  176. package/dist/src/tui/tools-ui/ToolsDashboard.js +1 -1
  177. package/dist/src/tui/tools-ui/ToolsDashboard.js.map +1 -1
  178. package/dist/src/tui/tools-ui/ToolsOverview.d.ts.map +1 -1
  179. package/dist/src/tui/tools-ui/ToolsOverview.js +51 -4
  180. package/dist/src/tui/tools-ui/ToolsOverview.js.map +1 -1
  181. package/package.json +1 -1
  182. package/shared/agent-types.ts +2 -0
  183. package/workflows/delegate-protocol.codex.md +65 -0
  184. package/workflows/issue-analyze.md +2 -3
  185. package/workflows/issue-gaps-analyze.codex.md +260 -0
  186. package/workflows/issue-gaps-analyze.md +214 -0
@@ -0,0 +1,260 @@
1
+ # Workflow: Issue Gaps Analysis (Codex — CSV Wave)
2
+
3
+ Root cause analysis for issues via `spawn_agents_on_csv` wave execution.
4
+ Supports single issue (ISS-ID) or batch with classification and parallel analysis.
5
+ Produces analysis records in issues.jsonl and context.md for downstream `plan --gaps`.
6
+
7
+ **Invoked by**: `maestro-analyze --gaps [ISS-ID]` (codex SKILL.md)
8
+
9
+ ## Pipeline
10
+
11
+ ```
12
+ Load Issues → Classify & Group → Generate tasks.csv → Wave 1: Explore (parallel per issue) → Wave 2: Synthesize (per group) → Write issue.analysis → Output context.md
13
+ ```
14
+
15
+ ---
16
+
17
+ ### Step 1: Load Issues
18
+
19
+ ```
20
+ If ISS-ID provided:
21
+ Load single issue from .workflow/issues/issues.jsonl
22
+ → fatal if file missing or ID not found (E_ISSUE_NOT_FOUND)
23
+ → skip Step 2 (single issue = single group)
24
+
25
+ If no ISS-ID:
26
+ Load all issues where status == "open" || status == "registered"
27
+ → fatal if none found (E_NO_ISSUES)
28
+ ```
29
+
30
+ ---
31
+
32
+ ### Step 2: Classify & Group (batch mode only)
33
+
34
+ ```
35
+ Group loaded issues by affected area overlap:
36
+
37
+ Classification dimensions:
38
+ - location: file path prefix (first 2 segments, e.g. src/auth/)
39
+ - component: affected_components field overlap
40
+ - category: issue.category or severity
41
+
42
+ Grouping rules:
43
+ 1. Same location prefix → same group
44
+ 2. Shared affected_components → same group
45
+ 3. Remaining ungrouped → individual groups (1 issue each)
46
+
47
+ Output: GROUPS[] = { group_id, label, issues[], shared_keywords[] }
48
+
49
+ Display group breakdown (skip if AUTO_YES).
50
+ ```
51
+
52
+ ---
53
+
54
+ ### Step 3: Generate tasks.csv
55
+
56
+ Generate CSV with two waves:
57
+ - **Wave 1**: One exploration row per issue (parallel within wave)
58
+ - **Wave 2**: One synthesis row per group (parallel across groups, depends on its issues in wave 1)
59
+
60
+ ```csv
61
+ id,title,description,iss_id,group_id,group_label,deps,context_from,wave,status,findings,analysis_json,error
62
+ ```
63
+
64
+ **Wave 1 rows** — one per issue:
65
+
66
+ ```csv
67
+ "1","Explore: ISS-xxx {title}","Root cause exploration for ISS-xxx: {description}. Location: {location}. Severity: {severity}. Fix hint: {fix_direction}. Search keywords: {keywords from title+description+components}. TASK: grep keywords → read top matches → trace call chain → identify root cause (file:line) → assess impact → list related files → rate confidence → suggest fix. EXPECTED: JSON { root_cause, impact, related_files[], confidence, suggested_approach }. CONSTRAINTS: Evidence-only, use file reads to verify.","ISS-xxx","G1","src/auth","","","1","","","",""
68
+ ```
69
+
70
+ **Wave 2 rows** — one per group:
71
+
72
+ ```csv
73
+ "N","Synthesize: {group_label}","Compile exploration findings for group [{group_label}]. For each issue: validate root cause evidence, identify cross-issue relationships, build analysis record. Output: JSON array [{ iss_id, root_cause, affected_files, impact_scope, fix_direction, confidence, cross_refs }]. Note shared root causes and dependency chains across issues in this group.","","G1","src/auth","1;2;3","1;2;3","2","","","",""
74
+ ```
75
+
76
+ **Column definitions**:
77
+
78
+ | Column | Phase | Description |
79
+ |--------|-------|-------------|
80
+ | `id` | Input | Unique task identifier |
81
+ | `title` | Input | Short task title |
82
+ | `description` | Input | Full exploration/synthesis instructions |
83
+ | `iss_id` | Input | Issue ID (wave 1 only, empty for wave 2) |
84
+ | `group_id` | Input | Group identifier |
85
+ | `group_label` | Input | Group label for display |
86
+ | `deps` | Input | Semicolon-separated dependency task IDs |
87
+ | `context_from` | Input | Task IDs whose findings this task needs |
88
+ | `wave` | Input | 1 = explore, 2 = synthesize |
89
+ | `status` | Output | `pending` → `completed` / `failed` |
90
+ | `findings` | Output | Key findings summary (max 500 chars) |
91
+ | `analysis_json` | Output | Structured analysis JSON (wave 2 only) |
92
+ | `error` | Output | Error message if failed |
93
+
94
+ Write `tasks.csv` to session folder.
95
+
96
+ ---
97
+
98
+ ### Step 4: Wave 1 — Explore (parallel per issue)
99
+
100
+ Filter `wave == 1 && status == pending`. Write `wave-1.csv`.
101
+
102
+ ```javascript
103
+ spawn_agents_on_csv({
104
+ csv_path: `${sessionFolder}/wave-1.csv`,
105
+ id_column: "id",
106
+ instruction: `You are analyzing a specific issue for root cause. Read the 'description' column for full instructions. Use file reads and grep to gather evidence. Write findings as a concise summary with file:line references. Write analysis_json as a JSON object: { root_cause, impact, related_files[], confidence, suggested_approach }.`,
107
+ max_concurrency: maxConcurrency,
108
+ max_runtime_seconds: 3600,
109
+ output_csv_path: `${sessionFolder}/wave-1-results.csv`,
110
+ output_schema: { id, status: ["completed"|"failed"], findings, analysis_json, error }
111
+ })
112
+ ```
113
+
114
+ Merge results into master `tasks.csv`, delete `wave-1.csv`.
115
+
116
+ **Per-issue agent responsibilities**:
117
+ 1. **Keyword Search** — grep issue keywords in source, find top 20 relevant paths
118
+ 2. **Context Read** — read top 5 matches with 10 lines surrounding context
119
+ 3. **Call Chain Trace** — trace 2-3 levels from issue location
120
+ 4. **Root Cause Identification** — pinpoint file:line with evidence
121
+ 5. **Impact Assessment** — scope of affected functionality
122
+
123
+ ---
124
+
125
+ ### Step 5: Wave 2 — Synthesize (parallel per group)
126
+
127
+ Filter `wave == 2 && status == pending`. Build `prev_context` from wave 1 findings of issues in same group. Write `wave-2.csv` with `prev_context` column.
128
+
129
+ ```javascript
130
+ spawn_agents_on_csv({
131
+ csv_path: `${sessionFolder}/wave-2.csv`,
132
+ id_column: "id",
133
+ instruction: `You are synthesizing root cause analysis for a group of related issues. Read prev_context for per-issue exploration findings. Validate evidence, identify cross-issue relationships and shared root causes. Output analysis_json as a JSON array: [{ iss_id, root_cause, affected_files, impact_scope, fix_direction, confidence, cross_refs }].`,
134
+ max_concurrency: maxConcurrency,
135
+ max_runtime_seconds: 3600,
136
+ output_csv_path: `${sessionFolder}/wave-2-results.csv`,
137
+ output_schema: { id, status: ["completed"|"failed"], findings, analysis_json, error }
138
+ })
139
+ ```
140
+
141
+ Merge results into master `tasks.csv`, delete `wave-2.csv`.
142
+
143
+ **Synthesis agent responsibilities**:
144
+ 1. Parse per-issue findings from prev_context
145
+ 2. Validate root cause evidence (file:line exists, logic holds)
146
+ 3. Identify cross-issue relationships within group
147
+ 4. Build consolidated analysis array with cross_refs
148
+ 5. Flag shared root causes that affect multiple issues
149
+
150
+ ---
151
+
152
+ ### Step 6: Write Analysis to issues.jsonl
153
+
154
+ ```
155
+ Parse analysis_json from wave 2 results.
156
+
157
+ For each issue in the analysis array:
158
+ Build IssueAnalysis record:
159
+ {
160
+ root_cause,
161
+ affected_files,
162
+ impact_scope,
163
+ fix_direction,
164
+ confidence,
165
+ cross_refs,
166
+ analyzed_at: NOW_ISO,
167
+ tool: "spawn_agents_on_csv",
168
+ depth: DEPTH
169
+ }
170
+
171
+ Read-modify-write issues.jsonl (single pass):
172
+ Set issue.analysis = ANALYSIS, updated_at = NOW_ISO
173
+ Append issue.history: { action: "analyzed", at: NOW_ISO, by: "maestro-analyze --gaps" }
174
+ Status unchanged (non-destructive enrichment).
175
+
176
+ Verify: re-read, confirm analysis field present for all updated issues.
177
+ ```
178
+
179
+ ---
180
+
181
+ ### Step 7: Output context.md
182
+
183
+ ```
184
+ Aggregate results organized by group:
185
+
186
+ # Context: Issue Gaps Analysis
187
+
188
+ **Date**: {date}
189
+ **Issues analyzed**: {count}
190
+ **Groups**: {group_count}
191
+ **Session**: {sessionFolder}
192
+
193
+ ## Group: {group.label}
194
+
195
+ ### ISS-{id}: {title}
196
+ - **Root cause**: {root_cause}
197
+ - **Affected files**: {affected_files}
198
+ - **Impact scope**: {impact_scope}
199
+ - **Fix direction**: {fix_direction}
200
+ - **Confidence**: {confidence}
201
+ - **Cross-refs**: {related ISS-IDs}
202
+
203
+ (repeat per issue, per group)
204
+
205
+ ## Cross-Group Dependencies
206
+ {issues sharing root causes across groups}
207
+
208
+ ## Constraints
209
+
210
+ ### Locked
211
+ {constraints from root cause evidence}
212
+
213
+ ### Free
214
+ {implementation choices left to planner}
215
+
216
+ Write context.md to session folder + copy to scratchDir.
217
+ Register artifact in state.json.
218
+ ```
219
+
220
+ ---
221
+
222
+ ### Step 8: Display Summary and Next Steps
223
+
224
+ ```
225
+ Display: group breakdown, per-issue root cause, confidence, cross-refs.
226
+
227
+ Next steps:
228
+ - maestro-plan --gaps (plan fix tasks linked to analyzed issues)
229
+ - maestro-analyze --gaps {ISS-ID} (re-analyze specific issue)
230
+ - manage-issue list (review all issues)
231
+ ```
232
+
233
+ ---
234
+
235
+ ## Session Structure
236
+
237
+ ```
238
+ .workflow/.csv-wave/{YYYYMMDD}-analyze-{slug}/
239
+ ├── tasks.csv # master state
240
+ ├── results.csv # final export
241
+ ├── wave-1.csv # temporary (deleted after merge)
242
+ ├── wave-2.csv # temporary (deleted after merge)
243
+ ├── discoveries.ndjson # shared board (append-only)
244
+ ├── context.md # decisions for plan --gaps
245
+ ```
246
+
247
+ ## Output
248
+
249
+ - **Updated**: `.workflow/issues/issues.jsonl` — enriched with `analysis` field per issue
250
+ - **Created**: `context.md` — grouped root causes for downstream `plan --gaps`
251
+ - **Created**: `results.csv` — full task execution results
252
+
253
+ ## Quality Criteria
254
+
255
+ - Issues classified into groups before CSV generation
256
+ - Wave 1 agents run parallel (one per issue, bounded by maxConcurrency)
257
+ - Wave 2 agents run parallel (one per group, after wave 1 deps met)
258
+ - Cross-issue relationships captured via cross_refs
259
+ - Single-pass JSONL update preserves integrity
260
+ - context.md organized by group with cross-group section
@@ -0,0 +1,214 @@
1
+ # Workflow: Issue Gaps Analysis
2
+
3
+ Root cause analysis for issues using CLI exploration and codebase context gathering.
4
+ Supports single issue (ISS-ID) or batch (all open/registered) with classification and parallel analysis.
5
+ Produces analysis records in issues.jsonl and context.md for downstream `plan --gaps`.
6
+
7
+ **Invoked by**: `maestro-analyze --gaps [ISS-ID]`
8
+
9
+ ## Input
10
+
11
+ - `ISS-ID` (optional): Specific issue to analyze. If omitted, analyze all open/registered issues.
12
+ - `TOOL`: CLI tool for exploration (default: gemini)
13
+ - `DEPTH`: `standard` or `deep` (default: standard)
14
+
15
+ ## Pipeline
16
+
17
+ ```
18
+ Load Issues → Classify & Group → Parallel Analysis (per group) → Write issue.analysis → Output context.md
19
+ ```
20
+
21
+ ---
22
+
23
+ ### Step 1: Load Issues
24
+
25
+ ```
26
+ If ISS-ID provided:
27
+ Load single issue from .workflow/issues/issues.jsonl
28
+ → fatal if file missing or ID not found (E_ISSUE_NOT_FOUND)
29
+ → skip Step 2 (classification), go directly to Step 3
30
+
31
+ If no ISS-ID:
32
+ Load all issues where status == "open" || status == "registered"
33
+ → fatal if none found (E_NO_ISSUES)
34
+
35
+ Validate: at least 1 issue loaded.
36
+ ```
37
+
38
+ ---
39
+
40
+ ### Step 2: Classify & Group (batch mode only)
41
+
42
+ ```
43
+ Group loaded issues by overlap in affected area:
44
+
45
+ Classification dimensions:
46
+ - location: file path prefix (e.g. src/auth/, src/api/)
47
+ - component: affected_components field overlap
48
+ - category: issue.category or severity level
49
+
50
+ Grouping rules:
51
+ 1. Same location prefix (first 2 path segments) → same group
52
+ 2. Shared affected_components → same group
53
+ 3. Remaining ungrouped → individual groups (1 issue each)
54
+
55
+ Output: GROUPS[] where each group = { group_id, label, issues[], shared_context_keywords[] }
56
+
57
+ Display group breakdown to user (skip if AUTO_YES).
58
+ ```
59
+
60
+ ---
61
+
62
+ ### Step 3: Gather Codebase Context (per group)
63
+
64
+ ```
65
+ For each group:
66
+ Merge keywords from all issues in group: title, description, location, affected_components.
67
+ Deduplicate keywords.
68
+
69
+ Standard depth: grep keywords in source files → top 20 paths, read 10 lines around
70
+ top 5 matches.
71
+ Deep depth: standard grep + semantic Agent search (error handling, data flow, deps),
72
+ merge results.
73
+
74
+ Build GROUP_CONTEXT: related files, key snippets (max 50 lines), dependency chain.
75
+ Shared context benefits co-located issues — avoids redundant exploration.
76
+ ```
77
+
78
+ ---
79
+
80
+ ### Step 4: Run Analysis (per group, parallel across groups)
81
+
82
+ ```
83
+ Launch analysis for each group in parallel using Agent tool:
84
+
85
+ Agent({
86
+ subagent_type: "general-purpose",
87
+ prompt: "Root cause analysis for issues in group [{group.label}]:
88
+ {for each issue in group}
89
+ ISS-{id}: {title} — {description}, severity: {severity}, location: {location}
90
+ {end}
91
+ CODEBASE CONTEXT: {GROUP_CONTEXT}
92
+ TASK: For EACH issue — identify root cause (file:line) → assess impact → list related files → rate confidence → suggest fix direction. Note cross-issue relationships within this group.
93
+ EXPECTED: JSON array [{ iss_id, root_cause, impact, related_files[], confidence, suggested_approach, cross_refs[] }]
94
+ CONSTRAINTS: Evidence-only, no speculation. Use Read/Grep to verify before concluding."
95
+ })
96
+
97
+ Alternatively, attempt CLI delegate first per group:
98
+
99
+ maestro delegate "<same prompt>" --role analyze --mode analysis
100
+
101
+ If delegate fails (timeout, unavailable, parse error):
102
+ Fall back to Agent tool with same prompt.
103
+ Record fallback in analysis metadata: { tool: "agent-fallback", reason: "<error>" }
104
+
105
+ Validate response per issue: all required fields present.
106
+ Parse failure → save raw output to issue feedback for review.
107
+ ```
108
+
109
+ ---
110
+
111
+ ### Step 5: Build Analysis Record (per issue)
112
+
113
+ ```
114
+ For each issue from Step 4 results:
115
+
116
+ Construct IssueAnalysis:
117
+ {
118
+ root_cause,
119
+ affected_files: related_files,
120
+ impact_scope: impact,
121
+ fix_direction: suggested_approach,
122
+ confidence,
123
+ cross_refs: [ISS-IDs of related issues in same group],
124
+ analyzed_at: NOW_ISO,
125
+ tool: TOOL or "agent-fallback",
126
+ depth: DEPTH
127
+ }
128
+ ```
129
+
130
+ ---
131
+
132
+ ### Step 6: Update Issues in JSONL
133
+
134
+ ```
135
+ Read-modify-write issues.jsonl (single pass for all analyzed issues):
136
+ For each issue:
137
+ Set issue.analysis = ANALYSIS, updated_at = NOW_ISO
138
+ Append issue.history: { action: "analyzed", at: NOW_ISO, by: "maestro-analyze --gaps" }
139
+ Status unchanged (analysis is metadata enrichment).
140
+ Verify: re-read file, confirm analysis field present for all updated issues.
141
+ ```
142
+
143
+ ---
144
+
145
+ ### Step 7: Output context.md
146
+
147
+ ```
148
+ Aggregate all analyzed issues into context.md, organized by group:
149
+
150
+ # Context: Issue Gaps Analysis
151
+
152
+ **Date**: {date}
153
+ **Issues analyzed**: {count}
154
+ **Groups**: {group_count}
155
+
156
+ ## Group: {group.label}
157
+
158
+ ### ISS-{id}: {title}
159
+ - **Root cause**: {root_cause}
160
+ - **Affected files**: {affected_files}
161
+ - **Impact scope**: {impact_scope}
162
+ - **Fix direction**: {fix_direction}
163
+ - **Confidence**: {confidence}
164
+ - **Cross-refs**: {related ISS-IDs}
165
+
166
+ (repeat per issue, per group)
167
+
168
+ ## Cross-Group Dependencies
169
+ {issues that span multiple groups or share root causes}
170
+
171
+ ## Constraints
172
+
173
+ ### Locked
174
+ {constraints derived from root cause evidence}
175
+
176
+ ### Free
177
+ {implementation choices left to planner}
178
+
179
+ Write context.md to session output directory.
180
+ ```
181
+
182
+ ---
183
+
184
+ ### Step 8: Display Summary and Next Steps
185
+
186
+ ```
187
+ Display: group breakdown, per-issue root cause, confidence, cross-refs.
188
+
189
+ Next steps:
190
+ - maestro-plan --gaps (plan fix tasks linked to analyzed issues)
191
+ - maestro-analyze --gaps {ISS-ID} (re-analyze specific issue with deeper context)
192
+ - manage-issue list (review all issues)
193
+ ```
194
+
195
+ ---
196
+
197
+ ## Output
198
+
199
+ - **Updated**: `.workflow/issues/issues.jsonl` -- issue records enriched with `analysis` field
200
+ - **Created**: `context.md` -- aggregated root causes grouped for downstream `plan --gaps`
201
+ - **Analysis fields**: root_cause, affected_files, impact_scope, fix_direction, confidence, cross_refs, analyzed_at, tool, depth
202
+
203
+ ## Quality Criteria
204
+
205
+ - Issues classified by location/component overlap before analysis
206
+ - Groups analyzed in parallel (Agent or delegate per group)
207
+ - CLI delegate attempted first; Agent fallback on failure
208
+ - Analysis grounded in actual codebase evidence (file:line references)
209
+ - Cross-issue relationships captured within groups (cross_refs)
210
+ - JSON result validated before writing to JSONL
211
+ - Issue status unchanged (analysis is non-destructive enrichment)
212
+ - Single-pass read-modify-write preserves JSONL integrity
213
+ - context.md organized by group with cross-group dependencies
214
+ - Next-step routing guides to plan --gaps