maestro-flow 0.3.26 → 0.3.27

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.
@@ -11,6 +11,7 @@ allowed-tools:
11
11
  - Grep
12
12
  - Agent
13
13
  - AskUserQuestion
14
+ - TodoWrite
14
15
  ---
15
16
  <purpose>
16
17
  Orchestrate all maestro commands automatically based on user intent and current project state.
@@ -28,7 +29,7 @@ Executes commands sequentially with artifact propagation between steps.
28
29
 
29
30
  <deferred_reading>
30
31
  - [maestro.md](~/.maestro/workflows/maestro.md) — read at execution start (Steps 1-3: intent analysis, chain selection, session setup)
31
- - [maestro-chain-execute.md](~/.maestro/workflows/maestro-chain-execute.md) — read when dispatching chain execution (Step 4b) or resume mode (Step 1b)
32
+ - [maestro-chain-execute.md](~/.maestro/workflows/maestro-chain-execute.md) — read when dispatching chain execution (Step 4) or resume mode
32
33
  - [maestro-super.md](~/.maestro/workflows/maestro-super.md) — read when `--super` flag is active
33
34
  </deferred_reading>
34
35
 
@@ -83,12 +84,10 @@ When `-y` is active, maestro propagates auto flags to downstream commands. Only
83
84
  Commands not listed (manage-*, spec-*, milestone-*) have no auto flags and execute as-is.
84
85
 
85
86
  In auto mode, maestro also:
86
- - Skips its own clarification (Step 4)
87
- - Skips chain confirmation (Step 5d)
87
+ - Skips intent clarification (workflow Step 2d)
88
+ - Skips chain confirmation (workflow Step 3d)
88
89
  - Auto-skips on step errors (retry once, then skip and continue)
89
90
 
90
- Context cleanup hints, context window reminders, and completion report format are defined in workflow maestro.md (Steps 7a-1, 7f).
91
-
92
91
  **Super mode (`--super`):** Read `maestro-super.md` from deferred_reading, then follow it completely.
93
92
  </execution>
94
93
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maestro-flow",
3
- "version": "0.3.26",
3
+ "version": "0.3.27",
4
4
  "description": "Workflow orchestration CLI with MCP endpoint support and extensible architecture",
5
5
  "type": "module",
6
6
  "imports": {
@@ -41,9 +41,9 @@ context = {
41
41
  current_phase, // from status.json.context or top-level phase
42
42
  user_intent, // from status.json.context or top-level intent
43
43
  issue_id,
44
+ milestone_num,
44
45
  spec_session_id,
45
- scratch_dir,
46
- auto_mode // from status.json.auto_mode
46
+ scratch_dir
47
47
  }
48
48
  ```
49
49
 
@@ -52,10 +52,11 @@ context = {
52
52
  ```
53
53
  1. Substitute placeholders in step.args:
54
54
  {phase} → context.current_phase
55
- {description} → context.user_intent
55
+ {description} → context.user_intent (chainMap uses {description} as alias for user intent)
56
56
  {issue_id} → context.issue_id
57
57
  {spec_session_id} → context.spec_session_id
58
58
  {scratch_dir} → context.scratch_dir
59
+ {milestone_num} → context.milestone_num
59
60
 
60
61
  2. In auto_mode, append per-command flag if not already present:
61
62
  maestro-analyze / maestro-brainstorm / maestro-roadmap / maestro-ui-design → -y
@@ -72,22 +73,16 @@ For each step starting at `$STEP_INDEX`:
72
73
 
73
74
  ### 3a. Select engine & display banner
74
75
 
75
- Per-step engine selection:
76
+ Read `step.engine` from status.json (pre-computed by selection workflow Step 3e).
76
77
 
78
+ If `step.engine` is missing or null, fallback to auto selection:
77
79
  ```
78
- If exec_mode is 'cli' or 'skill' → force that engine for all steps.
79
-
80
- In 'auto' mode, select per step:
81
- CLI steps (heavy, context-isolated):
82
- maestro-plan, maestro-execute, maestro-analyze, maestro-brainstorm,
83
- maestro-roadmap, maestro-ui-design, quality-refactor
84
-
85
- Skill steps (observable, interactive, lightweight):
86
- everything else — verify, review, test, debug, milestone-*,
87
- manage-*, spec-*, quick, etc.
80
+ CLI: maestro-plan, maestro-execute, maestro-analyze, maestro-brainstorm,
81
+ maestro-roadmap, maestro-ui-design, quality-refactor
82
+ Internal: everything else (current-session Skill() call)
88
83
  ```
89
84
 
90
- Display: `[Step {N}/{total}] /{cmd} [{engine}] — {args}`
85
+ Display: `[Step {N}/{total}] /{step.skill} [{engine}] — {args}`
91
86
 
92
87
  Update status.json: step `status = "running"`, `engine`, `started_at`.
93
88
 
@@ -97,10 +92,10 @@ Context window hint:
97
92
 
98
93
  ### 3b. Execute (engine-dependent)
99
94
 
100
- **Skill engine** — invoke directly (synchronous, visible):
95
+ **Internal engine** — current-session Skill() call (synchronous, visible):
101
96
 
102
97
  ```
103
- Skill({ skill: step.cmd, args: assembledArgs })
98
+ Skill({ skill: step.skill, args: assembledArgs })
104
99
  ```
105
100
 
106
101
  **CLI engine** — template-driven, async, context-isolated:
@@ -144,7 +139,7 @@ CLI: save output to `step-{N}-output.txt` in session directory.
144
139
 
145
140
  ### 3e. Post-step analysis (CLI steps only)
146
141
 
147
- Skip if: step failed/skipped, or `engine == 'skill'`.
142
+ Skip if: step failed/skipped, or `engine == 'internal'`.
148
143
 
149
144
  Delegate to gemini (analysis mode, `--resume` if `gemini_session_id` exists) with prompt containing:
150
145
  - Step command, args, chain name, intent
@@ -194,8 +189,8 @@ Update status.json: `status = "completed"`.
194
189
 
195
190
  Results:
196
191
  [✓] 1. maestro-plan — completed [cli] (quality: 85/100)
197
- [✓] 2. maestro-verify — completed [skill]
198
- [—] 3. quality-review — skipped [skill]
192
+ [✓] 2. maestro-verify — completed [internal]
193
+ [—] 3. quality-review — skipped [internal]
199
194
 
200
195
  CLI Avg Quality: {avgScore}/100 (based on {cliStepCount} cli steps)
201
196
 
@@ -7,7 +7,7 @@ Default `auto` mode selects engine based on chain complexity.
7
7
  **Prerequisites:**
8
8
  - None for initial invocation (can bootstrap)
9
9
  - `continue`/`next`: `.workflow/state.json` must exist
10
- - `-c` (resume): `.workflow/.maestro/*/status.json` must exist
10
+ - `-c` (resume): handled by command file before this workflow loads — not applicable here
11
11
 
12
12
  ## Step 1: Parse & Initialize
13
13
 
@@ -15,8 +15,8 @@ Default `auto` mode selects engine based on chain complexity.
15
15
 
16
16
  ```
17
17
  Parse $ARGUMENTS → extract flags, remainder is intent text.
18
- Flags: autoYes (-y/--yes), resumeMode (-c/--continue), dryRun (--dry-run)
19
- Valued: forcedChain (--chain X), execMode (--exec auto|cli|skill, default 'auto'), cliTool (--tool X, default 'claude')
18
+ Flags: autoYes (-y/--yes), dryRun (--dry-run)
19
+ Valued: execMode (--exec auto|cli|internal, default 'auto'), cliTool (--tool X, default 'claude')
20
20
  intent = arguments with all flags/valued options stripped, trimmed
21
21
  ```
22
22
 
@@ -51,9 +51,9 @@ Check `.workflow/state.json` existence.
51
51
  ============================================================
52
52
  MAESTRO COORDINATOR
53
53
  ============================================================
54
- Mode: {intent-based | state-based | resume}
54
+ Mode: {intent-based | state-based}
55
55
  Auto: {yes | no}
56
- Exec: {auto | cli | skill}
56
+ Exec: {auto | cli | internal}
57
57
  Input: {intent or "continue"}
58
58
  ```
59
59
 
@@ -61,16 +61,13 @@ Check `.workflow/state.json` existence.
61
61
 
62
62
  ### 2a: Fast path — forced chain or exact match
63
63
 
64
- **Forced chain (`--chain`):**
65
- - Validate against known chains (see [Chain Reference](#chain-reference))
66
- - If valid: skip intent analysis, jump to **Step 3**
67
- - If invalid: display valid chains, ask user to choose
68
-
69
64
  **Exact-match keywords:**
70
65
  ```
71
66
  Keyword → taskType (skip to Step 3):
72
67
  continue/next/go/继续/下一步 → 'state_continue'
73
- status/状态/dashboard → 'status'
68
+
69
+ Short-circuit (execute immediately, no chain):
70
+ status/状态/dashboard → Skill({ skill: "manage-status" }). **End.**
74
71
  ```
75
72
 
76
73
  ### 2b: Structured intent extraction (LLM-native)
@@ -160,7 +157,7 @@ Route priority:
160
157
  test: feature/code→test; default→test
161
158
  debug: default→debug
162
159
  refactor: default→refactor
163
- manage: issue→issue, milestone→milestone_audit, phase→milestone_close, memory→memory, doc→sync, codebase→codebase_refresh, config→spec_setup, team→team_coordinate; default→status
160
+ manage: issue→issue, milestone→milestone_audit, phase→milestone_close, memory→knowhow, doc→sync, codebase→codebase_refresh, config→spec_setup, team→team_coordinate; default→status
164
161
  transition: phase→milestone_close, milestone→milestone_complete; default→milestone_close
165
162
  continue: default→state_continue
166
163
  sync: doc→sync, codebase→codebase_refresh; default→sync
@@ -187,10 +184,9 @@ Display intent analysis: action, object, scope, issue_id, phase_ref, task_type,
187
184
  ### 3a: Map task_type → chain
188
185
 
189
186
  **Resolution order:**
190
- 1. `forcedChain` → `chainMap[forcedChain]`
191
- 2. `state_continue` `detectNextAction(projectState)` `{ chain, argsOverride? }`. Apply argsOverride before template substitution.
192
- 3. Task-type aliases named chain: `spec_generate`→`spec-driven`, `brainstorm`→`brainstorm-driven`, `issue_execute`→`issue-full`
193
- 4. `chainMap[taskType]` → direct lookup
187
+ 1. `state_continue` → `detectNextAction(projectState)` → `{ chain, argsOverride? }`. Apply argsOverride before template substitution.
188
+ 2. Task-type aliasesnamed chain: `spec_generate`→`spec-driven`, `brainstorm`→`brainstorm-driven`, `issue_execute`→`issue-full`
189
+ 3. `chainMap[taskType]`direct lookup
194
190
 
195
191
  Full `chainMap` and `detectNextAction` are in the [Reference Data](#reference-data) section.
196
192
 
@@ -228,21 +224,31 @@ When executing issue chains, replace `{issue_id}` in step args with resolved ID.
228
224
 
229
225
  **If `dryRun`:** Display chain visualization and exit.
230
226
  **If not `autoYes`:** Confirm with user — show numbered steps, offer: Execute / Execute from step N / Cancel.
227
+ If user chooses "Execute from step N": set `$START_STEP = N` (used in 3f to set `current_step`).
231
228
 
232
229
  ### 3e: Step-level engine selection
233
230
 
234
- Engine is selected **per step**, not per chain.
231
+ Engine is selected **per step**, not per chain. Pre-compute and write to each step's `engine` field in status.json (execution workflow reads this, does not re-compute).
235
232
 
236
233
  ```
237
- If execMode is 'cli' or 'skill' → force that engine for all steps.
234
+ If execMode is 'cli' or 'internal' → force that engine for all steps.
238
235
  In 'auto' mode, select per step:
239
236
  CLI steps (heavy, context-isolated): maestro-plan, maestro-execute, maestro-analyze, maestro-brainstorm, maestro-roadmap, maestro-ui-design, quality-refactor
240
- Skill steps (everything else): observable, interactive, lightweight (verify, review, test, debug, milestone-*, manage-*, spec-*, quick, etc.)
237
+ Internal steps (everything else): current-session Skill() call verify, review, test, debug, milestone-*, manage-*, spec-*, quick, etc.
241
238
  ```
242
239
 
243
- **Trade-off:** CLI = context isolation + template prompts + gemini analysis. Skill = direct visibility + synchronous + user can intervene.
240
+ **Trade-off:** CLI = context isolation + template prompts + gemini analysis. Internal = current-session Skill() call, direct visibility + synchronous + user can intervene.
241
+
242
+ ### 3f: Low-complexity fast path (before session creation)
243
+
244
+ If ALL conditions met:
245
+ - clarity >= 2
246
+ - task_type == `'quick'` or (action == `'create'` && object == `'feature'`)
247
+ - NOT `state_continue`
248
+
249
+ Then: `Skill({ skill: "maestro-quick", args: '"{description}"' })`. **End.** (no session created, no status.json)
244
250
 
245
- ### 3f: Setup session
251
+ ### 3g: Setup session
246
252
 
247
253
  Create session directory `.workflow/.maestro/maestro-{YYYYMMDD-HHMMSS}/` and write `status.json`:
248
254
  ```json
@@ -262,32 +268,22 @@ Create session directory `.workflow/.maestro/maestro-{YYYYMMDD-HHMMSS}/` and wri
262
268
  "current_phase": "{resolved_phase}",
263
269
  "user_intent": "{original_intent}",
264
270
  "issue_id": "{resolved_issue_id or null}",
271
+ "milestone_num": "{current_milestone_num or null}",
265
272
  "spec_session_id": null,
266
273
  "scratch_dir": null
267
274
  },
268
- "steps": [{ "index": 0, "skill": "{cmd}", "args": "{args}", "engine": null, "status": "pending", "started_at": null, "completed_at": null }],
269
- "current_step": 0,
275
+ "steps": [{ "index": 0, "skill": "{skill_name}", "args": "{args}", "engine": "{cli|internal from 3e}", "status": "pending", "started_at": null, "completed_at": null }],
276
+ "current_step": "{$START_STEP or 0}",
270
277
  "status": "running"
271
278
  }
272
279
  ```
273
280
 
274
- ## Step 4: Dispatch
275
-
276
- ### 4a: Low-complexity fast path
277
-
278
- If ALL conditions met:
279
- - clarity >= 2
280
- - task_type == `'quick'` or (action == `'create'` && object == `'feature'`)
281
- - NOT `forcedChain`, NOT `state_continue`
282
-
283
- Then: `Skill({ skill: "maestro-quick", args: '"{description}"' })`. **End.**
281
+ ## Step 4: Dispatch to execution workflow
284
282
 
285
- ### 4b: Standard execution read and follow execution workflow
283
+ status.json already created in Step 3g with `steps[]` and `context`.
286
284
 
287
- For ALL chains (regardless of step count):
288
- 1. status.json already created in Step 3f with `steps[]` and `context`
289
- 2. Read `~/.maestro/workflows/maestro-chain-execute.md`
290
- 3. Follow it with `$SESSION_PATH` = session directory from Step 3f
285
+ 1. Read `~/.maestro/workflows/maestro-chain-execute.md`
286
+ 2. Follow it with `$SESSION_PATH` = session directory from Step 3g
291
287
 
292
288
  ---
293
289
 
@@ -476,8 +472,8 @@ detectNextAction(state):
476
472
  1. **Semantic Routing** — LLM-native `action × object` extraction; disambiguates "问题" by context
477
473
  2. **State-Aware** — Reads `.workflow/state.json` before routing
478
474
  3. **Quality Gates** — Issue chains auto-include review; `issue-full` is default for issue execution
479
- 4. **Per-Step Engine** — Each step independently selects Skill or CLI. Heavy steps (plan, execute, analyze, brainstorm) → CLI for context isolation. Observable steps (verify, review, test, debug, manage-*) → Skill for direct visibility. `--exec cli|skill` forces all steps.
480
- 5. **CLI Analysis Chain** — Gemini evaluates each CLI step's output, generates `next_step_hints` via `{{ANALYSIS_HINTS}}`. Skill steps skip analysis (output already visible). Sessions chained via `--resume`
475
+ 4. **Per-Step Engine** — Each step independently selects internal or CLI. Heavy steps (plan, execute, analyze, brainstorm) → CLI for context isolation. Observable steps (verify, review, test, debug, manage-*) → internal (current-session Skill()) for direct visibility. `--exec cli|internal` forces all steps.
476
+ 5. **CLI Analysis Chain** — Gemini evaluates each CLI step's output, generates `next_step_hints` via `{{ANALYSIS_HINTS}}`. Internal steps skip analysis (output already visible). Sessions chained via `--resume`
481
477
  6. **Phase Propagation** — Auto-detects and passes phase numbers to downstream commands
482
478
  7. **Auto Mode** — `-y` propagates through chain, skipping all confirmations
483
479
  8. **Resumable** — Session state in `.workflow/.maestro/` enables `-c` resume