maestro-flow 0.3.28 → 0.3.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/maestro-init.md +3 -3
- package/.claude/commands/maestro-plan.md +2 -2
- package/.claude/commands/maestro-ralph-execute.md +332 -0
- package/.claude/commands/maestro-ralph.md +526 -0
- package/.claude/commands/maestro.md +13 -11
- package/.claude/commands/quality-business-test.md +3 -3
- package/.claude/commands/quality-retrospective.md +2 -2
- package/.codex/skills/maestro/SKILL.md +4 -4
- package/.codex/skills/maestro-init/SKILL.md +9 -9
- package/.codex/skills/maestro-link-coordinate/SKILL.md +4 -4
- package/.codex/skills/maestro-milestone-complete/SKILL.md +3 -2
- package/.codex/skills/maestro-plan/SKILL.md +2 -2
- package/.codex/skills/maestro-ralph/SKILL.md +662 -0
- package/.codex/skills/maestro-ralph-execute/SKILL.md +193 -0
- package/.codex/skills/quality-business-test/SKILL.md +6 -6
- package/.codex/skills/quality-retrospective/SKILL.md +5 -5
- package/.codex/skills/quality-test/SKILL.md +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maestro-ralph
|
|
3
|
+
description: Closed-loop lifecycle decision engine — read project state, infer position, build adaptive command chain with decision/skill/cli nodes
|
|
4
|
+
argument-hint: "\"intent\" | status | continue"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
- Skill
|
|
13
|
+
- AskUserQuestion
|
|
14
|
+
---
|
|
15
|
+
<purpose>
|
|
16
|
+
Closed-loop decision engine for the maestro workflow lifecycle.
|
|
17
|
+
Reads project state → infers lifecycle position → builds command chain with three node types:
|
|
18
|
+
- **decision**: Hand back to ralph for re-evaluation (adaptive branching)
|
|
19
|
+
- **skill**: In-session Skill() call (synchronous, lightweight)
|
|
20
|
+
- **cli**: CLI delegate call via `maestro delegate` (context-isolated, heavy)
|
|
21
|
+
|
|
22
|
+
Decision nodes at key checkpoints enable dynamic chain expansion —
|
|
23
|
+
ralph re-reads actual execution result files, then decides whether to append debug+fix loops or proceed.
|
|
24
|
+
|
|
25
|
+
Key difference from maestro coordinator:
|
|
26
|
+
- maestro: static chainMap → one-time selection → chain-execute runs all steps
|
|
27
|
+
- ralph: living chain → decision nodes re-evaluate after each critical step → chain grows/shrinks dynamically
|
|
28
|
+
|
|
29
|
+
Produces session at `.workflow/.ralph/ralph-{YYYYMMDD-HHmmss}/status.json`.
|
|
30
|
+
Mutual invocation with `/maestro-ralph-execute` forms a persistent self-perpetuating work loop.
|
|
31
|
+
</purpose>
|
|
32
|
+
|
|
33
|
+
<context>
|
|
34
|
+
$ARGUMENTS — user intent text, or keywords.
|
|
35
|
+
|
|
36
|
+
**Keywords:**
|
|
37
|
+
- `status` — Display current ralph session progress. **End.**
|
|
38
|
+
- `continue` — Find latest running session → `Skill({ skill: "maestro-ralph-execute" })`. **End.**
|
|
39
|
+
|
|
40
|
+
**Decision-node trigger detection:**
|
|
41
|
+
If a running ralph session exists AND `commands[current].type == "decision"` AND `commands[current].status == "running"`:
|
|
42
|
+
→ Enter **Decision Evaluation Mode** (Step 2b) instead of New Session Mode.
|
|
43
|
+
|
|
44
|
+
**State files read:**
|
|
45
|
+
- `.workflow/state.json` — artifact registry, milestone, phase status
|
|
46
|
+
- `.workflow/roadmap.md` — milestone/phase structure
|
|
47
|
+
- `.workflow/.ralph/ralph-*/status.json` — ralph session state
|
|
48
|
+
</context>
|
|
49
|
+
|
|
50
|
+
<execution>
|
|
51
|
+
|
|
52
|
+
## Step 1: Parse & Route
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
Parse $ARGUMENTS:
|
|
56
|
+
"status" → handleStatus(). End.
|
|
57
|
+
"continue" → handleContinue(). End.
|
|
58
|
+
|
|
59
|
+
Check running ralph session:
|
|
60
|
+
Scan .workflow/.ralph/ralph-*/status.json for status == "running"
|
|
61
|
+
If found AND commands[current].type == "decision" AND commands[current].status == "running":
|
|
62
|
+
→ Step 2b (Decision Evaluation Mode)
|
|
63
|
+
Else if $ARGUMENTS is non-empty:
|
|
64
|
+
→ Step 2a (New Session Mode)
|
|
65
|
+
Else:
|
|
66
|
+
→ AskUserQuestion: "请描述目标,或输入 status/continue"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### handleStatus()
|
|
70
|
+
```
|
|
71
|
+
Scan .workflow/.ralph/ralph-*/status.json (latest by created_at)
|
|
72
|
+
Display:
|
|
73
|
+
Session: {id}
|
|
74
|
+
Status: {status}
|
|
75
|
+
Position: {lifecycle_position}
|
|
76
|
+
Progress: {completed}/{total} commands
|
|
77
|
+
Current: [{current}] {commands[current].skill} [{commands[current].type}]
|
|
78
|
+
|
|
79
|
+
Commands:
|
|
80
|
+
[✓] 0. maestro-analyze 1 [skill]
|
|
81
|
+
[▸] 1. maestro-plan 1 [skill]
|
|
82
|
+
[ ] 2. maestro-execute 1 [cli]
|
|
83
|
+
...
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### handleContinue()
|
|
87
|
+
```
|
|
88
|
+
Find latest running ralph session
|
|
89
|
+
If not found → "无运行中的 ralph 会话"
|
|
90
|
+
Skill({ skill: "maestro-ralph-execute" })
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Step 2a: New Session Mode
|
|
96
|
+
|
|
97
|
+
### 2a.1: Read project state
|
|
98
|
+
|
|
99
|
+
Read `.workflow/state.json`. Extract:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
state.json actual schema:
|
|
103
|
+
{
|
|
104
|
+
"current_milestone": "MVP",
|
|
105
|
+
"milestones": [{ "id": "M1", "name": "MVP", "status": "active", "phases": [1, 2] }],
|
|
106
|
+
"artifacts": [
|
|
107
|
+
{
|
|
108
|
+
"id": "ANL-001",
|
|
109
|
+
"type": "analyze", // analyze | plan | execute | verify
|
|
110
|
+
"milestone": "MVP",
|
|
111
|
+
"phase": 1,
|
|
112
|
+
"scope": "phase", // phase | milestone | adhoc | standalone
|
|
113
|
+
"path": "phases/01-auth-multi-tenant", // relative to .workflow/scratch/
|
|
114
|
+
"status": "completed",
|
|
115
|
+
"depends_on": "PLN-001",
|
|
116
|
+
"harvested": true
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"accumulated_context": {
|
|
120
|
+
"key_decisions": [...],
|
|
121
|
+
"deferred": [...]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Also check:
|
|
127
|
+
- `.workflow/roadmap.md` existence
|
|
128
|
+
- `.workflow/scratch/` for recent result files
|
|
129
|
+
|
|
130
|
+
### 2a.2: Infer lifecycle position
|
|
131
|
+
|
|
132
|
+
**First: determine project bootstrap state:**
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
Check .workflow/ existence:
|
|
136
|
+
|
|
137
|
+
Case A — No .workflow/ at all (0→1 or existing code without workflow):
|
|
138
|
+
Check project root for source files (src/, package.json, go.mod, etc.)
|
|
139
|
+
|
|
140
|
+
A1: No source files (empty project, 0→1)
|
|
141
|
+
→ position = "brainstorm"
|
|
142
|
+
→ chain starts: brainstorm → init → roadmap → analyze → ...
|
|
143
|
+
→ brainstorm args = "{intent}" (user describes what to build)
|
|
144
|
+
|
|
145
|
+
A2: Has source files (existing code, first time using maestro)
|
|
146
|
+
→ position = "init"
|
|
147
|
+
→ chain starts: init → roadmap → analyze → ...
|
|
148
|
+
→ init auto-detects existing code and bootstraps state.json
|
|
149
|
+
|
|
150
|
+
Case B — Has .workflow/ but no state.json:
|
|
151
|
+
→ position = "init" (corrupted or partial setup)
|
|
152
|
+
→ chain starts: init → roadmap → analyze → ...
|
|
153
|
+
|
|
154
|
+
Case C — Has state.json:
|
|
155
|
+
→ proceed to artifact-based position inference below
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Artifact-based position inference (Case C):**
|
|
159
|
+
|
|
160
|
+
Filter artifacts by `milestone == current_milestone`. Group by phase. For the target phase, find the **latest completed artifact type**:
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
state.json exists, no milestones[] → "roadmap" (init done, needs roadmap)
|
|
164
|
+
Has milestones, no roadmap.md → "roadmap"
|
|
165
|
+
Has roadmap, no artifacts for target phase → "analyze"
|
|
166
|
+
Latest artifact type == "analyze" → "plan"
|
|
167
|
+
Latest artifact type == "plan" → "execute"
|
|
168
|
+
Latest artifact type == "execute" → "verify"
|
|
169
|
+
Latest artifact type == "verify" → check result files (see below)
|
|
170
|
+
|
|
171
|
+
When latest is "verify", read result files to refine position:
|
|
172
|
+
resolve_artifact_dir(latest_verify_artifact)
|
|
173
|
+
Read verification.json from that dir:
|
|
174
|
+
gaps[] non-empty or passed == false → "verify-failed" (needs fix loop)
|
|
175
|
+
passed == true, no review.json → "business-test"
|
|
176
|
+
has review.json with verdict == "BLOCK" → "review-failed"
|
|
177
|
+
has review.json with verdict != "BLOCK" → "test"
|
|
178
|
+
has uat.md with status == "complete", all passed → "milestone-audit"
|
|
179
|
+
has uat.md with failures → "test-failed"
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**resolve_artifact_dir(artifact):**
|
|
183
|
+
```
|
|
184
|
+
artifact.path is relative path (e.g. "phases/01-auth-multi-tenant")
|
|
185
|
+
Full path = .workflow/scratch/{artifact.path}/
|
|
186
|
+
If path starts with "phases/": also try .workflow/scratch/{YYYYMMDD}-*-P{phase}-*/
|
|
187
|
+
Fallback: glob .workflow/scratch/*-P{phase}-*/ sorted by date DESC, take first
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 2a.3: Resolve phase number
|
|
191
|
+
|
|
192
|
+
Priority:
|
|
193
|
+
1. User intent text (regex `phase\s*(\d+)` or bare number)
|
|
194
|
+
2. Latest in-progress artifact's phase field
|
|
195
|
+
3. First phase in current milestone's `phases[]` that lacks complete artifact chain
|
|
196
|
+
4. AskUserQuestion if ambiguous
|
|
197
|
+
|
|
198
|
+
### 2a.4: Build command sequence
|
|
199
|
+
|
|
200
|
+
Generate commands from `lifecycle_position` to target (default: `milestone-complete`).
|
|
201
|
+
|
|
202
|
+
**Lifecycle stages** (full pipeline with decision nodes):
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
Stage Command Type Decision After
|
|
206
|
+
─────────────────────────────────────────────────────────────────────────
|
|
207
|
+
brainstorm maestro-brainstorm "{intent}" cli — (0→1 only)
|
|
208
|
+
init maestro-init skill —
|
|
209
|
+
roadmap maestro-roadmap "{intent}" skill —
|
|
210
|
+
analyze maestro-analyze {phase} cli —
|
|
211
|
+
plan maestro-plan {phase} skill —
|
|
212
|
+
execute maestro-execute {phase} cli —
|
|
213
|
+
verify maestro-verify {phase} skill decision:post-verify
|
|
214
|
+
business-test quality-business-test {phase} skill decision:post-business-test
|
|
215
|
+
review quality-review {phase} skill decision:post-review
|
|
216
|
+
test-gen quality-test-gen {phase} skill —
|
|
217
|
+
test quality-test {phase} skill decision:post-test
|
|
218
|
+
milestone-audit maestro-milestone-audit skill —
|
|
219
|
+
milestone-complete maestro-milestone-complete skill decision:post-milestone
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**Command type (cli vs skill):**
|
|
223
|
+
| Command | Type | Why |
|
|
224
|
+
|---------|------|-----|
|
|
225
|
+
| maestro-analyze | `cli` | Heavy multi-source exploration |
|
|
226
|
+
| maestro-execute | `cli` | Heavy code generation |
|
|
227
|
+
| maestro-brainstorm | `cli` | Heavy multi-role generation |
|
|
228
|
+
| maestro-plan | `skill` | Needs user interaction for clarification |
|
|
229
|
+
| All quality-* | `skill` | In-session, user-visible results |
|
|
230
|
+
| All milestone-* | `skill` | Lightweight lifecycle ops |
|
|
231
|
+
|
|
232
|
+
**Build rules:**
|
|
233
|
+
1. Start from current lifecycle_position (skip completed stages)
|
|
234
|
+
2. After each decision-triggering stage, insert a decision node
|
|
235
|
+
3. Each decision node carries: `{ decision, retry_count: 0, max_retries: 2 }` in args
|
|
236
|
+
4. Args use placeholders — resolved at execution time by ralph-execute (Step 2.5):
|
|
237
|
+
- `{phase}` → session.phase
|
|
238
|
+
- `{intent}` → session.intent (user's original text)
|
|
239
|
+
- `{scratch_dir}` → resolved from latest artifact path at execution time
|
|
240
|
+
5. Commands that need user intent text (brainstorm, roadmap, init) use `"{intent}"` as args
|
|
241
|
+
6. Commands that need prior output (plan→execute, analyze→plan) have args resolved via artifact lookup at execution time
|
|
242
|
+
|
|
243
|
+
**Example — from "plan" position (M1 with phases [1,2]):**
|
|
244
|
+
```json
|
|
245
|
+
[
|
|
246
|
+
{ "index": 0, "type": "skill", "skill": "maestro-plan", "args": "{phase}" },
|
|
247
|
+
{ "index": 1, "type": "cli", "skill": "maestro-execute", "args": "{phase}" },
|
|
248
|
+
{ "index": 2, "type": "skill", "skill": "maestro-verify", "args": "{phase}" },
|
|
249
|
+
{ "index": 3, "type": "decision", "skill": "maestro-ralph", "args": "{\"decision\":\"post-verify\",\"retry_count\":0,\"max_retries\":2}" },
|
|
250
|
+
{ "index": 4, "type": "skill", "skill": "quality-business-test", "args": "{phase}" },
|
|
251
|
+
{ "index": 5, "type": "decision", "skill": "maestro-ralph", "args": "{\"decision\":\"post-business-test\",\"retry_count\":0,\"max_retries\":2}" },
|
|
252
|
+
{ "index": 6, "type": "skill", "skill": "quality-review", "args": "{phase}" },
|
|
253
|
+
{ "index": 7, "type": "decision", "skill": "maestro-ralph", "args": "{\"decision\":\"post-review\",\"retry_count\":0,\"max_retries\":2}" },
|
|
254
|
+
{ "index": 8, "type": "skill", "skill": "quality-test-gen", "args": "{phase}" },
|
|
255
|
+
{ "index": 9, "type": "skill", "skill": "quality-test", "args": "{phase}" },
|
|
256
|
+
{ "index": 10, "type": "decision", "skill": "maestro-ralph", "args": "{\"decision\":\"post-test\",\"retry_count\":0,\"max_retries\":2}" },
|
|
257
|
+
{ "index": 11, "type": "skill", "skill": "maestro-milestone-audit", "args": "" },
|
|
258
|
+
{ "index": 12, "type": "skill", "skill": "maestro-milestone-complete", "args": "" },
|
|
259
|
+
{ "index": 13, "type": "decision", "skill": "maestro-ralph", "args": "{\"decision\":\"post-milestone\"}" }
|
|
260
|
+
]
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### 2a.5: Create session
|
|
264
|
+
|
|
265
|
+
```
|
|
266
|
+
session_id = "ralph-{YYYYMMDD-HHmmss}"
|
|
267
|
+
session_dir = ".workflow/.ralph/{session_id}/"
|
|
268
|
+
|
|
269
|
+
Write status.json:
|
|
270
|
+
{
|
|
271
|
+
"id": "{session_id}",
|
|
272
|
+
"created_at": "{ISO}",
|
|
273
|
+
"intent": "{user_intent}",
|
|
274
|
+
"status": "running",
|
|
275
|
+
"lifecycle_position": "{position}",
|
|
276
|
+
"target": "milestone-complete",
|
|
277
|
+
"phase": {N},
|
|
278
|
+
"milestone": "{M}",
|
|
279
|
+
"commands": [...],
|
|
280
|
+
"current": 0,
|
|
281
|
+
"updated_at": "{ISO}"
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### 2a.6: Display plan + confirm
|
|
286
|
+
|
|
287
|
+
```
|
|
288
|
+
============================================================
|
|
289
|
+
RALPH DECISION
|
|
290
|
+
============================================================
|
|
291
|
+
Position: {lifecycle_position} (Phase {N}, {milestone})
|
|
292
|
+
Target: {target}
|
|
293
|
+
Commands: {total} steps ({decision_count} decision points)
|
|
294
|
+
|
|
295
|
+
[ ] 0. maestro-plan 1 [skill]
|
|
296
|
+
[ ] 1. maestro-execute 1 [cli]
|
|
297
|
+
[ ] 2. maestro-verify 1 [skill]
|
|
298
|
+
[ ] 3. ◆ post-verify [decision]
|
|
299
|
+
[ ] 4. quality-business-test 1 [skill]
|
|
300
|
+
[ ] 5. ◆ post-business-test [decision]
|
|
301
|
+
[ ] 6. quality-review 1 [skill]
|
|
302
|
+
[ ] 7. ◆ post-review [decision]
|
|
303
|
+
[ ] 8. quality-test-gen 1 [skill]
|
|
304
|
+
[ ] 9. quality-test 1 [skill]
|
|
305
|
+
[ ] 10. ◆ post-test [decision]
|
|
306
|
+
[ ] 11. maestro-milestone-audit [skill]
|
|
307
|
+
[ ] 12. maestro-milestone-complete [skill]
|
|
308
|
+
============================================================
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
AskUserQuestion: Proceed / Edit / Cancel
|
|
312
|
+
|
|
313
|
+
### 2a.7: Launch execution
|
|
314
|
+
|
|
315
|
+
```
|
|
316
|
+
Skill({ skill: "maestro-ralph-execute" })
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Step 2b: Decision Evaluation Mode
|
|
322
|
+
|
|
323
|
+
Triggered when ralph-execute encounters a decision node and hands back to ralph.
|
|
324
|
+
|
|
325
|
+
### 2b.1: Load session + locate results
|
|
326
|
+
|
|
327
|
+
Read ralph session status.json. Identify the decision node at `commands[current]`.
|
|
328
|
+
|
|
329
|
+
**Locate result files** — find the artifact dir for current phase:
|
|
330
|
+
```
|
|
331
|
+
Read .workflow/state.json
|
|
332
|
+
Filter artifacts: milestone == session.milestone, phase == session.phase
|
|
333
|
+
Sort by created_at DESC
|
|
334
|
+
|
|
335
|
+
For the decision type, find the relevant artifact:
|
|
336
|
+
post-verify → latest type=="verify" artifact → {.workflow/scratch/{artifact.path}/}
|
|
337
|
+
post-business-test → same dir as verify (business-test writes to same artifact dir)
|
|
338
|
+
post-review → latest artifact dir → review.json
|
|
339
|
+
post-test → latest artifact dir → uat.md + .tests/test-results.json
|
|
340
|
+
|
|
341
|
+
artifact_dir = .workflow/scratch/{artifact.path}/
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### 2b.2: Parse decision metadata
|
|
345
|
+
|
|
346
|
+
```
|
|
347
|
+
meta = JSON.parse(decision_node.args)
|
|
348
|
+
// { decision: "post-verify", retry_count: 0, max_retries: 2 }
|
|
349
|
+
// or { decision: "post-milestone" }
|
|
350
|
+
decision_type = meta.decision
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### 2b.3: Evaluate by decision type (meta.decision)
|
|
354
|
+
|
|
355
|
+
**post-verify:**
|
|
356
|
+
```
|
|
357
|
+
Read {artifact_dir}/verification.json
|
|
358
|
+
Check: gaps[] array and passed field
|
|
359
|
+
|
|
360
|
+
If gaps found (passed == false or gaps[].length > 0):
|
|
361
|
+
If meta.retry_count >= meta.max_retries:
|
|
362
|
+
→ Insert: [quality-debug "{gap_summary}", decision:post-debug-escalate]
|
|
363
|
+
→ Display: ◆ post-verify: max retries ({max_retries}) reached, escalating to debug
|
|
364
|
+
Else:
|
|
365
|
+
→ Insert: [quality-debug "{gap_summary}", maestro-plan --gaps {phase},
|
|
366
|
+
maestro-execute {phase} [cli], maestro-verify {phase},
|
|
367
|
+
decision:post-verify {retry_count+1}]
|
|
368
|
+
→ Display: ◆ post-verify: gaps detected, inserting debug+fix loop (retry {N}/{max})
|
|
369
|
+
|
|
370
|
+
If no gaps (passed == true):
|
|
371
|
+
→ No insertion, proceed
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
**post-business-test:**
|
|
375
|
+
```
|
|
376
|
+
Read {artifact_dir}/business-test-results.json or scan for business test output
|
|
377
|
+
Check: failures[] or passed field
|
|
378
|
+
|
|
379
|
+
If failures found:
|
|
380
|
+
If meta.retry_count >= meta.max_retries:
|
|
381
|
+
→ Insert: [quality-debug --from-business-test {phase}, decision:post-debug-escalate]
|
|
382
|
+
Else:
|
|
383
|
+
→ Insert: [quality-debug --from-business-test {phase},
|
|
384
|
+
maestro-plan --gaps {phase}, maestro-execute {phase} [cli],
|
|
385
|
+
maestro-verify {phase}, decision:post-verify {retry:0},
|
|
386
|
+
quality-business-test {phase}, decision:post-business-test {retry+1}]
|
|
387
|
+
|
|
388
|
+
If all pass:
|
|
389
|
+
→ No insertion, proceed
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
**post-review:**
|
|
393
|
+
```
|
|
394
|
+
Read {artifact_dir}/review.json
|
|
395
|
+
Check: verdict field and issues[].severity
|
|
396
|
+
|
|
397
|
+
If verdict == "BLOCK" or any issue.severity == "critical":
|
|
398
|
+
If meta.retry_count >= meta.max_retries:
|
|
399
|
+
→ Insert: [quality-debug "{block_summary}", decision:post-debug-escalate]
|
|
400
|
+
Else:
|
|
401
|
+
→ Insert: [quality-debug "{block_issues}",
|
|
402
|
+
maestro-plan --gaps {phase}, maestro-execute {phase} [cli],
|
|
403
|
+
quality-review {phase}, decision:post-review {retry+1}]
|
|
404
|
+
|
|
405
|
+
If verdict == "PASS" or "WARN":
|
|
406
|
+
→ No insertion, proceed
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
**post-test:**
|
|
410
|
+
```
|
|
411
|
+
Read {artifact_dir}/uat.md (parse frontmatter + gap sections)
|
|
412
|
+
Read {artifact_dir}/.tests/test-results.json if exists
|
|
413
|
+
|
|
414
|
+
If failures found (any test result != pass, or gaps with severity >= high):
|
|
415
|
+
If meta.retry_count >= meta.max_retries:
|
|
416
|
+
→ Insert: [quality-debug --from-uat {phase}, decision:post-debug-escalate]
|
|
417
|
+
Else:
|
|
418
|
+
→ Insert: [quality-debug --from-uat {phase},
|
|
419
|
+
maestro-plan --gaps {phase}, maestro-execute {phase} [cli],
|
|
420
|
+
maestro-verify {phase}, decision:post-verify {retry:0},
|
|
421
|
+
quality-business-test {phase}, decision:post-business-test {retry:0},
|
|
422
|
+
quality-review {phase}, decision:post-review {retry:0},
|
|
423
|
+
quality-test-gen {phase}, quality-test {phase},
|
|
424
|
+
decision:post-test {retry+1}]
|
|
425
|
+
|
|
426
|
+
If all pass:
|
|
427
|
+
→ No insertion, proceed
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
**post-milestone:**
|
|
431
|
+
```
|
|
432
|
+
Re-read .workflow/state.json (milestone-complete will have updated it).
|
|
433
|
+
Check: state.milestones[] for next milestone with status == "pending" or "active"
|
|
434
|
+
|
|
435
|
+
If next milestone found:
|
|
436
|
+
next_m = next milestone
|
|
437
|
+
next_phases = next_m.phases[]
|
|
438
|
+
first_phase = next_phases[0]
|
|
439
|
+
|
|
440
|
+
Update ralph session: milestone = next_m.name, phase = first_phase
|
|
441
|
+
|
|
442
|
+
→ Insert full lifecycle for next milestone:
|
|
443
|
+
[maestro-analyze {first_phase} [cli],
|
|
444
|
+
maestro-plan {first_phase} [skill],
|
|
445
|
+
maestro-execute {first_phase} [cli],
|
|
446
|
+
maestro-verify {first_phase} [skill],
|
|
447
|
+
decision:post-verify {retry:0},
|
|
448
|
+
quality-business-test {first_phase} [skill],
|
|
449
|
+
decision:post-business-test {retry:0},
|
|
450
|
+
quality-review {first_phase} [skill],
|
|
451
|
+
decision:post-review {retry:0},
|
|
452
|
+
quality-test-gen {first_phase} [skill],
|
|
453
|
+
quality-test {first_phase} [skill],
|
|
454
|
+
decision:post-test {retry:0},
|
|
455
|
+
maestro-milestone-audit [skill],
|
|
456
|
+
maestro-milestone-complete [skill],
|
|
457
|
+
decision:post-milestone {}]
|
|
458
|
+
|
|
459
|
+
→ Display: ◆ post-milestone: {completed_m.name} done → advancing to {next_m.name} Phase {first_phase} (+14 commands)
|
|
460
|
+
|
|
461
|
+
If no next milestone:
|
|
462
|
+
→ No insertion — session will complete naturally
|
|
463
|
+
→ Display: ◆ post-milestone: all milestones complete! 🎉
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
**post-debug-escalate:**
|
|
467
|
+
```
|
|
468
|
+
This is a terminal escalation — debug was run but we exceeded max retries.
|
|
469
|
+
→ Set session status = "paused"
|
|
470
|
+
→ Display: ◆ 已达最大重试次数,debug 已执行。请人工介入检查结果。
|
|
471
|
+
→ Display: 使用 /maestro-ralph continue 在处理后恢复
|
|
472
|
+
→ End.
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
### 2b.4: Insert commands + reindex
|
|
476
|
+
|
|
477
|
+
When inserting new commands after current position:
|
|
478
|
+
|
|
479
|
+
```
|
|
480
|
+
new_commands = buildInsertionCommands(...) // each with appropriate type/skill/args
|
|
481
|
+
splice commands[] at position (current + 1), insert new_commands
|
|
482
|
+
Reindex: commands.forEach((cmd, i) => cmd.index = i)
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
### 2b.5: Update session
|
|
486
|
+
|
|
487
|
+
```
|
|
488
|
+
Mark current decision node status = "completed", completed_at = now
|
|
489
|
+
Update status.json: commands[], current, updated_at
|
|
490
|
+
|
|
491
|
+
If commands were inserted:
|
|
492
|
+
Display: ◆ Decision: {type} → {outcome}, +{N} commands inserted
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
### 2b.6: Resume execution
|
|
496
|
+
|
|
497
|
+
```
|
|
498
|
+
Skill({ skill: "maestro-ralph-execute" })
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
</execution>
|
|
502
|
+
|
|
503
|
+
<error_codes>
|
|
504
|
+
| Code | Severity | Description | Recovery |
|
|
505
|
+
|------|----------|-------------|----------|
|
|
506
|
+
| E001 | error | No intent and no running session | Prompt for intent |
|
|
507
|
+
| E002 | error | Cannot infer lifecycle position | Show raw state, ask user |
|
|
508
|
+
| E003 | error | Artifact dir not found for decision evaluation | Show glob results, ask user |
|
|
509
|
+
| E004 | error | Result file (verification.json etc) missing in artifact dir | Warn, treat as failure |
|
|
510
|
+
| W001 | warning | Decision node expanded chain | Auto-handled, log expansion |
|
|
511
|
+
| W002 | warning | Max retries reached, escalating to debug | Auto-handled |
|
|
512
|
+
| W003 | warning | Multiple running sessions found | Use latest, warn user |
|
|
513
|
+
</error_codes>
|
|
514
|
+
|
|
515
|
+
<success_criteria>
|
|
516
|
+
- [ ] state.json artifacts correctly read with actual schema (type, path, scope, milestone)
|
|
517
|
+
- [ ] Lifecycle position inferred from artifacts + result files (verification.json, review.json, uat.md)
|
|
518
|
+
- [ ] Artifact dir resolved via artifact.path → .workflow/scratch/{path}/
|
|
519
|
+
- [ ] Full quality pipeline: verify → business-test → review → test-gen → test
|
|
520
|
+
- [ ] Decision nodes at: post-verify, post-business-test, post-review, post-test
|
|
521
|
+
- [ ] Every decision failure path starts with quality-debug before plan --gaps
|
|
522
|
+
- [ ] retry_count tracked per decision node, max_retries enforced
|
|
523
|
+
- [ ] Max retries → post-debug-escalate → session paused for human intervention
|
|
524
|
+
- [ ] Command insertion + reindex works correctly
|
|
525
|
+
- [ ] Handoff to maestro-ralph-execute via Skill()
|
|
526
|
+
</success_criteria>
|
|
@@ -65,21 +65,23 @@ When `-y` is active, maestro propagates auto flags to downstream commands. Only
|
|
|
65
65
|
|
|
66
66
|
| Command | Auto Flag | Effect |
|
|
67
67
|
|---------|-----------|--------|
|
|
68
|
+
| maestro-init | `-y` | Skip interactive questioning |
|
|
68
69
|
| maestro-analyze | `-y` | Skip interactive scoping, auto-deepen |
|
|
69
70
|
| maestro-brainstorm | `-y` | Skip interactive questions, use defaults |
|
|
70
71
|
| maestro-roadmap | `-y` | Skip interactive questions, use defaults (create/revise/review) |
|
|
71
72
|
| maestro-ui-design | `-y` | Skip interactive selection, pick top variant |
|
|
72
|
-
| maestro-plan |
|
|
73
|
-
| maestro-
|
|
74
|
-
| maestro-
|
|
75
|
-
|
|
|
76
|
-
| quality-review | *(none)* | No
|
|
77
|
-
| quality-test |
|
|
78
|
-
| quality-test-gen | *(none)* | No
|
|
79
|
-
| quality-debug | *(none)* | No
|
|
80
|
-
| quality-retrospective |
|
|
81
|
-
| maestro-milestone-audit | *(none)* | No
|
|
82
|
-
|
|
|
73
|
+
| maestro-plan | `-y` | Skip confirmations and clarification |
|
|
74
|
+
| maestro-execute | `-y` | Skip confirmations, blocked auto-continue |
|
|
75
|
+
| maestro-verify | *(none)* | No interactive prompts |
|
|
76
|
+
| quality-business-test | `-y` | Skip plan confirmation |
|
|
77
|
+
| quality-review | *(none)* | No interactive prompts, auto-detects level |
|
|
78
|
+
| quality-test | `-y --auto-fix` | Auto-trigger gap-fix loop on failures |
|
|
79
|
+
| quality-test-gen | *(none)* | No interactive prompts |
|
|
80
|
+
| quality-debug | *(none)* | No interactive prompts |
|
|
81
|
+
| quality-retrospective | `-y` | Accept all routing recommendations without prompting |
|
|
82
|
+
| maestro-milestone-audit | *(none)* | No interactive prompts |
|
|
83
|
+
| maestro-milestone-complete | `-y` | Skip knowledge promotion inquiry |
|
|
84
|
+
| manage-learn | *(none)* | No interactive prompts |
|
|
83
85
|
|
|
84
86
|
Commands not listed (manage-*, spec-*, milestone-*) have no auto flags and execute as-is.
|
|
85
87
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: quality-business-test
|
|
3
3
|
description: PRD-forward business testing with requirement traceability, fixture generation, and multi-layer execution
|
|
4
|
-
argument-hint: "<phase> [--spec SPEC-xxx] [--layer L1|L2|L3] [--gen-code] [--dry-run] [--re-run] [
|
|
4
|
+
argument-hint: "<phase> [--spec SPEC-xxx] [--layer L1|L2|L3] [--gen-code] [--dry-run] [--re-run] [-y]"
|
|
5
5
|
allowed-tools:
|
|
6
6
|
- Read
|
|
7
7
|
- Write
|
|
@@ -37,7 +37,7 @@ Phase: $ARGUMENTS (required -- phase number)
|
|
|
37
37
|
- `--gen-code` -- Generate framework-specific test classes (JUnit/RestAssured, supertest/vitest, pytest/httpx)
|
|
38
38
|
- `--dry-run` -- Extract scenarios and fixtures only, don't execute
|
|
39
39
|
- `--re-run` -- Re-run only previously failed/blocked scenarios
|
|
40
|
-
-
|
|
40
|
+
- `-y` -- Skip interactive confirmations
|
|
41
41
|
|
|
42
42
|
**Layer definitions:**
|
|
43
43
|
|
|
@@ -96,7 +96,7 @@ Follow '~/.maestro/workflows/business-test.md' completely.
|
|
|
96
96
|
- [ ] RFC 2119 keywords mapped to test priorities
|
|
97
97
|
- [ ] Test fixtures generated (valid/invalid/boundary per REQ data model)
|
|
98
98
|
- [ ] business-test-plan.json written with layer distribution
|
|
99
|
-
- [ ] User confirmed plan (or
|
|
99
|
+
- [ ] User confirmed plan (or -y skipped confirmation)
|
|
100
100
|
- [ ] Test code generated if --gen-code (framework-appropriate)
|
|
101
101
|
- [ ] L1 executed with Generator-Critic loop (max 3 iterations)
|
|
102
102
|
- [ ] L2 executed if no L1 critical failures
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: quality-retrospective
|
|
3
3
|
description: Multi-lens 复盘 of completed phase(s); routes insights to spec/note/issue stores and the lessons library
|
|
4
|
-
argument-hint: "[phase|N..M] [--lens technical|process|quality|decision] [--all] [--no-route] [--compare N] [
|
|
4
|
+
argument-hint: "[phase|N..M] [--lens technical|process|quality|decision] [--all] [--no-route] [--compare N] [-y]"
|
|
5
5
|
allowed-tools:
|
|
6
6
|
- Read
|
|
7
7
|
- Write
|
|
@@ -30,7 +30,7 @@ Post-execution multi-perspective retrospective (复盘) for completed phases. Co
|
|
|
30
30
|
<context>
|
|
31
31
|
Arguments: $ARGUMENTS
|
|
32
32
|
|
|
33
|
-
Modes (scan/single/range/all), flags (--lens, --no-route, --compare,
|
|
33
|
+
Modes (scan/single/range/all), flags (--lens, --no-route, --compare, -y), and storage paths defined in workflow retrospective.md Argument Shape and Stages 1-7.
|
|
34
34
|
</context>
|
|
35
35
|
|
|
36
36
|
<execution>
|
|
@@ -189,10 +189,10 @@ functions.update_plan({
|
|
|
189
189
|
|
|
190
190
|
| Skill | Flag |
|
|
191
191
|
|-------|------|
|
|
192
|
-
| `maestro-analyze`, `maestro-brainstorm`, `maestro-ui-design`, `maestro-roadmap` | `-y` |
|
|
193
|
-
| `maestro-plan` |
|
|
194
|
-
| `quality-test` |
|
|
195
|
-
| `quality-
|
|
192
|
+
| `maestro-init`, `maestro-analyze`, `maestro-brainstorm`, `maestro-ui-design`, `maestro-roadmap` | `-y` |
|
|
193
|
+
| `maestro-plan`, `maestro-execute`, `maestro-milestone-complete` | `-y` |
|
|
194
|
+
| `quality-business-test`, `quality-retrospective` | `-y` |
|
|
195
|
+
| `quality-test` | `-y --auto-fix` |
|
|
196
196
|
|
|
197
197
|
**`buildSkillCall(step, ctx)`**: Replace placeholders `{phase}`, `{description}`, `{issue_id}`, `{plan_dir}`, `{analysis_dir}`, `{brainstorm_dir}`, `{spec_session_id}` in `step.args` with corresponding `ctx` values. Append auto-yes flag if applicable. Return `$<skill> <args>`.
|
|
198
198
|
|