maestro-flow 0.3.48 → 0.4.1

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 (93) hide show
  1. package/.claude/agents/impeccable-agent.md +99 -0
  2. package/.claude/commands/maestro-analyze.md +2 -2
  3. package/.claude/commands/maestro-brainstorm.md +116 -112
  4. package/.claude/commands/maestro-composer.md +5 -0
  5. package/.claude/commands/maestro-impeccable.md +231 -74
  6. package/.claude/commands/maestro-merge.md +3 -0
  7. package/.claude/commands/maestro-roadmap.md +5 -1
  8. package/.claude/commands/maestro.md +3 -3
  9. package/.claude/commands/manage-issue-discover.md +4 -0
  10. package/.claude/commands/quality-refactor.md +3 -0
  11. package/.claude/skills/maestro-help/index/catalog.json +1 -1
  12. package/.claude/skills/maestro-help/phases/01-parse-intent.md +1 -1
  13. package/.codex/skills/maestro/SKILL.md +70 -28
  14. package/.codex/skills/maestro-brainstorm/SKILL.md +19 -2
  15. package/.codex/skills/maestro-composer/SKILL.md +5 -0
  16. package/.codex/skills/maestro-help/catalog.json +1 -1
  17. package/.codex/skills/maestro-impeccable/SKILL.md +230 -97
  18. package/.codex/skills/maestro-merge/SKILL.md +3 -0
  19. package/.codex/skills/maestro-milestone-audit/SKILL.md +64 -7
  20. package/.codex/skills/maestro-quick/SKILL.md +1 -1
  21. package/.codex/skills/maestro-roadmap/SKILL.md +1 -1
  22. package/.codex/skills/maestro-tools-execute/SKILL.md +1 -1
  23. package/.codex/skills/maestro-tools-register/SKILL.md +1 -1
  24. package/.codex/skills/quality-refactor/SKILL.md +114 -22
  25. package/chains/_intent-map.json +1 -1
  26. package/chains/singles/ui-design.json +4 -4
  27. package/chains/{ui-design-driven.json → ui-craft-build.json} +8 -8
  28. package/dashboard/dist-server/dashboard/src/server/coordinator/chain-map.js +3 -3
  29. package/dashboard/dist-server/dashboard/src/server/coordinator/chain-map.js.map +1 -1
  30. package/dist/src/commands/delegate.d.ts.map +1 -1
  31. package/dist/src/commands/delegate.js +12 -7
  32. package/dist/src/commands/delegate.js.map +1 -1
  33. package/dist/src/commands/impeccable.d.ts +2 -1
  34. package/dist/src/commands/impeccable.d.ts.map +1 -1
  35. package/dist/src/commands/impeccable.js +80 -1
  36. package/dist/src/commands/impeccable.js.map +1 -1
  37. package/package.json +1 -1
  38. package/templates/planning-roles/ui-designer.md +86 -99
  39. package/templates/workflows/specs/node-catalog.md +1 -1
  40. package/workflows/brainstorm.md +26 -0
  41. package/workflows/cli-tools-usage.md +9 -26
  42. package/workflows/delegate-usage.md +301 -343
  43. package/workflows/impeccable/design.md +462 -0
  44. package/workflows/impeccable/explore.md +157 -0
  45. package/workflows/impeccable/shape.md +4 -0
  46. package/workflows/impeccable/ui-search/__pycache__/core.cpython-313.pyc +0 -0
  47. package/workflows/impeccable/ui-search/__pycache__/design_system.cpython-313.pyc +0 -0
  48. package/workflows/impeccable/ui-search/core.py +262 -0
  49. package/workflows/impeccable/ui-search/data/app-interface.csv +31 -0
  50. package/workflows/impeccable/ui-search/data/charts.csv +26 -0
  51. package/workflows/impeccable/ui-search/data/colors.csv +162 -0
  52. package/workflows/impeccable/ui-search/data/design.csv +1776 -0
  53. package/workflows/impeccable/ui-search/data/draft.csv +1779 -0
  54. package/workflows/impeccable/ui-search/data/google-fonts.csv +1924 -0
  55. package/workflows/impeccable/ui-search/data/icons.csv +106 -0
  56. package/workflows/impeccable/ui-search/data/landing.csv +35 -0
  57. package/workflows/impeccable/ui-search/data/products.csv +162 -0
  58. package/workflows/impeccable/ui-search/data/react-performance.csv +45 -0
  59. package/workflows/impeccable/ui-search/data/stacks/angular.csv +51 -0
  60. package/workflows/impeccable/ui-search/data/stacks/astro.csv +54 -0
  61. package/workflows/impeccable/ui-search/data/stacks/flutter.csv +53 -0
  62. package/workflows/impeccable/ui-search/data/stacks/html-tailwind.csv +56 -0
  63. package/workflows/impeccable/ui-search/data/stacks/jetpack-compose.csv +53 -0
  64. package/workflows/impeccable/ui-search/data/stacks/laravel.csv +51 -0
  65. package/workflows/impeccable/ui-search/data/stacks/nextjs.csv +53 -0
  66. package/workflows/impeccable/ui-search/data/stacks/nuxt-ui.csv +51 -0
  67. package/workflows/impeccable/ui-search/data/stacks/nuxtjs.csv +59 -0
  68. package/workflows/impeccable/ui-search/data/stacks/react-native.csv +52 -0
  69. package/workflows/impeccable/ui-search/data/stacks/react.csv +54 -0
  70. package/workflows/impeccable/ui-search/data/stacks/shadcn.csv +61 -0
  71. package/workflows/impeccable/ui-search/data/stacks/svelte.csv +54 -0
  72. package/workflows/impeccable/ui-search/data/stacks/swiftui.csv +51 -0
  73. package/workflows/impeccable/ui-search/data/stacks/threejs.csv +54 -0
  74. package/workflows/impeccable/ui-search/data/stacks/vue.csv +50 -0
  75. package/workflows/impeccable/ui-search/data/styles.csv +85 -0
  76. package/workflows/impeccable/ui-search/data/typography.csv +74 -0
  77. package/workflows/impeccable/ui-search/data/ui-reasoning.csv +162 -0
  78. package/workflows/impeccable/ui-search/data/ux-guidelines.csv +100 -0
  79. package/workflows/impeccable/ui-search/design_system.py +1148 -0
  80. package/workflows/impeccable/ui-search/prototype-template.html +511 -0
  81. package/workflows/impeccable/ui-search/render-prototype.js +208 -0
  82. package/workflows/impeccable/ui-search/search.py +114 -0
  83. package/workflows/maestro-chain-execute.md +2 -2
  84. package/workflows/maestro.codex.md +3 -3
  85. package/workflows/maestro.md +107 -117
  86. package/workflows/plan.md +1 -1
  87. package/workflows/ui-design.md +1 -1
  88. package/workflows/ui-style.md +1 -1
  89. package/.claude/commands/maestro-ui-craft.md +0 -364
  90. package/.claude/commands/maestro-ui-design.md +0 -104
  91. package/.claude/skills/maestro-impeccable/SKILL.md +0 -169
  92. package/.codex/skills/maestro-ui-craft/SKILL.md +0 -341
  93. package/.codex/skills/maestro-ui-design/SKILL.md +0 -242
@@ -1,341 +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: Read, Write, Edit, Bash, Glob, Grep, Agent, request_user_input
6
- ---
7
- <purpose>
8
- Orchestrate maestro-impeccable skill commands via intelligent intent routing + quality gate auto-iteration.
9
- Chain: Build → Evaluate → Auto-Refine → Re-evaluate → Verify.
10
-
11
- Core innovation: critique/audit scores drive automatic command selection and iteration loops.
12
- maestro-impeccable has 23 commands across 6 categories -- this command chains them into automated pipelines
13
- with quality gates that loop until design quality meets the threshold.
14
-
15
- Prerequisite: maestro-impeccable skill available (auto-discovered by harness).
16
-
17
- Session: `.workflow/.maestro/ui-craft-{YYYYMMDD-HHmmss}/status.json`
18
- </purpose>
19
-
20
- <invariants>
21
- 1. **Session before execution** -- status.json created before any chain step runs
22
- 2. **All steps via Skill** -- every impeccable command dispatched through `$maestro-impeccable`
23
- 3. **Gate scores drive loops** -- refine loop auto-selects commands from P0/P1 findings, never from hardcoded lists
24
- 4. **Interactive gates respected** -- teach, shape, craft retain their user gates; never suppress
25
- </invariants>
26
-
27
- <context>
28
- $ARGUMENTS -- intent description or target path, with optional flags.
29
-
30
- **Keywords:** `continue`/`next` → resume previous session
31
-
32
- **Usage:**
33
-
34
- ```bash
35
- $maestro-ui-craft "create a landing page"
36
- $maestro-ui-craft "improve the dashboard" --chain improve
37
- $maestro-ui-craft "add animations" --chain enhance --enhance animate
38
- $maestro-ui-craft "production ready" --chain harden
39
- $maestro-ui-craft -c # resume previous session
40
- $maestro-ui-craft -y "create pricing page --chain build"
41
- ```
42
-
43
- **Flags:**
44
- - `--chain <type>` -- Force chain type: build, improve, enhance, harden, live
45
- - `--enhance <cmd>` -- Specific enhance command (animate|colorize|typeset|layout|delight|overdrive|bolder)
46
- - `--threshold <score>` -- Critique pass threshold (default: 26/40). Audit threshold auto-computed as threshold*0.5
47
- - `--max-loops <n>` -- Maximum quality gate iterations (default: 3)
48
- - `-c` / `--continue` -- Resume previous ui-craft session
49
- - `-y` -- Auto mode: auto-select at ambiguous routing, skip confirmations where maestro-impeccable allows
50
- </context>
51
-
52
- <chains>
53
-
54
- ### Chain Definitions
55
-
56
- | Chain | Sequence | Gate Condition |
57
- |-------|----------|----------------|
58
- | **build** | teach? → shape → craft → **critique** → [refine loop] → audit → polish | critique >= threshold AND P0 == 0 |
59
- | **improve** | **critique** → [refine loop] → polish → audit | critique >= threshold AND P0 == 0 |
60
- | **enhance** | {cmd} → **critique** → polish (if needed) | critique >= threshold |
61
- | **harden** | harden → **audit** → polish | audit >= threshold*0.5 |
62
- | **live** | live | -- (interactive, no gate) |
63
-
64
- - `teach?` -- conditional: only if PRODUCT.md missing/placeholder
65
- - `[refine loop]` -- quality gate loop: extract suggested commands from critique → execute → re-critique
66
-
67
- ### Intent → Chain Routing
68
-
69
- | Intent Pattern | Chain |
70
- |---------------|-------|
71
- | create, build, new, landing, feature, page | build |
72
- | improve, fix, iterate, better, optimize | improve |
73
- | animate, color, type, bold, delight, enhance | enhance |
74
- | production, harden, ship, edge case, i18n | harden |
75
- | live, browser, variant | live |
76
-
77
- Explicit `--chain` overrides routing. Ambiguous + no `-y` → `request_user_input`.
78
-
79
- </chains>
80
-
81
- <state_machine>
82
-
83
- <states>
84
- S_PARSE -- parse args, intent classification, chain selection PERSIST: --
85
- S_RESUME -- scan existing ui-craft sessions, resume execution PERSIST: --
86
- S_SETUP -- load context, check PRODUCT.md PERSIST: --
87
- S_CREATE -- create session + status.json PERSIST: session (full)
88
- S_CHAIN -- execute chain steps in sequence PERSIST: step progress, executed commands
89
- S_GATE -- quality gate: parse scores, decide PERSIST: scores, loop count
90
- S_REFINE -- execute auto-selected refine commands PERSIST: refine commands, loop state
91
- S_REPORT -- final report + trend PERSIST: final scores, status
92
- </states>
93
-
94
- <transitions>
95
-
96
- S_PARSE:
97
- → S_RESUME WHEN: -c / --continue flag OR keyword "continue"/"next"
98
- → S_SETUP WHEN: chain selected (explicit or routed)
99
- → S_PARSE WHEN: ambiguous AND not -y DO: request_user_input
100
- → END WHEN: no intent AND no target → E002
101
-
102
- S_RESUME:
103
- → S_CHAIN WHEN: session found DO: A_LOCATE_SESSION
104
- → END WHEN: no session found → E005
105
-
106
- S_SETUP:
107
- → S_CREATE DO: A_LOAD_CONTEXT
108
-
109
- S_CREATE:
110
- → S_CHAIN DO: A_CREATE_SESSION
111
-
112
- S_CHAIN:
113
- → S_GATE WHEN: current step is gate command (critique/audit)
114
- → S_CHAIN WHEN: step is normal command → execute → advance
115
- → S_REPORT WHEN: all steps complete
116
-
117
- S_GATE:
118
- → S_CHAIN WHEN: PASS (score >= threshold AND P0 == 0) → advance
119
- → S_REFINE WHEN: FAIL (score < threshold OR P0 > 0)
120
- → S_CHAIN WHEN: max loops exceeded → W002 → force advance
121
-
122
- S_REFINE:
123
- → S_GATE DO: execute auto-selected commands → re-run gate command
124
- GUARD: loop_count < max_loops
125
-
126
- S_REPORT:
127
- → END DO: A_FINAL_REPORT
128
-
129
- </transitions>
130
-
131
- <actions>
132
-
133
- ### A_LOCATE_SESSION
134
-
135
- 1. Scan `.workflow/.maestro/ui-craft-*/status.json`, filter `status == "running"`, sort DESC
136
- 2. Take most recent; load into context as current session
137
- 3. Resume from `current_step` position
138
-
139
- ### A_LOAD_CONTEXT
140
-
141
- 1. Trigger impeccable context loading: `$maestro-impeccable teach`
142
- - Impeccable's own setup auto-discovers and loads PRODUCT.md / DESIGN.md from `.workflow/impeccable/`
143
- - If PRODUCT.md missing/placeholder, impeccable teach handles the interview
144
- 2. If teach was not in the chain but PRODUCT.md is missing:
145
- - Prepend `teach` to chain start
146
- - Announce: W001
147
- 3. Context is now loaded for subsequent commands
148
-
149
- ### A_CREATE_SESSION
150
-
151
- 1. Read `.workflow/state.json` for project context (phase, milestone)
152
- 2. Create `.workflow/.maestro/ui-craft-{YYYYMMDD-HHmmss}/status.json`:
153
- ```json
154
- { "session_id": "ui-craft-{ts}", "source": "ui-craft", "intent": "...",
155
- "chain_type": "build|improve|enhance|harden|live", "target": "...",
156
- "auto_mode": false, "threshold": 26, "max_loops": 3,
157
- "steps": [{ "index": 0, "command": "shape", "status": "pending" }],
158
- "gate_history": [], "loop_count": 0,
159
- "current_step": 0, "status": "running",
160
- "created_at": "ISO-8601", "updated_at": "ISO-8601" }
161
- ```
162
- 3. Write status.json before executing any step
163
-
164
- ### A_FINAL_REPORT
165
-
166
- 1. Read critique trend if available (impeccable's critique persists snapshots automatically)
167
- 2. Update status.json with `status: "completed"` and final scores
168
- 3. Present summary table with scores, iterations, commands executed
169
-
170
- </actions>
171
-
172
- </state_machine>
173
-
174
- <execution>
175
-
176
- ## 1. Parse & Route
177
-
178
- 1. If `-c` / `--continue` or keyword "continue"/"next" → S_RESUME
179
- 2. If `--chain` present → use directly
180
- 3. Otherwise → match $ARGUMENTS against intent patterns
181
- 4. If `--enhance` present → chain = enhance, cmd = --enhance value
182
- 5. For enhance chain without `--enhance` → infer from intent
183
- 6. Ambiguous + no `-y` → `request_user_input`:
184
- ```json
185
- { "questions": [{ "id": "chain_select", "header": "Chain", "question": "Which workflow?", "options": [
186
- { "label": "Build (Recommended)", "description": "New UI from scratch: shape → craft → critique → refine → audit" },
187
- { "label": "Improve", "description": "Iterate existing: critique → refine → polish → audit" },
188
- { "label": "Enhance", "description": "Targeted improvement: specific command → critique → polish" },
189
- { "label": "Harden", "description": "Production-ready: harden → audit → polish" }
190
- ]}] }
191
- ```
192
-
193
- ## 2. Setup Context
194
-
195
- 1. If chain starts with `teach` → execute it first, maestro-impeccable handles context loading internally
196
- 2. Otherwise → invoke `$maestro-impeccable` with no args to trigger setup (context + register)
197
- 3. If maestro-impeccable reports PRODUCT.md missing → prepend teach, execute, then resume
198
-
199
- ## 3. Create Session
200
-
201
- Write `.workflow/.maestro/ui-craft-{ts}/status.json` with chain steps before any execution.
202
-
203
- ## 4. Execute Chain
204
-
205
- For each step in chain, sequentially:
206
-
207
- ```
208
- Step {n}/{total}: $maestro-impeccable {command} {target}
209
- ```
210
-
211
- After each step: update status.json `current_step` and step `status`.
212
-
213
- **Rules:**
214
- - `teach`, `shape`, `craft` are interactive -- do NOT suppress their user gates
215
- - After `teach` completes → re-run context loader for fresh PRODUCT.md
216
- - After `craft` completes → the build exists, ready for evaluation
217
- - Gate steps (critique/audit) → transition to quality gate logic
218
-
219
- ## 5. Quality Gate
220
-
221
- When chain reaches a gate step (critique or audit):
222
-
223
- ### 5a. Execute Gate Command
224
-
225
- ```
226
- $maestro-impeccable critique {target}
227
- ```
228
- or
229
- ```
230
- $maestro-impeccable audit {target}
231
- ```
232
-
233
- ### 5b. Parse Score
234
-
235
- From critique output, extract:
236
- - **score**: Nielsen's total (N/40) -- from "**Total** | | **N/40**" row
237
- - **P0_count**: count of `[P0]` tagged findings
238
- - **P1_count**: count of `[P1]` tagged findings
239
- - **suggested_commands**: list of "$maestro-impeccable <cmd>" from "Suggested command" fields
240
-
241
- From audit output, extract:
242
- - **score**: dimension total (N/20) -- from "**Total** | | **N/20**" row
243
- - **P0_count**: count of `[P0]` findings
244
-
245
- ### 5c. Evaluate
246
-
247
- ```
248
- critique_pass = (score >= threshold) AND (P0_count == 0)
249
- audit_pass = (score >= threshold * 0.5) AND (P0_count == 0)
250
- ```
251
-
252
- ### 5d. On PASS
253
-
254
- → advance to next chain step
255
-
256
- ### 5e. On FAIL
257
-
258
- 1. Collect suggested commands from P0/P1 findings
259
- 2. If no suggestions found → use fallback mapping (see quality_gate_routing)
260
- 3. De-duplicate, cap at 3 commands per iteration
261
- 4. Sort: P0-suggested first
262
- 5. Execute each: `$maestro-impeccable {cmd} {target}`
263
- 6. Re-run gate command (critique/audit)
264
- 7. Increment loop_count
265
- 8. Append to status.json `gate_history`
266
-
267
- ### 5f. On Max Loops Exceeded
268
-
269
- → force advance to next chain step with warning
270
-
271
- ## 6. Final Report
272
-
273
- Present summary: chain type, critique score with trend, audit score, loop count, commands executed, pass/partial status.
274
-
275
- Update status.json: `status: "completed"`, `final_scores`, `completed_at`.
276
-
277
- If issues remain → suggest: "Run `$maestro-ui-craft --chain improve {target}` to continue iteration."
278
-
279
- </execution>
280
-
281
- <quality_gate_routing>
282
-
283
- ### Finding → Command Fallback Mapping
284
-
285
- When critique/audit findings lack explicit "Suggested command", map by category:
286
-
287
- | Finding Category | Command |
288
- |-----------------|---------|
289
- | Visual hierarchy, layout, spacing, alignment | layout |
290
- | Color, contrast, palette, monochromatic | colorize |
291
- | Typography, font, readability, hierarchy | typeset |
292
- | Animation, motion, transitions, micro-interaction | animate |
293
- | Copy, labels, error messages, UX writing | clarify |
294
- | Responsive, mobile, breakpoints, touch targets | adapt |
295
- | Performance, loading, speed, bundle, jank | optimize |
296
- | Complexity, overload, clutter, cognitive load | distill |
297
- | Bland, safe, generic, lacks personality | bolder |
298
- | Aggressive, overwhelming, loud, overstimulating | quieter |
299
- | Onboarding, empty state, first-run, activation | onboard |
300
- | Edge cases, i18n, error handling, overflow | harden |
301
- | Personality, memorability, joy, delight | delight |
302
-
303
- ### Commands Never Auto-Selected
304
-
305
- | Command | Reason |
306
- |---------|--------|
307
- | teach | Project setup (run in S_SETUP only) |
308
- | shape | Requires user interview |
309
- | craft | Full build with multiple gates |
310
- | live | Interactive browser mode |
311
- | document | Generates DESIGN.md (setup) |
312
- | extract | Design system extraction (setup) |
313
- | overdrive | Requires explicit user vision |
314
- | critique | Gate command, not a fix |
315
- | audit | Gate command, not a fix |
316
-
317
- </quality_gate_routing>
318
-
319
- <error_codes>
320
- | Code | Severity | Description |
321
- |------|----------|-------------|
322
- | E001 | error | maestro-impeccable skill not found |
323
- | E002 | error | No intent or target specified |
324
- | E003 | error | Invalid --chain type |
325
- | E004 | error | Invalid --enhance command |
326
- | E005 | error | Resume session not found |
327
- | W001 | warning | PRODUCT.md missing, prepending teach to chain |
328
- | W002 | warning | Max quality gate loops exceeded, forcing continue |
329
- | W003 | warning | Could not parse score from critique/audit output |
330
- </error_codes>
331
-
332
- <success_criteria>
333
- - [ ] Intent classified and chain type selected
334
- - [ ] Context loaded (PRODUCT.md present or taught)
335
- - [ ] Session dir created with status.json before execution
336
- - [ ] All chain steps executed via $maestro-impeccable
337
- - [ ] Quality gate evaluated with parsed scores
338
- - [ ] Refine loop executed when gate failed (if applicable)
339
- - [ ] Gate history and scores persisted to status.json
340
- - [ ] Final report with scores and trend presented
341
- </success_criteria>
@@ -1,242 +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] [--style-skill PKG]"
5
- allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent, request_user_input
6
- ---
7
-
8
- <purpose>
9
- Two workflow paths, auto-selected by skill availability:
10
- 1. **Primary (ui-ux-pro-max)**: Lightweight -- delegates design generation, owns selection and solidification
11
- 2. **Fallback (self-contained)**: Full 4-layer pipeline (style -> animation -> layout -> assembly)
12
-
13
- Both produce the same output contract for downstream plan/execute consumption.
14
- </purpose>
15
-
16
- <deferred_reading>
17
- - [ui-style.md](~/.maestro/workflows/ui-style.md) — read when SKILL_PATH found (primary path)
18
- - [ui-design.md](~/.maestro/workflows/ui-design.md) — read when SKILL_PATH empty or --full (fallback path)
19
- - [index.json](~/.maestro/templates/index.json) — read when updating phase metadata
20
- - [scratch-index.json](~/.maestro/templates/scratch-index.json) — read when operating in scratch mode
21
- </deferred_reading>
22
-
23
- <context>
24
- $ARGUMENTS -- phase number or topic text, plus optional flags.
25
-
26
- **Usage**:
27
-
28
- ```bash
29
- $maestro-ui-design "3" # phase mode
30
- $maestro-ui-design "landing page for SaaS" # scratch mode
31
- $maestro-ui-design -y "3 --styles 5" # auto mode, 5 variants
32
- $maestro-ui-design "3 --style-skill PKG --stack react"
33
- ```
34
-
35
- **Flags**:
36
- - `[topic]`: Phase number or topic text (scratch mode)
37
- - `-y, --yes`: Auto mode -- skip all interactive selection
38
- - `--style-skill PKG`: Override ui-ux-pro-max skill path
39
- - `--styles N`: Number of style variants (default: 3, range: 2-5)
40
- - `--stack <stack>`: Tech stack for implementation guidelines (default: html-tailwind)
41
- - `--targets <pages>`: Comma-separated page/component targets
42
- - `--layouts N`: Number of layout templates per target (default: 2, range: 1-4, fallback path only)
43
- - `--refine`: Iterate on existing design-ref/ — load current tokens, present refinement options
44
- - `--persist`: Save design system with hierarchical page overrides
45
- - `--full`: Force full 4-layer self-contained pipeline
46
-
47
- When `--yes` or `-y`: Skip interactive selection, auto-pick top-scored variant, skip brief review.
48
-
49
- **Output**: `{scratch_dir}/design-ref/` with MASTER.md, design-tokens.json, animation-tokens.json, selection.json, prototypes/
50
- </context>
51
-
52
- <invariants>
53
- 1. **Output contract is fixed** -- both paths produce MASTER.md + design-tokens.json + animation-tokens.json + selection.json
54
- 2. **Colors in OKLCH** format in design-tokens.json
55
- 3. **WCAG AA** contrast: 4.5:1 text, 3:1 UI elements
56
- 4. **No lorem ipsum** -- use contextual placeholder content
57
- 5. **Agent calls use `run_in_background: false`** for synchronous execution
58
- 6. **Variant contrast** -- each variant must represent a distinctly different design direction
59
- </invariants>
60
-
61
- <execution>
62
-
63
- ### Step 0: Load UI Specs
64
-
65
- Load project UI conventions before generating designs:
66
-
67
- ```bash
68
- maestro spec load --category ui
69
- ```
70
-
71
- If specs not initialized, continue without — the workflow still produces valid output.
72
-
73
- ### Step 1: Parse Input and Resolve Target
74
-
75
- 1. Parse flags from `$ARGUMENTS`: `--styles N`, `--stack`, `--targets`, `--persist`, `--full`, `-y`
76
- 2. **Phase mode** (number): resolve via state.json artifact registry to `.workflow/scratch/{YYYYMMDD}-{type}-{slug}/`
77
- 3. **Scratch mode** (text): create `.workflow/scratch/ui-design-{slug}-{date}/` with minimal index.json
78
- 4. Create output directories: `${PHASE_DIR}/design-ref/prototypes/` and `${PHASE_DIR}/design-ref/layout-templates/`
79
-
80
- ### Step 2: Detect Skill Availability
81
-
82
- Search for `ui-ux-pro-max` script at `skills/ui-ux-pro-max/scripts/search.py` or `$HOME/.claude/plugins/cache/ui-ux-pro-max-skill/ui-ux-pro-max/*/scripts/search.py`.
83
-
84
- - If `--style-skill PKG` provided: override detected path
85
- - If `--full`: force self-contained pipeline regardless of skill availability
86
-
87
- ### Step 2.5: Refine Mode Branch (if `--refine`)
88
-
89
- If `--refine` is set:
90
- 1. Verify `design-ref/` exists in target directory (error E004 if missing)
91
- 2. Read current `design-ref/MASTER.md`, `design-tokens.json`, `animation-tokens.json`
92
- 3. Display current design summary (palette, typography, key components)
93
- 4. `request_user_input`:
94
- ```json
95
- { "questions": [{ "id": "refine_scope", "header": "Refine", "question": "Which aspects to refine?", "options": [
96
- { "label": "Colors & Typography (Recommended)", "description": "Adjust palette, font pairings, and scale." },
97
- { "label": "Layout & Spacing", "description": "Adjust grid, spacing tokens, and breakpoints." },
98
- { "label": "Full Redesign", "description": "Regenerate all variants from scratch, keeping requirements." }
99
- ]}] }
100
- ```
101
- 5. Apply refinement: directly edit token files and MASTER.md based on user feedback
102
- 6. Update `selection.json` with refinement metadata (iteration count, changes)
103
- 7. Skip to Step 8 (report)
104
-
105
- ### Step 3: Gather Requirements Context
106
-
107
- 1. Read phase context (context.md, brainstorm results, spec references)
108
- 2. Synthesize design brief: product_type, industry, style_keywords, audience
109
- 3. Infer targets from phase goal if not specified (fallback: "home")
110
- 4. **Interactive brief review** (skip if `-y`):
111
- - Present synthesized brief (product_type, industry, style_keywords, audience, targets)
112
- - `request_user_input`:
113
- ```json
114
- { "questions": [{ "id": "brief_review", "header": "Brief", "question": "Design brief ready. Proceed with this direction?", "options": [
115
- { "label": "Proceed (Recommended)", "description": "Generate variants with current brief." },
116
- { "label": "Adjust", "description": "Modify keywords, audience, or targets before generating." }
117
- ]}] }
118
- ```
119
- - **Adjust** → user provides changes, update brief, then proceed
120
-
121
- ### Step 4: Generate Style Variants
122
-
123
- **If SKILL_PATH found (primary path):**
124
-
125
- Generate `styleCount` keyword sets with intentional contrast, then call ui-ux-pro-max for each:
126
- ```bash
127
- python3 "${SKILL_PATH}" "${variant_keywords}" --design-system -p "${project_name}" -f markdown
128
- ```
129
-
130
- **If SKILL_PATH empty or --full (fallback path):**
131
-
132
- Spawn ui-design-agent to generate variants using 6D attribute space for maximum contrast:
133
-
134
- | Dimension | Range | Description |
135
- |-----------|-------|-------------|
136
- | mood | formal ↔ playful | Overall emotional tone |
137
- | density | spacious ↔ dense | Content density and whitespace |
138
- | contrast | subtle ↔ bold | Visual weight and contrast ratios |
139
- | rounding | sharp ↔ rounded | Border radius scale (0-24px) |
140
- | motion | minimal ↔ expressive | Animation intensity and frequency |
141
- | color-temp | cool ↔ warm | Color temperature bias |
142
-
143
- Each variant occupies a distinct region in 6D space — no two variants within 0.3 Euclidean distance.
144
-
145
- ### Step 5: Present and Select
146
-
147
- Present all variants with key attributes (colors, typography, effects, 6D coordinates for fallback path).
148
-
149
- **Interactive** (default): `request_user_input` with variants as options:
150
- ```json
151
- { "questions": [{ "id": "variant_select", "header": "Style", "question": "Select preferred design variant:", "options": [
152
- { "label": "Variant 1 (Recommended)", "description": "Brief: palette + mood + key trait." },
153
- { "label": "Variant 2", "description": "Brief: palette + mood + key trait." },
154
- { "label": "Variant 3", "description": "Brief: palette + mood + key trait." }
155
- ]}] }
156
- ```
157
- Options built dynamically from generated variants. User may respond with "Other" to request regeneration with different keywords.
158
-
159
- **Auto** (`-y`): select variant 1
160
-
161
- ### Step 6: Solidify Selected Design
162
-
163
- Spawn Agent to extract structured tokens from selected variant: `design-tokens.json` (OKLCH colors, component_styles, typography.combinations, spacing, border_radius, shadows, breakpoints) and `animation-tokens.json` (duration, easing, transitions, keyframes, interactions, reduced_motion).
164
-
165
- Write output artifacts:
166
- - `design-ref/MASTER.md` -- complete design system specification
167
- - `design-ref/design-tokens.json` -- production-ready tokens
168
- - `design-ref/animation-tokens.json` -- animation system
169
- - `design-ref/selection.json` -- selection metadata + rationale
170
-
171
- ### Step 6.5: Layout Template Generation (fallback path only)
172
-
173
- For each target, generate `layoutCount` layout templates:
174
- - Each template defines `dom_structure` (semantic HTML skeleton) + `css_layout_rules` (grid/flex layout)
175
- - Write to `design-ref/layout-templates/{target}-layout-{N}.json`
176
- - Templates vary in content organization: e.g., hero-first vs. feature-grid vs. sidebar-nav
177
-
178
- ### Step 7: Prototype Generation
179
-
180
- **Primary path**: For each target, spawn Agent to generate standalone HTML+CSS prototype from design-tokens.json and animation-tokens.json.
181
-
182
- **Fallback path**: Assemble prototype matrix: `styles × layouts × targets`. For each combination:
183
- - Merge selected style tokens + layout template + target content
184
- - Generate standalone HTML+CSS prototype
185
-
186
- Requirements (both paths): realistic content (no lorem ipsum), SVG icons via CDN, responsive at 375/768/1024px, WCAG AA contrast.
187
-
188
- **Fallback path only**: Generate `design-ref/compare.html` — interactive matrix viewer showing all prototypes side-by-side with style/layout/target filtering.
189
-
190
- ### Step 8: Update State and Report
191
-
192
- 1. Update index.json with `design_ref` status
193
- 2. Display completion report: phase, variant count + selected, stack, targets, artifact paths
194
- 3. **Next-Step Routing** (skip if `-y` — default to Plan):
195
- - `request_user_input`:
196
- ```json
197
- { "questions": [{ "id": "next_step", "header": "Next Step", "question": "Design system complete. What next?", "options": [
198
- { "label": "Plan (Recommended)", "description": "Create execution plan with design reference." },
199
- { "label": "Refine", "description": "Iterate on selected design with adjustments." },
200
- { "label": "Analyze", "description": "Evaluate feasibility before planning." }
201
- ]}] }
202
- ```
203
- - **Plan** → invoke `maestro-plan {phase}`
204
- - **Refine** → invoke `maestro-ui-design {phase} --refine`
205
- - **Analyze** → invoke `maestro-analyze {phase}`
206
- </execution>
207
-
208
- <error_codes>
209
- | Code | Severity | Condition | Recovery |
210
- |------|----------|-----------|----------|
211
- | E001 | error | Phase or topic argument required | Prompt user |
212
- | E002 | error | Phase directory not found | Check phase number |
213
- | E003 | error | Python not available for ui-ux-pro-max | Fall back to self-contained pipeline |
214
- | E004 | error | --refine requires existing design-ref/ | Run without --refine first |
215
- | W001 | warning | Design system returned partial results | Retry with broader keywords |
216
- | W002 | warning | Prototype rendering failed for one variant | Continue with remaining |
217
- | W003 | warning | No context.md found, using phase goal only | Continue with phase goal |
218
- | W004 | warning | ui-ux-pro-max not found, using fallback | Proceed with self-contained pipeline |
219
- </error_codes>
220
-
221
- <success_criteria>
222
- **Common (both paths)**:
223
- - [ ] Target resolved (phase or scratch directory)
224
- - [ ] Requirements context gathered (context.md, brainstorm, or user input)
225
- - [ ] Style variants generated with intentional contrast
226
- - [ ] User selected variant (or auto-picked in `-y` mode)
227
- - [ ] MASTER.md + design-tokens.json + animation-tokens.json + selection.json written
228
- - [ ] Colors in OKLCH format, WCAG AA contrast met (4.5:1 text, 3:1 UI)
229
- - [ ] Prototypes generated for all targets with realistic content (no lorem ipsum)
230
- - [ ] index.json updated with design_ref status
231
- - [ ] Next-step routing presented (or auto-defaulted with `-y`)
232
-
233
- **Primary path (ui-ux-pro-max)**:
234
- - [ ] ui-ux-pro-max `--design-system` called with product/industry/style keywords
235
- - [ ] Tokens extracted from ui-ux-pro-max output into structured JSON
236
-
237
- **Fallback path (--full or no skill)**:
238
- - [ ] 6D attribute space used with ≥0.3 Euclidean distance between variants
239
- - [ ] Layout templates generated per target (`dom_structure` + `css_layout_rules`)
240
- - [ ] Prototype matrix assembled: selected style × layouts × targets
241
- - [ ] `compare.html` generated as interactive matrix viewer
242
- </success_criteria>