maestro-flow 0.3.13 → 0.3.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.claude/commands/maestro-composer.md +354 -0
  2. package/.claude/commands/maestro-player.md +404 -0
  3. package/.claude/skills/skill-iter-tune/SKILL.md +382 -0
  4. package/.claude/skills/skill-iter-tune/phases/01-setup.md +144 -0
  5. package/.claude/skills/skill-iter-tune/phases/02-execute.md +292 -0
  6. package/.claude/skills/skill-iter-tune/phases/03-evaluate.md +312 -0
  7. package/.claude/skills/skill-iter-tune/phases/04-improve.md +186 -0
  8. package/.claude/skills/skill-iter-tune/phases/05-report.md +166 -0
  9. package/.claude/skills/skill-iter-tune/specs/evaluation-criteria.md +63 -0
  10. package/.claude/skills/skill-iter-tune/templates/eval-prompt.md +134 -0
  11. package/.claude/skills/skill-iter-tune/templates/execute-prompt.md +97 -0
  12. package/.claude/skills/workflow-skill-designer/SKILL.md +496 -0
  13. package/.claude/skills/workflow-skill-designer/phases/01-requirements-analysis.md +356 -0
  14. package/.claude/skills/workflow-skill-designer/phases/02-orchestrator-design.md +444 -0
  15. package/.claude/skills/workflow-skill-designer/phases/03-phase-design.md +458 -0
  16. package/.claude/skills/workflow-skill-designer/phases/04-validation.md +471 -0
  17. package/.codex/skills/maestro-composer/SKILL.md +285 -0
  18. package/.codex/skills/maestro-link-coordinate/SKILL.md +430 -224
  19. package/.codex/skills/maestro-player/SKILL.md +448 -0
  20. package/chains/milestone-fork-merge.json +6 -6
  21. package/dist/src/hooks/auto-mode.d.ts +18 -0
  22. package/dist/src/hooks/auto-mode.d.ts.map +1 -0
  23. package/dist/src/hooks/auto-mode.js +28 -0
  24. package/dist/src/hooks/auto-mode.js.map +1 -0
  25. package/dist/src/hooks/context-monitor.d.ts.map +1 -1
  26. package/dist/src/hooks/context-monitor.js +14 -3
  27. package/dist/src/hooks/context-monitor.js.map +1 -1
  28. package/dist/src/hooks/coordinator-tracker.d.ts +1 -0
  29. package/dist/src/hooks/coordinator-tracker.d.ts.map +1 -1
  30. package/dist/src/hooks/coordinator-tracker.js +19 -9
  31. package/dist/src/hooks/coordinator-tracker.js.map +1 -1
  32. package/package.json +1 -1
  33. package/templates/workflows/specs/node-catalog.md +170 -0
  34. package/templates/workflows/specs/template-schema.md +157 -0
  35. package/workflows/maestro-coordinate.codex.md +9 -9
  36. package/workflows/maestro-coordinate.md +9 -9
  37. package/workflows/maestro.md +2 -2
  38. package/.codex/skills/maestro-chain/SKILL.md +0 -233
@@ -0,0 +1,285 @@
1
+ ---
2
+ name: maestro-composer
3
+ description: Interactive workflow template composer — parse natural language into DAG of skill nodes, auto-inject checkpoints, confirm pipeline interactively, persist as reusable JSON template to ~/.maestro/templates/workflows/
4
+ argument-hint: "\"workflow description\" [--resume] [--edit <template-path>]"
5
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
+ ---
7
+
8
+ <purpose>
9
+ Interactive workflow template composer. Parses natural language into a reusable DAG template
10
+ via 5 phases with user confirmation at each boundary. Templates saved globally at
11
+ `~/.maestro/templates/workflows/`. Progressive disclosure — specs loaded only when phase needs them.
12
+
13
+ Sequential interactive flow (no spawn_agents_on_csv — this is design, not execution):
14
+ ```
15
+ Parse NL → [confirm] → Resolve to nodes → [confirm] → Inject checkpoints → Confirm pipeline → Persist
16
+ ```
17
+
18
+ Three entry modes:
19
+ 1. **New design**: Phase 1-5
20
+ 2. **Resume design**: Load draft from `.workflow/templates/design-drafts/`
21
+ 3. **Edit template**: Load existing, modify, re-save
22
+ </purpose>
23
+
24
+ <context>
25
+ $ARGUMENTS — natural language workflow description, or flags.
26
+
27
+ **Flags:**
28
+ - `--resume` — Resume in-progress design session
29
+ - `--edit <template-path>` — Edit an existing template
30
+
31
+ **Shared constants:**
32
+
33
+ | Constant | Value |
34
+ |----------|-------|
35
+ | Session prefix | `WFD` |
36
+ | Template dir (global) | `~/.maestro/templates/workflows/` |
37
+ | Template index (global) | `~/.maestro/templates/workflows/index.json` |
38
+ | Design drafts dir (local) | `.workflow/templates/design-drafts/` |
39
+ | Template ID format | `wft-<slug>-<YYYYMMDD>` |
40
+ | Node ID format | `N-<seq>` (e.g. N-001), `CP-<seq>` for checkpoints |
41
+ | Max nodes | 20 |
42
+
43
+ **Entry routing:**
44
+
45
+ | Detection | Condition | Handler |
46
+ |-----------|-----------|---------|
47
+ | Resume | `--resume` or existing WFD session | Phase 0: Resume |
48
+ | Edit | `--edit <path>` | Phase 0: Load + Edit |
49
+ | New | Default | Phase 1: Parse |
50
+
51
+ **Node catalog**: Read `~/.maestro/templates/workflows/specs/node-catalog.md` at Phase 2 (deferred).
52
+ **Template schema**: Read `~/.maestro/templates/workflows/specs/template-schema.md` at Phase 5 (deferred).
53
+ </context>
54
+
55
+ <execution>
56
+
57
+ ### Phase 0: Resume / Edit (conditional)
58
+
59
+ **Resume** (`--resume`):
60
+ 1. Scan `.workflow/templates/design-drafts/WFD-*/` for in-progress designs
61
+ 2. Multiple → AskUserQuestion for selection
62
+ 3. Load draft → skip to last incomplete phase
63
+
64
+ **Edit** (`--edit <path>`):
65
+ 1. Load template JSON
66
+ 2. Show pipeline visualization (Phase 4 format)
67
+ 3. AskUserQuestion: which nodes to modify/add/remove
68
+ 4. Re-enter at Phase 3
69
+
70
+ ---
71
+
72
+ ### Phase 1: Parse — Semantic Intent Extraction
73
+
74
+ **Step 1.1** — Parse `$ARGUMENTS`. If empty, AskUserQuestion:
75
+ ```
76
+ "Describe the workflow you want to automate.
77
+ Include: what steps to run, in what order, and what varies each time.
78
+ Example: 'analyze the code, then plan, implement, and test the feature'"
79
+ ```
80
+
81
+ **Step 1.2** — Extract sequential actions as candidate nodes:
82
+
83
+ | Signal | Candidate Type |
84
+ |--------|---------------|
85
+ | "analyze", "review", "explore" | analysis (cli) |
86
+ | "plan", "design", "spec" | planning (skill) |
87
+ | "implement", "build", "code", "fix" | execution (skill) |
88
+ | "test", "validate", "verify" | testing (skill) |
89
+ | "brainstorm", "ideate" | brainstorm (skill) |
90
+ | "review code" | review (skill) |
91
+ | "then", "next", "after" | sequential edge |
92
+ | "parallel", "simultaneously" | parallel edge |
93
+
94
+ **Step 1.3** — Extract variables (inputs that vary per run).
95
+
96
+ **Step 1.4** — Classify task type: `bugfix | feature | tdd | review | brainstorm | spec-driven | roadmap | refactor | integration-test | quick-task | custom`
97
+
98
+ **Step 1.5** — Assess complexity: `simple` (1-3 nodes), `medium` (4-7), `complex` (8+)
99
+
100
+ **Step 1.6** — Write `intent.json` to `.workflow/templates/design-drafts/WFD-<slug>-<date>/`.
101
+
102
+ **Step 1.7 — Interactive confirmation**:
103
+ ```
104
+ ============================================================
105
+ COMPOSER — Intent Parsed
106
+ ============================================================
107
+ Description: "<original input>"
108
+ Task type: <type>
109
+ Complexity: <level>
110
+
111
+ Detected steps:
112
+ 1. <description> → <type_hint>
113
+ 2. <description> → <type_hint>
114
+ 3. <description> → <type_hint>
115
+
116
+ Variables:
117
+ - goal (required): <inferred description>
118
+ ============================================================
119
+ ```
120
+
121
+ AskUserQuestion: `Looks good, continue to resolution` / `Edit steps` / `Add a step` / `Cancel`
122
+
123
+ ---
124
+
125
+ ### Phase 2: Resolve — Map Steps to Executor Nodes
126
+
127
+ **Read deferred**: `~/.maestro/templates/workflows/specs/node-catalog.md`
128
+
129
+ If spec not found, use built-in fallback:
130
+
131
+ | type_hint | executor type | executor |
132
+ |-----------|--------------|----------|
133
+ | `planning` | skill | `maestro-plan` |
134
+ | `execution` | skill | `maestro-execute` |
135
+ | `testing` | skill | `quality-test` |
136
+ | `review` | skill | `quality-review` |
137
+ | `brainstorm` | skill | `maestro-brainstorm` |
138
+ | `analysis` | cli | `maestro delegate --to gemini --mode analysis` |
139
+ | `verify` | skill | `maestro-verify` |
140
+ | `refactor` | skill | `quality-refactor` |
141
+ | `debug` | skill | `quality-debug` |
142
+ | `spec` | skill | `maestro-spec-generate` |
143
+ | `checkpoint` | checkpoint | — |
144
+
145
+ **Step 2.1** — Load `intent.json`, map each step to executor.
146
+
147
+ **Step 2.2** — Build `args_template` with variable placeholders and context injection:
148
+ - Planning after analysis → `--context {prev_output_path}`
149
+ - Execution after planning → inherit phase
150
+ - Testing after execution → inherit phase
151
+
152
+ **Step 2.3** — Assign `parallel_group` for parallel steps.
153
+
154
+ **Step 2.4** — Write `nodes.json`.
155
+
156
+ **Step 2.5 — Interactive confirmation**:
157
+ ```
158
+ ============================================================
159
+ COMPOSER — Nodes Resolved
160
+ ============================================================
161
+ N-001 [skill] maestro-plan "{goal}"
162
+ N-002 [skill] maestro-execute {phase}
163
+ N-003 [skill] quality-test {phase}
164
+
165
+ Parallel groups: none
166
+ ============================================================
167
+ ```
168
+
169
+ AskUserQuestion: `Continue to checkpoint injection` / `Change executor` / `Change node type` / `Back to intent` / `Cancel`
170
+
171
+ ---
172
+
173
+ ### Phase 3: Enrich — Inject Checkpoints + Build DAG
174
+
175
+ **Step 3.1** — Load `nodes.json`. Build sequential edges. For parallel groups: fan-out/fan-in.
176
+
177
+ **Step 3.2** — Auto-inject checkpoint nodes:
178
+
179
+ | Rule | Condition |
180
+ |------|-----------|
181
+ | Artifact boundary | Source output_ports: plan, spec, analysis, review-findings |
182
+ | Execution gate | Target executor contains `execute` |
183
+ | Agent spawn | Target type is `agent` |
184
+ | Long-running | Target is maestro-plan, maestro-spec-generate |
185
+ | User-defined | Step had `type_hint: checkpoint` |
186
+ | Post-testing | Source executor contains `test` or `integration-test` |
187
+
188
+ Set `auto_continue: false` for checkpoints before user-facing deliverables.
189
+
190
+ **Step 3.3** — Finalize `context_schema`, validate DAG (no cycles, no orphans).
191
+
192
+ **Step 3.4** — Write `dag.json`. → Proceed to Phase 4.
193
+
194
+ ---
195
+
196
+ ### Phase 4: Confirm — Visualize + User Approval
197
+
198
+ **Step 4.1** — Render ASCII pipeline:
199
+ ```
200
+ ============================================================
201
+ COMPOSER — Pipeline Review
202
+ ============================================================
203
+ Pipeline: <template-name>
204
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
205
+ N-001 [skill] maestro-plan "{goal}"
206
+ |
207
+ CP-01 [checkpoint] After Plan auto-continue
208
+ |
209
+ N-002 [skill] maestro-execute {phase}
210
+ |
211
+ CP-02 [checkpoint] Before Tests pause-for-user
212
+ |
213
+ N-003 [skill] quality-test {phase}
214
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
215
+ Variables (required): goal
216
+ Checkpoints: 2 (1 auto, 1 pause)
217
+ Nodes: 3 work + 2 checkpoints
218
+ ============================================================
219
+ ```
220
+
221
+ **Step 4.2** — AskUserQuestion: `Confirm & Save` / `Edit a node` / `Add a node` / `Remove a node` / `Rename template` / `Re-run checkpoint injection` / `Cancel`
222
+
223
+ **Step 4.3** — Loop edits until Confirm or Cancel.
224
+
225
+ ---
226
+
227
+ ### Phase 5: Persist — Assemble + Save Template
228
+
229
+ **Read deferred**: `~/.maestro/templates/workflows/specs/template-schema.md`
230
+
231
+ **Step 5.1** — Load `intent.json` + `dag.json`. Assemble template JSON.
232
+
233
+ **Step 5.2** — Determine slug (kebab-case). If exists, append `-v2`.
234
+
235
+ **Step 5.3** — Write `~/.maestro/templates/workflows/<slug>.json`.
236
+
237
+ **Step 5.4** — Update `~/.maestro/templates/workflows/index.json`.
238
+
239
+ **Step 5.5** — Output summary:
240
+ ```
241
+ ============================================================
242
+ COMPOSER — Template Saved
243
+ ============================================================
244
+ Path: ~/.maestro/templates/workflows/<slug>.json
245
+ ID: wft-<slug>-<date>
246
+ Nodes: <n> work + <n> checkpoints
247
+ Variables: <required vars>
248
+
249
+ To execute:
250
+ $maestro-player <slug> --context goal="<your goal>"
251
+
252
+ To edit later:
253
+ $maestro-composer --edit ~/.maestro/templates/workflows/<slug>.json
254
+
255
+ To list all templates:
256
+ $maestro-player --list
257
+ ============================================================
258
+ ```
259
+
260
+ **Step 5.6** — Clean up design draft directory.
261
+ </execution>
262
+
263
+ <error_codes>
264
+ | Code | Severity | Condition | Recovery |
265
+ |------|----------|-----------|----------|
266
+ | E001 | error | Empty description and no flags | AskUserQuestion for description |
267
+ | E002 | error | 0 steps extracted | Ask to rephrase with action verbs |
268
+ | E003 | error | Node count exceeds 20 | Suggest splitting into sub-workflows |
269
+ | E004 | error | DAG cycle detected | Show cycle, ask to resolve |
270
+ | E005 | error | Resume session not found | Show available drafts |
271
+ | E006 | error | Edit template not found | Show available templates |
272
+ | W001 | warning | Ambiguous executor mapping | Show candidates, let user choose |
273
+ | W002 | warning | No checkpoint rules triggered | Warn, offer manual add |
274
+ | W003 | warning | Deferred spec not found | Use built-in fallback |
275
+ </error_codes>
276
+
277
+ <success_criteria>
278
+ - [ ] Intent parsed and confirmed by user (Phase 1 gate)
279
+ - [ ] Nodes resolved and confirmed by user (Phase 2 gate)
280
+ - [ ] DAG built with auto-injected checkpoints
281
+ - [ ] Pipeline visualized and confirmed by user (Phase 4 gate)
282
+ - [ ] Template JSON written to `~/.maestro/templates/workflows/<slug>.json`
283
+ - [ ] Template index updated
284
+ - [ ] Deferred specs loaded only when phase needs them
285
+ </success_criteria>