maestro-flow-one 0.2.6 → 0.2.8

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.
@@ -1,364 +0,0 @@
1
- ---
2
- name: maestro-ui-craft
3
- description: Chain maestro-impeccable commands with intelligent routing and quality gate loops for automated UI production
4
- argument-hint: "<intent|target> [--chain build|improve|enhance|harden|live] [--enhance <cmd>] [--threshold <score>] [--max-loops <n>] [-y] [-c]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Bash
10
- - Glob
11
- - Grep
12
- - Agent
13
- - Skill
14
- - AskUserQuestion
15
- - TodoWrite
16
- ---
17
- <purpose>
18
- Orchestrate maestro-impeccable skill commands via intelligent intent routing + quality gate auto-iteration.
19
- Chain: Build → Evaluate → Auto-Refine → Re-evaluate → Verify.
20
-
21
- Core innovation: critique/audit scores drive automatic command selection and iteration loops.
22
- Impeccable has 23 commands across 6 categories — this command chains them into automated pipelines
23
- with quality gates that loop until design quality meets the threshold.
24
-
25
- Prerequisite: maestro-impeccable skill available (auto-discovered by harness).
26
-
27
- Session: `.workflow/.maestro/ui-craft-{YYYYMMDD-HHmmss}/status.json`
28
- </purpose>
29
-
30
- <invariants>
31
- 1. **Session before execution** — status.json created before any chain step runs
32
- 2. **All steps via Skill** — every impeccable command dispatched through `Skill({ skill: "maestro-impeccable" })`
33
- 3. **Gate scores drive loops** — refine loop auto-selects commands from P0/P1 findings, never from hardcoded lists
34
- 4. **Interactive gates respected** — teach, shape, craft retain their user gates; never suppress
35
- </invariants>
36
-
37
- <context>
38
- $ARGUMENTS — intent description or target path, with optional flags.
39
-
40
- **Keywords:** `continue`/`next` → resume previous session
41
-
42
- **Flags:**
43
- - `--chain <type>` — Force chain type: build, improve, enhance, harden, live
44
- - `--enhance <cmd>` — Specific enhance command for enhance chain (animate|colorize|typeset|layout|delight|overdrive|bolder)
45
- - `--threshold <score>` — Critique pass threshold (default: 26/40). Audit threshold auto-computed as threshold×0.5
46
- - `--max-loops <n>` — Maximum quality gate iterations (default: 3)
47
- - `-c` / `--continue` — Resume previous ui-craft session
48
- - `-y` — Auto mode: auto-select at ambiguous routing, skip confirmations where impeccable allows
49
- </context>
50
-
51
- <chains>
52
-
53
- ### Chain Definitions
54
-
55
- | Chain | Sequence | Gate Condition |
56
- |-------|----------|----------------|
57
- | **build** | teach? → shape → craft → **critique** → [refine loop] → audit → polish | critique ≥ threshold AND P0 == 0 |
58
- | **improve** | **critique** → [refine loop] → polish → audit | critique ≥ threshold AND P0 == 0 |
59
- | **enhance** | {cmd} → **critique** → polish (if needed) | critique ≥ threshold |
60
- | **harden** | harden → **audit** → polish | audit ≥ threshold×0.5 |
61
- | **live** | live | — (interactive, no gate) |
62
-
63
- - `teach?` — conditional: only if PRODUCT.md missing/placeholder
64
- - `[refine loop]` — quality gate loop: extract suggested commands from critique → execute → re-critique
65
-
66
- ### Intent → Chain Routing
67
-
68
- | Intent Pattern | Chain |
69
- |---------------|-------|
70
- | 新建, create, build, new, 从零, landing, feature, page | build |
71
- | 改进, improve, fix, 优化, iterate, better, 迭代 | improve |
72
- | 动画, 颜色, 排版, animate, color, type, bold, delight, enhance | enhance |
73
- | 生产, production, harden, 上线, ship, edge case, i18n | harden |
74
- | 实时, live, browser, 浏览器, variant | live |
75
-
76
- Explicit `--chain` overrides routing. Ambiguous + no `-y` → AskUserQuestion.
77
-
78
- </chains>
79
-
80
- <state_machine>
81
-
82
- <states>
83
- S_PARSE — 解析参数、意图分类、chain 选择 PERSIST: —
84
- S_RESUME — 扫描已有 ui-craft session、恢复执行 PERSIST: —
85
- S_SETUP — 加载 context、检查 PRODUCT.md PERSIST: —
86
- S_CREATE — 创建 session + status.json PERSIST: session (全量)
87
- S_CHAIN — 按序执行 chain 步骤 PERSIST: step progress, executed commands
88
- S_GATE — 质量门控:解析评分、决策 PERSIST: scores, loop count
89
- S_REFINE — 执行自动选取的 refine 命令 PERSIST: refine commands, loop state
90
- S_REPORT — 最终报告 + 趋势 PERSIST: final scores, status
91
- </states>
92
-
93
- <transitions>
94
-
95
- S_PARSE:
96
- → S_RESUME WHEN: -c / --continue flag OR keyword "continue"/"next"
97
- → S_SETUP WHEN: chain selected (explicit or routed)
98
- → S_PARSE WHEN: ambiguous AND not -y DO: AskUserQuestion
99
- → END WHEN: no intent AND no target → E002
100
-
101
- S_RESUME:
102
- → S_CHAIN WHEN: session found DO: A_LOCATE_SESSION
103
- → S_FALLBACK WHEN: no session found → E005
104
-
105
- S_SETUP:
106
- → S_CREATE DO: A_LOAD_CONTEXT
107
-
108
- S_CREATE:
109
- → S_CHAIN DO: A_CREATE_SESSION
110
-
111
- S_CHAIN:
112
- → S_GATE WHEN: current step is gate command (critique/audit)
113
- → S_CHAIN WHEN: step is normal command → execute → advance
114
- → S_REPORT WHEN: all steps complete
115
-
116
- S_GATE:
117
- → S_CHAIN WHEN: PASS (score ≥ threshold AND P0 == 0) → advance to next step
118
- → S_REFINE WHEN: FAIL (score < threshold OR P0 > 0)
119
- → S_CHAIN WHEN: max loops exceeded → W002 → force advance
120
-
121
- S_REFINE:
122
- → S_GATE DO: execute auto-selected commands → re-run gate command
123
- GUARD: loop_count < max_loops
124
-
125
- S_REPORT:
126
- → END DO: A_FINAL_REPORT
127
-
128
- </transitions>
129
-
130
- <actions>
131
-
132
- ### A_LOCATE_SESSION
133
-
134
- 1. Scan `.workflow/.maestro/ui-craft-*/status.json`, filter `status == "running"`, sort DESC
135
- 2. Take most recent; load into context as current session
136
- 3. Resume from `current_step` position
137
-
138
- ### A_LOAD_CONTEXT
139
-
140
- 1. Trigger impeccable context loading by invoking: `Skill({ skill: "maestro-impeccable", args: "teach" })`
141
- - Impeccable's own setup will auto-discover and load PRODUCT.md / DESIGN.md
142
- - If PRODUCT.md missing/placeholder, impeccable teach handles the interview
143
- 2. If teach was not in the chain but PRODUCT.md is missing:
144
- - Prepend `teach` to chain start
145
- - Announce: W001
146
- 3. Context is now in conversation for subsequent commands
147
-
148
- ### A_CREATE_SESSION
149
-
150
- 1. Read `.workflow/state.json` for project context (phase, milestone)
151
- 2. Create `.workflow/.maestro/ui-craft-{YYYYMMDD-HHmmss}/status.json`:
152
- ```json
153
- { "session_id": "ui-craft-{ts}", "source": "ui-craft", "intent": "...",
154
- "chain_type": "build|improve|enhance|harden|live", "target": "...",
155
- "auto_mode": false, "threshold": 26, "max_loops": 3,
156
- "steps": [{ "index": 0, "command": "shape", "status": "pending" }],
157
- "gate_history": [], "loop_count": 0,
158
- "current_step": 0, "status": "running",
159
- "created_at": "ISO-8601", "updated_at": "ISO-8601" }
160
- ```
161
- 3. Write status.json before executing any step
162
-
163
- ### A_FINAL_REPORT
164
-
165
- 1. Read critique trend if available (impeccable's critique persists snapshots automatically)
166
- 2. Update status.json with `status: "completed"` and final scores
167
- 3. Present summary table with scores, iterations, commands executed
168
-
169
- </actions>
170
-
171
- </state_machine>
172
-
173
- <execution>
174
-
175
- ## 1. Parse & Route
176
-
177
- 1. If `-c` / `--continue` or keyword "continue"/"next" → S_RESUME
178
- 2. If `--chain` present → use directly
179
- 3. Otherwise → match $ARGUMENTS against intent patterns
180
- 4. If `--enhance` present → chain = enhance, cmd = --enhance value
181
- 5. For enhance chain without `--enhance` → infer from intent ("动画" → animate, "颜色" → colorize, etc.)
182
- 6. Ambiguous + no `-y` → ask user to pick chain
183
-
184
- Create TodoWrite with chain steps.
185
-
186
- ## 2. Setup Context
187
-
188
- 1. If chain starts with `teach` → execute it first, impeccable handles context loading internally
189
- 2. Otherwise → invoke `Skill({ skill: "maestro-impeccable" })` with no args to trigger setup (context + register)
190
- 3. If impeccable reports PRODUCT.md missing → prepend teach, execute, then resume
191
-
192
- ## 3. Create Session
193
-
194
- Write `.workflow/.maestro/ui-craft-{ts}/status.json` with chain steps before any execution.
195
-
196
- ## 4. Execute Chain
197
-
198
- For each step in chain, sequentially:
199
-
200
- ```
201
- ▸ Step {n}/{total}: /maestro-impeccable {command} {target}
202
- ```
203
-
204
- Execute via: `Skill({ skill: "maestro-impeccable", args: "{command} {target}" })`
205
-
206
- After each step: update status.json `current_step` and step `status`.
207
-
208
- **Rules:**
209
- - `teach`, `shape`, `craft` are interactive — do NOT suppress their user gates
210
- - After `teach` completes → re-run context loader for fresh PRODUCT.md
211
- - After `craft` completes → the build exists, ready for evaluation
212
- - Gate steps (critique/audit) → transition to quality gate logic
213
-
214
- ## 5. Quality Gate
215
-
216
- When chain reaches a gate step (critique or audit):
217
-
218
- ### 5a. Execute Gate Command
219
-
220
- ```
221
- Skill({ skill: "maestro-impeccable", args: "critique {target}" })
222
- ```
223
- or
224
- ```
225
- Skill({ skill: "maestro-impeccable", args: "audit {target}" })
226
- ```
227
-
228
- ### 5b. Parse Score
229
-
230
- From critique output, extract:
231
- - **score**: Nielsen's total (N/40) — from "**Total** | | **N/40**" row
232
- - **P0_count**: count of `[P0]` tagged findings
233
- - **P1_count**: count of `[P1]` tagged findings
234
- - **suggested_commands**: list of "/maestro-impeccable <cmd>" from "Suggested command" fields
235
-
236
- From audit output, extract:
237
- - **score**: dimension total (N/20) — from "**Total** | | **N/20**" row
238
- - **P0_count**: count of `[P0]` findings
239
-
240
- ### 5c. Evaluate
241
-
242
- ```
243
- critique_pass = (score >= threshold) AND (P0_count == 0)
244
- audit_pass = (score >= threshold * 0.5) AND (P0_count == 0)
245
- ```
246
-
247
- ### 5d. On PASS
248
-
249
- ```
250
- ✓ Gate passed: {score}/{max} (P0: 0)
251
- ```
252
- → advance to next chain step
253
-
254
- ### 5e. On FAIL
255
-
256
- ```
257
- ⟳ Loop {n}/{max_loops}: {score}/{max}, P0={count}
258
- Running: {command_list}
259
- ```
260
-
261
- 1. Collect suggested commands from P0/P1 findings
262
- 2. If no suggestions found → use fallback mapping (see quality_gate_routing)
263
- 3. De-duplicate, cap at 3 commands per iteration
264
- 4. Sort: P0-suggested first
265
- 5. Execute each: `Skill({ skill: "maestro-impeccable", args: "{cmd} {target}" })`
266
- - Pass issue context: the specific findings that triggered this command are already in conversation
267
- 6. Re-run gate command (critique/audit)
268
- 7. Increment loop_count
269
- 8. Append to status.json `gate_history`
270
-
271
- ### 5f. On Max Loops Exceeded
272
-
273
- ```
274
- ⚠ Max iterations ({max_loops}) reached. Score: {score}/{max}, P0: {count}
275
- Continuing chain with remaining issues.
276
- ```
277
- → force advance to next chain step
278
-
279
- ## 6. Final Report
280
-
281
- ```
282
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
283
- Chain complete: {chain_type}
284
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
285
-
286
- Critique : {score}/40 (trend: {trend_line})
287
- Audit : {score}/20
288
- Loops : {total_iterations}
289
- Commands : {executed_command_list}
290
-
291
- Status : {PASS | PARTIAL — N issues remain}
292
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
293
- ```
294
-
295
- Update status.json: `status: "completed"`, `final_scores`, `completed_at`.
296
-
297
- If issues remain → suggest: "Run `/maestro-ui-craft --chain improve {target}` to continue iteration."
298
-
299
- </execution>
300
-
301
- <quality_gate_routing>
302
-
303
- ### Finding → Command Fallback Mapping
304
-
305
- When critique/audit findings lack explicit "Suggested command", map by category:
306
-
307
- | Finding Category | Command |
308
- |-----------------|---------|
309
- | Visual hierarchy, layout, spacing, alignment | layout |
310
- | Color, contrast, palette, monochromatic | colorize |
311
- | Typography, font, readability, hierarchy | typeset |
312
- | Animation, motion, transitions, micro-interaction | animate |
313
- | Copy, labels, error messages, UX writing | clarify |
314
- | Responsive, mobile, breakpoints, touch targets | adapt |
315
- | Performance, loading, speed, bundle, jank | optimize |
316
- | Complexity, overload, clutter, cognitive load | distill |
317
- | Bland, safe, generic, lacks personality | bolder |
318
- | Aggressive, overwhelming, loud, overstimulating | quieter |
319
- | Onboarding, empty state, first-run, activation | onboard |
320
- | Edge cases, i18n, error handling, overflow | harden |
321
- | Personality, memorability, joy, delight | delight |
322
-
323
- ### Commands Never Auto-Selected
324
-
325
- These are structural/interactive — never picked by the refine loop:
326
-
327
- | Command | Reason |
328
- |---------|--------|
329
- | teach | Project setup (run in S_SETUP only) |
330
- | shape | Requires user interview |
331
- | craft | Full build with multiple gates |
332
- | live | Interactive browser mode |
333
- | document | Generates DESIGN.md (setup) |
334
- | extract | Design system extraction (setup) |
335
- | overdrive | Requires explicit user vision |
336
- | critique | Gate command, not a fix |
337
- | audit | Gate command, not a fix |
338
-
339
- </quality_gate_routing>
340
-
341
- <error_codes>
342
- | Code | Severity | Description |
343
- |------|----------|-------------|
344
- | E001 | error | Impeccable skill not found in project |
345
- | E002 | error | No intent or target specified |
346
- | E003 | error | Invalid --chain type |
347
- | E004 | error | Invalid --enhance command |
348
- | E005 | error | Resume session not found |
349
- | W001 | warning | PRODUCT.md missing, prepending teach to chain |
350
- | W002 | warning | Max quality gate loops exceeded, forcing continue |
351
- | W003 | warning | Could not parse score from critique/audit output |
352
- </error_codes>
353
-
354
- <success_criteria>
355
- - [ ] Intent classified and chain type selected
356
- - [ ] Context loaded (PRODUCT.md present or taught)
357
- - [ ] Session dir created with status.json before execution
358
- - [ ] All chain steps executed via Skill("maestro-impeccable", ...)
359
- - [ ] Quality gate evaluated with parsed scores
360
- - [ ] Refine loop executed when gate failed (if applicable)
361
- - [ ] Gate history and scores persisted to status.json
362
- - [ ] Final report with scores and trend presented
363
- - [ ] Progress tracked via TodoWrite throughout
364
- </success_criteria>
@@ -1,104 +0,0 @@
1
- ---
2
- name: maestro-ui-design
3
- description: Generate UI design prototypes, select and solidify as code
4
- argument-hint: "<phase|topic> [--styles N] [--stack <stack>] [--targets <pages>] [--layouts N] [--refine] [--persist] [--full] [-y]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Bash
10
- - Glob
11
- - Grep
12
- - Agent
13
- - AskUserQuestion
14
- ---
15
- <purpose>
16
- Generate UI design prototypes for a phase or topic. Two workflow paths, auto-selected by skill availability:
17
-
18
- 1. **Primary (ui-style.md):** Delegates design to ui-ux-pro-max skill. Generates multiple style variants via `--design-system`, user selects, solidifies as code reference. Lightweight and fast.
19
- 2. **Fallback (ui-design.md):** Self-contained 4-layer pipeline (style → animation → layout → assembly) with 6D attribute space, OKLCH tokens, layout templates, and full prototype matrix. Used when ui-ux-pro-max is unavailable or `--full` is requested.
20
-
21
- Both paths produce the same output contract: MASTER.md + design-tokens.json + animation-tokens.json + selection.json for downstream plan/execute consumption.
22
-
23
- Position in pipeline: analyze -> **ui-design** -> plan -> execute -> verify
24
- </purpose>
25
-
26
- <deferred_reading>
27
- - [ui-style.md](~/.maestro/workflows/ui-style.md) — read when SKILL_PATH found (primary path)
28
- - [ui-design.md](~/.maestro/workflows/ui-design.md) — read when SKILL_PATH empty or --full (fallback path)
29
- - [index.json](~/.maestro/templates/index.json) — read when updating phase metadata
30
- - [scratch-index.json](~/.maestro/templates/scratch-index.json) — read when operating in scratch mode
31
- </deferred_reading>
32
-
33
- <context>
34
- $ARGUMENTS — phase number for phase mode, topic text for scratch mode, with optional flags.
35
-
36
- Flags, workflow routing, scope modes, and output artifacts defined in the routed workflow (ui-style.md or ui-design.md).
37
-
38
- **Phase mode** (number): resolves phase directory, reads context.md/brainstorm for requirements.
39
- **Scratch mode** (text): creates `.workflow/scratch/{YYYYMMDD}-ui-design-{slug}/` for standalone exploration.
40
- </context>
41
-
42
- <execution>
43
- ## 1. Load UI Specs
44
-
45
- Load project UI conventions before generating designs:
46
-
47
- ```bash
48
- maestro spec load --category ui
49
- ```
50
-
51
- If specs not initialized, continue without — the workflow still produces valid output.
52
-
53
- ## 2. Workflow Routing
54
-
55
- Detect ui-ux-pro-max skill availability and route to the appropriate workflow:
56
-
57
- - **`--full` flag present** → Follow '~/.maestro/workflows/ui-design.md' completely (forced full pipeline)
58
- - **ui-ux-pro-max found** → Follow '~/.maestro/workflows/ui-style.md' completely (lightweight delegation)
59
- - **ui-ux-pro-max not found** → Follow '~/.maestro/workflows/ui-design.md' completely (self-contained fallback)
60
-
61
- Skill detection logic, report format, and complete pipeline steps defined in the routed workflow file.
62
-
63
- **Next-step routing on completion:**
64
- - Plan with design reference → /maestro-plan {phase}
65
- - Refine selected design → /maestro-ui-design {phase} --refine
66
- - Analyze before planning → /maestro-analyze {phase}
67
- </execution>
68
-
69
- <error_codes>
70
- | Code | Severity | Description | Stage |
71
- |------|----------|-------------|-------|
72
- | E001 | error | Phase or topic argument required | parse_input |
73
- | E002 | error | Phase directory not found | parse_input |
74
- | E003 | error | Python not available (both paths need Python for ui-ux-pro-max or agent fallback) | setup |
75
- | E004 | error | --refine requires existing design-ref/ | parse_input |
76
- | W001 | warning | Design system generation returned partial results | generate |
77
- | W002 | warning | Prototype rendering failed for one variant | render |
78
- | W003 | warning | No context.md found, using phase goal only | context |
79
- | W004 | warning | ui-ux-pro-max not found, falling back to full pipeline | routing |
80
- </error_codes>
81
-
82
- <success_criteria>
83
- **Both paths (common):**
84
- - [ ] UI specs loaded via `spec load --category ui` (if available)
85
- - [ ] Requirements extracted from phase context (context.md, brainstorm, spec, or user input)
86
- - [ ] N style variants generated with contrasting design directions
87
- - [ ] User selected preferred variant (or auto-selected in -y mode)
88
- - [ ] MASTER.md written with complete design system specification
89
- - [ ] design-tokens.json written with production-ready tokens (OKLCH colors, component_styles)
90
- - [ ] animation-tokens.json written (duration, easing, transitions, keyframes)
91
- - [ ] selection.json recorded with choice metadata
92
- - [ ] index.json updated with design_ref status
93
-
94
- **ui-style.md path (primary):**
95
- - [ ] ui-ux-pro-max --design-system called with product/industry/style keywords
96
- - [ ] Tokens extracted from ui-ux-pro-max output into structured JSON
97
-
98
- **ui-design.md path (--full or fallback):**
99
- - [ ] 6D attribute space used for maximum contrast between variants
100
- - [ ] Layout templates generated per target (dom_structure + css_layout_rules)
101
- - [ ] HTML prototypes assembled: styles x layouts x targets
102
- - [ ] compare.html generated as interactive matrix viewer
103
- </success_criteria>
104
- </output>