maestro-flow-one 0.2.33 → 0.2.35

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 (48) hide show
  1. package/maestro-flow/commands/learn/investigate.md +151 -152
  2. package/maestro-flow/commands/learn/second-opinion.md +118 -122
  3. package/maestro-flow/commands/lifecycle/analyze.md +215 -266
  4. package/maestro-flow/commands/lifecycle/blueprint.md +189 -204
  5. package/maestro-flow/commands/lifecycle/brainstorm.md +209 -213
  6. package/maestro-flow/commands/lifecycle/companion.md +531 -531
  7. package/maestro-flow/commands/lifecycle/composer.md +188 -179
  8. package/maestro-flow/commands/lifecycle/execute.md +183 -184
  9. package/maestro-flow/commands/lifecycle/fork.md +111 -110
  10. package/maestro-flow/commands/lifecycle/grill.md +175 -176
  11. package/maestro-flow/commands/lifecycle/guard.md +103 -102
  12. package/maestro-flow/commands/lifecycle/impeccable.md +311 -268
  13. package/maestro-flow/commands/lifecycle/init.md +130 -131
  14. package/maestro-flow/commands/lifecycle/merge.md +87 -80
  15. package/maestro-flow/commands/lifecycle/next.md +253 -257
  16. package/maestro-flow/commands/lifecycle/overlay.md +188 -178
  17. package/maestro-flow/commands/lifecycle/plan.md +225 -211
  18. package/maestro-flow/commands/lifecycle/quick.md +83 -77
  19. package/maestro-flow/commands/lifecycle/roadmap.md +173 -186
  20. package/maestro-flow/commands/lifecycle/swarm-workflow.md +243 -264
  21. package/maestro-flow/commands/lifecycle/tools-execute.md +122 -117
  22. package/maestro-flow/commands/lifecycle/tools-register.md +162 -157
  23. package/maestro-flow/commands/lifecycle/ui-codify.md +117 -100
  24. package/maestro-flow/commands/lifecycle/universal-workflow.md +548 -561
  25. package/maestro-flow/commands/lifecycle/update.md +122 -119
  26. package/maestro-flow/commands/manage/codebase-rebuild.md +87 -85
  27. package/maestro-flow/commands/manage/harvest.md +97 -95
  28. package/maestro-flow/commands/manage/issue-discover.md +83 -81
  29. package/maestro-flow/commands/manage/issue.md +72 -73
  30. package/maestro-flow/commands/manage/kg-extractors.md +128 -0
  31. package/maestro-flow/commands/manage/knowhow-capture.md +92 -82
  32. package/maestro-flow/commands/manage/knowhow.md +83 -79
  33. package/maestro-flow/commands/manage/knowledge-audit.md +105 -88
  34. package/maestro-flow/commands/manage/status.md +62 -52
  35. package/maestro-flow/commands/manage/wiki.md +82 -71
  36. package/maestro-flow/commands/milestone/audit.md +4 -10
  37. package/maestro-flow/commands/milestone/complete.md +6 -7
  38. package/maestro-flow/commands/milestone/release.md +136 -145
  39. package/maestro-flow/commands/quality/auto-test.md +153 -136
  40. package/maestro-flow/commands/quality/debug.md +159 -120
  41. package/maestro-flow/commands/quality/refactor.md +105 -67
  42. package/maestro-flow/commands/quality/retrospective.md +123 -77
  43. package/maestro-flow/commands/quality/review.md +155 -128
  44. package/maestro-flow/commands/quality/sync.md +88 -52
  45. package/maestro-flow/commands/quality/test.md +147 -117
  46. package/maestro-flow/commands/spec/add.md +77 -70
  47. package/maestro-flow/commands/spec/setup.md +49 -52
  48. package/package.json +1 -1
@@ -1,268 +1,311 @@
1
- ---
2
- name: maestro-impeccable
3
- description: Use when designing, auditing, polishing, or improving frontend UI — websites, dashboards, landing pages, components
4
- argument-hint: "<command|intent> [target] [flags] — 可选 chain: build|redesign|improve|enhance|launch|harden|foundation|live"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Bash
10
- - Glob
11
- - Grep
12
- - Agent
13
- - AskUserQuestion
14
- - TodoWrite
15
- ---
16
-
17
- <purpose>
18
- UI design command. Parse input prerequisites read workflow file execute → track.
19
-
20
- - **Direct**: single command via workflow file
21
- - **Chain**: orchestrate command sequence with quality gates
22
- - **Search**: query design knowledge base via CLI
23
- </purpose>
24
-
25
- ## Input
26
-
27
- $ARGUMENTS first word determines mode:
28
-
29
- | First Word | Mode |
30
- |------------|------|
31
- | Known command (see routing table) | Direct |
32
- | Chain name: build, redesign, improve, enhance, launch, harden, foundation, live | Chain |
33
- | continue / next / -c | Resume |
34
- | search | Search: `maestro impeccable search "$REST"` |
35
- | Free text (concrete task) | Direct craft — has specific target + specs/reference |
36
- | Free text (project intent) | Intent → classify → chain |
37
- | (empty) | Menu: show commands by category |
38
-
39
- ## Command Routing
40
-
41
- All workflows at `~/.maestro/workflows/impeccable/{command}.md`:
42
-
43
- | Command | Category | Description |
44
- |---------|----------|-------------|
45
- | craft | Build | Shape then build end-to-endfull page/component implementation |
46
- | shape | Build | Plan UX/UI before code information architecture, wireframe, visual direction |
47
- | teach | Build | Set up PRODUCT.md users, brand, tone, anti-references, principles |
48
- | document | Build | Generate DESIGN.md from existing code extract tokens, typography, colors |
49
- | extract | Build | Pull tokens/components into reusable design system |
50
- | explore | Build | Multi-style comparisongenerate variants, render prototypes, visual compare, select/mix |
51
- | critique | Evaluate | UX heuristic review with Nielsen scoring (/40) + P0/P1 findings |
52
- | audit | Evaluate | Technical quality checksa11y, performance, responsive, code quality (/20) |
53
- | polish | Refine | Final quality passmicro-adjustments, pixel perfection |
54
- | bolder | Refine | Amplify bland/safe designs stronger personality, more contrast |
55
- | quieter | Refine | Tone down aggressive/overwhelming designs reduce visual noise |
56
- | distill | Refine | Strip to essenceremove clutter, reduce cognitive load |
57
- | harden | Refine | Production-ready error states, i18n, edge cases, overflow, empty states |
58
- | onboard | Refine | First-run flows, empty states, activation paths, progressive disclosure |
59
- | animate | Enhance | Add purposeful motion transitions, micro-interactions, scroll effects |
60
- | colorize | Enhance | Add strategic color OKLCH palette, contrast, color strategy |
61
- | typeset | Enhance | Improve typography scale, hierarchy, font pairing, line length |
62
- | layout | Enhance | Fix spacing, rhythm, visual hierarchy, alignment, grid |
63
- | delight | Enhance | Add personalitymemorable details, joy, surprise moments |
64
- | overdrive | Enhance | Push past conventional limits ambitious visual effects |
65
- | clarify | Fix | Improve UX copylabels, error messages, microcopy, CTAs |
66
- | adapt | Fix | Adapt for devices/screens — responsive, touch targets, breakpoints |
67
- | optimize | Fix | Fix UI performance — loading, rendering, bundle, paint/layout jank |
68
- | live | Iterate | Browser-based variant iteration — real-time design in DevTools |
69
-
70
- Reference files (loaded by workflow as needed, not standalone commands):
71
- brand.md, product.md, design.md, codex.md, heuristics-scoring.md, cognitive-load.md,
72
- color-and-contrast.md, interaction-design.md, motion-design.md, personas.md,
73
- responsive-design.md, spatial-design.md, typography.md, ux-writing.md
74
-
75
- ## Chains
76
-
77
- Chain step names below reuse Command Routing names but resolve through the chain runner. To avoid ambiguity with Direct command invocation, internal display, todo items, and session status records always tag chain steps with the `impeccable:` prefix (e.g. `impeccable:craft`, `impeccable:critique`). The bare names in this table refer to the workflow file at `~/.maestro/workflows/impeccable/{name}.md` that the chain step reads.
78
-
79
- | Chain | Steps | Scenario |
80
- |-------|-------|----------|
81
- | build | teach?explore? → shape → craft → critique → [refine] → audit → polish | New from scratch |
82
- | redesign | documentexploreshapecraft → critique → [refine] → audit → polish | Redesign existing code |
83
- | improve | critique[refine] → polish audit | Iterative improvement |
84
- | enhance | {cmd...}critique[refine]polish | Targeted enhancement (multi-command) |
85
- | launch | harden → adapt → optimize → audit → polish | Full production readiness |
86
- | harden | harden → audit → polish | Edge case hardening |
87
- | foundation | teach? explore document extract | Design system setup |
88
- | live | live | Real-time iteration |
89
-
90
- - `?` = conditional: teach if PRODUCT.md missing; explore if DESIGN.md missing and --skip-design not set
91
- - `[refine]` = quality gate loop: gate fails auto-select fix commands from findings → re-gate
92
- - `{cmd...}` = enhance supports multiple commands, comma-separated: `enhance colorize,typeset landing-page`
93
-
94
- Chain flags: --threshold <N> (default 26/40), --max-loops <N> (default 3), --skip-design, --styles <N>, -y
95
-
96
- ## Free Text Routing
97
-
98
- Three-layer priority matching. Stop on first match — do not continue to lower layers.
99
-
100
- ### Layer 1: Single command intent → Direct
101
-
102
- Semantically match user description against the Command Routing table's Description column. Match the closest **single** command.
103
-
104
- **Skip condition**: If the prompt also contains a Layer 2 chain keyword AND does not focus on a single design dimension, skip this layer.
105
- Example: `enhance colors and typography` — "enhance" is a chain keyword + multiple design dimensions → skip to Layer 2.
106
-
107
- | Intent signal | Command |
108
- |---------------|---------|
109
- | review, check UX, score, heuristic, evaluate usability | critique |
110
- | audit, a11y, accessibility, technical check, performance audit, code quality | audit |
111
- | add animation, motion, transitions, micro-interactions | animate |
112
- | color, palette, OKLCH, contrast, color scheme | colorize |
113
- | font, typography, type scale, line height, font pairing | typeset |
114
- | layout, spacing, grid, alignment, visual hierarchy | layout |
115
- | too loud, tone down, visual noise, make it simpler, too busy | quieter |
116
- | too bland, bolder, more personality, stronger, more contrast | bolder |
117
- | too complex, simplify, strip, remove clutter, cognitive load | distill |
118
- | polish, fine-tune, pixel perfect, final pass, refine details | polish |
119
- | copy, labels, error messages, UX writing, microcopy, CTAs | clarify |
120
- | responsive, mobile, adapt, breakpoints, touch targets | adapt |
121
- | performance, loading, bundle, jank, speed, rendering | optimize |
122
- | edge cases, error states, i18n, overflow, empty state hardening | harden |
123
- | onboarding, first-run, empty state, activation, progressive disclosure | onboard |
124
- | fun, surprise, personality, memorable, joy, delight | delight |
125
- | extraordinary, push limits, ambitious effects, cutting-edge | overdrive |
126
- | plan UX, wireframe, information architecture, visual direction | shape |
127
- | multi-style, variants, compare styles, style comparison | explore |
128
- | brand definition, PRODUCT.md, product context | teach |
129
- | extract design, DESIGN.md, document design system | document |
130
- | pull tokens, extract components, design system extraction | extract |
131
- | real-time, browser iteration, live editing | live |
132
-
133
- ### Layer 2: Project intent → Chain
134
-
135
- Layer 1 did not match. Check for chain-level keywords — even if the prompt also contains a specific target/path, chain matching takes priority.
136
-
137
- | Pattern | Chain |
138
- |---------|-------|
139
- | new, create, build, from scratch, start fresh | build |
140
- | redo, redesign, rethink, restyle, overhaul, revamp | redesign |
141
- | improve, iterate, better, refine overall | improve |
142
- | enhance, visual upgrade, level up | enhance |
143
- | launch, deploy, ship, production-ready, go live | launch |
144
- | harden, production-harden, edge cases | harden |
145
- | design system, tokens, design foundation, design infrastructure | foundation |
146
- | real-time, live, browser | live |
147
-
148
- Ambiguous + no `-y`:
149
-
150
- AskUserQuestion (single-select, header: "意图确认"):
151
- - Options: top 2-3 matched chains from Layer 2 table, each with label = chain name, description = matched keywords
152
- - Last option: **"直接构建"** — skip chain, route to Layer 3 craft
153
-
154
- ### Layer 3: Concrete build task Direct craft
155
-
156
- Layer 1+2 both did not match, but intent is to build/create a specific thing:
157
- - Contains a specific file path or target (`d:\path`, `src/pages/`, `index.html`)
158
- - Contains detailed visual specs (layout, style, color scheme)
159
- - Contains reference material (`based on...`, `like...`, `similar to...`)
160
-
161
- → Route to **craft** (Direct)
162
-
163
- ## Prerequisites
164
-
165
- Before reading any command workflow:
166
-
167
- 1. **Context**: `maestro spec load --category ui` → if empty → `maestro impeccable load-context`
168
- 2. **PRODUCT.md**: missing/placeholder (<200 chars / `[TODO]`) → execute teach first, then resume original task
169
- 3. **Register**: identify brand/product → Read `~/.maestro/workflows/impeccable/{brand|product}.md`
170
-
171
- ## Direct Execution
172
-
173
- 1. Prerequisites
174
- 2. **Display execution info**:
175
- ```
176
- ── Command: {command} ────────────────────
177
- Category: {category} | Target: {target}
178
- ─────────────────────────────────────────
179
- ```
180
- 3. Read `~/.maestro/workflows/impeccable/{command}.md`
181
- 4. **TodoWrite tracking**: create todo items for each major phase in the workflow file
182
- - Format: `[{command}] {phase description}`
183
- - Mark each phase completed immediately upon finishing
184
- 5. Follow workflow file instructions
185
- 6. Post: suggest logical next command (teach→shape, shape→craft, craft→critique, etc.)
186
-
187
- ## Chain Execution
188
-
189
- 1. Prerequisites
190
- 2. **Display chain preview**: parse chain definition, output full step preview (chain steps prefixed `impeccable:` to disambiguate from Direct commands):
191
- ```
192
- ── Chain: build ──────────────────────────
193
- 1. impeccable:teach (conditional: PRODUCT.md missing)
194
- 2. impeccable:explore (conditional: DESIGN.md missing)
195
- 3. impeccable:shape
196
- 4. impeccable:craft
197
- 5. impeccable:critique ◆ quality gate (threshold: 26/40)
198
- 6. impeccable:[refine] ↺ auto-fix loop (max: 3)
199
- 7. impeccable:audit ◆ quality gate (threshold: 14/20)
200
- 8. impeccable:polish
201
- ─────────────────────────────────────────
202
- Target: {target}
203
- ```
204
- - `◆` marks quality gate steps with threshold
205
- - `↺` marks refine loop with max iteration count
206
- - Conditional steps show trigger condition
207
- - Skipped conditional steps marked `(skipped)`
208
- 3. Create session: `.workflow/.maestro/ui-craft-{YYYYMMDD-HHmmss}/status.json`
209
- ```json
210
- { "chain_type": "...", "target": "...", "steps": [...], "current_step": 0,
211
- "gate_history": [], "loop_count": 0, "status": "running" }
212
- ```
213
- 4. **TodoWrite init**: create todo items for all chain steps
214
- - One item per step, format: `[chain] step N: impeccable:{command} — {description}` (use `impeccable:` prefix to disambiguate from Direct command items)
215
- - If conditional step is skipped, immediately mark completed
216
- - Quality gate steps include threshold: `[chain] step 5: impeccable:critique ◆ gate ≥26/40`
217
- 5. For each step:
218
- - Read `~/.maestro/workflows/impeccable/{command}.md` execute
219
- - **Step start**: TodoWrite marks current step in_progress
220
- - **Step done**: TodoWrite marks completed + update status.json (`current_step`, step `status`)
221
- - **Step failed**: TodoWrite marks completed (with note) + record reason
222
- 6. **Quality gate** (critique/audit steps):
223
- - Parse score: critique `**Total** | | **N/40**`, audit `**Total** | | **N/20**`
224
- - Count `[P0]` / `[P1]` tags
225
- - Pass: score threshold AND P0 == 0 advance
226
- - Fail: collect suggested commands from findings → execute → re-gate
227
- - Max loops exceeded → force advance with warning
228
- - TodoWrite: record gate result in current step notes (score, P0/P1 count, pass/fail)
229
- 7. Final report: scores + trend + commands executed
230
-
231
- ## Resume
232
-
233
- Scan `.workflow/.maestro/ui-craft-*/status.json` for `status == "running"` → most recent → resume from `current_step`.
234
-
235
- ## Quality Gate — Finding → Command Fallback
236
-
237
- When findings lack explicit suggested command:
238
-
239
- | Finding Category | Command |
240
- |-----------------|---------|
241
- | Layout, spacing, hierarchy, alignment | layout |
242
- | Color, contrast, palette | colorize |
243
- | Typography, font, readability | typeset |
244
- | Animation, motion, transitions | animate |
245
- | Copy, labels, UX writing | clarify |
246
- | Responsive, mobile, breakpoints | adapt |
247
- | Performance, loading, speed | optimize |
248
- | Complexity, overload, clutter | distill |
249
- | Bland, safe, generic | bolder |
250
- | Aggressive, overwhelming | quieter |
251
- | Onboarding, empty state | onboard |
252
- | Edge cases, i18n, error handling | harden |
253
- | Personality, memorability | delight |
254
-
255
- Never auto-select: teach, shape, craft, live, document, extract, overdrive, critique, audit.
256
-
257
- ## Chain Phase Gates (MANDATORY for chain mode)
258
-
259
- **GATE: Quality Gate Step Next Step**
260
- - REQUIRED: Score parsed from critique/audit output (not assumed or estimated).
261
- - REQUIRED: P0 count extracted from findings P0 == 0 required for pass.
262
- - REQUIRED: If gate fails, refine commands executed and re-gate attempted.
263
- - Do NOT skip quality gate steps or mark as "passed" without parsing actual score.
264
-
265
- **GATE: Chain Completion**
266
- - REQUIRED: All non-skipped steps executed (TodoWrite all completed).
267
- - REQUIRED: status.json updated with `status: "completed"` and final scores.
268
- - REQUIRED: If any step failed: documented in status.json with reason.
1
+ ---
2
+ name: maestro-impeccable
3
+ description: Use when designing, auditing, polishing, or improving frontend UI — websites, dashboards, landing pages, components
4
+ argument-hint: "<command|intent> [target] [flags] — 可选 chain: build|redesign|improve|enhance|launch|harden|foundation|live"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ - TodoWrite
15
+ ---
16
+
17
+ <purpose>
18
+ UI design command: direct single-command, chain multi-step with quality gates, or search design knowledge.
19
+ Parse input → prerequisites → read workflow file → execute → track.
20
+ </purpose>
21
+
22
+ ## Input
23
+
24
+ $ARGUMENTS first word determines mode:
25
+
26
+ | First Word | Mode |
27
+ |------------|------|
28
+ | Known command (see routing table) | Direct |
29
+ | Chain name: build, redesign, improve, enhance, launch, harden, foundation, live | Chain |
30
+ | continue / next / -c | Resume |
31
+ | search | Search: `maestro impeccable search "$REST"` |
32
+ | Free text (concrete task) | Direct craft has specific target + specs/reference |
33
+ | Free text (project intent) | Intent → classify → chain |
34
+ | (empty) | Menu: show commands by category |
35
+
36
+ ## Command Routing
37
+
38
+ All workflows at `~/.maestro/workflows/impeccable/{command}.md`:
39
+
40
+ | Command | Category | Description |
41
+ |---------|----------|-------------|
42
+ | craft | Build | Shape then build end-to-end — full page/component implementation |
43
+ | shape | Build | Plan UX/UI before code — information architecture, wireframe, visual direction |
44
+ | teach | Build | Set up PRODUCT.md — users, brand, tone, anti-references, principles |
45
+ | document | Build | Generate DESIGN.md from existing code extract tokens, typography, colors |
46
+ | extract | Build | Pull tokens/components into reusable design system |
47
+ | explore | Build | Multi-style comparisongenerate variants, render prototypes, visual compare, select/mix |
48
+ | critique | Evaluate | UX heuristic review with Nielsen scoring (/40) + P0/P1 findings |
49
+ | audit | Evaluate | Technical quality checks a11y, performance, responsive, code quality (/20) |
50
+ | polish | Refine | Final quality pass micro-adjustments, pixel perfection |
51
+ | bolder | Refine | Amplify bland/safe designs stronger personality, more contrast |
52
+ | quieter | Refine | Tone down aggressive/overwhelming designs reduce visual noise |
53
+ | distill | Refine | Strip to essenceremove clutter, reduce cognitive load |
54
+ | harden | Refine | Production-ready error states, i18n, edge cases, overflow, empty states |
55
+ | onboard | Refine | First-run flows, empty states, activation paths, progressive disclosure |
56
+ | animate | Enhance | Add purposeful motiontransitions, micro-interactions, scroll effects |
57
+ | colorize | Enhance | Add strategic color OKLCH palette, contrast, color strategy |
58
+ | typeset | Enhance | Improve typography scale, hierarchy, font pairing, line length |
59
+ | layout | Enhance | Fix spacing, rhythm, visual hierarchy, alignment, grid |
60
+ | delight | Enhance | Add personalitymemorable details, joy, surprise moments |
61
+ | overdrive | Enhance | Push past conventional limits ambitious visual effects |
62
+ | clarify | Fix | Improve UX copy — labels, error messages, microcopy, CTAs |
63
+ | adapt | Fix | Adapt for devices/screens responsive, touch targets, breakpoints |
64
+ | optimize | Fix | Fix UI performanceloading, rendering, bundle, paint/layout jank |
65
+ | live | Iterate | Browser-based variant iterationreal-time design in DevTools |
66
+
67
+ Reference files (loaded by workflow as needed, not standalone commands):
68
+ brand.md, product.md, design.md, codex.md, heuristics-scoring.md, cognitive-load.md,
69
+ color-and-contrast.md, interaction-design.md, motion-design.md, personas.md,
70
+ responsive-design.md, spatial-design.md, typography.md, ux-writing.md
71
+
72
+ ## Chains
73
+
74
+ Chain step names below reuse Command Routing names but resolve through the chain runner. To avoid ambiguity with Direct command invocation, internal display, todo items, and session status records always tag chain steps with the `impeccable:` prefix (e.g. `impeccable:craft`, `impeccable:critique`). The bare names in this table refer to the workflow file at `~/.maestro/workflows/impeccable/{name}.md` that the chain step reads.
75
+
76
+ | Chain | Steps | Scenario |
77
+ |-------|-------|----------|
78
+ | build | teach? → explore? → shape → craft → critique → [refine] → audit → polish | New from scratch |
79
+ | redesign | document → explore → shape → craft → critique → [refine] → audit → polish | Redesign existing code |
80
+ | improve | critique → [refine] → polish → audit | Iterative improvement |
81
+ | enhance | {cmd...} → critique → [refine] → polish | Targeted enhancement (multi-command) |
82
+ | launch | hardenadaptoptimize → audit → polish | Full production readiness |
83
+ | harden | hardenaudit → polish | Edge case hardening |
84
+ | foundation | teach?exploredocumentextract | Design system setup |
85
+ | live | live | Real-time iteration |
86
+
87
+ - `?` = conditional: teach if PRODUCT.md missing; explore if DESIGN.md missing and --skip-design not set
88
+ - `[refine]` = quality gate loop: gate fails → auto-select fix commands from findings → re-gate
89
+ - `{cmd...}` = enhance supports multiple commands, comma-separated: `enhance colorize,typeset landing-page`
90
+
91
+ Chain flags: --threshold <N> (default 26/40), --max-loops <N> (default 3), --skip-design, --styles <N>, -y
92
+
93
+ ## Free Text Routing
94
+
95
+ Three-layer priority matching. Stop on first match — do not continue to lower layers.
96
+
97
+ ### Layer 1: Single command intent → Direct
98
+
99
+ Semantically match user description against the Command Routing table's Description column. Match the closest **single** command.
100
+
101
+ **Skip condition**: If the prompt also contains a Layer 2 chain keyword AND does not focus on a single design dimension, skip this layer.
102
+ Example: `enhance colors and typography` "enhance" is a chain keyword + multiple design dimensions → skip to Layer 2.
103
+
104
+ | Intent signal | Command |
105
+ |---------------|---------|
106
+ | review, check UX, score, heuristic, evaluate usability | critique |
107
+ | audit, a11y, accessibility, technical check, performance audit, code quality | audit |
108
+ | add animation, motion, transitions, micro-interactions | animate |
109
+ | color, palette, OKLCH, contrast, color scheme | colorize |
110
+ | font, typography, type scale, line height, font pairing | typeset |
111
+ | layout, spacing, grid, alignment, visual hierarchy | layout |
112
+ | too loud, tone down, visual noise, make it simpler, too busy | quieter |
113
+ | too bland, bolder, more personality, stronger, more contrast | bolder |
114
+ | too complex, simplify, strip, remove clutter, cognitive load | distill |
115
+ | polish, fine-tune, pixel perfect, final pass, refine details | polish |
116
+ | copy, labels, error messages, UX writing, microcopy, CTAs | clarify |
117
+ | responsive, mobile, adapt, breakpoints, touch targets | adapt |
118
+ | performance, loading, bundle, jank, speed, rendering | optimize |
119
+ | edge cases, error states, i18n, overflow, empty state hardening | harden |
120
+ | onboarding, first-run, empty state, activation, progressive disclosure | onboard |
121
+ | fun, surprise, personality, memorable, joy, delight | delight |
122
+ | extraordinary, push limits, ambitious effects, cutting-edge | overdrive |
123
+ | plan UX, wireframe, information architecture, visual direction | shape |
124
+ | multi-style, variants, compare styles, style comparison | explore |
125
+ | brand definition, PRODUCT.md, product context | teach |
126
+ | extract design, DESIGN.md, document design system | document |
127
+ | pull tokens, extract components, design system extraction | extract |
128
+ | real-time, browser iteration, live editing | live |
129
+
130
+ ### Layer 2: Project intent Chain
131
+
132
+ Layer 1 did not match. Check for chain-level keywords — even if the prompt also contains a specific target/path, chain matching takes priority.
133
+
134
+ | Pattern | Chain |
135
+ |---------|-------|
136
+ | new, create, build, from scratch, start fresh | build |
137
+ | redo, redesign, rethink, restyle, overhaul, revamp | redesign |
138
+ | improve, iterate, better, refine overall | improve |
139
+ | enhance, visual upgrade, level up | enhance |
140
+ | launch, deploy, ship, production-ready, go live | launch |
141
+ | harden, production-harden, edge cases | harden |
142
+ | design system, tokens, design foundation, design infrastructure | foundation |
143
+ | real-time, live, browser | live |
144
+
145
+ Ambiguous + no `-y`:
146
+
147
+ AskUserQuestion (single-select, header: "意图确认"):
148
+ - Options: top 2-3 matched chains from Layer 2 table, each with label = chain name, description = matched keywords
149
+ - Last option: **"直接构建"** — skip chain, route to Layer 3 craft
150
+
151
+ ### Layer 3: Concrete build task Direct craft
152
+
153
+ Layer 1+2 both did not match, but intent is to build/create a specific thing:
154
+ - Contains a specific file path or target (`d:\path`, `src/pages/`, `index.html`)
155
+ - Contains detailed visual specs (layout, style, color scheme)
156
+ - Contains reference material (`based on...`, `like...`, `similar to...`)
157
+
158
+ Route to **craft** (Direct)
159
+
160
+ ## Prerequisites
161
+
162
+ Before reading any command workflow:
163
+
164
+ 1. **Context**: `maestro spec load --category ui` → if empty → `maestro impeccable load-context`
165
+ 2. **PRODUCT.md**: missing/placeholder (<200 chars / `[TODO]`) → execute teach first, then resume original task
166
+ 3. **Register**: identify brand/product → Read `~/.maestro/workflows/impeccable/{brand|product}.md`
167
+
168
+ ## Direct Execution
169
+
170
+ 1. Prerequisites ✓
171
+ 2. **Display execution info**:
172
+ ```
173
+ ── Command: {command} ────────────────────
174
+ Category: {category} | Target: {target}
175
+ ─────────────────────────────────────────
176
+ ```
177
+ 3. Read `~/.maestro/workflows/impeccable/{command}.md`
178
+ 4. **TodoWrite tracking**: create todo items for each major phase in the workflow file
179
+ - Format: `[{command}] {phase description}`
180
+ - Mark each phase completed immediately upon finishing
181
+ 5. Follow workflow file instructions
182
+ 6. Post: suggest logical next command (teach→shape, shape→craft, craft→critique, etc.)
183
+
184
+ ## Chain Execution
185
+
186
+ 1. Prerequisites ✓
187
+ 2. **Display chain preview**: parse chain definition, output full step preview (chain steps prefixed `impeccable:` to disambiguate from Direct commands):
188
+ ```
189
+ ── Chain: build ──────────────────────────
190
+ 1. impeccable:teach (conditional: PRODUCT.md missing)
191
+ 2. impeccable:explore (conditional: DESIGN.md missing)
192
+ 3. impeccable:shape
193
+ 4. impeccable:craft
194
+ 5. impeccable:critique ◆ quality gate (threshold: 26/40)
195
+ 6. impeccable:[refine] ↺ auto-fix loop (max: 3)
196
+ 7. impeccable:audit ◆ quality gate (threshold: 14/20)
197
+ 8. impeccable:polish
198
+ ─────────────────────────────────────────
199
+ Target: {target}
200
+ ```
201
+ - `◆` marks quality gate steps with threshold
202
+ - `↺` marks refine loop with max iteration count
203
+ - Conditional steps show trigger condition
204
+ - Skipped conditional steps marked `(skipped)`
205
+ 3. Create session: `.workflow/.maestro/ui-craft-{YYYYMMDD-HHmmss}/status.json`
206
+ ```json
207
+ { "chain_type": "...", "target": "...", "steps": [...], "current_step": 0,
208
+ "gate_history": [], "loop_count": 0, "status": "running" }
209
+ ```
210
+ 4. **TodoWrite init**: create todo items for all chain steps
211
+ - One item per step, format: `[chain] step N: impeccable:{command} {description}` (use `impeccable:` prefix to disambiguate from Direct command items)
212
+ - If conditional step is skipped, immediately mark completed
213
+ - Quality gate steps include threshold: `[chain] step 5: impeccable:critique ◆ gate ≥26/40`
214
+ 5. For each step:
215
+ - Read `~/.maestro/workflows/impeccable/{command}.md` execute
216
+ - **Step start**: TodoWrite marks current step in_progress
217
+ - **Step done**: TodoWrite marks completed + update status.json (`current_step`, step `status`)
218
+ - **Step failed**: TodoWrite marks completed (with note) + record reason
219
+ 6. **Quality gate** (critique/audit steps):
220
+ - Parse score: critique `**Total** | | **N/40**`, audit `**Total** | | **N/20**`
221
+ - Count `[P0]` / `[P1]` tags
222
+ - Pass: score threshold AND P0 == 0 → advance
223
+ - Fail: collect suggested commands from findings execute re-gate
224
+ - Max loops exceeded force advance with warning
225
+ - TodoWrite: record gate result in current step notes (score, P0/P1 count, pass/fail)
226
+ 7. Final report: scores + trend + commands executed
227
+
228
+ ## Resume
229
+
230
+ Scan `.workflow/.maestro/ui-craft-*/status.json` for `status == "running"` → most recent → resume from `current_step`.
231
+
232
+ ## Quality Gate — Finding → Command Fallback
233
+
234
+ When findings lack explicit suggested command:
235
+
236
+ | Finding Category | Command |
237
+ |-----------------|---------|
238
+ | Layout, spacing, hierarchy, alignment | layout |
239
+ | Color, contrast, palette | colorize |
240
+ | Typography, font, readability | typeset |
241
+ | Animation, motion, transitions | animate |
242
+ | Copy, labels, UX writing | clarify |
243
+ | Responsive, mobile, breakpoints | adapt |
244
+ | Performance, loading, speed | optimize |
245
+ | Complexity, overload, clutter | distill |
246
+ | Bland, safe, generic | bolder |
247
+ | Aggressive, overwhelming | quieter |
248
+ | Onboarding, empty state | onboard |
249
+ | Edge cases, i18n, error handling | harden |
250
+ | Personality, memorability | delight |
251
+
252
+ Never auto-select: teach, shape, craft, live, document, extract, overdrive, critique, audit.
253
+
254
+ ## Chain Phase Gates (MANDATORY for chain mode)
255
+
256
+ **GATE: Quality Gate Step → Next Step**
257
+ - REQUIRED: Score parsed from critique/audit output (not assumed or estimated).
258
+ - REQUIRED: P0 count extracted from findings — P0 == 0 required for pass.
259
+ - REQUIRED: If gate fails, refine commands executed and re-gate attempted.
260
+ - BLOCKED if: score not parsed from actual output, or P0 > 0 and max refine loops not exhausted do not advance past gate.
261
+ - Do NOT skip quality gate steps or mark as "passed" without parsing actual score.
262
+
263
+ **GATE: Chain Completion**
264
+ - REQUIRED: All non-skipped steps executed (TodoWrite all completed).
265
+ - REQUIRED: status.json updated with `status: "completed"` and final scores.
266
+ - REQUIRED: If any step failed: documented in status.json with reason.
267
+ - BLOCKED if missing: steps not all completed or status.json not updated chain is incomplete.
268
+
269
+ <error_codes>
270
+ | Code | Severity | Condition | Recovery |
271
+ |------|----------|-----------|----------|
272
+ | E001 | error | No command or intent resolved from input | Provide a known command, chain name, or descriptive intent |
273
+ | E002 | error | Source/target path not found | Verify path exists |
274
+ | E003 | error | PRODUCT.md missing and teach step failed | Run `maestro impeccable teach` manually first |
275
+ | E004 | error | Chain quality gate failed after max loops | Review findings manually, fix critical issues, then resume |
276
+ | W001 | warning | UI specs not found via spec load | Continuing without specs — output may miss project conventions |
277
+ | W002 | warning | Quality gate score below threshold but P0 == 0 | Auto-refine loop triggered |
278
+ | W003 | warning | Chain step failed but non-blocking | Step failure documented, chain continues |
279
+ </error_codes>
280
+
281
+ <success_criteria>
282
+ Direct mode:
283
+ - [ ] Command resolved from input (routing table or free text matching)
284
+ - [ ] Prerequisites satisfied (UI specs loaded, PRODUCT.md present)
285
+ - [ ] Workflow file read and executed completely
286
+ - [ ] TodoWrite tracking created and all phases marked completed
287
+ - [ ] Next-step suggestion provided
288
+
289
+ Chain mode:
290
+ - [ ] Chain steps resolved and preview displayed
291
+ - [ ] Session status.json created in `.workflow/.maestro/ui-craft-*/`
292
+ - [ ] TodoWrite items created for all chain steps
293
+ - [ ] Each step executed with workflow file read
294
+ - [ ] Quality gates parsed with actual scores (not estimated)
295
+ - [ ] Refine loops executed when gate fails (up to max-loops)
296
+ - [ ] status.json updated with `status: "completed"` and final scores
297
+ - [ ] Final report with scores, trend, and commands executed
298
+ </success_criteria>
299
+
300
+ <completion>
301
+ ### Next-step routing
302
+
303
+ | Condition | Suggestion |
304
+ |-----------|-----------|
305
+ | Direct teach complete | `maestro impeccable shape` |
306
+ | Direct shape complete | `maestro impeccable craft` |
307
+ | Direct craft complete | `maestro impeccable critique` |
308
+ | Direct critique findings | `maestro impeccable polish` or targeted fix command |
309
+ | Chain complete | Review final scores, consider `maestro impeccable improve` for iteration |
310
+ | Chain paused/interrupted | `maestro impeccable continue` to resume |
311
+ </completion>