maestro-flow-one 0.2.5 → 0.2.7

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 (33) hide show
  1. package/maestro-flow/agents/impeccable-agent.md +99 -0
  2. package/maestro-flow/agents/ui-design-agent.md +1 -0
  3. package/maestro-flow/agents/workflow-executor.md +3 -0
  4. package/maestro-flow/commands/learn/decompose.md +91 -146
  5. package/maestro-flow/commands/learn/follow.md +102 -137
  6. package/maestro-flow/commands/learn/investigate.md +102 -167
  7. package/maestro-flow/commands/learn/retro.md +100 -243
  8. package/maestro-flow/commands/learn/second-opinion.md +95 -135
  9. package/maestro-flow/commands/lifecycle/amend.md +95 -232
  10. package/maestro-flow/commands/lifecycle/analyze.md +3 -8
  11. package/maestro-flow/commands/lifecycle/brainstorm.md +116 -112
  12. package/maestro-flow/commands/lifecycle/collab.md +104 -265
  13. package/maestro-flow/commands/lifecycle/composer.md +117 -292
  14. package/maestro-flow/commands/lifecycle/execute.md +10 -17
  15. package/maestro-flow/commands/lifecycle/impeccable.md +126 -0
  16. package/maestro-flow/commands/lifecycle/merge.md +3 -0
  17. package/maestro-flow/commands/lifecycle/plan.md +1 -6
  18. package/maestro-flow/commands/lifecycle/player.md +111 -340
  19. package/maestro-flow/commands/lifecycle/quick.md +9 -0
  20. package/maestro-flow/commands/lifecycle/roadmap.md +5 -1
  21. package/maestro-flow/commands/lifecycle/ui-codify.md +13 -0
  22. package/maestro-flow/commands/lifecycle/ui-craft.md +416 -0
  23. package/maestro-flow/commands/lifecycle/verify.md +12 -13
  24. package/maestro-flow/commands/manage/issue-discover.md +4 -0
  25. package/maestro-flow/commands/manage/knowhow-capture.md +45 -170
  26. package/maestro-flow/commands/quality/auto-test.md +9 -0
  27. package/maestro-flow/commands/quality/debug.md +11 -25
  28. package/maestro-flow/commands/quality/refactor.md +12 -0
  29. package/maestro-flow/commands/quality/review.md +5 -14
  30. package/maestro-flow/commands/spec/add.md +1 -1
  31. package/maestro-flow/commands/spec/load.md +3 -2
  32. package/package.json +1 -1
  33. package/maestro-flow/commands/lifecycle/ui-design.md +0 -93
@@ -11,344 +11,169 @@ allowed-tools:
11
11
  - Grep
12
12
  - Agent
13
13
  - AskUserQuestion
14
+ - Skill
14
15
  ---
15
16
  <purpose>
16
- Interactive workflow template composer. Parses natural language into a reusable DAG template
17
- via 5 phases with user confirmation at each boundary. Templates saved globally at
18
- `~/.maestro/templates/workflows/`. Progressive disclosure specs loaded only when phase needs them.
19
-
20
- Three entry modes:
21
- 1. **New design**: Parse → [confirm] → Resolve → [confirm] → Enrich → Confirm pipeline → Persist
22
- 2. **Resume design**: Load in-progress draft from `.workflow/templates/design-drafts/`
23
- 3. **Edit template**: Load existing template, modify, re-save
17
+ Interactive workflow template composer. Parse natural language resolve executors → inject checkpoints → build DAG → persist to `~/.maestro/templates/workflows/`. Progressive disclosure — specs loaded only when phase needs them.
18
+
19
+ Three entry modes: **New design** (default), **Resume** (`--resume`), **Edit** (`--edit <path>`).
24
20
  </purpose>
25
21
 
26
22
  <deferred_reading>
27
- - [node-catalog](~/.maestro/templates/workflows/specs/node-catalog.md) — read at Phase 2 (Resolve) when mapping steps to executors
28
- - [template-schema](~/.maestro/templates/workflows/specs/template-schema.md) — read at Phase 5 (Persist) when assembling final JSON
23
+ - [node-catalog](~/.maestro/templates/workflows/specs/node-catalog.md) — read at Phase 2 (Resolve)
24
+ - [template-schema](~/.maestro/templates/workflows/specs/template-schema.md) — read at Phase 5 (Persist)
29
25
  </deferred_reading>
30
26
 
31
27
  <context>
32
- $ARGUMENTS — natural language workflow description, or flags.
33
-
34
- **Flags:**
35
- - `--resume` — Resume in-progress design session
36
- - `--edit <template-path>` — Edit an existing template
37
-
38
- **Shared constants:**
39
-
40
- | Constant | Value |
41
- |----------|-------|
42
- | Session prefix | `WFD` |
43
- | Template dir (global) | `~/.maestro/templates/workflows/` |
44
- | Template index (global) | `~/.maestro/templates/workflows/index.json` |
45
- | Design drafts dir (local) | `.workflow/templates/design-drafts/` |
46
- | Template ID format | `wft-<slug>-<YYYYMMDD>` |
47
- | Node ID format | `N-<seq>` (e.g. N-001), `CP-<seq>` for checkpoints |
48
- | Max nodes | 20 |
49
-
50
- **Entry routing:**
51
-
52
- | Detection | Condition | Handler |
53
- |-----------|-----------|---------|
54
- | Resume design | `--resume` flag or existing WFD session | Phase 0: Resume |
55
- | Edit template | `--edit <template-path>` | Phase 0: Load + Edit |
56
- | New design | Default | Phase 1: Parse |
57
- </context>
58
-
59
- <execution>
60
-
61
- ### Phase 0: Resume / Edit (conditional)
28
+ $ARGUMENTS — natural language description, or flags.
62
29
 
63
- **Resume design session** (if `--resume`):
64
- 1. Scan `.workflow/templates/design-drafts/WFD-*/` for in-progress designs
65
- 2. Multiple found → AskUserQuestion for selection
66
- 3. Load draft → skip to last incomplete phase
67
-
68
- **Edit existing template** (if `--edit <path>`):
69
- 1. Load template from `--edit` path
70
- 2. Show current pipeline visualization (Phase 4 format)
71
- 3. AskUserQuestion: which nodes to modify/add/remove
72
- 4. Re-enter at Phase 3 with edits applied
73
-
74
- ---
30
+ **Flags**: `--resume` (resume in-progress design), `--edit <path>` (edit existing template)
75
31
 
76
- ### Phase 1: Parse — Semantic Intent Extraction
32
+ **Constants**:
33
+ - Template dir: `~/.maestro/templates/workflows/`
34
+ - Template index: `~/.maestro/templates/workflows/index.json`
35
+ - Design drafts: `.workflow/templates/design-drafts/`
36
+ - Template ID: `wft-<slug>-<YYYYMMDD>`, Node ID: `N-<seq>`, Checkpoint: `CP-<seq>`
37
+ - Max nodes: 20
77
38
 
78
- **Step 1.1** — Parse `$ARGUMENTS` as description. If empty, AskUserQuestion:
79
- ```
80
- "Describe the workflow you want to automate.
81
- Include: what steps to run, in what order, and what varies each time (inputs).
82
- Example: 'analyze the code, then plan, implement, and test the feature'"
83
- ```
84
-
85
- **Step 1.2** — Extract sequential actions as candidate nodes using semantic understanding:
86
-
87
- | Signal | Candidate Type |
88
- |--------|---------------|
89
- | "analyze", "review", "explore" | analysis (cli) |
90
- | "plan", "design", "spec" | planning (skill) |
91
- | "implement", "build", "code", "fix" | execution (skill) |
92
- | "test", "validate", "verify" | testing (skill) |
93
- | "brainstorm", "ideate" | brainstorm (skill) |
94
- | "review code" | review (skill) |
95
- | "then", "next", "after" | sequential edge |
96
- | "parallel", "simultaneously" | parallel edge |
97
-
98
- **Step 1.3** — Extract variables (inputs that vary per run). Detect from: direct mentions, `{var}` patterns, implicit from task type.
99
-
100
- **Step 1.4** — Classify task type: `bugfix | feature | tdd | review | brainstorm | spec-driven | roadmap | refactor | auto-test | quick-task | custom`
101
-
102
- **Step 1.5** — Assess complexity: `simple` (1-3 nodes), `medium` (4-7), `complex` (8+)
103
-
104
- **Step 1.6** — Write `intent.json` to `.workflow/templates/design-drafts/WFD-<slug>-<date>/`.
105
-
106
- **Step 1.7 — Interactive confirmation**:
107
-
108
- Display parsed intent summary:
109
- ```
110
- ============================================================
111
- COMPOSER — Intent Parsed
112
- ============================================================
113
- Description: "<original input>"
114
- Task type: <type>
115
- Complexity: <level>
39
+ ### Pre-load specs
40
+ 1. **Architecture specs**: Run `maestro spec load --category arch` to load architecture constraints. Use as context for node resolution — ensures workflow design respects documented patterns.
41
+ 2. **Coding specs**: Run `maestro spec load --category coding` to load coding conventions. Informs executor argument defaults and context injection.
42
+ 3. Optional proceed without if unavailable.
43
+ </context>
116
44
 
117
- Detected steps:
118
- 1. <description> → <type_hint>
119
- 2. <description> → <type_hint>
120
- 3. <description> → <type_hint>
45
+ <state_machine>
121
46
 
122
- Variables:
123
- - goal (required): <inferred description>
47
+ <states>
48
+ S_ROUTE — 入口路由(new/resume/edit) PERSIST:
49
+ S_PARSE — 语义意图提取 PERSIST: intent.json
50
+ S_CONFIRM_1 — 确认解析结果 PERSIST: —
51
+ S_RESOLVE — 映射步骤到 executor 节点 PERSIST: nodes.json
52
+ S_CONFIRM_2 — 确认节点映射 PERSIST: —
53
+ S_ENRICH — 注入 checkpoint + 构建 DAG PERSIST: dag.json
54
+ S_CONFIRM_3 — 可视化 pipeline + 用户审批 PERSIST: —
55
+ S_PERSIST — 组装 JSON + 保存模板 PERSIST: template file + index
56
+ </states>
124
57
 
125
- Draft: .workflow/templates/design-drafts/WFD-<slug>-<date>/
126
- ============================================================
127
- ```
58
+ <transitions>
128
59
 
129
- AskUserQuestion:
130
- ```
131
- options:
132
- - "Looks good, continue to resolution" → Phase 2
133
- - "Edit steps" → re-describe, re-parse
134
- - "Add a step" → append, re-parse
135
- - "Cancel" → save draft, exit
136
- ```
60
+ S_ROUTE:
61
+ → S_PARSE WHEN: no flags (new design)
62
+ → S_RESOLVE WHEN: --resume DO: load draft, skip to last incomplete phase
63
+ S_CONFIRM_3 WHEN: --edit <path> DO: load template, show pipeline, ask edits
137
64
 
138
- ---
65
+ S_PARSE:
66
+ → S_CONFIRM_1 DO: A_PARSE_INTENT
139
67
 
140
- ### Phase 2: Resolve — Map Steps to Executor Nodes
68
+ S_CONFIRM_1:
69
+ → S_RESOLVE WHEN: user confirms "Looks good"
70
+ → S_PARSE WHEN: user selects "Edit steps" or "Add step"
71
+ → END WHEN: user cancels DO: save draft
141
72
 
142
- **Read deferred**: `~/.maestro/templates/workflows/specs/node-catalog.md` — load node catalog for executor mapping.
73
+ S_RESOLVE:
74
+ → S_CONFIRM_2 DO: A_RESOLVE_NODES (read deferred: node-catalog)
143
75
 
144
- If the spec file does not exist, use the built-in fallback mapping:
76
+ S_CONFIRM_2:
77
+ → S_ENRICH WHEN: user confirms "Continue"
78
+ → S_RESOLVE WHEN: user changes executor or node type
79
+ → S_PARSE WHEN: user selects "Back to intent"
80
+ → END WHEN: user cancels DO: save draft
145
81
 
146
- | type_hint | Default executor type | Default executor |
147
- |-----------|----------------------|------------------|
148
- | `planning` | skill | `maestro-plan` |
149
- | `execution` | skill | `maestro-execute` |
150
- | `testing` | skill | `quality-test` |
151
- | `review` | skill | `quality-review` |
152
- | `brainstorm` | skill | `maestro-brainstorm` |
153
- | `analysis` | cli | `maestro delegate --role analyze --mode analysis` |
154
- | `verify` | skill | `maestro-verify` |
155
- | `refactor` | skill | `quality-refactor` |
156
- | `debug` | skill | `quality-debug` |
157
- | `spec` | skill | `maestro-roadmap --mode full` |
158
- | `checkpoint` | checkpoint | — |
82
+ S_ENRICH:
83
+ → S_CONFIRM_3 DO: A_BUILD_DAG
159
84
 
160
- **Step 2.1** — Load `intent.json`.
85
+ S_CONFIRM_3:
86
+ → S_PERSIST WHEN: user confirms "Confirm & Save"
87
+ → S_CONFIRM_3 WHEN: user edits/adds/removes node DO: apply change, re-render
88
+ → S_ENRICH WHEN: user selects "Re-run checkpoints"
89
+ → END WHEN: user cancels DO: save draft
161
90
 
162
- **Step 2.2** — Map each step to executor. Resolution: match `type_hint` → catalog → semantic fit → fallback `cli`.
91
+ S_PERSIST:
92
+ → END DO: A_SAVE_TEMPLATE (read deferred: template-schema)
163
93
 
164
- **Step 2.3** — Build `args_template` with variable placeholders. Context injection:
165
- - Planning after analysis → `--context {prev_output_path}`
166
- - Execution after planning → `--resume-session {prev_session_id}`
167
- - Testing after execution → `--session {prev_session_id}`
94
+ </transitions>
168
95
 
169
- **Step 2.4** — Assign `parallel_group` for steps with `parallel_with` set.
96
+ <actions>
170
97
 
171
- **Step 2.5** — Write `nodes.json`.
98
+ ### A_PARSE_INTENT
172
99
 
173
- **Step 2.6 Interactive confirmation**:
100
+ 1. Parse description (if empty: AskUserQuestion for workflow description)
101
+ 2. Extract candidate nodes via semantic signals:
174
102
 
175
- Display resolved nodes:
176
- ```
177
- ============================================================
178
- COMPOSER Nodes Resolved
179
- ============================================================
180
- N-001 [skill] maestro-plan "{goal}"
181
- N-002 [skill] maestro-execute {phase}
182
- N-003 [skill] quality-test {phase}
103
+ | Signal | Type hint |
104
+ |--------|-----------|
105
+ | "analyze", "review", "explore" | analysis (cli) |
106
+ | "plan", "design", "spec" | planning (skill) |
107
+ | "implement", "build", "code", "fix" | execution (skill) |
108
+ | "test", "validate", "verify" | testing (skill) |
109
+ | "then", "next", "after" | sequential edge |
110
+ | "parallel", "simultaneously" | parallel edge |
183
111
 
184
- Parallel groups: none
185
- ============================================================
186
- ```
112
+ 3. Extract variables (inputs that vary per run)
113
+ 4. Classify: task type + complexity (simple 1-3 / medium 4-7 / complex 8+)
114
+ 5. Write `intent.json` to design drafts dir
115
+ 6. Display: parsed steps, variables, task type, complexity
187
116
 
188
- AskUserQuestion:
189
- ```
190
- options:
191
- - "Continue to checkpoint injection" → Phase 3
192
- - "Change executor for a node" → select node, pick new executor
193
- - "Change node type" → skill/cli/agent/command
194
- - "Back to intent" → Phase 1
195
- - "Cancel" → save draft, exit
196
- ```
117
+ ### A_RESOLVE_NODES
197
118
 
198
- ---
119
+ Read deferred `node-catalog.md` (fallback to built-in mapping):
199
120
 
200
- ### Phase 3: Enrich Inject Checkpoints + Build DAG
121
+ | Type hint | Default executor |
122
+ |-----------|-----------------|
123
+ | planning | `maestro-plan` |
124
+ | execution | `maestro-execute` |
125
+ | testing | `quality-test` |
126
+ | review | `quality-review` |
127
+ | brainstorm | `maestro-brainstorm` |
128
+ | analysis | `maestro delegate --role analyze` |
129
+ | verify | `maestro-verify` |
130
+ | refactor | `quality-refactor` |
131
+ | debug | `quality-debug` |
201
132
 
202
- **Step 3.1** Load `nodes.json`.
133
+ Build `args_template` with variable placeholders. Context injection: planning-after-analysis → `--context {prev_output_path}`, execution-after-planning → `--resume-session {prev_session_id}`.
134
+ Write `nodes.json`. Display resolved node list.
203
135
 
204
- **Step 3.2** — Build sequential edges (N-001 → N-002 → ...). For parallel groups: fan-out/fan-in.
136
+ ### A_BUILD_DAG
205
137
 
206
- **Step 3.3** Auto-inject checkpoint nodes. Inject if ANY rule triggers:
138
+ 1. Build sequential edges (fan-out/fan-in for parallel groups)
139
+ 2. Auto-inject checkpoints:
207
140
 
208
141
  | Rule | Condition |
209
142
  |------|-----------|
210
- | Artifact boundary | Source output_ports: plan, spec, analysis, review-findings |
211
- | Execution gate | Target executor contains `execute` |
212
- | Agent spawn | Target type is `agent` |
143
+ | Artifact boundary | Source outputs plan/spec/analysis/review |
144
+ | Execution gate | Target contains `execute` |
213
145
  | Long-running | Target is maestro-plan, maestro-roadmap --mode full |
214
- | User-defined | Step had `type_hint: checkpoint` |
215
- | Post-testing | Source executor contains `test` or `auto-test` |
216
-
217
- Set `auto_continue: false` for checkpoints before user-facing deliverables.
218
-
219
- **Step 3.4** — Insert checkpoint edges (A → B becomes A → CP-X → B).
220
-
221
- **Step 3.5** — Finalize `context_schema` from all `{variable}` references.
222
-
223
- **Step 3.6** — Validate: no cycles, no orphans, all nodes reachable.
224
-
225
- **Step 3.7** — Write `dag.json`.
226
-
227
- → Proceed directly to Phase 4 (confirm is the pipeline visualization).
228
-
229
- ---
230
-
231
- ### Phase 4: Confirm — Visualize + User Approval
232
-
233
- **Step 4.1** — Render ASCII pipeline from `dag.json`:
234
- ```
235
- ============================================================
236
- COMPOSER — Pipeline Review
237
- ============================================================
238
- Pipeline: <template-name>
239
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
240
- N-001 [skill] maestro-plan "{goal}"
241
- |
242
- CP-01 [checkpoint] After Plan auto-continue
243
- |
244
- N-002 [skill] maestro-execute {phase}
245
- |
246
- CP-02 [checkpoint] Before Tests pause-for-user
247
- |
248
- N-003 [skill] quality-test {phase}
249
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
250
- Variables (required): goal
251
- Checkpoints: 2 (1 auto, 1 pause)
252
- Nodes: 3 work + 2 checkpoints
253
- ============================================================
254
- ```
255
-
256
- For parallel groups show fan-out/fan-in:
257
- ```
258
- N-003a [skill] quality-review ─┐
259
- ├─ N-004 [skill] quality-test
260
- N-003b [cli] cli analysis ─┘
261
- ```
262
-
263
- **Step 4.2** — AskUserQuestion:
264
- ```
265
- options:
266
- - "Confirm & Save" → Phase 5
267
- - "Edit a node" → select node ID, modify executor/args, re-render
268
- - "Add a node" → insert position + description, re-resolve + re-enrich, re-render
269
- - "Remove a node" → select node, re-wire edges, re-render
270
- - "Rename template" → new name
271
- - "Re-run checkpoint injection" → back to Phase 3.3
272
- - "Cancel" → save draft, output resume command
273
- ```
274
-
275
- **Step 4.3** — On edit: apply change, re-render, re-ask. Loop until Confirm or Cancel.
276
-
277
- **Step 4.4** — On Confirm: freeze dag.json, proceed to Phase 5. On Cancel: save draft, output `/maestro-composer --resume`.
278
-
279
- ---
280
-
281
- ### Phase 5: Persist — Assemble + Save Template
282
-
283
- **Read deferred**: `~/.maestro/templates/workflows/specs/template-schema.md` — load full JSON schema for template assembly.
284
-
285
- If the spec file does not exist, use the built-in template structure:
286
- ```json
287
- {
288
- "template_id": "wft-<slug>-<YYYYMMDD>",
289
- "name": "<name>", "description": "<desc>", "version": "1.0",
290
- "created_at": "<ISO>", "source_session": "WFD-<slug>-<date>",
291
- "tags": [], "context_schema": {},
292
- "nodes": [], "edges": [], "checkpoints": [],
293
- "execution_mode": "serial",
294
- "metadata": { "node_count": 0, "checkpoint_count": 0 }
295
- }
296
- ```
297
-
298
- **Step 5.1** — Load `intent.json` + `dag.json`.
299
-
300
- **Step 5.2** — Determine template name (from Phase 4 or derive from task_type + description). Slug = kebab-case. If file exists with different content, append `-v2`, `-v3`.
301
-
302
- **Step 5.3** — Assemble template JSON.
303
-
304
- **Step 5.4** — Ensure `~/.maestro/templates/workflows/` exists. Write `<slug>.json`.
305
-
306
- **Step 5.5** — Update `~/.maestro/templates/workflows/index.json`.
146
+ | Post-testing | Source contains `test` or `auto-test` |
147
+ | User-defined | type_hint == checkpoint |
307
148
 
308
- **Step 5.6** Output summary:
309
- ```
310
- ============================================================
311
- COMPOSER Template Saved
312
- ============================================================
313
- Path: ~/.maestro/templates/workflows/<slug>.json
314
- ID: wft-<slug>-<date>
315
- Nodes: <n> work + <n> checkpoints
316
- Variables: <required vars>
149
+ 3. Finalize context_schema from {variable} references
150
+ 4. Validate: no cycles, no orphans, all reachable
151
+ 5. Write `dag.json`
152
+ 6. Display ASCII pipeline visualization
317
153
 
318
- To execute:
319
- /maestro-player <slug> --context goal="<your goal>"
154
+ ### A_SAVE_TEMPLATE
320
155
 
321
- To edit later:
322
- /maestro-composer --edit ~/.maestro/templates/workflows/<slug>.json
156
+ Read deferred `template-schema.md` (fallback to built-in structure).
157
+ Assemble template JSON: template_id, name, nodes, edges, checkpoints, context_schema, execution_mode.
158
+ Write to `~/.maestro/templates/workflows/<slug>.json`. Update index.json.
159
+ Display: path, ID, node count, variables, execute/edit commands. Clean up draft dir.
323
160
 
324
- To list all templates:
325
- /maestro-player --list
326
- ============================================================
327
- ```
161
+ </actions>
328
162
 
329
- **Step 5.7** — Clean up design draft directory.
330
- </execution>
163
+ </state_machine>
331
164
 
332
165
  <error_codes>
333
- | Code | Severity | Description | Recovery |
334
- |------|----------|-------------|----------|
335
- | E001 | error | Empty description and no flags | AskUserQuestion for workflow description |
336
- | E002 | error | Step extraction found 0 steps | Ask user to rephrase with action verbs |
337
- | E003 | error | Node count exceeds max (20) | Suggest splitting into sub-workflows |
338
- | E004 | error | DAG cycle detected | Show cycle, ask user to resolve |
339
- | E005 | error | Resume session not found | Show available design drafts |
340
- | E006 | error | Edit template not found | Show available templates |
341
- | W001 | warning | Ambiguous step-to-executor mapping | Show candidates, let user choose |
342
- | W002 | warning | No checkpoint injection rules triggered | Warn user, offer to add manually |
343
- | W003 | warning | Deferred spec file not found | Use built-in fallback, continue |
166
+ | Code | Condition | Recovery |
167
+ |------|-----------|----------|
168
+ | E002 | 0 steps extracted | Ask user to rephrase with action verbs |
169
+ | E003 | Node count > 20 | Suggest splitting into sub-workflows |
170
+ | E005 | DAG cycle detected | Show cycle, ask user to resolve |
171
+ | E006 | Edit template not found (--edit) | Show available templates |
172
+ | W001 | Ambiguous step→executor mapping | Show candidates, let user choose |
344
173
  </error_codes>
345
174
 
346
175
  <success_criteria>
347
- - [ ] Intent parsed and confirmed by user (Phase 1 interactive gate)
348
- - [ ] Nodes resolved and confirmed by user (Phase 2 interactive gate)
349
- - [ ] DAG built with auto-injected checkpoints
350
- - [ ] Pipeline visualized and confirmed by user (Phase 4 interactive gate)
351
- - [ ] Template JSON written to `~/.maestro/templates/workflows/<slug>.json`
352
- - [ ] Template index updated at `~/.maestro/templates/workflows/index.json`
353
- - [ ] Deferred specs loaded only when phase needs them (not upfront)
176
+ - [ ] Each phase has interactive confirmation gate
177
+ - [ ] Template JSON written with nodes, edges, checkpoints, context_schema
178
+ - [ ] Index updated; deferred specs loaded only when phase needs them
354
179
  </success_criteria>
@@ -37,15 +37,11 @@ Scope routing, flags, resolution logic, output directory format, artifact regist
37
37
  1. **Codebase docs**: If `.workflow/codebase/doc-index.json` exists, read `ARCHITECTURE.md` for module boundaries. Pass as shared context to executor agents.
38
38
  2. **Wiki knowledge**: Run `maestro wiki search "<phase keywords>" --json 2>/dev/null`. If results found, extract top 5 entries as prior knowledge context for agents.
39
39
  3. **Coding specs + tools**: Run `maestro spec load --category coding` to load coding conventions AND discoverable knowhow tools (tool: true entries). Pass as specs context to all executor agents.
40
- 4. All are optional proceed without if unavailable (log warning).
40
+ 4. **UI specs (conditional)**: If any task involves frontend/UI work (task scope/description contains keywords like component, page, style, layout, CSS, HTML, frontend; or focus_paths in `src/components/`, `src/pages/`, `src/styles/`, `src/ui/`), also run `maestro spec load --category ui` and include in agent context.
41
+ 5. All are optional — proceed without if unavailable (log warning).
41
42
 
42
43
  ### Role Knowledge
43
- 1. Browse accumulated knowledge for this role:
44
- `maestro wiki list --category coding`
45
- 2. Analyze the index, identify entries relevant to the current task
46
- 3. Load selected documents:
47
- `maestro wiki load <id1> [id2] [id3...]`
48
- 4. Review loaded knowledge before proceeding
44
+ `maestro wiki list --category coding` select relevant → `maestro wiki load`
49
45
  </context>
50
46
 
51
47
  <execution>
@@ -61,18 +57,15 @@ Follow '~/.maestro/workflows/execute.md' completely.
61
57
 
62
58
  ### Post-task Knowledge Inquiry
63
59
 
64
- After each task completes, evaluate inquiry triggers:
60
+ After each task completion, check triggers:
65
61
 
66
- 1. **Execution deviation**: If task summary mentions approach change, dependency swap, or plan deviation:
67
- → Ask: "TASK-{NNN} deviated from the plan. Should this decision be recorded as an architecture constraint? (`/spec-add arch`)"
62
+ | Condition | Ask | Route |
63
+ |-----------|-----|-------|
64
+ | Summary mentions approach change / plan deviation | "Record as arch constraint?" | spec-add arch |
65
+ | retry_count >= 2 | "Document fix pattern?" | spec-add debug |
66
+ | Summary contains design rationale ("chose X because") | "Record as knowhow?" | spec-add learning |
68
67
 
69
- 2. **Retry success**: If task required ≥2 retries before completion:
70
- → Ask: "TASK-{NNN} succeeded after {N} retries. Should this fix pattern be documented? (`/spec-add debug`)"
71
-
72
- 3. **Implicit knowledge**: If task summary contains design rationale ("chose X because", "rejected Y due to"):
73
- → Ask: "Design decision detected. Should it be recorded as knowhow? (`/spec-add learning`)"
74
-
75
- If user confirms, invoke `Skill({ skill: "spec-add", args: "<category> <content>" })` with extracted content.
68
+ On confirm `Skill("spec-add", "<category> <content>")`.
76
69
 
77
70
  ### Issue Status Sync
78
71
 
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: maestro-impeccable
3
+ description: Production-grade UI design with knowhow accumulation — 24 commands + integrated design search for build, evaluate, refine, enhance, fix
4
+ argument-hint: "<command> [target] [--skip-harvest] [-y] | search <query> [-d <domain>] [--design-system]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Skill
13
+ - AskUserQuestion
14
+ ---
15
+ <purpose>
16
+ Replaces impeccable as the primary UI design entry point. 24 commands covering the full design lifecycle:
17
+ Build (craft, shape, teach, document, extract, explore), Evaluate (critique, audit), Refine (polish, bolder, quieter, distill, harden, onboard),
18
+ Enhance (animate, colorize, typeset, layout, delight, overdrive), Fix (clarify, adapt, optimize), Iterate (live).
19
+
20
+ Core innovation over impeccable: after each command execution, automatically harvests design decisions
21
+ into `.workflow/knowhow/` (DCS-, AST-, TIP-, REF-) for cross-session accumulation. Other maestro commands
22
+ consume this via `category: coding` auto-injection and keyword matching.
23
+
24
+ Includes integrated `search` CLI subcommand for querying the UI/UX design knowledge base
25
+ (BM25 search engine + 30+ CSV data files covering styles, colors, typography, UX guidelines, charts, stacks).
26
+ Search is invoked directly via `maestro impeccable search`, not through the Skill dispatch.
27
+ </purpose>
28
+
29
+ <deferred_reading>
30
+ - [impeccable harvest workflow](~/.maestro/workflows/impeccable.md) — read after command execution for harvest logic
31
+ </deferred_reading>
32
+
33
+ <context>
34
+ $ARGUMENTS — sub-command + target + optional flags.
35
+
36
+ **Sub-commands** (24):
37
+
38
+ | Category | Commands |
39
+ |----------|----------|
40
+ | Build | craft, shape, teach, document, extract, explore |
41
+ | Evaluate | critique, audit |
42
+ | Refine | polish, bolder, quieter, distill, harden, onboard |
43
+ | Enhance | animate, colorize, typeset, layout, delight, overdrive |
44
+ | Fix | clarify, adapt, optimize |
45
+ | Iterate | live |
46
+
47
+ **Flags:**
48
+ - `--skip-harvest` — Execute command without knowhow capture
49
+ - `-y` — Auto-confirm where the skill allows
50
+
51
+ **Harvest behavior**: After command completion, the harvest workflow extracts design decisions
52
+ and writes knowhow entries. DCS-/AST- types also get spec index entries for discoverability.
53
+ `live` command is exempt (too ephemeral). Use `--skip-harvest` to suppress.
54
+ </context>
55
+
56
+ <execution>
57
+
58
+ ## 1. Route
59
+
60
+ If first argument is `search` → direct CLI dispatch (no Skill, no harvest):
61
+
62
+ ```bash
63
+ maestro impeccable search "<query>" [options]
64
+ ```
65
+
66
+ Options: `-d <domain>`, `-s <stack>`, `-n <max>`, `--design-system`, `-p <name>`, `-f <fmt>`, `--persist`, `--page <page>`, `-o <dir>`
67
+
68
+ Domains: style, color, chart, landing, product, ux, typography, icons, react, web, google-fonts.
69
+ Stacks: react, nextjs, vue, svelte, astro, swiftui, react-native, flutter, html-tailwind, shadcn, + more.
70
+
71
+ Search uses `workflows/impeccable/ui-search/search.py` (BM25 engine + 30+ CSV knowledge files).
72
+ Output goes to stdout. No Skill invocation, no harvest. Return after output.
73
+
74
+ ## 2. Invoke Skill (all other sub-commands)
75
+
76
+ ```
77
+ Skill({ skill: "maestro-impeccable", args: "$ARGUMENTS" })
78
+ ```
79
+
80
+ The skill handles: context loading (spec load --category ui, with load-context fallback), register detection (brand/product),
81
+ reference file loading, and command execution.
82
+
83
+ ## 3. Harvest
84
+
85
+ After the skill completes, read `~/.maestro/workflows/impeccable.md` and follow the harvest workflow.
86
+
87
+ Skip harvest if:
88
+ - `--skip-harvest` flag is set
89
+ - Sub-command is `live` (interactive, no harvestable output)
90
+ - Sub-command is unrecognized
91
+
92
+ ## 4. Post-Execution Routing
93
+
94
+ After harvest (or skip), determine whether this command was invoked as part of a larger pipeline by checking conversation context (e.g., brainstorm Step 3.5, ui-craft chain step).
95
+
96
+ **Pipeline context detected** (called via Skill from brainstorm, ui-craft, etc.):
97
+ - Report command result (output, scores, artifacts produced) and **stop**
98
+ - Do NOT suggest next-step commands — the calling flow owns what happens next
99
+
100
+ **Standalone invocation** (user directly ran `/maestro-impeccable`):
101
+ - Show next-step suggestions based on what was executed:
102
+ - `teach` → suggest `explore` or `shape`
103
+ - `explore` → suggest `shape` → `craft`
104
+ - `shape` → suggest `craft`
105
+ - `craft` → suggest `critique`
106
+ - `critique`/`audit` → suggest commands from findings
107
+ - Enhancement/fix commands → suggest `critique` to re-evaluate
108
+
109
+ </execution>
110
+
111
+ <error_codes>
112
+ | Code | Severity | Description |
113
+ |------|----------|-------------|
114
+ | E001 | error | Invalid sub-command (not in 24 valid commands) |
115
+ | E002 | error | No intent or target specified |
116
+ | W001 | warning | Harvest failed — design knowledge not captured (command still succeeded) |
117
+ | W002 | warning | PRODUCT.md missing — skill will auto-trigger teach |
118
+ </error_codes>
119
+
120
+ <success_criteria>
121
+ - [ ] Sub-command recognized and routed to maestro-impeccable skill
122
+ - [ ] Skill executed with context (spec load --category ui or load-context fallback, register identified)
123
+ - [ ] Design changes applied to target files
124
+ - [ ] Knowhow entry created in .workflow/knowhow/ (unless --skip-harvest or live)
125
+ - [ ] Spec index entry created for DCS-/AST- types
126
+ </success_criteria>
@@ -31,6 +31,9 @@ Flags (`-m`, `--force`, `--dry-run`, `--no-cleanup`, `--continue`), merge sequen
31
31
  <execution>
32
32
  Follow '~/.maestro/workflows/merge.md' completely.
33
33
 
34
+ **Knowledge inquiry on completion:**
35
+ After successful merge, ask user once: "Record milestone learnings?" If yes, persist via `Skill("spec-add", "learning \"<title>\" \"<insight>\" --keywords <kw1>,<kw2>")`.
36
+
34
37
  **Next-step routing on completion:**
35
38
  - View dashboard → Skill({ skill: "manage-status" })
36
39
  - Audit milestone → Skill({ skill: "maestro-milestone-audit" })
@@ -47,12 +47,7 @@ Scope routing, base flags (`--collab`, `--spec`, `-y`, `--gaps`, `--dir`), outpu
47
47
  - Reads `conclusions.json` if available (implementation_scope seeds task generation)
48
48
 
49
49
  ### Role Knowledge
50
- 1. Browse accumulated knowledge for this role:
51
- `maestro wiki list --category arch`
52
- 2. Analyze the index, identify entries relevant to the current task
53
- 3. Load selected documents:
54
- `maestro wiki load <id1> [id2] [id3...]`
55
- 4. Review loaded knowledge before proceeding
50
+ `maestro wiki list --category arch` select relevant → `maestro wiki load`
56
51
  </context>
57
52
 
58
53
  <execution>