maestro-flow-one 0.2.0 → 0.2.2
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/.ace-tool/index.json +108 -0
- package/bin/maestro-flow.js +30 -0
- package/claude/maestro-flow/agents/cli-explore-agent.md +187 -0
- package/claude/maestro-flow/agents/conceptual-planning-agent.md +245 -0
- package/claude/maestro-flow/agents/team-supervisor.md +143 -0
- package/claude/maestro-flow/agents/team-worker.md +237 -0
- package/claude/maestro-flow/agents/ui-design-agent.md +286 -0
- package/claude/maestro-flow/agents/workflow-analyzer.md +115 -0
- package/claude/maestro-flow/agents/workflow-codebase-mapper.md +77 -0
- package/claude/maestro-flow/agents/workflow-collab-planner.md +143 -0
- package/claude/maestro-flow/agents/workflow-debugger.md +103 -0
- package/claude/maestro-flow/agents/workflow-executor.md +129 -0
- package/claude/maestro-flow/agents/workflow-external-researcher.md +86 -0
- package/claude/maestro-flow/agents/workflow-integration-checker.md +83 -0
- package/claude/maestro-flow/agents/workflow-nyquist-auditor.md +85 -0
- package/claude/maestro-flow/agents/workflow-phase-researcher.md +85 -0
- package/claude/maestro-flow/agents/workflow-plan-checker.md +90 -0
- package/claude/maestro-flow/agents/workflow-planner.md +195 -0
- package/claude/maestro-flow/agents/workflow-project-researcher.md +74 -0
- package/claude/maestro-flow/agents/workflow-research-synthesizer.md +70 -0
- package/claude/maestro-flow/agents/workflow-reviewer.md +82 -0
- package/claude/maestro-flow/agents/workflow-roadmapper.md +81 -0
- package/claude/maestro-flow/agents/workflow-verifier.md +120 -0
- package/codex/maestro-flow/agents/team-supervisor.toml +40 -0
- package/codex/maestro-flow/agents/team-worker.toml +63 -0
- package/maestro-flow/agents/cli-explore-agent.md +187 -0
- package/maestro-flow/agents/conceptual-planning-agent.md +245 -0
- package/maestro-flow/agents/team-supervisor.md +143 -0
- package/maestro-flow/agents/team-worker.md +237 -0
- package/maestro-flow/agents/ui-design-agent.md +286 -0
- package/maestro-flow/agents/workflow-analyzer.md +115 -0
- package/maestro-flow/agents/workflow-codebase-mapper.md +77 -0
- package/maestro-flow/agents/workflow-collab-planner.md +143 -0
- package/maestro-flow/agents/workflow-debugger.md +103 -0
- package/maestro-flow/agents/workflow-executor.md +129 -0
- package/maestro-flow/agents/workflow-external-researcher.md +86 -0
- package/maestro-flow/agents/workflow-integration-checker.md +83 -0
- package/maestro-flow/agents/workflow-nyquist-auditor.md +85 -0
- package/maestro-flow/agents/workflow-phase-researcher.md +85 -0
- package/maestro-flow/agents/workflow-plan-checker.md +90 -0
- package/maestro-flow/agents/workflow-planner.md +195 -0
- package/maestro-flow/agents/workflow-project-researcher.md +74 -0
- package/maestro-flow/agents/workflow-research-synthesizer.md +70 -0
- package/maestro-flow/agents/workflow-reviewer.md +82 -0
- package/maestro-flow/agents/workflow-roadmapper.md +81 -0
- package/maestro-flow/agents/workflow-verifier.md +120 -0
- package/maestro-flow/commands/learn/decompose.md +176 -0
- package/maestro-flow/commands/learn/follow.md +167 -0
- package/maestro-flow/commands/learn/investigate.md +221 -0
- package/maestro-flow/commands/learn/retro.md +303 -0
- package/maestro-flow/commands/learn/second-opinion.md +167 -0
- package/maestro-flow/commands/lifecycle/amend.md +300 -0
- package/maestro-flow/commands/lifecycle/analyze.md +130 -0
- package/maestro-flow/commands/lifecycle/brainstorm.md +104 -0
- package/maestro-flow/commands/lifecycle/collab.md +333 -0
- package/maestro-flow/commands/lifecycle/composer.md +354 -0
- package/maestro-flow/commands/lifecycle/execute.md +120 -0
- package/maestro-flow/commands/lifecycle/fork.md +86 -0
- package/maestro-flow/commands/lifecycle/init.md +78 -0
- package/maestro-flow/commands/lifecycle/learn.md +140 -0
- package/maestro-flow/commands/lifecycle/link-coordinate.md +71 -0
- package/maestro-flow/commands/lifecycle/merge.md +61 -0
- package/maestro-flow/commands/lifecycle/overlay.md +178 -0
- package/maestro-flow/commands/lifecycle/plan.md +154 -0
- package/maestro-flow/commands/lifecycle/player.md +404 -0
- package/maestro-flow/commands/lifecycle/quick.md +56 -0
- package/maestro-flow/commands/lifecycle/roadmap.md +164 -0
- package/maestro-flow/commands/lifecycle/ui-design.md +93 -0
- package/maestro-flow/commands/lifecycle/update.md +176 -0
- package/maestro-flow/commands/lifecycle/verify.md +96 -0
- package/maestro-flow/commands/manage/codebase-rebuild.md +75 -0
- package/maestro-flow/commands/manage/codebase-refresh.md +57 -0
- package/maestro-flow/commands/manage/harvest.md +94 -0
- package/maestro-flow/commands/manage/issue-discover.md +77 -0
- package/maestro-flow/commands/manage/issue.md +73 -0
- package/maestro-flow/commands/manage/knowhow-capture.md +193 -0
- package/maestro-flow/commands/manage/knowhow.md +77 -0
- package/maestro-flow/commands/manage/learn.md +67 -0
- package/maestro-flow/commands/manage/status.md +51 -0
- package/maestro-flow/commands/manage/wiki.md +62 -0
- package/maestro-flow/commands/milestone/audit.md +68 -0
- package/maestro-flow/commands/milestone/complete.md +75 -0
- package/maestro-flow/commands/milestone/release.md +96 -0
- package/maestro-flow/commands/quality/auto-test.md +128 -0
- package/maestro-flow/commands/quality/debug.md +125 -0
- package/maestro-flow/commands/quality/refactor.md +55 -0
- package/maestro-flow/commands/quality/retrospective.md +78 -0
- package/maestro-flow/commands/quality/review.md +114 -0
- package/maestro-flow/commands/quality/sync.md +51 -0
- package/maestro-flow/commands/quality/test.md +107 -0
- package/maestro-flow/commands/spec/add.md +49 -0
- package/maestro-flow/commands/spec/load.md +51 -0
- package/maestro-flow/commands/spec/remove.md +51 -0
- package/maestro-flow/commands/spec/setup.md +51 -0
- package/maestro-flow/commands/wiki/connect.md +62 -0
- package/maestro-flow/commands/wiki/digest.md +69 -0
- package/package.json +1 -1
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maestro-player
|
|
3
|
+
description: Play workflow templates with checkpoint resume
|
|
4
|
+
argument-hint: "<template-slug|path> [--context key=value...] [-c [session-id]] [--list] [--dry-run]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
- Agent
|
|
13
|
+
- AskUserQuestion
|
|
14
|
+
- Skill
|
|
15
|
+
---
|
|
16
|
+
<purpose>
|
|
17
|
+
Load a workflow template (produced by maestro-composer) → bind context variables →
|
|
18
|
+
execute DAG nodes in topological order → persist state at checkpoints → support resume.
|
|
19
|
+
|
|
20
|
+
Node execution mechanisms:
|
|
21
|
+
- `skill` node → `Skill()` (synchronous)
|
|
22
|
+
- `command` node → `Skill()` with namespace (synchronous)
|
|
23
|
+
- `cli` node → `maestro delegate` (background + wait for callback)
|
|
24
|
+
- `agent` node → `Agent()` (sync or background per config)
|
|
25
|
+
- `checkpoint` node → state save, optional user pause
|
|
26
|
+
|
|
27
|
+
Session state persisted at `.workflow/.maestro/<session_id>/status.json` (same tracking
|
|
28
|
+
location as maestro.md), enabling resume from any checkpoint via `-c`.
|
|
29
|
+
</purpose>
|
|
30
|
+
|
|
31
|
+
<context>
|
|
32
|
+
$ARGUMENTS — template slug/path, or flags.
|
|
33
|
+
|
|
34
|
+
**Flags:**
|
|
35
|
+
- `--context key=value` — Bind context variables (repeatable)
|
|
36
|
+
- `-c` / `--continue [session-id]` — Resume paused/interrupted session (consistent with maestro.md)
|
|
37
|
+
- `--list` — List available templates from `~/.maestro/templates/workflows/index.json`
|
|
38
|
+
- `--dry-run` — Show execution plan without executing
|
|
39
|
+
|
|
40
|
+
**Entry routing:**
|
|
41
|
+
|
|
42
|
+
| Detection | Condition | Handler |
|
|
43
|
+
|-----------|-----------|---------|
|
|
44
|
+
| List templates | `--list` in args | handleList |
|
|
45
|
+
| Resume session | `-c [session-id]` | Phase 0: Resume |
|
|
46
|
+
| Dry run | `--dry-run` in args | Phase 1 + 2, print plan, exit |
|
|
47
|
+
| Normal | Template slug/path provided | Phase 1 |
|
|
48
|
+
| No args | Empty args | handleList + AskUserQuestion |
|
|
49
|
+
|
|
50
|
+
**Shared constants (aligned with maestro.md tracking):**
|
|
51
|
+
|
|
52
|
+
| Constant | Value |
|
|
53
|
+
|----------|-------|
|
|
54
|
+
| Session prefix | `player` |
|
|
55
|
+
| Session dir | `.workflow/.maestro/player-<YYYYMMDD>-<HHmmss>/` |
|
|
56
|
+
| State file | `status.json` |
|
|
57
|
+
| Template dir (global) | `~/.maestro/templates/workflows/` |
|
|
58
|
+
| Template index (global) | `~/.maestro/templates/workflows/index.json` |
|
|
59
|
+
|
|
60
|
+
**Session status.json schema (aligned with maestro.md):**
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"session_id": "player-<YYYYMMDD>-<HHmmss>",
|
|
65
|
+
"created_at": "<ISO>",
|
|
66
|
+
"intent": "<template_name> with context",
|
|
67
|
+
"task_type": "player",
|
|
68
|
+
"chain_name": "<template_id>",
|
|
69
|
+
"template_id": "wft-<slug>-<date>",
|
|
70
|
+
"template_path": "~/.maestro/templates/workflows/<slug>.json",
|
|
71
|
+
"template_name": "<name>",
|
|
72
|
+
"auto_mode": false,
|
|
73
|
+
"status": "running | paused | completed | failed | aborted",
|
|
74
|
+
"context": { "goal": "...", "scope": "..." },
|
|
75
|
+
"steps": [
|
|
76
|
+
{
|
|
77
|
+
"index": 0,
|
|
78
|
+
"node_id": "N-001",
|
|
79
|
+
"skill": "<executor>",
|
|
80
|
+
"args": "<resolved_args>",
|
|
81
|
+
"type": "skill | cli | command | agent | checkpoint",
|
|
82
|
+
"status": "pending | running | completed | skipped | failed",
|
|
83
|
+
"started_at": null,
|
|
84
|
+
"completed_at": null,
|
|
85
|
+
"session_id": null,
|
|
86
|
+
"output_path": null,
|
|
87
|
+
"artifacts": [],
|
|
88
|
+
"error": null
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"current_step": 0,
|
|
92
|
+
"last_checkpoint": null,
|
|
93
|
+
"updated_at": "<ISO>",
|
|
94
|
+
"completed_at": null
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Session directory structure (under .workflow/.maestro/):**
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
.workflow/.maestro/player-<YYYYMMDD>-<HHmmss>/
|
|
102
|
+
├── status.json # Main state file (maestro.md compatible)
|
|
103
|
+
├── checkpoints/
|
|
104
|
+
│ ├── CP-01.json
|
|
105
|
+
│ └── CP-02.json
|
|
106
|
+
└── artifacts/
|
|
107
|
+
└── N-001-output.md
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Node execution mechanisms:**
|
|
111
|
+
|
|
112
|
+
| Node type | Mechanism | Blocking |
|
|
113
|
+
|-----------|-----------|----------|
|
|
114
|
+
| skill | `Skill(skill=executor, args=resolved_args)` | sync |
|
|
115
|
+
| command | `Skill(skill=executor, args=resolved_args)` | sync |
|
|
116
|
+
| cli | `maestro delegate "prompt" --to tool --mode mode --rule rule` via `Bash(run_in_background: true)` | async, wait for callback |
|
|
117
|
+
| agent | `Agent(subagent_type=executor, prompt=resolved_args)` | configurable |
|
|
118
|
+
| checkpoint | State save + optional user pause | — |
|
|
119
|
+
|
|
120
|
+
**Runtime reference resolution:**
|
|
121
|
+
|
|
122
|
+
Before executing each node, resolve `{ref}` patterns in `args_template`:
|
|
123
|
+
|
|
124
|
+
| Reference | Resolves To |
|
|
125
|
+
|-----------|-------------|
|
|
126
|
+
| `{variable}` | `session_state.context[variable]` |
|
|
127
|
+
| `{N-001.session_id}` | `node_states["N-001"].session_id` |
|
|
128
|
+
| `{N-001.output_path}` | `node_states["N-001"].output_path` |
|
|
129
|
+
| `{prev_session_id}` | session_id of previous non-checkpoint node |
|
|
130
|
+
| `{prev_output_path}` | output_path of previous non-checkpoint node |
|
|
131
|
+
|
|
132
|
+
Fallback: if referenced field is null, substitution results in empty string.
|
|
133
|
+
</context>
|
|
134
|
+
|
|
135
|
+
<execution>
|
|
136
|
+
|
|
137
|
+
### handleList
|
|
138
|
+
|
|
139
|
+
Scan `~/.maestro/templates/workflows/index.json`. Display:
|
|
140
|
+
```
|
|
141
|
+
Available workflow templates:
|
|
142
|
+
feature-tdd-review [feature, complex] 3 work nodes, 2 checkpoints
|
|
143
|
+
quick-bugfix [bugfix, simple] 2 work nodes, 1 checkpoint
|
|
144
|
+
|
|
145
|
+
Run: /maestro-player <slug> --context goal="..."
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
If index not found, output: "No templates found. Create one with /maestro-composer"
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
### Phase 0: Resume — Session Reconciliation
|
|
153
|
+
|
|
154
|
+
**Trigger**: `-c [session-id]`
|
|
155
|
+
|
|
156
|
+
1. If session-id provided: load `.workflow/.maestro/<session-id>/status.json`
|
|
157
|
+
2. If no session-id: scan `.workflow/.maestro/player-*/status.json` for `status = "running" | "paused"`
|
|
158
|
+
3. Multiple found → AskUserQuestion for selection
|
|
159
|
+
4. None found → error E004
|
|
160
|
+
5. Reset any `running` steps back to `pending` (interrupted mid-execution)
|
|
161
|
+
6. Determine next executable step from `steps[]` after `last_checkpoint`
|
|
162
|
+
7. Set `current_step` to resume point
|
|
163
|
+
8. Resume at Phase 3 (Execute Loop) from that step
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
### Phase 1: Load & Bind
|
|
168
|
+
|
|
169
|
+
**Objective**: Load template, collect missing variables, bind all references.
|
|
170
|
+
|
|
171
|
+
**Step 1.1** — Resolve template path:
|
|
172
|
+
1. Absolute path → use as-is
|
|
173
|
+
2. Relative path (`.` prefix) → resolve from cwd
|
|
174
|
+
3. Slug only → look up in `~/.maestro/templates/workflows/index.json`
|
|
175
|
+
4. Partial match → scan index, confirm with user
|
|
176
|
+
5. Not found → show available templates, AskUserQuestion
|
|
177
|
+
|
|
178
|
+
**Step 1.2** — Parse `--context key=value` pairs into `bound_context`.
|
|
179
|
+
|
|
180
|
+
**Step 1.3** — Load and validate template JSON (`template_id`, `nodes`, `edges`, `context_schema` must be present).
|
|
181
|
+
|
|
182
|
+
**Step 1.4** — Collect missing required variables:
|
|
183
|
+
- For each `context_schema` entry where `required: true` and not in `bound_context`:
|
|
184
|
+
AskUserQuestion to collect value
|
|
185
|
+
- For optional variables: use `default` or empty string
|
|
186
|
+
|
|
187
|
+
**Step 1.5** — Bind variables: replace `{variable_name}` with values in all `args_template` strings. Leave `{N-xxx.field}` and `{prev_*}` unresolved (runtime Phase 3).
|
|
188
|
+
|
|
189
|
+
**Step 1.6** — If `--dry-run`: print execution plan and exit:
|
|
190
|
+
```
|
|
191
|
+
Workflow: <template.name>
|
|
192
|
+
Context: goal = "<value>"
|
|
193
|
+
|
|
194
|
+
Execution Plan:
|
|
195
|
+
[1] N-001 [skill] maestro-plan "<goal>"
|
|
196
|
+
[2] CP-01 [checkpoint] After Plan auto-continue
|
|
197
|
+
[3] N-002 [skill] maestro-execute --resume-session {N-001.session_id}
|
|
198
|
+
|
|
199
|
+
To execute: /maestro-player <slug> --context goal="..."
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
### Phase 2: Instantiate — Init Session State
|
|
205
|
+
|
|
206
|
+
**Objective**: Create session directory, init state, compute execution plan.
|
|
207
|
+
|
|
208
|
+
**Step 2.1** — Generate session ID: `player-<YYYYMMDD>-<HHmmss>`. Create directory at `.workflow/.maestro/<session_id>/`.
|
|
209
|
+
|
|
210
|
+
**Step 2.2** — Topological sort via Kahn's algorithm. Flatten nodes into `steps[]` array (maestro.md format). Parallel nodes get same batch index.
|
|
211
|
+
|
|
212
|
+
**Step 2.3** — Init all steps as `status: "pending"`.
|
|
213
|
+
|
|
214
|
+
**Step 2.4** — Write `status.json` (see schema in Context section).
|
|
215
|
+
|
|
216
|
+
**Step 2.5** — Show execution start banner:
|
|
217
|
+
```
|
|
218
|
+
============================================================
|
|
219
|
+
MAESTRO PLAYER
|
|
220
|
+
============================================================
|
|
221
|
+
Template: <template.name>
|
|
222
|
+
Session: <session_id>
|
|
223
|
+
Context: goal="<value>"
|
|
224
|
+
|
|
225
|
+
Pipeline:
|
|
226
|
+
1. N-001 [skill] maestro-plan
|
|
227
|
+
2. CP-01 [checkpoint] After Plan
|
|
228
|
+
3. N-002 [skill] maestro-execute
|
|
229
|
+
============================================================
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
### Phase 3: Execute Loop
|
|
235
|
+
|
|
236
|
+
**Objective**: Execute each step in order. Save state after every step.
|
|
237
|
+
|
|
238
|
+
**CRITICAL**: After each step status change, write `status.json` immediately. This enables resume on interruption.
|
|
239
|
+
|
|
240
|
+
**For each step starting at `current_step`:**
|
|
241
|
+
|
|
242
|
+
**3a. Display step banner** (consistent with maestro.md):
|
|
243
|
+
```
|
|
244
|
+
------------------------------------------------------------
|
|
245
|
+
STEP {i+1}/{total}: {node_id} [{type}] {executor}
|
|
246
|
+
------------------------------------------------------------
|
|
247
|
+
Args: {resolved_args}
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**3b. Update status.json**: Set step status = `"running"`, started_at = now.
|
|
251
|
+
|
|
252
|
+
**3c. Execute by node type:**
|
|
253
|
+
|
|
254
|
+
**skill / command node**:
|
|
255
|
+
```
|
|
256
|
+
resolved_args = resolveArgs(step.args_template, status)
|
|
257
|
+
Skill(skill=step.skill, args=resolved_args)
|
|
258
|
+
|
|
259
|
+
Extract from result: session_id (WFS-*), output_path, artifacts
|
|
260
|
+
Update step: status="completed", session_id, output_path, artifacts, completed_at
|
|
261
|
+
Write status.json
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**cli node — CRITICAL: background + stop**:
|
|
265
|
+
```
|
|
266
|
+
resolved_args = resolveArgs(step.args_template, status)
|
|
267
|
+
|
|
268
|
+
Bash({
|
|
269
|
+
command: `maestro delegate "${resolved_args}" --to ${step.cli_tool} --mode ${step.cli_mode} --rule ${step.cli_rule}`,
|
|
270
|
+
run_in_background: true
|
|
271
|
+
})
|
|
272
|
+
|
|
273
|
+
Write status.json // persist "running" state
|
|
274
|
+
STOP — wait for background callback
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
On callback:
|
|
278
|
+
```
|
|
279
|
+
Load status.json
|
|
280
|
+
Find step with status "running"
|
|
281
|
+
Retrieve output: maestro delegate output <exec_id>
|
|
282
|
+
Update step: status="completed", output_path, completed_at
|
|
283
|
+
Write status.json
|
|
284
|
+
Advance to next step
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**agent node**:
|
|
288
|
+
```
|
|
289
|
+
resolved_args = resolveArgs(step.args_template, status)
|
|
290
|
+
|
|
291
|
+
Agent({
|
|
292
|
+
subagent_type: step.skill,
|
|
293
|
+
prompt: resolved_args,
|
|
294
|
+
run_in_background: step.run_in_background ?? false,
|
|
295
|
+
description: step.node_id
|
|
296
|
+
})
|
|
297
|
+
|
|
298
|
+
Update step: status="completed", output_path, completed_at
|
|
299
|
+
Write status.json
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
**checkpoint node**:
|
|
303
|
+
```
|
|
304
|
+
// 1. Write checkpoint snapshot
|
|
305
|
+
Write <session_dir>/checkpoints/<step.node_id>.json with:
|
|
306
|
+
session_id, checkpoint_id, saved_at, steps_snapshot, last_completed_step
|
|
307
|
+
|
|
308
|
+
// 2. Update status.json
|
|
309
|
+
status.last_checkpoint = step.node_id
|
|
310
|
+
Mark step completed, write status.json
|
|
311
|
+
|
|
312
|
+
// 3. If auto_continue == false: pause for user
|
|
313
|
+
AskUserQuestion:
|
|
314
|
+
- Continue → proceed
|
|
315
|
+
- Pause → set status="paused", write status.json, output resume command, EXIT
|
|
316
|
+
- Abort → set status="aborted", EXIT
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
**3d. Handle result** (consistent with maestro.md):
|
|
320
|
+
|
|
321
|
+
On success: update step status = `"completed"`, advance `current_step`.
|
|
322
|
+
|
|
323
|
+
On failure:
|
|
324
|
+
```
|
|
325
|
+
on_fail = step.on_fail || "abort"
|
|
326
|
+
|
|
327
|
+
skip → mark "skipped", log warning, advance
|
|
328
|
+
retry → retry once, if still fails → fall to abort
|
|
329
|
+
abort → AskUserQuestion: Retry / Skip / Abort
|
|
330
|
+
On Abort: save progress, display: "Resume with: /maestro-player -c"
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
**3e. Context cleanup hint** (after step 3+, consistent with maestro.md):
|
|
334
|
+
```
|
|
335
|
+
⚡ 已执行 {i} 步,上下文较重。可随时 /maestro-player -c 在新上下文中恢复。
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
### Phase 4: Complete — Archive + Summary
|
|
341
|
+
|
|
342
|
+
**Objective**: Mark session complete, output summary.
|
|
343
|
+
|
|
344
|
+
**Step 4.1** — Set `status = "completed"`, `completed_at = <ISO>`, write `status.json`.
|
|
345
|
+
|
|
346
|
+
**Step 4.2** — Collect all artifacts from steps.
|
|
347
|
+
|
|
348
|
+
**Step 4.3** — Display execution summary (consistent with maestro.md):
|
|
349
|
+
```
|
|
350
|
+
============================================================
|
|
351
|
+
MAESTRO PLAYER SESSION COMPLETE
|
|
352
|
+
============================================================
|
|
353
|
+
Session: <session_id>
|
|
354
|
+
Template: <template_name> (<template_id>)
|
|
355
|
+
Steps: <completed>/<total> completed
|
|
356
|
+
Context: goal="<value>"
|
|
357
|
+
|
|
358
|
+
Results:
|
|
359
|
+
[✓] 1. N-001 maestro-plan — completed (WFS-plan-xxx)
|
|
360
|
+
[✓] 2. CP-01 After Plan — completed (checkpoint)
|
|
361
|
+
[✓] 3. N-002 maestro-execute — completed (WFS-exec-xxx)
|
|
362
|
+
[✓] 4. N-003 quality-test — completed (WFS-test-xxx)
|
|
363
|
+
|
|
364
|
+
Artifacts:
|
|
365
|
+
- IMPL_PLAN.md (N-001)
|
|
366
|
+
- src/auth/index.ts (N-002)
|
|
367
|
+
- test/auth.test.ts (N-003)
|
|
368
|
+
|
|
369
|
+
Session dir: .workflow/.maestro/<session_id>/
|
|
370
|
+
============================================================
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
**Step 4.4** — AskUserQuestion completion action:
|
|
374
|
+
- **Keep session** → leave at current path
|
|
375
|
+
- **Run again** → AskUserQuestion for same/new context, re-enter Phase 1
|
|
376
|
+
- **Nothing** → done
|
|
377
|
+
</execution>
|
|
378
|
+
|
|
379
|
+
<error_codes>
|
|
380
|
+
| Code | Severity | Description | Recovery |
|
|
381
|
+
|------|----------|-------------|----------|
|
|
382
|
+
| E001 | error | Template not found | Show --list output, suggest closest match |
|
|
383
|
+
| E002 | error | Template JSON invalid (missing required fields) | Point to template file for fix |
|
|
384
|
+
| E003 | error | Required context variable missing and user declined | Cannot proceed without required vars |
|
|
385
|
+
| E004 | error | Resume session not found | Scan `.workflow/.maestro/player-*/`, list available |
|
|
386
|
+
| E005 | error | DAG cycle in template | Point to template for fix, suggest maestro-composer --edit |
|
|
387
|
+
| E006 | error | Node execution failed + abort chosen | Save state, suggest --resume |
|
|
388
|
+
| W001 | warning | Node completed with warnings | Log and continue |
|
|
389
|
+
| W002 | warning | Runtime reference resolved to empty string | Log, executor handles gracefully |
|
|
390
|
+
</error_codes>
|
|
391
|
+
|
|
392
|
+
<success_criteria>
|
|
393
|
+
- [ ] Template loaded from `~/.maestro/templates/workflows/` and validated
|
|
394
|
+
- [ ] All required context variables bound (from --context or user input)
|
|
395
|
+
- [ ] Session directory created at `.workflow/.maestro/player-*/` with `status.json`
|
|
396
|
+
- [ ] Steps array computed via topological sort (maestro.md compatible format)
|
|
397
|
+
- [ ] Each step executed with correct mechanism (Skill/delegate/Agent)
|
|
398
|
+
- [ ] Runtime references ({N-xxx.field}, {prev_*}) resolved before each step
|
|
399
|
+
- [ ] `status.json` written after every step status change (resume-safe)
|
|
400
|
+
- [ ] Checkpoints saved with snapshots under `checkpoints/`
|
|
401
|
+
- [ ] CLI nodes use `maestro delegate` with `Bash(run_in_background: true)` + stop pattern
|
|
402
|
+
- [ ] Step banners and completion report match maestro.md format
|
|
403
|
+
- [ ] Resume via `-c` scans `.workflow/.maestro/player-*/status.json`
|
|
404
|
+
</success_criteria>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maestro-quick
|
|
3
|
+
description: Quick task execution, skip optional agents
|
|
4
|
+
argument-hint: "[description] [--full] [--discuss]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
- Task
|
|
13
|
+
- AskUserQuestion
|
|
14
|
+
---
|
|
15
|
+
<purpose>
|
|
16
|
+
Execute small, ad-hoc tasks with workflow guarantees (atomic commits, state tracking) using a shortened pipeline. Invoked for tasks that are well-understood and do not require full phase-level planning. Produces scratch task directory with plan, execution results, and optional verification. Flags --discuss and --full enable additional pipeline stages.
|
|
17
|
+
</purpose>
|
|
18
|
+
|
|
19
|
+
<required_reading>
|
|
20
|
+
@~/.maestro/workflows/quick.md
|
|
21
|
+
</required_reading>
|
|
22
|
+
|
|
23
|
+
<context>
|
|
24
|
+
$ARGUMENTS
|
|
25
|
+
|
|
26
|
+
Parse for:
|
|
27
|
+
- `--full` flag -- Enables plan-checking (max 2 iterations) and post-execution verification
|
|
28
|
+
- `--discuss` flag -- Decision extraction before planning (gray areas, Locked/Free/Deferred classification)
|
|
29
|
+
- Remaining text as task description
|
|
30
|
+
</context>
|
|
31
|
+
|
|
32
|
+
<execution>
|
|
33
|
+
Follow '~/.maestro/workflows/quick.md' completely.
|
|
34
|
+
|
|
35
|
+
**Next-step routing on completion:**
|
|
36
|
+
- Task done, --full verification passed → /manage-status
|
|
37
|
+
- Task done, verification found gaps → /quality-debug {issue}
|
|
38
|
+
- Task done, want to sync docs → /quality-sync
|
|
39
|
+
- Need a full phase workflow instead → /maestro-plan {phase}
|
|
40
|
+
</execution>
|
|
41
|
+
|
|
42
|
+
<error_codes>
|
|
43
|
+
| Code | Severity | Condition | Recovery |
|
|
44
|
+
|------|----------|-----------|----------|
|
|
45
|
+
| E001 | error | Task description required (no text provided) | Check arguments format, re-run with correct input |
|
|
46
|
+
| E002 | error | Scratch directory creation failed | Check disk space and .workflow/ permissions |
|
|
47
|
+
| W001 | warning | Verification found minor gaps | Review gaps and determine if they need fixing |
|
|
48
|
+
</error_codes>
|
|
49
|
+
|
|
50
|
+
<success_criteria>
|
|
51
|
+
- [ ] Scratch task directory created under .workflow/scratch/
|
|
52
|
+
- [ ] plan.json written with task definitions
|
|
53
|
+
- [ ] All tasks executed with summaries written
|
|
54
|
+
- [ ] state.json updated with scratch task entry
|
|
55
|
+
- [ ] Commit created with task changes
|
|
56
|
+
</success_criteria>
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maestro-roadmap
|
|
3
|
+
description: Generate roadmap from requirements (light or full mode)
|
|
4
|
+
argument-hint: "<requirement> [--mode light|full] [-y] [-c] [-m progressive|direct|auto] [--from-brainstorm SESSION-ID] [--revise [instructions]] [--review]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
- Agent
|
|
13
|
+
- AskUserQuestion
|
|
14
|
+
---
|
|
15
|
+
<purpose>
|
|
16
|
+
Unified roadmap generation with two execution paths:
|
|
17
|
+
|
|
18
|
+
- **Light mode** (default): Directly from requirements to roadmap. No specification documents.
|
|
19
|
+
- **Full mode** (`--mode full`): 7-phase document chain (Product Brief → PRD → Architecture → Epics → Roadmap) producing a complete specification package in `.workflow/.spec/` plus `.workflow/roadmap.md`.
|
|
20
|
+
|
|
21
|
+
Additional operation modes (light mode only):
|
|
22
|
+
- **Revise** (`--revise`): Modify existing roadmap while preserving completed phase progress
|
|
23
|
+
- **Review** (`--review`): Health assessment of current roadmap (read-only)
|
|
24
|
+
|
|
25
|
+
Both modes produce `.workflow/roadmap.md` with milestone/phase structure ready for maestro-plan.
|
|
26
|
+
</purpose>
|
|
27
|
+
|
|
28
|
+
<required_reading>
|
|
29
|
+
@~/.maestro/workflows/roadmap-common.md
|
|
30
|
+
@~/.maestro/templates/roadmap.md
|
|
31
|
+
</required_reading>
|
|
32
|
+
|
|
33
|
+
<deferred_reading>
|
|
34
|
+
- [roadmap.md](~/.maestro/workflows/roadmap.md) — read when mode is light (default)
|
|
35
|
+
- [spec-generate.md](~/.maestro/workflows/spec-generate.md) — read when mode is full
|
|
36
|
+
- [spec-config.json](~/.maestro/templates/spec-config.json) — read when initializing spec configuration (full mode)
|
|
37
|
+
</deferred_reading>
|
|
38
|
+
|
|
39
|
+
<context>
|
|
40
|
+
$ARGUMENTS -- requirement text, @file reference, or brainstorm session reference.
|
|
41
|
+
|
|
42
|
+
**Flags (shared):**
|
|
43
|
+
- `--mode light|full`: Execution path (default: light)
|
|
44
|
+
- `-y` / `--yes`: Auto mode — skip interactive questions, use recommended defaults
|
|
45
|
+
- `-c` / `--continue`: Resume from last checkpoint
|
|
46
|
+
- `--from-brainstorm SESSION-ID`: Import guidance-specification.md from a brainstorm session as seed
|
|
47
|
+
|
|
48
|
+
**Flags (light mode only):**
|
|
49
|
+
- `-m progressive|direct|auto`: Decomposition strategy (default: auto)
|
|
50
|
+
- `--revise [instructions]`: Revise existing roadmap. If instructions provided, apply directly. If omitted, ask user. Preserves completed phase progress.
|
|
51
|
+
- `--review`: Roadmap health assessment (read-only)
|
|
52
|
+
|
|
53
|
+
**Input types:**
|
|
54
|
+
- Direct text: `"Implement user authentication system with OAuth and 2FA"`
|
|
55
|
+
- File reference: `@requirements.md`
|
|
56
|
+
- Brainstorm import: `--from-brainstorm WFS-xxx`
|
|
57
|
+
- No args + `--revise` / `--review`: Operate on existing `.workflow/roadmap.md`
|
|
58
|
+
|
|
59
|
+
**Pipeline position:**
|
|
60
|
+
```
|
|
61
|
+
maestro-brainstorm (optional upstream)
|
|
62
|
+
↓ guidance-specification.md
|
|
63
|
+
maestro-init (project setup)
|
|
64
|
+
↓ project.md, state.json, config.json
|
|
65
|
+
maestro-roadmap [--mode light] → roadmap.md directly
|
|
66
|
+
maestro-roadmap --mode full → spec package + roadmap.md
|
|
67
|
+
↓
|
|
68
|
+
maestro-plan → maestro-execute → maestro-verify
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Note (full mode):** `maestro-init` MUST run before `--mode full`. It creates the `.workflow/` directory and project context.
|
|
72
|
+
</context>
|
|
73
|
+
|
|
74
|
+
<execution>
|
|
75
|
+
|
|
76
|
+
### Mode routing
|
|
77
|
+
|
|
78
|
+
1. Read `@~/.maestro/workflows/roadmap-common.md` (always — shared logic)
|
|
79
|
+
2. Parse `--mode` flag:
|
|
80
|
+
- `light` or omitted → read `@~/.maestro/workflows/roadmap.md`, follow its process
|
|
81
|
+
- `full` → read `@~/.maestro/workflows/spec-generate.md`, follow its process
|
|
82
|
+
3. If `--revise` or `--review` present → force light mode (these are light-mode-only operations)
|
|
83
|
+
|
|
84
|
+
### Light mode (default)
|
|
85
|
+
|
|
86
|
+
Follow `~/.maestro/workflows/roadmap.md` completely.
|
|
87
|
+
|
|
88
|
+
Sub-modes:
|
|
89
|
+
- **Create** (default): Build roadmap from requirements
|
|
90
|
+
- **Revise** (`--revise`): Follow workflow roadmap.md "Mode: Revise" section
|
|
91
|
+
- **Review** (`--review`): Follow workflow roadmap.md "Mode: Review" section
|
|
92
|
+
|
|
93
|
+
### Full mode (`--mode full`)
|
|
94
|
+
|
|
95
|
+
Follow `~/.maestro/workflows/spec-generate.md` completely.
|
|
96
|
+
|
|
97
|
+
### Next-step routing on completion
|
|
98
|
+
|
|
99
|
+
| Condition | Suggestion |
|
|
100
|
+
|-----------|-----------|
|
|
101
|
+
| Roadmap approved, need analysis | /maestro-analyze 1 |
|
|
102
|
+
| Simple project, ready to plan | /maestro-plan 1 |
|
|
103
|
+
| Need UI design first | /maestro-ui-design 1 |
|
|
104
|
+
| View project dashboard | /manage-status |
|
|
105
|
+
| Need project setup (full mode) | /maestro-init |
|
|
106
|
+
</execution>
|
|
107
|
+
|
|
108
|
+
<error_codes>
|
|
109
|
+
|
|
110
|
+
**Shared:**
|
|
111
|
+
| Code | Severity | Condition | Recovery |
|
|
112
|
+
|------|----------|-----------|----------|
|
|
113
|
+
| E001 | error | Requirement/idea text or @file required | Prompt user for input |
|
|
114
|
+
| E002 | error | Brainstorm session not found (--from-brainstorm) | Show available sessions |
|
|
115
|
+
| W001 | warning | CLI analysis failed, using fallback | Continue with available data |
|
|
116
|
+
| W005 | warning | External research agent failed | Continue without apiResearchContext |
|
|
117
|
+
|
|
118
|
+
**Light mode:**
|
|
119
|
+
| Code | Severity | Condition | Recovery |
|
|
120
|
+
|------|----------|-----------|----------|
|
|
121
|
+
| E003 | error | Circular dependency detected in phases | Prompt user to re-decompose |
|
|
122
|
+
| E004 | error | roadmap.md not found (--revise/--review) | Run maestro-roadmap first |
|
|
123
|
+
| E005 | error | Revision invalidates completed phase work | Warn user, ask to confirm or adjust |
|
|
124
|
+
| W002 | warning | Max refinement rounds (5) reached | Force proceed with current roadmap |
|
|
125
|
+
|
|
126
|
+
**Full mode:**
|
|
127
|
+
| Code | Severity | Condition | Recovery |
|
|
128
|
+
|------|----------|-----------|----------|
|
|
129
|
+
| E006 | error | `.workflow/` not initialized | Run maestro-init first |
|
|
130
|
+
| E007 | error | Phase 6 readiness Fail after 2 auto-fix iterations | Present manual fix options |
|
|
131
|
+
| W002 | warning | Codebase exploration failed | Continue without codebase context |
|
|
132
|
+
| W003 | warning | Glossary has < 5 terms | Note in readiness check |
|
|
133
|
+
| W004 | warning | Review-level readiness score (60-79%) | Proceed with caveats |
|
|
134
|
+
</error_codes>
|
|
135
|
+
|
|
136
|
+
<success_criteria>
|
|
137
|
+
|
|
138
|
+
**Light mode:**
|
|
139
|
+
- [ ] Requirement parsed with goal, constraints, stakeholders
|
|
140
|
+
- [ ] Decomposition strategy selected (progressive or direct)
|
|
141
|
+
- [ ] Phases defined with success criteria, dependencies, and requirement mappings
|
|
142
|
+
- [ ] Every Active requirement from project.md mapped to exactly one phase
|
|
143
|
+
- [ ] No circular dependencies in phase ordering
|
|
144
|
+
- [ ] User approved roadmap (or auto-approved with -y)
|
|
145
|
+
- [ ] `.workflow/roadmap.md` written with phase details, scope decisions, and progress table
|
|
146
|
+
- [ ] No phase directories created (phases are labels in roadmap, not directories)
|
|
147
|
+
|
|
148
|
+
**Full mode (in addition to light mode criteria for roadmap):**
|
|
149
|
+
- [ ] `spec-config.json` created with session metadata and phase tracking
|
|
150
|
+
- [ ] `product-brief.md` with vision, goals, scope, multi-perspective synthesis
|
|
151
|
+
- [ ] `glossary.json` with 5+ core terms for cross-document consistency
|
|
152
|
+
- [ ] `requirements/` directory with `_index.md` + individual `REQ-*.md` + `NFR-*.md` files
|
|
153
|
+
- [ ] All requirements have RFC 2119 keywords and acceptance criteria
|
|
154
|
+
- [ ] `architecture/` directory with `_index.md` + individual `ADR-*.md` files
|
|
155
|
+
- [ ] Architecture includes state machine, config model, error handling, observability (service type)
|
|
156
|
+
- [ ] `epics/` directory with `_index.md` + individual `EPIC-*.md` files
|
|
157
|
+
- [ ] Cross-Epic dependency map (Mermaid) and MVP subset tagged
|
|
158
|
+
- [ ] `readiness-report.md` with 4-dimension quality scores and traceability matrix
|
|
159
|
+
- [ ] `spec-summary.md` with one-page executive summary
|
|
160
|
+
- [ ] All documents have valid YAML frontmatter with session_id
|
|
161
|
+
- [ ] Glossary terms used consistently across all documents
|
|
162
|
+
- [ ] Readiness gate: Pass (>=80%) or Review (>=60%) with documented caveats
|
|
163
|
+
- [ ] `.workflow/roadmap.md` written
|
|
164
|
+
</success_criteria>
|