maestro-flow 0.3.38 → 0.3.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/workflow-analyzer.md +2 -0
- package/.claude/agents/workflow-debugger.md +2 -0
- package/.claude/agents/workflow-executor.md +2 -0
- package/.claude/agents/workflow-integration-checker.md +1 -0
- package/.claude/agents/workflow-nyquist-auditor.md +1 -0
- package/.claude/agents/workflow-planner.md +2 -0
- package/.claude/agents/workflow-reviewer.md +2 -0
- package/.claude/agents/workflow-verifier.md +2 -0
- package/.claude/commands/learn-decompose.md +176 -176
- package/.claude/commands/learn-follow.md +167 -167
- package/.claude/commands/learn-investigate.md +221 -221
- package/.claude/commands/learn-retro.md +303 -303
- package/.claude/commands/learn-second-opinion.md +167 -167
- package/.claude/commands/maestro-amend.md +300 -300
- package/.claude/commands/maestro-analyze.md +130 -126
- package/.claude/commands/maestro-brainstorm.md +104 -100
- package/.claude/commands/maestro-composer.md +354 -354
- package/.claude/commands/maestro-execute.md +120 -114
- package/.claude/commands/maestro-fork.md +86 -86
- package/.claude/commands/maestro-init.md +78 -78
- package/.claude/commands/maestro-learn.md +140 -140
- package/.claude/commands/maestro-link-coordinate.md +1 -1
- package/.claude/commands/maestro-merge.md +61 -61
- package/.claude/commands/maestro-milestone-release.md +96 -96
- package/.claude/commands/maestro-overlay.md +178 -178
- package/.claude/commands/maestro-plan.md +154 -138
- package/.claude/commands/maestro-player.md +404 -404
- package/.claude/commands/maestro-quick.md +56 -56
- package/.claude/commands/maestro-ralph-execute.md +7 -18
- package/.claude/commands/maestro-ralph.md +48 -12
- package/.claude/commands/maestro-roadmap.md +1 -1
- package/.claude/commands/maestro-ui-design.md +93 -93
- package/.claude/commands/maestro-update.md +176 -176
- package/.claude/commands/maestro-verify.md +96 -90
- package/.claude/commands/maestro.md +121 -121
- package/.claude/commands/manage-codebase-rebuild.md +75 -75
- package/.claude/commands/manage-codebase-refresh.md +57 -57
- package/.claude/commands/manage-harvest.md +94 -94
- package/.claude/commands/manage-issue-discover.md +77 -77
- package/.claude/commands/manage-issue.md +73 -73
- package/.claude/commands/manage-knowhow-capture.md +193 -193
- package/.claude/commands/manage-knowhow.md +77 -77
- package/.claude/commands/manage-learn.md +67 -67
- package/.claude/commands/manage-status.md +51 -51
- package/.claude/commands/manage-wiki.md +62 -62
- package/.claude/commands/quality-auto-test.md +5 -1
- package/.claude/commands/quality-debug.md +125 -115
- package/.claude/commands/quality-refactor.md +55 -55
- package/.claude/commands/quality-retrospective.md +78 -78
- package/.claude/commands/quality-review.md +114 -108
- package/.claude/commands/quality-sync.md +51 -51
- package/.claude/commands/quality-test.md +107 -103
- package/.claude/commands/spec-add.md +49 -49
- package/.claude/commands/spec-load.md +51 -51
- package/.claude/commands/spec-remove.md +51 -51
- package/.claude/commands/spec-setup.md +51 -51
- package/.claude/commands/wiki-connect.md +62 -62
- package/.claude/commands/wiki-digest.md +69 -69
- package/.codex/skills/learn-decompose/SKILL.md +113 -113
- package/.codex/skills/learn-follow/SKILL.md +1 -1
- package/.codex/skills/learn-investigate/SKILL.md +83 -83
- package/.codex/skills/learn-retro/SKILL.md +83 -83
- package/.codex/skills/learn-second-opinion/SKILL.md +86 -86
- package/.codex/skills/maestro/SKILL.md +304 -304
- package/.codex/skills/maestro-analyze/SKILL.md +11 -3
- package/.codex/skills/maestro-brainstorm/SKILL.md +451 -397
- package/.codex/skills/maestro-composer/SKILL.md +213 -213
- package/.codex/skills/maestro-execute/SKILL.md +346 -318
- package/.codex/skills/maestro-fork/SKILL.md +56 -2
- package/.codex/skills/maestro-init/SKILL.md +40 -16
- package/.codex/skills/maestro-learn/SKILL.md +80 -80
- package/.codex/skills/maestro-link-coordinate/SKILL.md +257 -257
- package/.codex/skills/maestro-merge/SKILL.md +1 -1
- package/.codex/skills/maestro-milestone-audit/SKILL.md +1 -1
- package/.codex/skills/maestro-milestone-complete/SKILL.md +40 -9
- package/.codex/skills/maestro-milestone-release/SKILL.md +70 -70
- package/.codex/skills/maestro-overlay/SKILL.md +1 -1
- package/.codex/skills/maestro-plan/SKILL.md +29 -4
- package/.codex/skills/maestro-player/SKILL.md +323 -323
- package/.codex/skills/maestro-quick/SKILL.md +1 -1
- package/.codex/skills/maestro-ralph/SKILL.md +693 -578
- package/.codex/skills/maestro-roadmap/SKILL.md +518 -468
- package/.codex/skills/maestro-ui-design/SKILL.md +109 -12
- package/.codex/skills/maestro-verify/SKILL.md +27 -9
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +3 -2
- package/.codex/skills/manage-codebase-refresh/SKILL.md +1 -1
- package/.codex/skills/manage-harvest/SKILL.md +91 -91
- package/.codex/skills/manage-issue/SKILL.md +19 -6
- package/.codex/skills/manage-issue-discover/SKILL.md +1 -1
- package/.codex/skills/manage-knowhow/SKILL.md +95 -95
- package/.codex/skills/manage-knowhow-capture/SKILL.md +110 -110
- package/.codex/skills/manage-learn/SKILL.md +1 -1
- package/.codex/skills/manage-status/SKILL.md +1 -1
- package/.codex/skills/manage-wiki/SKILL.md +55 -55
- package/.codex/skills/quality-auto-test/SKILL.md +553 -547
- package/.codex/skills/quality-debug/SKILL.md +345 -334
- package/.codex/skills/quality-refactor/SKILL.md +1 -1
- package/.codex/skills/quality-retrospective/SKILL.md +292 -292
- package/.codex/skills/quality-review/SKILL.md +365 -364
- package/.codex/skills/quality-sync/SKILL.md +1 -1
- package/.codex/skills/quality-test/SKILL.md +507 -498
- package/.codex/skills/spec-add/SKILL.md +101 -101
- package/.codex/skills/spec-load/SKILL.md +77 -77
- package/.codex/skills/spec-map/SKILL.md +1 -1
- package/.codex/skills/spec-remove/SKILL.md +69 -69
- package/.codex/skills/spec-setup/SKILL.md +1 -1
- package/.codex/skills/team-coordinate/SKILL.md +2 -1
- package/.codex/skills/team-executor/SKILL.md +116 -115
- package/.codex/skills/team-lifecycle-v4/SKILL.md +2 -1
- package/.codex/skills/team-lifecycle-v4/instructions/agent-instruction.md +14 -6
- package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +16 -4
- package/.codex/skills/team-lifecycle-v4/roles/executor/commands/implement.md +7 -1
- package/.codex/skills/team-lifecycle-v4/roles/planner/role.md +16 -4
- package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +8 -2
- package/.codex/skills/team-quality-assurance/SKILL.md +2 -1
- package/.codex/skills/team-quality-assurance/roles/scout/role.md +9 -2
- package/.codex/skills/team-review/SKILL.md +2 -1
- package/.codex/skills/team-review/roles/reviewer/role.md +10 -1
- package/.codex/skills/team-review/roles/scanner/role.md +10 -1
- package/.codex/skills/team-tech-debt/SKILL.md +144 -143
- package/.codex/skills/team-tech-debt/roles/executor/role.md +9 -5
- package/.codex/skills/team-tech-debt/roles/scanner/role.md +10 -0
- package/.codex/skills/team-tech-debt/roles/validator/role.md +8 -2
- package/.codex/skills/team-testing/SKILL.md +2 -1
- package/.codex/skills/team-testing/roles/executor/role.md +8 -2
- package/.codex/skills/team-testing/roles/generator/role.md +8 -2
- package/.codex/skills/wiki-connect/SKILL.md +73 -73
- package/.codex/skills/wiki-digest/SKILL.md +87 -87
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +4 -0
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +6 -0
- package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
- package/dashboard/dist-server/shared/agent-types.d.ts +2 -0
- package/dashboard/dist-server/src/agents/cli-agent-runner.d.ts +2 -0
- package/dashboard/dist-server/src/agents/cli-agent-runner.js +4 -0
- package/dashboard/dist-server/src/agents/cli-agent-runner.js.map +1 -1
- package/dashboard/dist-server/src/commands/delegate.d.ts +2 -0
- package/dashboard/dist-server/src/commands/delegate.js +18 -0
- package/dashboard/dist-server/src/commands/delegate.js.map +1 -1
- package/dashboard/dist-server/src/config/cli-tools-config.d.ts +6 -0
- package/dashboard/dist-server/src/config/cli-tools-config.js +2 -0
- package/dashboard/dist-server/src/config/cli-tools-config.js.map +1 -1
- package/dist/shared/agent-types.d.ts +2 -0
- package/dist/shared/agent-types.d.ts.map +1 -1
- package/dist/src/agents/cli-agent-runner.d.ts +2 -0
- package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
- package/dist/src/agents/cli-agent-runner.js +4 -0
- package/dist/src/agents/cli-agent-runner.js.map +1 -1
- package/dist/src/commands/config.d.ts.map +1 -1
- package/dist/src/commands/config.js +29 -1
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/delegate.d.ts +2 -0
- package/dist/src/commands/delegate.d.ts.map +1 -1
- package/dist/src/commands/delegate.js +18 -0
- package/dist/src/commands/delegate.js.map +1 -1
- package/dist/src/commands/launcher.d.ts.map +1 -1
- package/dist/src/commands/launcher.js +27 -4
- package/dist/src/commands/launcher.js.map +1 -1
- package/dist/src/config/cli-tools-config.d.ts +6 -0
- package/dist/src/config/cli-tools-config.d.ts.map +1 -1
- package/dist/src/config/cli-tools-config.js +2 -0
- package/dist/src/config/cli-tools-config.js.map +1 -1
- package/dist/src/core/overlay/applier.d.ts.map +1 -1
- package/dist/src/core/overlay/applier.js +65 -5
- package/dist/src/core/overlay/applier.js.map +1 -1
- package/dist/src/core/overlay/loader.d.ts.map +1 -1
- package/dist/src/core/overlay/loader.js +9 -4
- package/dist/src/core/overlay/loader.js.map +1 -1
- package/dist/src/core/overlay/types.d.ts +2 -0
- package/dist/src/core/overlay/types.d.ts.map +1 -1
- package/dist/src/core/overlay/types.js +2 -0
- package/dist/src/core/overlay/types.js.map +1 -1
- package/dist/src/tui/tools-ui/ToolsDashboard.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/ToolsDashboard.js +1 -1
- package/dist/src/tui/tools-ui/ToolsDashboard.js.map +1 -1
- package/dist/src/tui/tools-ui/ToolsOverview.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/ToolsOverview.js +51 -4
- package/dist/src/tui/tools-ui/ToolsOverview.js.map +1 -1
- package/package.json +1 -1
- package/shared/agent-types.ts +2 -0
- package/workflows/analyze.md +24 -2
- package/workflows/auto-test.md +12 -0
- package/workflows/brainstorm.md +11 -1
- package/workflows/debug.md +13 -4
- package/workflows/delegate-protocol.codex.md +65 -0
- package/workflows/plan.md +14 -4
- package/workflows/test.md +10 -0
|
@@ -1,578 +1,693 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: maestro-ralph
|
|
3
|
-
description:
|
|
4
|
-
argument-hint: "\"intent\" [-y] | status | continue | execute"
|
|
5
|
-
allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep,
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<purpose>
|
|
9
|
-
Closed-loop decision engine for the maestro workflow lifecycle.
|
|
10
|
-
Coordinator assembles fully-resolved skill calls → spawns via `spawn_agents_on_csv` →
|
|
11
|
-
delegates evaluation at decision nodes → dynamically expands/shrinks chain.
|
|
12
|
-
|
|
13
|
-
Entry points:
|
|
14
|
-
- **`$maestro-ralph "intent"`** — New session: read state → infer → build → execute
|
|
15
|
-
- **`$maestro-ralph execute`** / **`continue`** — Resume: run next wave(s) until decision or completion
|
|
16
|
-
- **`$maestro-ralph status`** — Display session progress
|
|
17
|
-
|
|
18
|
-
Two node types:
|
|
19
|
-
- **external**: Executed via `spawn_agents_on_csv`. Barrier steps solo; non-barriers parallel.
|
|
20
|
-
- **decision**: Delegate evaluation via `maestro delegate --role analyze`, then expand/proceed/escalate.
|
|
21
|
-
|
|
22
|
-
Key difference from maestro coordinator:
|
|
23
|
-
- maestro: static chain → run all waves
|
|
24
|
-
- ralph: living chain → decision nodes delegate-evaluate → chain adapts dynamically
|
|
25
|
-
|
|
26
|
-
Session at `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json`.
|
|
27
|
-
</purpose>
|
|
28
|
-
|
|
29
|
-
<context>
|
|
30
|
-
$ARGUMENTS — intent text or keywords.
|
|
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
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
```
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
-
|
|
457
|
-
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
-
|
|
461
|
-
-
|
|
462
|
-
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
```
|
|
478
|
-
|
|
479
|
-
Display:
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
-
|
|
530
|
-
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
-
|
|
561
|
-
-
|
|
562
|
-
-
|
|
563
|
-
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
-
|
|
570
|
-
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
-
|
|
574
|
-
-
|
|
575
|
-
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
1
|
+
---
|
|
2
|
+
name: maestro-ralph
|
|
3
|
+
description: Adaptive lifecycle engine -- infer state, build command chain
|
|
4
|
+
argument-hint: "\"intent\" [-y] | status | continue | execute"
|
|
5
|
+
allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request_user_input
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<purpose>
|
|
9
|
+
Closed-loop decision engine for the maestro workflow lifecycle.
|
|
10
|
+
Coordinator assembles fully-resolved skill calls → spawns via `spawn_agents_on_csv` →
|
|
11
|
+
delegates evaluation at decision nodes → dynamically expands/shrinks chain.
|
|
12
|
+
|
|
13
|
+
Entry points:
|
|
14
|
+
- **`$maestro-ralph "intent"`** — New session: read state → infer → build → execute
|
|
15
|
+
- **`$maestro-ralph execute`** / **`continue`** — Resume: run next wave(s) until decision or completion
|
|
16
|
+
- **`$maestro-ralph status`** — Display session progress
|
|
17
|
+
|
|
18
|
+
Two node types:
|
|
19
|
+
- **external**: Executed via `spawn_agents_on_csv`. Barrier steps solo; non-barriers parallel.
|
|
20
|
+
- **decision**: Delegate evaluation via `maestro delegate --role analyze`, then expand/proceed/escalate.
|
|
21
|
+
|
|
22
|
+
Key difference from maestro coordinator:
|
|
23
|
+
- maestro: static chain → run all waves
|
|
24
|
+
- ralph: living chain → decision nodes delegate-evaluate → chain adapts dynamically
|
|
25
|
+
|
|
26
|
+
Session at `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json`.
|
|
27
|
+
</purpose>
|
|
28
|
+
|
|
29
|
+
<context>
|
|
30
|
+
$ARGUMENTS — intent text, flags, or keywords.
|
|
31
|
+
|
|
32
|
+
**State files:**
|
|
33
|
+
- `.workflow/state.json` — artifact registry, milestones, phases
|
|
34
|
+
- `.workflow/roadmap.md` — milestone/phase structure
|
|
35
|
+
- `.workflow/.maestro/ralph-*/status.json` — ralph session state
|
|
36
|
+
|
|
37
|
+
**Parse & Route:**
|
|
38
|
+
```
|
|
39
|
+
Parse $ARGUMENTS:
|
|
40
|
+
-y / --yes → auto_mode = true
|
|
41
|
+
.md/.txt path → input_doc (supplementary context for downstream commands)
|
|
42
|
+
Remaining → intent
|
|
43
|
+
|
|
44
|
+
Route:
|
|
45
|
+
intent == "status" → handleStatus(). End.
|
|
46
|
+
intent == "execute" | "continue" → Phase 2 (Wave Execution).
|
|
47
|
+
|
|
48
|
+
Check running ralph session (.workflow/.maestro/ralph-*/status.json, status=="running"):
|
|
49
|
+
If found AND steps[current_step].type == "decision" AND steps[current_step].status == "running":
|
|
50
|
+
→ Phase 2, Step 2.2 (Delegate Evaluation — resume mid-decision)
|
|
51
|
+
Else if intent is non-empty:
|
|
52
|
+
→ Phase 1 (New Session)
|
|
53
|
+
Else:
|
|
54
|
+
→ request_user_input: "请描述目标,或输入 status/continue/execute"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
HARD RULE: `input_doc` is supplementary context only. It NEVER substitutes for lifecycle stages.
|
|
58
|
+
|
|
59
|
+
### handleStatus()
|
|
60
|
+
```
|
|
61
|
+
Find latest ralph session (by created_at).
|
|
62
|
+
Display:
|
|
63
|
+
Session: {id}
|
|
64
|
+
Status: {status}
|
|
65
|
+
Position: {lifecycle_position}
|
|
66
|
+
Quality: {quality_mode}
|
|
67
|
+
Progress: {completed}/{total} steps ({decision_count} decisions)
|
|
68
|
+
Current: [{current_step}] {steps[current_step].skill} [{type}]
|
|
69
|
+
|
|
70
|
+
Steps:
|
|
71
|
+
[✓] 0. maestro-analyze 1 [W1, barrier]
|
|
72
|
+
[▸] 1. maestro-plan 1 [barrier]
|
|
73
|
+
[ ] 2. maestro-execute 1 [barrier]
|
|
74
|
+
[ ] 3. ◆ post-verify [decision]
|
|
75
|
+
...
|
|
76
|
+
End.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Flags:**
|
|
80
|
+
- `-y` / `--yes` → `session.auto_mode = true`
|
|
81
|
+
- Skip confirmation prompts
|
|
82
|
+
- Decision nodes: auto-follow delegate verdict (no STOP), except post-debug-escalate
|
|
83
|
+
- Failures: retry once then pause
|
|
84
|
+
|
|
85
|
+
**`-y` downstream propagation** (appended to skill_call in CSV):
|
|
86
|
+
|
|
87
|
+
| Skill | Flag | Effect |
|
|
88
|
+
|-------|------|--------|
|
|
89
|
+
| maestro-init | `-y` | 跳过交互提问 |
|
|
90
|
+
| maestro-analyze | `-y` | 跳过 scoping 交互 |
|
|
91
|
+
| maestro-brainstorm | `-y` | 跳过交互提问 |
|
|
92
|
+
| maestro-roadmap | `-y` | 跳过交互选择 |
|
|
93
|
+
| maestro-plan | `-y` | 跳过确认和澄清 |
|
|
94
|
+
| maestro-execute | `-y` | 跳过确认,blocked 自动继续 |
|
|
95
|
+
| quality-auto-test | `-y` | 跳过计划确认 |
|
|
96
|
+
| quality-test | `-y --auto-fix` | 自动触发 gap-fix loop |
|
|
97
|
+
| maestro-milestone-complete | `-y` | 跳过 knowledge promotion 交互 |
|
|
98
|
+
|
|
99
|
+
未列出的命令无 auto flag,原样执行。
|
|
100
|
+
</context>
|
|
101
|
+
|
|
102
|
+
<invariants>
|
|
103
|
+
1. **ALL external steps via spawn_agents_on_csv** — coordinator NEVER executes skill logic directly
|
|
104
|
+
2. **Coordinator = prompt assembler** — classify → enrich args → build CSV → spawn → read results → assemble next
|
|
105
|
+
3. **Decision nodes delegate-evaluate** — use `maestro delegate --role analyze` for quality-gate assessment; structural decisions (post-milestone, post-debug-escalate) evaluated directly
|
|
106
|
+
4. **Decision STOP behavior** — default: STOP after evaluation; `-y` mode: auto-continue (except post-debug-escalate always STOPs)
|
|
107
|
+
5. **Barrier = solo wave** — analyze, plan, execute, brainstorm, roadmap always run alone
|
|
108
|
+
6. **Non-barriers can parallel** — consecutive non-barrier, non-decision external steps grouped into one wave
|
|
109
|
+
7. **Wave-by-wave** — never start wave N+1 before wave N results are read
|
|
110
|
+
8. **Coordinator owns context** — sub-agents never read prior results; coordinator assembles full skill_call
|
|
111
|
+
9. **Abort on failure** — `-y`: retry once then pause; non-`-y`: mark remaining skipped → pause
|
|
112
|
+
10. **Quality mode governs steps** — full/standard/quick determines which quality stages are included
|
|
113
|
+
11. **passed_gates skip** — already-passed gates not re-run in retry loops (unless code changed)
|
|
114
|
+
</invariants>
|
|
115
|
+
|
|
116
|
+
<execution>
|
|
117
|
+
|
|
118
|
+
## Phase 1: New Session
|
|
119
|
+
|
|
120
|
+
### 1.1: Read project state
|
|
121
|
+
|
|
122
|
+
Read `.workflow/state.json` schema:
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"current_milestone": "MVP",
|
|
126
|
+
"milestones": [{ "id": "M1", "name": "MVP", "status": "active", "phases": [1, 2] }],
|
|
127
|
+
"artifacts": [{
|
|
128
|
+
"id": "ANL-001", "type": "analyze|plan|execute|verify",
|
|
129
|
+
"milestone": "MVP", "phase": 1, "scope": "phase|milestone|adhoc|standalone",
|
|
130
|
+
"path": "phases/01-auth-multi-tenant", // relative to .workflow/scratch/
|
|
131
|
+
"status": "completed", "depends_on": "PLN-001", "harvested": true
|
|
132
|
+
}],
|
|
133
|
+
"accumulated_context": { "key_decisions": [], "deferred": [] }
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### 1.2: Infer lifecycle position
|
|
138
|
+
|
|
139
|
+
**Intent-based override:**
|
|
140
|
+
|
|
141
|
+
If intent matches brainstorm pattern (contains "brainstorm", "头脑风暴", "探索", "ideate", or "设计思路"), position = `brainstorm` regardless of project state.
|
|
142
|
+
|
|
143
|
+
Chain for existing project: `brainstorm → roadmap → analyze → ...` (skip init if `.workflow/state.json` exists).
|
|
144
|
+
|
|
145
|
+
**Bootstrap detection:**
|
|
146
|
+
|
|
147
|
+
| Condition | Position | Chain starts at |
|
|
148
|
+
|-----------|----------|-----------------|
|
|
149
|
+
| No `.workflow/` + no source files | `brainstorm` | brainstorm → init → roadmap → ... |
|
|
150
|
+
| No `.workflow/` + has source files | `init` | init → roadmap → ... |
|
|
151
|
+
| Has `.workflow/` but no state.json | `init` | init → roadmap → ... |
|
|
152
|
+
| Has state.json | → Artifact-based inference below |
|
|
153
|
+
|
|
154
|
+
**Artifact-based inference:**
|
|
155
|
+
|
|
156
|
+
Filter by `milestone == current_milestone`, target phase. Find latest completed artifact type:
|
|
157
|
+
|
|
158
|
+
| State | Position |
|
|
159
|
+
|-------|----------|
|
|
160
|
+
| No milestones[] or no roadmap.md | `roadmap` |
|
|
161
|
+
| No artifacts for target phase | `analyze` |
|
|
162
|
+
| Latest == "analyze" | `plan` |
|
|
163
|
+
| Latest == "plan" | `execute` |
|
|
164
|
+
| Latest == "execute" | `verify` |
|
|
165
|
+
| Latest == "verify" | → Refine by result files |
|
|
166
|
+
|
|
167
|
+
**Refine from verify results** (read `{artifact_dir}/`):
|
|
168
|
+
|
|
169
|
+
| Condition | Position |
|
|
170
|
+
|-----------|----------|
|
|
171
|
+
| verification.json: `passed==false` or `gaps[]` non-empty | `verify-failed` |
|
|
172
|
+
| verification.json: `passed==true`, no review.json, has `.tests/auto-test/report.json` | `review` |
|
|
173
|
+
| verification.json: `passed==true`, no review.json, no `.tests/auto-test/report.json` | `business-test` (full) / `review` (standard/quick) |
|
|
174
|
+
| review.json: `verdict=="BLOCK"` | `review-failed` |
|
|
175
|
+
| review.json: `verdict!="BLOCK"` | `test` |
|
|
176
|
+
| uat.md: all passed | `milestone-audit` |
|
|
177
|
+
| uat.md: has failures | `test-failed` |
|
|
178
|
+
|
|
179
|
+
**resolve_artifact_dir(artifact):**
|
|
180
|
+
```
|
|
181
|
+
Full path = .workflow/scratch/{artifact.path}/
|
|
182
|
+
Fallback: glob .workflow/scratch/*-P{phase}-*/ sorted by date DESC, take first
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### 1.3: Resolve phase number
|
|
186
|
+
|
|
187
|
+
Priority order:
|
|
188
|
+
1. Regex from intent: `phase\s*(\d+)` or bare number
|
|
189
|
+
2. Latest in-progress artifact's phase field
|
|
190
|
+
3. First incomplete phase in current milestone's `phases[]`
|
|
191
|
+
4. `null` if position is brainstorm/init/roadmap (deferred to post-roadmap)
|
|
192
|
+
5. request_user_input if ambiguous (auto_mode does NOT skip this)
|
|
193
|
+
|
|
194
|
+
### 1.4: Determine quality mode
|
|
195
|
+
|
|
196
|
+
**Auto-inference (can be overridden by user to any mode):**
|
|
197
|
+
|
|
198
|
+
| Condition | Mode | Pipeline |
|
|
199
|
+
|-----------|------|----------|
|
|
200
|
+
| Has requirements/REQ-*.md + phase scope | `full` | verify → business-test → review → test-gen → test |
|
|
201
|
+
| Default | `standard` | verify → review → test (test-gen conditional on coverage < 80%) |
|
|
202
|
+
| User explicit `--quality quick` | `quick` | verify → review --tier quick |
|
|
203
|
+
|
|
204
|
+
User can specify `--quality full|standard|quick` to override auto-inference.
|
|
205
|
+
|
|
206
|
+
### 1.5: Build command sequence
|
|
207
|
+
|
|
208
|
+
**Lifecycle stages:**
|
|
209
|
+
|
|
210
|
+
| Stage | Skill | Barrier | Decision after | Condition |
|
|
211
|
+
|-------|-------|---------|----------------|-----------|
|
|
212
|
+
| brainstorm | `maestro-brainstorm "{intent}"` | yes | — | intent-override or 0→1 bootstrap |
|
|
213
|
+
| init | `maestro-init` | no | — | always |
|
|
214
|
+
| roadmap | `maestro-roadmap "{intent}"` | yes | — | always |
|
|
215
|
+
| analyze | `maestro-analyze {phase}` | yes | — | always |
|
|
216
|
+
| plan | `maestro-plan {phase}` | yes | — | always |
|
|
217
|
+
| execute | `maestro-execute {phase}` | yes | — | always |
|
|
218
|
+
| verify | `maestro-verify {phase}` | no | `post-verify` | always |
|
|
219
|
+
| business-test | `quality-auto-test {phase}` | no | `post-business-test` | full only |
|
|
220
|
+
| review | `quality-review {phase}` | no | `post-review` | always (quick: +`--tier quick`) |
|
|
221
|
+
| test-gen | `quality-auto-test {phase}` | no | — | full; standard if coverage < 80% |
|
|
222
|
+
| test | `quality-test {phase}` | no | `post-test` | full/standard |
|
|
223
|
+
| milestone-audit | `maestro-milestone-audit` | no | — | always |
|
|
224
|
+
| milestone-complete | `maestro-milestone-complete` | no | `post-milestone` | always |
|
|
225
|
+
|
|
226
|
+
**Build rules:**
|
|
227
|
+
1. Start from inferred position, skip completed stages
|
|
228
|
+
2. Filter by quality_mode (remove inapplicable stages)
|
|
229
|
+
3. After each decision-triggering stage, insert decision node: `{ decision, retry_count: 0, max_retries: 2 }`
|
|
230
|
+
4. Conditional steps (test-gen in standard) use: `{ "condition": "check_coverage", "threshold": 80 }`
|
|
231
|
+
5. Phase-independent commands (brainstorm, roadmap, init) use `"{intent}"` as args
|
|
232
|
+
6. Commands needing prior output (analyze→plan, plan→execute) have args resolved via artifact lookup at wave build time by coordinator (see buildSkillCall enrichment table in 2.3)
|
|
233
|
+
7. Args use placeholders resolved at wave build time by coordinator
|
|
234
|
+
|
|
235
|
+
**Example — from "plan" position, standard quality mode:**
|
|
236
|
+
```json
|
|
237
|
+
[
|
|
238
|
+
{ "index": 0, "type": "external", "skill": "maestro-plan", "args": "{phase}", "barrier": true },
|
|
239
|
+
{ "index": 1, "type": "external", "skill": "maestro-execute", "args": "{phase}", "barrier": true },
|
|
240
|
+
{ "index": 2, "type": "external", "skill": "maestro-verify", "args": "{phase}" },
|
|
241
|
+
{ "index": 3, "type": "decision", "skill": "maestro-ralph", "args": "{\"decision\":\"post-verify\",\"retry_count\":0,\"max_retries\":2}" },
|
|
242
|
+
{ "index": 4, "type": "external", "skill": "quality-review", "args": "{phase}" },
|
|
243
|
+
{ "index": 5, "type": "decision", "skill": "maestro-ralph", "args": "{\"decision\":\"post-review\",\"retry_count\":0,\"max_retries\":2}" },
|
|
244
|
+
{ "index": 6, "type": "external", "skill": "quality-auto-test", "args": "{phase}", "condition": "check_coverage" },
|
|
245
|
+
{ "index": 7, "type": "external", "skill": "quality-test", "args": "{phase}" },
|
|
246
|
+
{ "index": 8, "type": "decision", "skill": "maestro-ralph", "args": "{\"decision\":\"post-test\",\"retry_count\":0,\"max_retries\":2}" },
|
|
247
|
+
{ "index": 9, "type": "external", "skill": "maestro-milestone-audit", "args": "" },
|
|
248
|
+
{ "index": 10, "type": "external", "skill": "maestro-milestone-complete", "args": "" },
|
|
249
|
+
{ "index": 11, "type": "decision", "skill": "maestro-ralph", "args": "{\"decision\":\"post-milestone\"}" }
|
|
250
|
+
]
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### 1.6: Create session
|
|
254
|
+
|
|
255
|
+
Write `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json`:
|
|
256
|
+
```json
|
|
257
|
+
{
|
|
258
|
+
"session_id": "ralph-{YYYYMMDD-HHmmss}",
|
|
259
|
+
"source": "ralph",
|
|
260
|
+
"created_at": "ISO", "updated_at": "ISO",
|
|
261
|
+
"intent": "{user_intent}",
|
|
262
|
+
"status": "running",
|
|
263
|
+
"chain_name": "ralph-lifecycle",
|
|
264
|
+
"task_type": "lifecycle",
|
|
265
|
+
"lifecycle_position": "{position}",
|
|
266
|
+
"target": "milestone-complete",
|
|
267
|
+
"phase": null | N,
|
|
268
|
+
"milestone": null | "{M}",
|
|
269
|
+
"auto_mode": false,
|
|
270
|
+
"quality_mode": "standard",
|
|
271
|
+
"passed_gates": [],
|
|
272
|
+
"context": {
|
|
273
|
+
"issue_id": null, "milestone_num": null, "spec_session_id": null,
|
|
274
|
+
"scratch_dir": null, "plan_dir": null, "analysis_dir": null, "brainstorm_dir": null
|
|
275
|
+
},
|
|
276
|
+
"steps": [...],
|
|
277
|
+
"waves": [],
|
|
278
|
+
"current_step": 0
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### 1.7: Initialize plan + confirm
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
functions.update_plan({
|
|
286
|
+
explanation: "Ralph lifecycle: {position} → milestone-complete",
|
|
287
|
+
plan: steps.map(step => ({ step: stepLabel(step), status: "pending" }))
|
|
288
|
+
})
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Display:
|
|
292
|
+
```
|
|
293
|
+
============================================================
|
|
294
|
+
RALPH DECISION ENGINE
|
|
295
|
+
============================================================
|
|
296
|
+
Position: {position} (Phase {N}, {milestone})
|
|
297
|
+
Target: milestone-complete
|
|
298
|
+
Quality: {quality_mode}
|
|
299
|
+
Steps: {total} ({decision_count} decision points)
|
|
300
|
+
|
|
301
|
+
[ ] 0. maestro-plan {phase} [barrier]
|
|
302
|
+
[ ] 1. maestro-execute {phase} [barrier]
|
|
303
|
+
[ ] 2. maestro-verify {phase} [external]
|
|
304
|
+
[ ] 3. ◆ post-verify [decision]
|
|
305
|
+
...
|
|
306
|
+
============================================================
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
- If `-y`: proceed directly
|
|
310
|
+
- Else: request_user_input → Proceed / Edit / Cancel / Change quality mode
|
|
311
|
+
|
|
312
|
+
Fall through to Phase 2.
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## Phase 2: Wave Execution Loop
|
|
317
|
+
|
|
318
|
+
### 2.1: Load session + find next step
|
|
319
|
+
|
|
320
|
+
Read status.json. Rebuild `update_plan` from step statuses.
|
|
321
|
+
Find first pending step.
|
|
322
|
+
|
|
323
|
+
- If decision node → Step 2.2 (Delegate Evaluation)
|
|
324
|
+
- If external node → Step 2.3 (Wave Execution)
|
|
325
|
+
- If no pending → Phase 3 (Completion)
|
|
326
|
+
|
|
327
|
+
### 2.2: Delegate Evaluation (decision nodes)
|
|
328
|
+
|
|
329
|
+
**Route by decision type:**
|
|
330
|
+
- Quality-gate decisions (post-verify, post-business-test, post-review, post-test) → delegate analysis
|
|
331
|
+
- Structural decisions (post-milestone, post-debug-escalate) → direct evaluation
|
|
332
|
+
|
|
333
|
+
#### 2.2a: Delegate quality-gate assessment
|
|
334
|
+
|
|
335
|
+
Read decision metadata: `{ decision, retry_count, max_retries }`
|
|
336
|
+
|
|
337
|
+
**Result file mapping:**
|
|
338
|
+
|
|
339
|
+
| Decision | Files to include |
|
|
340
|
+
|----------|-----------------|
|
|
341
|
+
| post-verify | `{artifact_dir}/verification.json` |
|
|
342
|
+
| post-business-test | `{artifact_dir}/.tests/auto-test/report.json` |
|
|
343
|
+
| post-review | `{artifact_dir}/review.json` |
|
|
344
|
+
| post-test | `{artifact_dir}/uat.md`, `{artifact_dir}/.tests/test-results.json` |
|
|
345
|
+
|
|
346
|
+
```
|
|
347
|
+
exec_command({
|
|
348
|
+
cmd: `maestro delegate "PURPOSE: 评估 ${meta.decision} 质量门结果
|
|
349
|
+
TASK: 读取结果文件 | 分析通过/失败 | 评估严重性 | 给出建议
|
|
350
|
+
MODE: analysis
|
|
351
|
+
CONTEXT: @${result_files}
|
|
352
|
+
EXPECTED: 严格按格式输出:
|
|
353
|
+
---VERDICT---
|
|
354
|
+
STATUS: proceed | fix | escalate
|
|
355
|
+
REASON: 一句话解释
|
|
356
|
+
GAP_SUMMARY: 问题描述(fix/escalate 时填写)
|
|
357
|
+
CONFIDENCE: high | medium | low
|
|
358
|
+
CONFIDENCE_SCORE: 0-100(从结果文件中读取置信度分数,无则估算)
|
|
359
|
+
WEAKEST_DIMENSION: 最弱维度名称
|
|
360
|
+
---END---
|
|
361
|
+
CONSTRAINTS: 只评估 | STATUS 三选一 | 置信度 < 60% 倾向 fix | retry ${meta.retry_count}/${meta.max_retries} 达上限必须 escalate" --role analyze --mode analysis`,
|
|
362
|
+
yield_time_ms: 30000,
|
|
363
|
+
max_output_tokens: 6000
|
|
364
|
+
})
|
|
365
|
+
// ⚠️ If session_id returned → poll write_stdin until completion (see @~/.maestro/workflows/delegate-protocol.codex.md)
|
|
366
|
+
// NEVER skip — verdict is required for decision routing
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
**Parse verdict** (on callback):
|
|
370
|
+
```
|
|
371
|
+
Extract STATUS / REASON / GAP_SUMMARY / CONFIDENCE / CONFIDENCE_SCORE / WEAKEST_DIMENSION from output.
|
|
372
|
+
If parse fails → fallback: STATUS = "fix", GAP_SUMMARY = generic
|
|
373
|
+
|
|
374
|
+
Confidence-based verdict adjustment (after parse, before apply):
|
|
375
|
+
If CONFIDENCE_SCORE < 60 AND STATUS == "proceed":
|
|
376
|
+
→ Override to "fix", REASON += " (置信度不足: {score}%,{weakest} 需加强)"
|
|
377
|
+
If CONFIDENCE_SCORE > 95 AND STATUS == "fix" AND retry_count > 0:
|
|
378
|
+
→ Suggest "proceed" override, REASON += " (置信度充分: {score}%,建议通过)"
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
**Confidence-aware evaluation**: Before delegating, check if artifact contains confidence section (added by downstream commands). If found, include `已有置信度评估: 整体 {overall}%, 最弱维度: {weakest} ({score}%)` in delegate prompt as additional signal.
|
|
382
|
+
|
|
383
|
+
**Apply verdict:**
|
|
384
|
+
|
|
385
|
+
| Mode | Behavior |
|
|
386
|
+
|------|----------|
|
|
387
|
+
| `-y` (auto_mode) | Follow adjusted verdict directly, no user prompt |
|
|
388
|
+
| Interactive + confidence_score >= 80 | Display recommendation with confidence, prompt user |
|
|
389
|
+
| Interactive + confidence_score < 80 | Display recommendation **with confidence warning**, prompt user |
|
|
390
|
+
|
|
391
|
+
Interactive prompt (via `request_user_input`):
|
|
392
|
+
```json
|
|
393
|
+
{ "questions": [{ "id": "decision_override", "header": "◆ {meta.decision} 评估结果", "question": "STATUS: {verdict.status}\nREASON: {verdict.reason}\n\n选择操作:", "options": [
|
|
394
|
+
{ "label": "按建议执行 (Recommended)", "description": "执行 {verdict.status} 操作" },
|
|
395
|
+
{ "label": "覆盖 proceed", "description": "忽略问题,强制通过" },
|
|
396
|
+
{ "label": "覆盖 fix", "description": "强制进入修复循环" },
|
|
397
|
+
{ "label": "取消", "description": "暂停会话,手动处理" }
|
|
398
|
+
]}] }
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
**Verdict → action:**
|
|
402
|
+
|
|
403
|
+
| Verdict | Action |
|
|
404
|
+
|---------|--------|
|
|
405
|
+
| `proceed` | Add gate to passed_gates, continue |
|
|
406
|
+
| `fix` | Clear passed_gates (code will change), insert fix-loop |
|
|
407
|
+
| `escalate` | Insert `[quality-debug "{gap_summary}", decision:post-debug-escalate]` |
|
|
408
|
+
|
|
409
|
+
#### 2.2b: Fix-loop templates
|
|
410
|
+
|
|
411
|
+
The delegate's `gap_summary` is passed as context to `quality-debug`.
|
|
412
|
+
|
|
413
|
+
**passed_gates reset**: Every fix-loop inserts `maestro-execute` (code changes), so `passed_gates` is cleared at insertion time (see 2.2a verdict action). Downstream decision nodes restart with `retry: 0` to re-validate against modified code. Only the triggering decision's own `retry_count` increments.
|
|
414
|
+
|
|
415
|
+
**post-verify fix-loop:**
|
|
416
|
+
Reset: `passed_gates = []` (code changed via execute)
|
|
417
|
+
```
|
|
418
|
+
quality-debug "{gap_summary}"
|
|
419
|
+
maestro-plan --gaps {phase} [barrier]
|
|
420
|
+
maestro-execute {phase} [barrier]
|
|
421
|
+
maestro-verify {phase}
|
|
422
|
+
decision:post-verify {retry+1}
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
**post-business-test fix-loop (full mode):**
|
|
426
|
+
Reset: `passed_gates = []` (code changed via execute); post-verify restarts at retry: 0
|
|
427
|
+
```
|
|
428
|
+
quality-debug --from-business-test "{gap_summary}"
|
|
429
|
+
maestro-plan --gaps {phase} [barrier]
|
|
430
|
+
maestro-execute {phase} [barrier]
|
|
431
|
+
maestro-verify {phase}
|
|
432
|
+
decision:post-verify {retry: 0}
|
|
433
|
+
quality-auto-test {phase}
|
|
434
|
+
decision:post-business-test {retry+1}
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
**post-review fix-loop:**
|
|
438
|
+
Reset: `passed_gates = []` (code changed via execute); post-verify restarts at retry: 0
|
|
439
|
+
```
|
|
440
|
+
quality-debug "{gap_summary}"
|
|
441
|
+
maestro-plan --gaps {phase} [barrier]
|
|
442
|
+
maestro-execute {phase} [barrier]
|
|
443
|
+
maestro-verify {phase}
|
|
444
|
+
decision:post-verify {retry: 0}
|
|
445
|
+
quality-review {phase}
|
|
446
|
+
decision:post-review {retry+1}
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
**post-test fix-loop:**
|
|
450
|
+
Reset: `passed_gates = []` (code changed via execute); all downstream decisions restart at retry: 0
|
|
451
|
+
```
|
|
452
|
+
quality-debug --from-uat "{gap_summary}"
|
|
453
|
+
maestro-plan --gaps {phase} [barrier]
|
|
454
|
+
maestro-execute {phase} [barrier]
|
|
455
|
+
maestro-verify {phase}
|
|
456
|
+
decision:post-verify {retry: 0}
|
|
457
|
+
quality-auto-test {phase} # full mode only
|
|
458
|
+
decision:post-business-test {retry: 0} # full mode only
|
|
459
|
+
quality-review {phase}
|
|
460
|
+
decision:post-review {retry: 0}
|
|
461
|
+
quality-auto-test {phase} # full mode; standard if coverage < 80%
|
|
462
|
+
quality-test {phase}
|
|
463
|
+
decision:post-test {retry+1}
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
#### 2.2c: Structural decisions (direct evaluation)
|
|
467
|
+
|
|
468
|
+
**post-milestone:**
|
|
469
|
+
```
|
|
470
|
+
Read .workflow/state.json — check next milestone (status "pending"/"active")
|
|
471
|
+
If found: update session (milestone, phase, reset passed_gates), re-infer quality_mode,
|
|
472
|
+
insert lifecycle via buildSteps() for next milestone
|
|
473
|
+
If none: proceed — session completes naturally
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
**post-debug-escalate:**
|
|
477
|
+
```
|
|
478
|
+
Set session status = "paused"
|
|
479
|
+
Display: ◆ 已达最大重试次数,debug 已执行。请人工介入检查结果。
|
|
480
|
+
STOP (always, regardless of -y)
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
#### 2.2d: Finalize decision
|
|
484
|
+
|
|
485
|
+
```
|
|
486
|
+
Mark decision step "completed"
|
|
487
|
+
Reindex steps if commands inserted
|
|
488
|
+
Write status.json
|
|
489
|
+
Sync update_plan
|
|
490
|
+
|
|
491
|
+
Display: ◆ Decision: {type} → {verdict.status} ({verdict.reason})
|
|
492
|
+
|
|
493
|
+
STOP behavior:
|
|
494
|
+
post-debug-escalate → always STOP
|
|
495
|
+
auto_mode == true → no STOP, continue to 2.3
|
|
496
|
+
auto_mode == false → STOP. Display: ⏸ 使用 $maestro-ralph execute 继续
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
### 2.3: Build and Execute Wave
|
|
500
|
+
|
|
501
|
+
**Loop while pending non-decision steps exist:**
|
|
502
|
+
|
|
503
|
+
**1. buildNextWave:**
|
|
504
|
+
- Conditional step → evaluate condition, skip if not met:
|
|
505
|
+
- `check_coverage`: read `{artifact_dir}/validation.json`, if `coverage >= threshold` → skip test-gen; else → include
|
|
506
|
+
- If validation.json not found → include (assume coverage insufficient)
|
|
507
|
+
- Barrier step → solo wave (single row CSV)
|
|
508
|
+
- Non-barrier → collect consecutive non-barrier, non-decision steps (multi-row CSV)
|
|
509
|
+
- Stop at first decision node
|
|
510
|
+
|
|
511
|
+
**2. buildSkillCall(step, session)** — assemble fully-resolved command:
|
|
512
|
+
|
|
513
|
+
Placeholder resolution:
|
|
514
|
+
```
|
|
515
|
+
{phase} → session.phase
|
|
516
|
+
{intent} → session.intent
|
|
517
|
+
{scratch_dir} → latest artifact path
|
|
518
|
+
{plan_dir} → session.context.plan_dir
|
|
519
|
+
{analysis_dir} → session.context.analysis_dir
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
Per-skill enrichment:
|
|
523
|
+
| Skill | Enrichment |
|
|
524
|
+
|-------|-----------|
|
|
525
|
+
| maestro-brainstorm | args empty → `"{intent}"` |
|
|
526
|
+
| maestro-roadmap | args empty → `"{intent}"` |
|
|
527
|
+
| maestro-analyze | args empty → `{phase}` |
|
|
528
|
+
| maestro-plan | resolve latest analyze artifact → `--dir .workflow/scratch/{path}` |
|
|
529
|
+
| maestro-execute | resolve latest plan artifact → `--dir .workflow/scratch/{path}` |
|
|
530
|
+
| quality-debug | append gap_summary or `--from-uat`/`--from-business-test` |
|
|
531
|
+
| quality-* / maestro-verify / milestone-* | args empty → `{phase}` or empty |
|
|
532
|
+
|
|
533
|
+
Auto flag: append from propagation table if `auto_mode == true`.
|
|
534
|
+
|
|
535
|
+
Result: `$<skill-name> <enriched-args> [auto-flag]`
|
|
536
|
+
|
|
537
|
+
**3. Write wave CSV:** `{sessionDir}/wave-{N}.csv`
|
|
538
|
+
|
|
539
|
+
**4. Update plan** (mark wave steps in_progress)
|
|
540
|
+
|
|
541
|
+
**5. Spawn:**
|
|
542
|
+
```
|
|
543
|
+
spawn_agents_on_csv({
|
|
544
|
+
csv_path: "{sessionDir}/wave-{N}.csv",
|
|
545
|
+
id_column: "id",
|
|
546
|
+
instruction: WAVE_INSTRUCTION,
|
|
547
|
+
max_workers: <wave_size>,
|
|
548
|
+
max_runtime_seconds: 3600,
|
|
549
|
+
output_csv_path: "{sessionDir}/wave-{N}-results.csv",
|
|
550
|
+
output_schema: RESULT_SCHEMA
|
|
551
|
+
})
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
**6. Read results** — update step statuses from results CSV
|
|
555
|
+
|
|
556
|
+
**7. Barrier context update:**
|
|
557
|
+
|
|
558
|
+
| Barrier | Read | Update |
|
|
559
|
+
|---------|------|--------|
|
|
560
|
+
| maestro-analyze | context.md, state.json | context.analysis_dir |
|
|
561
|
+
| maestro-plan | plan.json | context.plan_dir |
|
|
562
|
+
| maestro-execute | results | context.exec_status |
|
|
563
|
+
| maestro-brainstorm | .brainstorming/ | context.brainstorm_dir |
|
|
564
|
+
| maestro-roadmap | specs/ | context.spec_session_id |
|
|
565
|
+
|
|
566
|
+
**8. Persist** — write status.json + sync update_plan
|
|
567
|
+
|
|
568
|
+
**9. Failure check:**
|
|
569
|
+
- `-y`: retry once, then pause (await manual intervention)
|
|
570
|
+
- Non-`-y`: mark remaining skipped → pause → STOP
|
|
571
|
+
|
|
572
|
+
**10. Next step check:**
|
|
573
|
+
- Decision node + auto_mode → loop to 2.2
|
|
574
|
+
- Decision node + non-auto → STOP
|
|
575
|
+
- External node → loop to step 1
|
|
576
|
+
|
|
577
|
+
---
|
|
578
|
+
|
|
579
|
+
## Phase 3: Completion
|
|
580
|
+
|
|
581
|
+
```
|
|
582
|
+
status.status = "completed"
|
|
583
|
+
status.updated_at = now
|
|
584
|
+
Write status.json
|
|
585
|
+
|
|
586
|
+
functions.update_plan({
|
|
587
|
+
explanation: "Ralph lifecycle complete",
|
|
588
|
+
plan: steps.map(step => ({ step: stepLabel(step), status: "completed" }))
|
|
589
|
+
})
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
Display:
|
|
593
|
+
```
|
|
594
|
+
============================================================
|
|
595
|
+
RALPH COMPLETE
|
|
596
|
+
============================================================
|
|
597
|
+
Session: {session_id}
|
|
598
|
+
Quality: {quality_mode}
|
|
599
|
+
Phase: {phase} → {milestone}
|
|
600
|
+
Waves: {wave_count} executed
|
|
601
|
+
Steps: {completed}/{total} ({skipped} skipped)
|
|
602
|
+
|
|
603
|
+
[✓] 0. maestro-plan 1 [W1]
|
|
604
|
+
[✓] 1. maestro-execute 1 [W2]
|
|
605
|
+
[✓] 2. maestro-verify 1 [W3]
|
|
606
|
+
[✓] 3. ◆ post-verify → proceed [decision]
|
|
607
|
+
[~] 4. quality-auto-test 1 [skipped: standard mode]
|
|
608
|
+
[✓] 5. quality-review 1 [W4]
|
|
609
|
+
...
|
|
610
|
+
============================================================
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
</execution>
|
|
614
|
+
|
|
615
|
+
<csv_schema>
|
|
616
|
+
### wave-{N}.csv
|
|
617
|
+
|
|
618
|
+
Coordinator 已完成 arg 组装 + auto flag 附加:
|
|
619
|
+
|
|
620
|
+
```csv
|
|
621
|
+
id,skill_call,topic
|
|
622
|
+
"3","$maestro-verify 1","Ralph step 3/14: verify phase 1"
|
|
623
|
+
"4","$quality-review 1 --tier quick","Ralph step 4/14: review phase 1"
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
Rules:
|
|
627
|
+
- `skill_call`: complete `$<skill> <args> [auto-flag]` from `buildSkillCall()`
|
|
628
|
+
- `topic`: human-readable step description
|
|
629
|
+
- Non-barrier external + non-decision → multi-row (parallel)
|
|
630
|
+
- Barrier external → single-row (solo)
|
|
631
|
+
- Decision nodes NEVER appear in CSV — processed by coordinator directly
|
|
632
|
+
|
|
633
|
+
### Sub-Agent Instruction
|
|
634
|
+
|
|
635
|
+
```
|
|
636
|
+
你是 CSV job 子 agent。
|
|
637
|
+
|
|
638
|
+
执行技能调用:{skill_call}
|
|
639
|
+
任务说明:{topic}
|
|
640
|
+
|
|
641
|
+
限制:
|
|
642
|
+
- 不要修改 .workflow/.maestro/ 下的 status 文件
|
|
643
|
+
- skill 内部有自己的 session 管理,按 skill SKILL.md 执行
|
|
644
|
+
|
|
645
|
+
完成后调用 `report_agent_job_result`,返回:
|
|
646
|
+
{"status":"completed|failed","skill_call":"{skill_call}","summary":"一句话结果","artifacts":"产物路径","error":"失败原因"}
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
### Result Schema
|
|
650
|
+
|
|
651
|
+
`{ status, skill_call, summary, artifacts, error }` — all string
|
|
652
|
+
</csv_schema>
|
|
653
|
+
|
|
654
|
+
<error_codes>
|
|
655
|
+
| Code | Severity | Description | Recovery |
|
|
656
|
+
|------|----------|-------------|----------|
|
|
657
|
+
| E001 | error | No intent and no running session | Prompt for intent |
|
|
658
|
+
| E002 | error | Cannot infer lifecycle position | Show raw state, ask user |
|
|
659
|
+
| E003 | error | Artifact dir not found for decision | Show glob results, ask user |
|
|
660
|
+
| E004 | error | Delegate verdict parse failed | Fallback: treat as "fix" |
|
|
661
|
+
| E005 | error | Delegate execution failed | Fallback: treat as "fix" with generic summary |
|
|
662
|
+
| E006 | error | Wave timeout (max_runtime_seconds) | Mark step failed, pause |
|
|
663
|
+
| E007 | error | No session found for execute/continue | Suggest $maestro-ralph "intent" |
|
|
664
|
+
| W001 | warning | Decision node expanded chain | Auto-handled, log expansion |
|
|
665
|
+
| W002 | warning | Max retries reached, escalating | Auto-handled |
|
|
666
|
+
| W003 | warning | Multiple running sessions found | Use latest, warn user |
|
|
667
|
+
| W004 | warning | Delegate confidence == "low" | Show warning in interactive mode |
|
|
668
|
+
</error_codes>
|
|
669
|
+
|
|
670
|
+
<success_criteria>
|
|
671
|
+
- [ ] state.json parsed with actual schema (type, path, scope, milestone, depends_on)
|
|
672
|
+
- [ ] Lifecycle position inferred from bootstrap + artifact chain + result files
|
|
673
|
+
- [ ] Artifact dir resolved via resolve_artifact_dir() with fallback glob
|
|
674
|
+
- [ ] Quality mode (full/standard/quick) correctly inferred and governs step generation
|
|
675
|
+
- [ ] Conditional steps evaluated at decision time (coverage threshold)
|
|
676
|
+
- [ ] buildSkillCall() completes arg enrichment + auto flag, CSV contains full commands
|
|
677
|
+
- [ ] Quality-gate decisions delegate-evaluated via `maestro delegate --role analyze`
|
|
678
|
+
- [ ] Delegate verdict parsed: STATUS / REASON / GAP_SUMMARY / CONFIDENCE / CONFIDENCE_SCORE / WEAKEST_DIMENSION
|
|
679
|
+
- [ ] Confidence-based verdict adjustment applied (< 60% bias fix, > 95% bias proceed)
|
|
680
|
+
- [ ] Artifact confidence sections read when available as additional signal
|
|
681
|
+
- [ ] `-y` mode: auto-follow adjusted verdict, no STOP (except post-debug-escalate)
|
|
682
|
+
- [ ] Interactive mode: display recommendation with confidence score + request_user_input with override
|
|
683
|
+
- [ ] Delegate failure fallback: treat as "fix" verdict
|
|
684
|
+
- [ ] passed_gates[] tracks passed quality gates, skips re-runs in retry loops
|
|
685
|
+
- [ ] passed_gates cleared when code changes (fix-loop inserts execute step)
|
|
686
|
+
- [ ] Fix-loop templates correctly use gap_summary from delegate
|
|
687
|
+
- [ ] retry_count tracked per decision, max_retries enforced → escalation
|
|
688
|
+
- [ ] ALL external steps via spawn_agents_on_csv — coordinator never executes directly
|
|
689
|
+
- [ ] Barrier steps solo wave, non-barriers parallel
|
|
690
|
+
- [ ] functions.update_plan() initialized in 1.7, synced per wave, finalized in Phase 3
|
|
691
|
+
- [ ] status.json persisted after every wave and decision
|
|
692
|
+
- [ ] Command insertion + reindex preserves step integrity
|
|
693
|
+
</success_criteria>
|