pi-maestro-flow 0.2.0 → 0.3.0

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 (235) hide show
  1. package/README.md +44 -72
  2. package/agents/cross-role-reviewer.md +1 -1
  3. package/agents/impeccable-agent.md +1 -1
  4. package/agents/ralph-executor.md +1 -1
  5. package/agents/team-worker.md +1 -1
  6. package/agents/workflow-analyzer.md +1 -1
  7. package/agents/workflow-codebase-mapper.md +1 -1
  8. package/agents/workflow-collab-planner.md +1 -1
  9. package/agents/workflow-debugger.md +1 -1
  10. package/agents/workflow-executor.md +1 -1
  11. package/agents/workflow-integration-checker.md +1 -1
  12. package/agents/workflow-nyquist-auditor.md +1 -1
  13. package/agents/workflow-phase-researcher.md +1 -1
  14. package/agents/workflow-planner.md +1 -1
  15. package/agents/workflow-project-researcher.md +1 -1
  16. package/agents/workflow-reviewer.md +1 -1
  17. package/agents/workflow-verifier.md +1 -1
  18. package/package.json +13 -4
  19. package/skills/codify-to-knowhow/SKILL.md +1 -1
  20. package/skills/delegation-check/SKILL.md +1 -1
  21. package/skills/domain-add/SKILL.md +5 -7
  22. package/skills/insight-challenge/SKILL.md +1 -1
  23. package/skills/learn-decompose/SKILL.md +4 -4
  24. package/skills/learn-follow/SKILL.md +5 -5
  25. package/skills/learn-investigate/SKILL.md +5 -5
  26. package/skills/learn-second-opinion/SKILL.md +5 -5
  27. package/skills/maestro/SKILL.md +9 -10
  28. package/skills/maestro-amend/SKILL.md +3 -3
  29. package/skills/maestro-analyze/SKILL.md +10 -13
  30. package/skills/maestro-blueprint/SKILL.md +8 -11
  31. package/skills/maestro-brainstorm/SKILL.md +11 -14
  32. package/skills/maestro-collab/SKILL.md +4 -4
  33. package/skills/maestro-companion/SKILL.md +3 -3
  34. package/skills/maestro-composer/SKILL.md +11 -12
  35. package/skills/maestro-execute/SKILL.md +9 -12
  36. package/skills/maestro-fork/SKILL.md +8 -11
  37. package/skills/maestro-grill/SKILL.md +13 -16
  38. package/skills/maestro-guard/SKILL.md +5 -5
  39. package/skills/maestro-help/SKILL.md +3 -3
  40. package/skills/maestro-impeccable/SKILL.md +7 -7
  41. package/skills/maestro-init/SKILL.md +9 -12
  42. package/skills/maestro-merge/SKILL.md +6 -8
  43. package/skills/maestro-milestone-audit/SKILL.md +3 -5
  44. package/skills/maestro-milestone-complete/SKILL.md +9 -12
  45. package/skills/maestro-milestone-release/SKILL.md +9 -11
  46. package/skills/maestro-next/SKILL.md +5 -5
  47. package/skills/maestro-overlay/SKILL.md +16 -16
  48. package/skills/maestro-plan/SKILL.md +9 -12
  49. package/skills/maestro-player/SKILL.md +5 -5
  50. package/skills/maestro-quick/SKILL.md +5 -7
  51. package/skills/maestro-ralph/SKILL.md +16 -17
  52. package/skills/maestro-ralph-cli/SKILL.md +6 -6
  53. package/skills/maestro-ralph-cli-execute/SKILL.md +2 -2
  54. package/skills/maestro-ralph-execute/SKILL.md +4 -4
  55. package/skills/maestro-ralph-v2/SKILL.md +18 -19
  56. package/skills/maestro-roadmap/SKILL.md +8 -9
  57. package/skills/maestro-swarm-workflow/SKILL.md +9 -9
  58. package/skills/maestro-tools-execute/SKILL.md +5 -7
  59. package/skills/maestro-tools-register/SKILL.md +7 -9
  60. package/skills/maestro-ui-codify/SKILL.md +9 -10
  61. package/skills/maestro-universal-workflow/SKILL.md +15 -15
  62. package/skills/maestro-update/SKILL.md +10 -10
  63. package/skills/manage-codebase-rebuild/SKILL.md +4 -6
  64. package/skills/manage-drift-realign/SKILL.md +8 -11
  65. package/skills/manage-harvest/SKILL.md +6 -9
  66. package/skills/manage-issue/SKILL.md +5 -8
  67. package/skills/manage-issue-discover/SKILL.md +8 -11
  68. package/skills/manage-kg-extractors/SKILL.md +3 -3
  69. package/skills/manage-knowhow/SKILL.md +3 -5
  70. package/skills/manage-knowhow-capture/SKILL.md +4 -6
  71. package/skills/manage-knowledge-audit/SKILL.md +6 -9
  72. package/skills/manage-status/SKILL.md +3 -5
  73. package/skills/manage-wiki/SKILL.md +5 -7
  74. package/skills/odyssey-debug/SKILL.md +13 -13
  75. package/skills/odyssey-improve/SKILL.md +15 -15
  76. package/skills/odyssey-planex/SKILL.md +16 -16
  77. package/skills/odyssey-review-test-fix/SKILL.md +11 -11
  78. package/skills/odyssey-ui/SKILL.md +10 -10
  79. package/skills/prompt-generator/SKILL.md +5 -5
  80. package/skills/quality-auto-test/SKILL.md +3 -5
  81. package/skills/quality-debug/SKILL.md +3 -5
  82. package/skills/quality-refactor/SKILL.md +3 -5
  83. package/skills/quality-retrospective/SKILL.md +10 -13
  84. package/skills/quality-review/SKILL.md +5 -8
  85. package/skills/quality-sync/SKILL.md +3 -5
  86. package/skills/quality-test/SKILL.md +4 -6
  87. package/skills/scholar-anti-ai-writing/SKILL.md +1 -1
  88. package/skills/scholar-citation-verify/SKILL.md +1 -1
  89. package/skills/scholar-experiment/SKILL.md +2 -2
  90. package/skills/scholar-ideation/SKILL.md +7 -7
  91. package/skills/scholar-latex-organizer/SKILL.md +1 -1
  92. package/skills/scholar-publish/SKILL.md +3 -3
  93. package/skills/scholar-rebuttal-pro/SKILL.md +3 -3
  94. package/skills/scholar-review/SKILL.md +1 -1
  95. package/skills/scholar-writing/SKILL.md +1 -1
  96. package/skills/security-audit/SKILL.md +2 -4
  97. package/skills/skill-generator/SKILL.md +3 -3
  98. package/skills/skill-iter-tune/SKILL.md +3 -3
  99. package/skills/skill-simplify/SKILL.md +1 -1
  100. package/skills/skill-tuning/SKILL.md +1 -1
  101. package/skills/spec-add/SKILL.md +5 -7
  102. package/skills/spec-load/SKILL.md +3 -5
  103. package/skills/spec-remove/SKILL.md +4 -6
  104. package/skills/spec-setup/SKILL.md +6 -8
  105. package/skills/team-adversarial-swarm/SKILL.md +5 -5
  106. package/skills/team-arch-opt/SKILL.md +2 -2
  107. package/skills/team-brainstorm/SKILL.md +3 -3
  108. package/skills/team-coordinate/SKILL.md +4 -4
  109. package/skills/team-designer/SKILL.md +1 -1
  110. package/skills/team-executor/SKILL.md +3 -3
  111. package/skills/team-frontend/SKILL.md +2 -2
  112. package/skills/team-frontend-debug/SKILL.md +3 -3
  113. package/skills/team-interactive-craft/SKILL.md +2 -2
  114. package/skills/team-issue/SKILL.md +3 -3
  115. package/skills/team-lifecycle-v4/SKILL.md +4 -4
  116. package/skills/team-motion-design/SKILL.md +2 -2
  117. package/skills/team-perf-opt/SKILL.md +3 -3
  118. package/skills/team-planex/SKILL.md +2 -2
  119. package/skills/team-quality-assurance/SKILL.md +3 -3
  120. package/skills/team-review/SKILL.md +3 -3
  121. package/skills/team-roadmap-dev/SKILL.md +3 -3
  122. package/skills/team-swarm/SKILL.md +4 -4
  123. package/skills/team-tech-debt/SKILL.md +2 -2
  124. package/skills/team-testing/SKILL.md +3 -3
  125. package/skills/team-ui-polish/SKILL.md +2 -2
  126. package/skills/team-uidesign/SKILL.md +2 -2
  127. package/skills/team-ultra-analyze/SKILL.md +4 -4
  128. package/skills/team-ux-improve/SKILL.md +3 -3
  129. package/skills/team-visual-a11y/SKILL.md +2 -2
  130. package/skills/workflow-skill-designer/SKILL.md +8 -8
  131. package/templates/business-test-report.json +68 -0
  132. package/templates/config.json +48 -0
  133. package/templates/context.md +16 -0
  134. package/templates/doc-index.json +11 -0
  135. package/templates/index.json +68 -0
  136. package/templates/issue.json +36 -0
  137. package/templates/plan.json +38 -0
  138. package/templates/project.md +60 -0
  139. package/templates/reflection-log.md +20 -0
  140. package/templates/roadmap.md +45 -0
  141. package/templates/scratch-index.json +19 -0
  142. package/templates/search-tool.json +1 -0
  143. package/templates/search-tools.md +47 -0
  144. package/templates/state.json +18 -0
  145. package/templates/task-summary.md +21 -0
  146. package/templates/task.json +89 -0
  147. package/templates/terminology-template.json +22 -0
  148. package/templates/uat.md +21 -0
  149. package/templates/validation.json +31 -0
  150. package/templates/verification.json +37 -0
  151. package/templates/workflow.md +14 -0
  152. package/templates/worktree-scope.json +9 -0
  153. package/templates/worktrees.json +26 -0
  154. package/workflows/agy-instructions.md +156 -0
  155. package/workflows/analyze.md +768 -0
  156. package/workflows/auto-test.md +705 -0
  157. package/workflows/blueprint.md +406 -0
  158. package/workflows/boundary-grill.md +50 -0
  159. package/workflows/brainstorm.md +508 -0
  160. package/workflows/business-test.md +574 -0
  161. package/workflows/chinese-response.md +25 -0
  162. package/workflows/claude-instructions.md +167 -0
  163. package/workflows/codebase-rebuild.md +267 -0
  164. package/workflows/codebase-refresh.md +168 -0
  165. package/workflows/codex-instructions.md +156 -0
  166. package/workflows/coding-philosophy.md +70 -0
  167. package/workflows/command-authoring.md +823 -0
  168. package/workflows/debug.md +409 -0
  169. package/workflows/delegate-usage.md +99 -0
  170. package/workflows/domain-add.md +121 -0
  171. package/workflows/drift-realign.md +396 -0
  172. package/workflows/execute.md +631 -0
  173. package/workflows/explore-usage.md +93 -0
  174. package/workflows/finish-work.md +124 -0
  175. package/workflows/fork.md +162 -0
  176. package/workflows/grill.md +494 -0
  177. package/workflows/harvest.md +478 -0
  178. package/workflows/impeccable.md +168 -0
  179. package/workflows/init.md +157 -0
  180. package/workflows/instruction-authoring-guide.md +97 -0
  181. package/workflows/integration-test.md +186 -0
  182. package/workflows/interview-mechanics.md +8 -0
  183. package/workflows/issue-analyze.md +20 -0
  184. package/workflows/issue-discover.md +238 -0
  185. package/workflows/issue-execute.md +110 -0
  186. package/workflows/issue-gaps-analyze.codex.md +256 -0
  187. package/workflows/issue-gaps-analyze.md +215 -0
  188. package/workflows/issue-plan.md +110 -0
  189. package/workflows/issue.md +338 -0
  190. package/workflows/knowhow.md +429 -0
  191. package/workflows/knowledge-audit.md +355 -0
  192. package/workflows/learn.md +271 -0
  193. package/workflows/maestro-chain-execute.md +20 -0
  194. package/workflows/maestro-link-coordinate.md +114 -0
  195. package/workflows/maestro-super.md +120 -0
  196. package/workflows/maestro.md +501 -0
  197. package/workflows/map.md +74 -0
  198. package/workflows/merge.md +122 -0
  199. package/workflows/milestone-audit.md +155 -0
  200. package/workflows/milestone-complete.md +167 -0
  201. package/workflows/milestone-release.md +82 -0
  202. package/workflows/odyssey-base-codex.md +305 -0
  203. package/workflows/odyssey-base.md +256 -0
  204. package/workflows/overlays.md +109 -0
  205. package/workflows/plan.md +520 -0
  206. package/workflows/quick.md +350 -0
  207. package/workflows/ralph-amend-goal.md +177 -0
  208. package/workflows/refactor.md +87 -0
  209. package/workflows/retrospective.md +471 -0
  210. package/workflows/review.md +448 -0
  211. package/workflows/roadmap-common.md +193 -0
  212. package/workflows/roadmap.md +106 -0
  213. package/workflows/shell-exec-protocol.md +30 -0
  214. package/workflows/skill-authoring.md +265 -0
  215. package/workflows/spec-generate.md +475 -0
  216. package/workflows/specs-add.md +123 -0
  217. package/workflows/specs-load.md +76 -0
  218. package/workflows/specs-remove.md +104 -0
  219. package/workflows/specs-setup.md +316 -0
  220. package/workflows/status.md +149 -0
  221. package/workflows/sync.md +116 -0
  222. package/workflows/tdd.md +255 -0
  223. package/workflows/test-gen.md +226 -0
  224. package/workflows/test.md +385 -0
  225. package/workflows/tools-spec.md +70 -0
  226. package/workflows/ui-codify-extract.md +372 -0
  227. package/workflows/ui-codify-knowhow.md +258 -0
  228. package/workflows/ui-codify-package.md +159 -0
  229. package/workflows/ui-codify.md +227 -0
  230. package/workflows/ui-design.md +393 -0
  231. package/workflows/ui-style.md +201 -0
  232. package/workflows/verify.md +557 -0
  233. package/workflows/wiki-connect.md +153 -0
  234. package/workflows/wiki-digest.md +180 -0
  235. package/workflows/wiki-manage.md +113 -0
@@ -0,0 +1,393 @@
1
+ # UI Design Workflow
2
+
3
+ 4-layer extraction pipeline (style → animation → layout → assembly) producing design prototypes.
4
+ Powered by ui-ux-pro-max (design system recommendations) and ui-design-agent (token generation + assembly).
5
+ User reviews via compare.html, selects winner(s), design solidified as code reference for plan/execute.
6
+
7
+ Pipeline position: analyze -> **ui-design** -> plan -> execute -> verify
8
+
9
+ > **Note:** This is the primary implementation. When the `ui-ux-pro-max` skill is available,
10
+ > the command may delegate to `ui-style.md` for a lightweight path. This workflow is the
11
+ > fallback when the skill is unavailable, and is also used when `--full` is explicitly requested.
12
+
13
+ ---
14
+
15
+ ## Prerequisites
16
+
17
+ - `.workflow/` directory initialized (or auto-bootstrap)
18
+ - Python 3 available (required by ui-ux-pro-max skill)
19
+ - ui-ux-pro-max skill installed (search.py available)
20
+
21
+ ---
22
+
23
+ ## Scope Resolution
24
+
25
+ ```
26
+ Input: <phase> (number) OR topic text
27
+ Output: .workflow/scratch/{YYYYMMDD}-ui-design-{slug}/
28
+
29
+ Resolve scope:
30
+ number → phase slug from roadmap.md, scope="phase", register with phase
31
+ text → slugify(topic), scope="adhoc"|"standalone" (based on current_milestone)
32
+
33
+ mkdir -p ${OUTPUT_DIR}
34
+ ```
35
+
36
+ ---
37
+
38
+ ## Flag Processing
39
+
40
+ | Flag | Default | Effect |
41
+ |------|---------|--------|
42
+ | `--styles N` | 3 | Number of style variants (2-5) |
43
+ | `--layouts N` | 2 | Layout variants per target (1-3) |
44
+ | `--stack <stack>` | html-tailwind | Tech stack for guidelines |
45
+ | `--targets <pages>` | (inferred) | Comma-separated page/component targets |
46
+ | `--refine` | false | Refinement mode: fine-tune existing design-ref |
47
+ | `--persist` | false | Save MASTER.md + page overrides |
48
+ | `-y` | false | Auto mode: skip interactive selection |
49
+
50
+ ---
51
+
52
+ ### Step 1: Parse Arguments & Validate Environment
53
+
54
+ **1a. Parse flags:**
55
+ Extract from $ARGUMENTS per flag table above (styleCount clamped 2-5, layoutCount clamped 1-3, defaults applied).
56
+
57
+ **1b. Validate Python & locate ui-ux-pro-max:**
58
+ Require Python 3. Locate `search.py` in: `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`. If not found: **Error E003**.
59
+
60
+ **1c. Refinement mode validation:**
61
+ If `--refine` but `${PHASE_DIR}/design-ref/design-tokens.json` missing: **Error E004**.
62
+
63
+ **1d. Create output directories:**
64
+ ```bash
65
+ mkdir -p "${PHASE_DIR}/design-ref/prototypes"
66
+ mkdir -p "${PHASE_DIR}/design-ref/layout-templates"
67
+ mkdir -p "${PHASE_DIR}/design-ref/.intermediates/style-analysis"
68
+ mkdir -p "${PHASE_DIR}/design-ref/.intermediates/layout-analysis"
69
+ mkdir -p "${PHASE_DIR}/design-ref/variants"
70
+ ```
71
+
72
+ **1e. Display banner:**
73
+ Show: phase/topic, mode (explore|refine), styleCount, layoutCount, stack, targets, auto flag.
74
+
75
+ ---
76
+
77
+ ### Step 2: Gather Requirements Context
78
+
79
+ **Purpose:** Collect design-relevant context from existing artifacts.
80
+
81
+ Gather from available sources:
82
+ - **2a.** `${PHASE_DIR}/context.md` -- product type, industry, audience, design preferences, locked UI decisions
83
+ - **2b.** `${PHASE_DIR}/brainstorm/ui-designer/analysis.md`, `${PHASE_DIR}/brainstorm/product-manager/analysis.md` (visual keywords, personas)
84
+ - **2c.** `blueprint-summary.md` + `requirements/_index.md` (if index.json.blueprint_ref) -- UI-relevant requirements & acceptance criteria
85
+ - **2d.** `.workflow/codebase/doc-index.json` -- existing design tokens, CSS frameworks, component libraries, brand colors
86
+
87
+ **2e. Synthesize design brief:**
88
+ ```json
89
+ DESIGN_BRIEF = {
90
+ "product_type": "SaaS dashboard | e-commerce | landing page | ...",
91
+ "industry": "fintech | healthcare | beauty | ...",
92
+ "style_keywords": "modern minimalist professional | bold geometric | ...",
93
+ "audience": "enterprise users | young consumers | ...",
94
+ "constraints": { "brand_colors": [], "existing_components": [], "accessibility": "WCAG AA" },
95
+ "stack": "{resolved stack}"
96
+ }
97
+ ```
98
+
99
+ **2f. Infer targets** (if not specified):
100
+ Extract page names from phase goal / brainstorm / spec epics. Fallback: `["home"]`.
101
+
102
+ **2g. Interactive refinement** (skip if -y):
103
+ Present DESIGN_BRIEF summary, allow user adjustments before proceeding.
104
+
105
+ ---
106
+
107
+ ### Step 3: Generate Style Variants (Layer 1 — Style)
108
+
109
+ **Purpose:** Generate maximally contrasting design systems via ui-ux-pro-max + ui-design-agent.
110
+
111
+ #### 3a. Get primary design recommendations from ui-ux-pro-max
112
+
113
+ ```bash
114
+ # Primary design system + stack guidelines
115
+ python3 "${SKILL_PATH}" "${product_type} ${industry} ${style_keywords}" --design-system -p "${project_name}" -f markdown
116
+ python3 "${SKILL_PATH}" "layout responsive form component" --stack ${stack}
117
+
118
+ # Supplementary domain data (parallel): color, typography, ux
119
+ python3 "${SKILL_PATH}" "${industry} ${product_type}" --domain color
120
+ python3 "${SKILL_PATH}" "${style_keywords}" --domain typography
121
+ python3 "${SKILL_PATH}" "accessibility animation interaction" --domain ux
122
+ ```
123
+
124
+ #### 3b. Generate design direction options via ui-design-agent
125
+
126
+ ```
127
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Agent(ui-design-agent): [DESIGN_DIRECTION_GENERATION]
128
+
129
+ Generate ${styleCount} maximally contrasting design directions (min 6D distance: 0.7).
130
+
131
+ Input: DESIGN_BRIEF, ui-ux-pro-max recommendations, color/typography data.
132
+ If refine mode: also read existing design-tokens.json.
133
+
134
+ 6D Attribute Space (each 0.0-1.0):
135
+ color_saturation | visual_weight | formality | organic_geometric | innovation | density
136
+
137
+ Per direction generate:
138
+ Core: philosophy_name, 6D scores, search_keywords, anti_keywords, rationale
139
+ Preview: colors (OKLCH), fonts (Google Fonts), border_radius_base, mood_description
140
+
141
+ Output: ${PHASE_DIR}/design-ref/.intermediates/style-analysis/analysis-options.json
142
+ Schema: { "mode": "explore|refine", "design_directions": [...], "attribute_space_coverage": {...} }
143
+ ```
144
+
145
+ #### 3c. Interactive style selection (skip if -y)
146
+
147
+ Present directions with 6D visualization (colors, fonts, attribute scores, mood). Multi-select supported.
148
+ Update `analysis-options.json` with `user_selection` field.
149
+
150
+ #### 3d. Generate design-tokens.json for selected variant(s) (parallel)
151
+
152
+ For each selected direction, spawn ui-design-agent:
153
+
154
+ ```
155
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Agent(ui-design-agent): [DESIGN_SYSTEM_GENERATION #${variant_index}]
156
+
157
+ Generate production-ready design tokens from selected direction.
158
+ Map 6D attributes to token values:
159
+ color_saturation→chroma | visual_weight→weights/shadows | formality→serif choice/radius
160
+ organic_geometric→shapes | innovation→experimental values | density→spacing compression
161
+
162
+ Output: ${PHASE_DIR}/design-ref/variants/style-${variant_index}/design-tokens.json
163
+
164
+ Required schema:
165
+ {
166
+ "colors": {
167
+ "brand": { "primary|secondary|accent": "oklch(...)" },
168
+ "surface": { "background|elevated|card|overlay": "oklch(...)" },
169
+ "semantic": { "success|warning|error|info": "oklch(...)" },
170
+ "text": { "primary|secondary|tertiary|inverse": "oklch(...)" },
171
+ "border": { "default|strong|subtle": "oklch(...)" }
172
+ },
173
+ "typography": {
174
+ "font_family": { "heading|body|mono": "..." },
175
+ "font_size": { "xs..5xl": "rem scale" },
176
+ "font_weight": { "normal(400)|medium(500)|semibold(600)|bold(700)" },
177
+ "line_height": { "tight(1.25)|normal(1.5)|relaxed(1.75)" },
178
+ "letter_spacing": { "tight(-0.025em)|normal(0)|wide(0.025em)|wider(0.05em)" },
179
+ "combinations": { "heading-primary|heading-secondary|body-regular|body-emphasis|caption|label": "{family,size,weight,line_height,letter_spacing}" }
180
+ },
181
+ "spacing": { "0..24": "rem scale (0.25rem increments)" },
182
+ "opacity": { "0..100": "0.0-1.0 scale" },
183
+ "border_radius": { "none|sm|md|lg|xl|2xl|full": "0-9999px" },
184
+ "shadows": { "sm|md|lg|xl": "oklch shadow values" },
185
+ "component_styles": {
186
+ "button": { "primary|secondary|tertiary": "{bg, color, padding, radius, weight}" },
187
+ "card": { "default|interactive": "{bg, padding, radius, shadow}" },
188
+ "input": { "default|focus|error": "{border, padding, radius}" }
189
+ },
190
+ "breakpoints": { "sm(640)|md(768)|lg(1024)|xl(1280)|2xl(1536)": "px" }
191
+ }
192
+
193
+ Requirements: ALL colors OKLCH, WCAG AA (4.5:1 text, 3:1 UI), complete combinations + component_styles with var() refs, full opacity scale.
194
+ ```
195
+
196
+ ---
197
+
198
+ ### Step 4: Generate Animation Tokens (Layer 2 — Animation)
199
+
200
+ **Purpose:** Generate animation system complementing the selected styles.
201
+
202
+ ```
203
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Agent(ui-design-agent): [ANIMATION_SYSTEM_GENERATION]
204
+
205
+ Input: selected variant's design-tokens.json (mood/weight context) + ui-ux-pro-max UX data.
206
+ Output: ${PHASE_DIR}/design-ref/animation-tokens.json
207
+
208
+ Schema:
209
+ {
210
+ "duration": { "instant(0ms)|fast(100ms)|normal(200ms)|slow(300ms)|slower(500ms)|slowest(1000ms)" },
211
+ "easing": { "linear|ease-out|ease-in|ease-in-out|spring": "cubic-bezier values" },
212
+ "transitions": { "color|transform|opacity|shadow|all": "property + duration + easing var() refs" },
213
+ "keyframes": { "fadeIn|slideUp|scaleIn": "from/to with transform + opacity" },
214
+ "interactions": { "button-hover|card-hover|link-hover": "transform + shadow + transition var() refs" },
215
+ "reduced_motion": { "strategy": "remove-motion-keep-opacity", "media_query": "@media (prefers-reduced-motion: reduce)" }
216
+ }
217
+
218
+ Requirements: CSS custom properties, prefers-reduced-motion mandatory, var() refs for interactions, 100-300ms micro / up to 1000ms page transitions.
219
+ ```
220
+
221
+ ---
222
+
223
+ ### Step 5: Generate Layout Templates (Layer 3 — Layout)
224
+
225
+ **Purpose:** Generate structural layout templates per target, separate from visual style.
226
+
227
+ #### 5a. Generate layout concept options
228
+
229
+ ```
230
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Agent(ui-design-agent): [LAYOUT_CONCEPT_GENERATION]
231
+
232
+ Generate ${layoutCount} structurally distinct layout concepts per target.
233
+ Concepts must differ in: grid structure, component arrangement, visual hierarchy, navigation pattern.
234
+
235
+ Per Target x Concept: concept_name, design_philosophy, layout_pattern (grid-3col|flex-row|single-column|asymmetric-grid),
236
+ key_components, structural_features, ascii_art wireframe.
237
+
238
+ Output: ${PHASE_DIR}/design-ref/.intermediates/layout-analysis/analysis-options.json
239
+ Schema: { "layout_concepts": { "${target}": [concepts] }, "device_type": "responsive" }
240
+ ```
241
+
242
+ #### 5b. Interactive layout selection (skip if -y)
243
+
244
+ Present layout concepts per target with ASCII wireframes. Multi-select supported.
245
+ Update analysis-options.json with `user_selection.selected_variants`.
246
+
247
+ #### 5c. Generate layout template files (parallel)
248
+
249
+ For each selected concept × target:
250
+
251
+ ```
252
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Agent(ui-design-agent): [LAYOUT_TEMPLATE_GENERATION -- ${target} variant ${variant_id}]
253
+
254
+ Structure ONLY, no visual style. Output: ${PHASE_DIR}/design-ref/layout-templates/layout-${target}-${variant_id}.json
255
+
256
+ Schema:
257
+ {
258
+ "target": "${target}",
259
+ "variant_id": "layout-${variant_id}",
260
+ "device_type": "responsive",
261
+ "design_philosophy": "...",
262
+ "dom_structure": { "tag": "body", "children": [header>nav, div.layout-main-wrapper>[main+aside], footer] },
263
+ "component_hierarchy": ["header", "main-content", "sidebar", "footer"],
264
+ "css_layout_rules": "grid/flex rules using var(--spacing-*), var(--breakpoint-*)"
265
+ }
266
+
267
+ Rules: semantic HTML5, ARIA roles, var() refs only (no hard-coded values), mobile-first responsive. NO colors/fonts/shadows.
268
+ ```
269
+
270
+ GATE Step 5→6: design-tokens.json + animation-tokens.json + layout-templates exist BEFORE assembly; BLOCKED if any missing
271
+
272
+ ---
273
+
274
+ ### Step 6: Assemble HTML Prototypes (Layer 4 — Assembly)
275
+
276
+ **Purpose:** Combine layout templates + design tokens + animation tokens into viewable HTML.
277
+
278
+ For each `style × layout × target` combination, spawn ui-design-agent:
279
+
280
+ ```
281
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Agent(ui-design-agent): [PROTOTYPE_ASSEMBLY -- ${target}-style-${s}-layout-${l}]
282
+
283
+ Pure assembly: combine pre-extracted structure + tokens. NO design decisions.
284
+
285
+ Inputs: layout-${target}-${l}.json + style-${s}/design-tokens.json + animation-tokens.json
286
+
287
+ Assembly:
288
+ HTML: dom_structure -> <!DOCTYPE html>, Google Fonts CDN, realistic content (not lorem ipsum), ARIA preserved
289
+ CSS: css_layout_rules + resolved token values (colors, typography, shadows, radius) +
290
+ component_styles + typography.combinations + animation keyframes/interactions + reduced-motion
291
+
292
+ Quality: SVG icons (not emojis), cursor-pointer on clickables, 150-300ms transitions,
293
+ 4.5:1 contrast, prefers-reduced-motion, responsive (375/768/1024/1440px)
294
+
295
+ Output: ${PHASE_DIR}/design-ref/prototypes/${target}-style-${s}-layout-${l}.{html,css}
296
+ ```
297
+
298
+ **Agent grouping**: Max 6 concurrent agents. Each agent processes ONE style (may handle multiple layouts).
299
+
300
+ **Generate compare.html**: Interactive matrix viewer with:
301
+ - Style tabs × Layout tabs × Target tabs
302
+ - Each cell: iframe loading the corresponding HTML
303
+ - Side-by-side comparison mode
304
+
305
+ ---
306
+
307
+ ### Step 7: User Selection & Solidification
308
+
309
+ **Purpose:** Present variants, collect user choice, solidify as canonical reference.
310
+
311
+ #### 7a. Present overview
312
+
313
+ Present S x L x T matrix overview with compare.html link. Per style: name, colors, fonts, 6D scores.
314
+ Selection options: `1-N` (select), `mix` (merge), `redo` (regenerate), `all` (keep all).
315
+
316
+ #### 7b. Process selection
317
+
318
+ Auto mode (-y): select variant 1. Otherwise: `redo` -> Step 3, `mix` -> merge tokens, `all` -> keep all, number -> select that variant.
319
+
320
+ #### 7c. Solidify selected design
321
+
322
+ **Write MASTER.md:**
323
+ Sections: Selected Style (6D attributes), Color Palette (token table), Typography (fonts/scale/combinations),
324
+ Spacing & Layout, Effects & Interactions, Component Styles, Animation System, Anti-Patterns, Reference Prototypes.
325
+
326
+ **Copy canonical files:**
327
+ - `design-ref/design-tokens.json` ← selected variant's tokens
328
+ - `design-ref/animation-tokens.json` ← already at root
329
+ - `design-ref/layout-templates/` ← already populated
330
+
331
+ **Write selection.json:**
332
+ ```json
333
+ {
334
+ "selected_variant": 1,
335
+ "variant_name": "Clean Minimalist",
336
+ "selection_mode": "user_choice|auto|mix|all",
337
+ "rationale": "...",
338
+ "design_attributes": { "color_saturation": 0.3, "visual_weight": 0.2, "...": "..." },
339
+ "alternatives_reviewed": 3,
340
+ "selected_at": "ISO timestamp"
341
+ }
342
+ ```
343
+
344
+ **Write page-specific overrides** (if --persist):
345
+ `design-ref/pages/{target}.md` per target page.
346
+
347
+ **Update index.json:**
348
+ ```json
349
+ {
350
+ "design_ref": {
351
+ "status": "selected",
352
+ "variant": "{variant_name}",
353
+ "master": "design-ref/MASTER.md",
354
+ "tokens": "design-ref/design-tokens.json",
355
+ "animation": "design-ref/animation-tokens.json",
356
+ "layouts": "design-ref/layout-templates/",
357
+ "prototypes": "design-ref/prototypes/",
358
+ "created_at": "ISO timestamp"
359
+ }
360
+ }
361
+ ```
362
+
363
+ ---
364
+
365
+ ## Integration with maestro-plan
366
+
367
+ `maestro-plan` P1 (Context Collection):
368
+ - If `${PHASE_DIR}/design-ref/MASTER.md` exists: load as planner context, add `design-tokens.json`, `layout-templates/layout-*.json`, `animation-tokens.json` to UI task `read_first[]`
369
+ - If missing + phase goal has UI keywords: suggest `maestro-impeccable --chain build` (non-blocking)
370
+
371
+ ---
372
+
373
+ ## Error Handling
374
+
375
+ | Error | Action |
376
+ |-------|--------|
377
+ | Python not found | Abort with install instructions per OS |
378
+ | ui-ux-pro-max not found | Abort, suggest skill installation |
379
+ | Design system returns empty | Retry with broader keywords, then abort |
380
+ | Prototype agent fails | Log error, continue with other variants; flag variants as [LOW CONFIDENCE] (prototype agent failed) |
381
+ | User cancels selection | Save all variants as-is, exit without MASTER.md |
382
+ | --refine without existing design-ref | Error E004 |
383
+
384
+ ---
385
+
386
+ ## State Updates
387
+
388
+ | When | Field | Value |
389
+ |------|-------|-------|
390
+ | Step 1 start | index.json.status | "designing" |
391
+ | Step 6 complete | index.json.design_ref.status | "variants_ready" |
392
+ | Step 7 complete | index.json.design_ref.status | "selected" |
393
+ | Step 7 complete | index.json.updated_at | Current timestamp |
@@ -0,0 +1,201 @@
1
+ # UI Style Workflow (ui-ux-pro-max powered)
2
+
3
+ Lightweight design workflow delegating to ui-ux-pro-max for design system generation.
4
+ Command owns: requirements gathering, variant presentation, user selection, solidification.
5
+
6
+ Pipeline position: analyze -> **ui-design** -> plan -> execute -> verify
7
+
8
+ ---
9
+
10
+ ## Prerequisites
11
+
12
+ - `.workflow/` directory initialized
13
+ - Phase directory OR scratch mode
14
+ - Python 3 + ui-ux-pro-max skill installed (SKILL_PATH resolved by command)
15
+
16
+ ---
17
+
18
+ ## Phase Resolution
19
+
20
+ ```
21
+ If argument is phase number/slug:
22
+ Resolve PHASE_DIR from state.json artifact registry. Error if not found.
23
+ SCRATCH_MODE = false
24
+
25
+ If argument is topic text (scratch mode):
26
+ PHASE_DIR = .workflow/scratch/{YYYYMMDD}-ui-design-{slug}
27
+ Create directory + minimal index.json (type="ui-design", goal=topic).
28
+ SCRATCH_MODE = true
29
+ ```
30
+
31
+ ---
32
+
33
+ ## Flag Processing
34
+
35
+ | Flag | Default | Effect |
36
+ |------|---------|--------|
37
+ | `--styles N` | 3 | Number of style variants (2-5) |
38
+ | `--stack <stack>` | html-tailwind | Tech stack for guidelines |
39
+ | `--targets <pages>` | (inferred) | Comma-separated page targets |
40
+ | `--persist` | false | Save with hierarchical page overrides |
41
+ | `-y` | false | Auto mode: skip interactive selection |
42
+
43
+ ---
44
+
45
+ ### Step 1: Setup
46
+
47
+ **1a. Parse flags** from $ARGUMENTS: `--styles N` (2-5, default 3), `--stack` (default html-tailwind), `--targets` (comma-separated), `--persist`, `-y`/`--yes`.
48
+
49
+ **1b. Create output directories:** `${PHASE_DIR}/design-ref/prototypes/` and `design-ref/layout-templates/`.
50
+
51
+ **1c. Display banner** with phase, style count, stack, targets.
52
+
53
+ ---
54
+
55
+ ### Step 2: Gather Requirements Context
56
+
57
+ Gather context from available sources:
58
+ - **2a.** Phase context.md: product type, industry, audience, preferences
59
+ - **2b.** Brainstorm results: visual direction keywords, persona, product type
60
+ - **2c.** Blueprint reference (index.json.blueprint_ref): UI-relevant requirements
61
+
62
+ **2d. Synthesize design brief:** product_type, industry, style_keywords, audience.
63
+
64
+ **2e. Infer targets** from phase goal / brainstorm / spec. Fallback: `["home"]`.
65
+
66
+ **2f. Interactive brief review** (skip if -y): present brief, allow adjustments.
67
+
68
+ ---
69
+
70
+ ### Step 3: Generate Style Variants via ui-ux-pro-max
71
+
72
+ **Purpose:** Call ui-ux-pro-max multiple times with different keyword emphasis to produce contrasting variants.
73
+
74
+ #### 3a. Build variant keyword sets
75
+
76
+ Generate `styleCount` contrasting keyword sets (e.g., conservative/expressive/premium directions).
77
+
78
+ #### 3b. Call ui-ux-pro-max for each variant (parallel)
79
+
80
+ ```bash
81
+ # Per variant — design system
82
+ python3 "${SKILL_PATH}" "${variant_keywords[N]}" --design-system -p "${project_name}" -f markdown
83
+
84
+ # Once — stack guidelines + domain supplements
85
+ python3 "${SKILL_PATH}" "layout responsive form component" --stack ${stack}
86
+ python3 "${SKILL_PATH}" "${industry} ${product_type}" --domain color
87
+ python3 "${SKILL_PATH}" "accessibility animation interaction" --domain ux
88
+ ```
89
+
90
+ Save variants to `${PHASE_DIR}/design-ref/prototypes/variant-{N}-system.md`.
91
+
92
+ #### 3c. Present variants (skip if -y)
93
+
94
+ Display each variant summary (pattern, colors, typography, effects, anti-patterns).
95
+ User selects: [1-N | "redo" | "all"]. Auto mode selects variant 1.
96
+
97
+ GATE Step 3→4: selected variant confirmed BEFORE solidification; BLOCKED if no variant selected
98
+
99
+ ---
100
+
101
+ ### Step 4: Solidify Selected Design
102
+
103
+ **Purpose:** Map ui-ux-pro-max output to design-ref/ structure for downstream plan/execute.
104
+
105
+ #### 4a. Persist via ui-ux-pro-max
106
+
107
+ ```bash
108
+ python3 "${SKILL_PATH}" "${selected_variant_keywords}" --design-system --persist -p "${project_name}"
109
+ # If --persist + targets: generate page overrides per target with --page "${target}"
110
+ ```
111
+
112
+ #### 4b. Generate design-tokens.json
113
+
114
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Spawn agent to extract structured tokens from MASTER.md into `${PHASE_DIR}/design-ref/design-tokens.json`.
115
+
116
+ **Token schema keys:** colors (brand/surface/semantic/text/border in OKLCH), typography (family/size/weight/line_height/combinations), spacing, border_radius, shadows, component_styles (button/card/input), breakpoints.
117
+
118
+ **Rules:** hex/rgb to OKLCH, var() references in combinations/components, WCAG AA contrast (4.5:1 text, 3:1 UI).
119
+
120
+ #### 4c. Generate animation-tokens.json
121
+
122
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Spawn agent to generate `${PHASE_DIR}/design-ref/animation-tokens.json` from design-tokens + MASTER.md.
123
+
124
+ **Token schema keys:** duration (instant-slower), easing (ease-out/ease-in-out/spring), transitions, keyframes, interactions (hover states), reduced_motion (prefers-reduced-motion strategy).
125
+
126
+ #### 4d. Map files to design-ref/
127
+
128
+ Copy `design-system/MASTER.md` and `design-system/pages/*.md` (if generated) to `${PHASE_DIR}/design-ref/`.
129
+
130
+ #### 4e. Write selection.json
131
+
132
+ ```json
133
+ {
134
+ "selected_variant": 1,
135
+ "variant_name": "{pattern_name} — {style_name}",
136
+ "selection_mode": "user_choice|auto",
137
+ "source": "ui-ux-pro-max",
138
+ "keywords": "{selected_variant_keywords}",
139
+ "selected_at": "ISO timestamp"
140
+ }
141
+ ```
142
+
143
+ #### 4f. Optional: Generate HTML prototype
144
+
145
+ For each target, MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: spawn agent to create `${PHASE_DIR}/design-ref/prototypes/${target}.html` from design-tokens + animation-tokens + MASTER.md.
146
+
147
+ **Rules:** standalone HTML with embedded CSS, realistic content (not lorem ipsum), SVG icons (Heroicons/Lucide CDN), cursor-pointer on clickables, responsive (375/768/1024px), WCAG AA, prefers-reduced-motion.
148
+
149
+ #### 4g. Update index.json
150
+
151
+ ```json
152
+ {
153
+ "design_ref": {
154
+ "status": "selected",
155
+ "variant": "{variant_name}",
156
+ "source": "ui-ux-pro-max",
157
+ "master": "design-ref/MASTER.md",
158
+ "tokens": "design-ref/design-tokens.json",
159
+ "animation": "design-ref/animation-tokens.json",
160
+ "prototypes": "design-ref/prototypes/",
161
+ "created_at": "ISO timestamp"
162
+ }
163
+ }
164
+ ```
165
+
166
+ ---
167
+
168
+ ## Escalation
169
+
170
+ If the design needs exceed ui-ux-pro-max capabilities (e.g., multi-layout matrix, 6D attribute space exploration, full style x layout x target prototype grid), suggest:
171
+
172
+ ```
173
+ For advanced multi-layer design exploration:
174
+ /maestro-impeccable --chain build {target}
175
+ ```
176
+
177
+ ---
178
+
179
+ ## Integration with maestro-plan
180
+
181
+ Same as ui-design.md — plan.md Step 4b detects `design-ref/MASTER.md` and includes tokens in task `read_first[]`.
182
+
183
+ ---
184
+
185
+ ## Error Handling
186
+
187
+ | Error | Action |
188
+ |-------|--------|
189
+ | ui-ux-pro-max returns empty | Retry with broader keywords, then abort |
190
+ | Token extraction agent fails | Retry once, warn if still fails; if still fails, mark design-tokens.json as [LOW CONFIDENCE] (token extraction agent failed) |
191
+ | User cancels selection | Save all variants, exit without solidification |
192
+
193
+ ---
194
+
195
+ ## State Updates
196
+
197
+ | When | Field | Value |
198
+ |------|-------|-------|
199
+ | Step 1 start | index.json.status | "designing" |
200
+ | Step 4 complete | index.json.design_ref.status | "selected" |
201
+ | Step 4 complete | index.json.updated_at | Current timestamp |