@polymorphism-tech/morph-spec 4.10.6 → 4.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +3 -0
- package/LICENSE +71 -71
- package/README.md +379 -379
- package/bin/morph-spec.js +89 -0
- package/bin/task-manager.js +59 -6
- package/claude-plugin.json +14 -14
- package/docs/CHEATSHEET.md +1 -1
- package/docs/QUICKSTART.md +206 -206
- package/framework/agents/README.md +14 -14
- package/framework/agents/architecture/standards-architect.md +159 -159
- package/framework/agents/frontend/blazor-builder.md +13 -0
- package/framework/agents/frontend/css-specialist.md +87 -0
- package/framework/agents/frontend/nextjs-expert.md +13 -0
- package/framework/agents/frontend/nextjs-ui-specialist.md +218 -0
- package/framework/agents/frontend/ui-ux-designer.md +80 -10
- package/framework/agents/infrastructure/azure-architect.md +149 -149
- package/framework/agents/infrastructure/infra-architect.md +48 -48
- package/framework/agents.json +2268 -2567
- package/framework/hooks/README.md +204 -204
- package/framework/hooks/claude-code/post-tool-use/dispatch.js +10 -5
- package/framework/hooks/claude-code/session-start/inject-morph-context.js +10 -24
- package/framework/hooks/shared/phase-utils.js +139 -139
- package/framework/hooks/shared/worktree-helpers.js +30 -8
- package/framework/rules/csharp-standards.md +13 -13
- package/framework/rules/frontend-standards.md +13 -13
- package/framework/rules/infrastructure-standards.md +16 -16
- package/framework/rules/testing-standards.md +14 -14
- package/framework/skills/README.md +0 -1
- package/framework/skills/level-0-meta/morph-brainstorming/SKILL.md +12 -0
- package/framework/skills/level-0-meta/morph-code-review-nextjs/references/review-example-nextjs.md +254 -254
- package/framework/skills/level-0-meta/morph-init/SKILL.md +88 -3
- package/framework/skills/level-1-workflows/morph-phase-clarify/SKILL.md +247 -247
- package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +270 -270
- package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +515 -499
- package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +508 -471
- package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +12 -1
- package/framework/skills/level-1-workflows/morph-phase-setup/SKILL.md +272 -258
- package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +317 -311
- package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +424 -323
- package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +1 -1
- package/framework/standards/STANDARDS.json +2040 -2040
- package/framework/standards/frontend/nextjs/motion-patterns.md +321 -0
- package/framework/standards/frontend/nextjs/nextjs-patterns.md +17 -17
- package/framework/templates/README.md +814 -814
- package/framework/templates/code/dotnet/contracts/Commands.cs +74 -74
- package/framework/templates/code/dotnet/contracts/Entities.cs +25 -25
- package/framework/templates/code/dotnet/contracts/Queries.cs +74 -74
- package/framework/templates/code/dotnet/contracts/README.md +74 -74
- package/framework/templates/code/dotnet/contracts/api-contracts.cs +173 -173
- package/framework/templates/code/dotnet/frontend/component.razor +239 -239
- package/framework/templates/code/dotnet/jobs/agent.cs +163 -163
- package/framework/templates/code/dotnet/jobs/job.cs +171 -171
- package/framework/templates/code/dotnet/test.cs +239 -239
- package/framework/templates/code/sql/rls-policy.sql +57 -57
- package/framework/templates/code/sql/supabase-migration.sql +100 -100
- package/framework/templates/code/sql/supabase-migration.template.sql +113 -113
- package/framework/templates/code/typescript/contracts.ts +168 -168
- package/framework/templates/context/CONTEXT.md +181 -181
- package/framework/templates/context/design-system.md +211 -0
- package/framework/templates/docs/proposal.md +182 -182
- package/framework/templates/docs/user-stories.md +34 -34
- package/framework/templates/examples/design-system-examples.md +357 -357
- package/framework/templates/examples/spec-examples.md +90 -90
- package/framework/templates/feature/decisions.md +187 -187
- package/framework/templates/feature/recap.md +146 -146
- package/framework/templates/feature/tasks.md +199 -199
- package/framework/templates/infrastructure/azure/README.md +286 -286
- package/framework/templates/infrastructure/azure/deploy-checklist.md +426 -426
- package/framework/templates/infrastructure/azure/parameters.dev.json +29 -29
- package/framework/templates/infrastructure/azure/parameters.prod.json +29 -29
- package/framework/templates/infrastructure/azure/parameters.staging.json +29 -29
- package/framework/templates/infrastructure/docker/docker-compose.template.yml +67 -67
- package/framework/templates/infrastructure/docker/dockerfile-api.dockerfile +38 -38
- package/framework/templates/infrastructure/docker/dockerfile-web.dockerfile +48 -48
- package/framework/templates/infrastructure/docker/easypanel.template.json +54 -54
- package/package.json +82 -82
- package/src/commands/agents/agent-metrics.js +174 -0
- package/src/commands/agents/audit-dispatch.js +82 -0
- package/src/commands/agents/detect-agents.js +275 -0
- package/src/commands/agents/dispatch-agents.js +41 -135
- package/src/commands/agents/index.js +13 -4
- package/src/commands/agents/manage-agents.js +352 -0
- package/src/commands/project/doctor.js +59 -0
- package/src/commands/project/install-plugin-cmd.js +28 -28
- package/src/commands/project/setup-infra-cmd.js +12 -12
- package/src/commands/project/update.js +1 -17
- package/src/commands/project/worktree.js +58 -2
- package/src/commands/state/advance-phase.js +11 -3
- package/src/commands/tasks/index.js +4 -4
- package/src/commands/templates/index.js +5 -5
- package/src/commands/utils/index.js +3 -3
- package/src/commands/validation/index.js +4 -4
- package/src/core/state/phase-state-machine.js +217 -217
- package/src/core/state/state-manager.js +81 -0
- package/src/lib/agents/agents-manager.js +349 -0
- package/src/lib/agents/metrics-calculator.js +125 -0
- package/src/lib/agents/output-collector.js +75 -0
- package/src/lib/generators/context-generator.js +8 -7
- package/src/lib/generators/design-system-generator.js +298 -298
- package/src/lib/generators/index.js +10 -10
- package/src/lib/generators/metadata-extractor.js +387 -387
- package/src/lib/stack-filter.js +65 -65
- package/src/lib/standards/index.js +7 -7
- package/src/lib/standards/standards-context-injector.js +302 -302
- package/src/lib/tasks/task-parser.js +94 -3
- package/src/lib/validators/architecture/architecture-validator.js +387 -387
- package/src/lib/validators/architecture/index.js +7 -7
- package/src/lib/validators/blazor/blazor-concurrency-analyzer.js +316 -316
- package/src/lib/validators/blazor/blazor-state-validator.js +279 -279
- package/src/lib/validators/blazor/blazor-validator.js +369 -369
- package/src/lib/validators/blazor/index.js +9 -9
- package/src/lib/validators/checkpoint-persistence.js +39 -0
- package/src/lib/validators/content/content-validator.js +287 -279
- package/src/lib/validators/content/index.js +7 -7
- package/src/lib/validators/contracts/index.js +7 -7
- package/src/lib/validators/css/css-validator.js +352 -352
- package/src/lib/validators/css/index.js +7 -7
- package/src/lib/validators/design-system/design-system-validator.js +231 -231
- package/src/lib/validators/design-system/index.js +7 -7
- package/src/lib/validators/nextjs/index.js +6 -6
- package/src/lib/validators/nextjs/next-component-validator.js +183 -183
- package/src/lib/validators/packages/index.js +7 -7
- package/src/lib/validators/packages/package-validator.js +360 -360
- package/src/lib/validators/shared/index.js +12 -12
- package/src/lib/validators/shared/issue-counter.js +18 -18
- package/src/lib/validators/shared/result-formatter.js +124 -124
- package/src/lib/validators/spec-validator.js +2 -2
- package/src/lib/validators/ui/index.js +7 -7
- package/src/lib/validators/ui/ui-contrast-validator.js +422 -422
- package/src/lib/validators/validation-runner.js +20 -0
- package/src/scripts/global-install.js +58 -58
- package/src/scripts/install-plugin.js +126 -126
- package/src/scripts/setup-infra.js +1 -17
- package/src/utils/agent-id-mapper.js +11 -0
- package/src/utils/agents-installer.js +40 -8
- package/src/utils/claude-md-injector.js +90 -90
- package/src/utils/claude-settings-manager.js +1 -1
- package/src/utils/file-copier.js +200 -196
- package/src/utils/hooks-installer.js +556 -739
- package/src/utils/logger.js +32 -32
- package/src/utils/skills-installer.js +178 -178
- package/src/utils/tier-helpers.js +24 -0
- package/src/utils/version-checker.js +175 -175
- package/framework/agents/architecture/po-pm-advisor.md +0 -203
- package/framework/hooks/claude-code/user-prompt/set-terminal-title.js +0 -68
- package/framework/skills/level-1-workflows/morph-phase-implement/.morph/logs/activity.json +0 -38
- package/framework/skills/level-1-workflows/morph-phase-tasks/.morph/logs/activity.json +0 -14
- package/framework/templates/.idea/morph-templates.xml +0 -92
- package/framework/templates/.vscode/morph-templates.code-snippets +0 -186
|
@@ -1,324 +1,425 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: morph-phase-uiux
|
|
3
|
-
description: MORPH-SPEC Phase 1.5 (UI/UX). Creates design-system.md, mockups.md, components.md, and flows.md using Playwright/Context7 MCPs. Use after setup for features with frontend UI components, pages, dashboards, forms, wizards, or visual interactions requiring design documentation.
|
|
4
|
-
argument-hint: "[feature-name]"
|
|
5
|
-
user-invocable: false
|
|
6
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
7
|
-
cliVersion: "4.10.
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# MORPH UI/UX Design - Phase 1.5
|
|
11
|
-
|
|
12
|
-
> INTERNAL: Workflow skill used by /morph-proposal during automated phase orchestration. Not a user command.
|
|
13
|
-
|
|
14
|
-
Conditional phase for features with front-end. Collects UI/UX requirements, generates wireframes, component specs, and user flows.
|
|
15
|
-
|
|
16
|
-
## Prerequisites
|
|
17
|
-
|
|
18
|
-
- [ ] Phase 1 (Setup) completed
|
|
19
|
-
- [ ] Feature has detected UI keywords (blazor, ui, component, page, dashboard, wizard, form, chart)
|
|
20
|
-
- [ ] `
|
|
21
|
-
|
|
22
|
-
## Recommended Tools
|
|
23
|
-
|
|
24
|
-
> **Ref:** `framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md` for complete guide.
|
|
25
|
-
> **Ref:** `framework/standards/integration/mcp/mcp-tools.md` for MCP reference.
|
|
26
|
-
|
|
27
|
-
| Action | Tool | Alternative |
|
|
28
|
-
|--------|------|-------------|
|
|
29
|
-
| Check existing design system | **Read** `.morph/context/design-system.md` | — |
|
|
30
|
-
| Read user screenshots | **Read** (image file) | — |
|
|
31
|
-
| Search for existing CSS variables | **Grep** `--root:` in `*.css,*.scss` | — |
|
|
32
|
-
| Find existing components | **Glob** `**/Components/**/*.razor` or `**/components/**/*.tsx` | — |
|
|
33
|
-
| UI component documentation | **Context7 MCP** `query_docs({ libraryId, query })` | **WebSearch** + **WebFetch** |
|
|
34
|
-
| Preview existing page | **Playwright MCP** `browser_navigate()` + `browser_take_screenshot()` | **WebFetch** URL |
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
- Do you have
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- What
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
- **
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
- **
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
>
|
|
164
|
-
|
|
165
|
-
####
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
-
|
|
184
|
-
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
194
|
-
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
**
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
/
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
**
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
-
|
|
304
|
-
|
|
305
|
-
- [
|
|
306
|
-
- [
|
|
307
|
-
- [
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
1
|
+
---
|
|
2
|
+
name: morph-phase-uiux
|
|
3
|
+
description: MORPH-SPEC Phase 1.5 (UI/UX). Creates design-system.md, mockups.md, components.md, and flows.md using Playwright/Context7 MCPs. Use after setup for features with frontend UI components, pages, dashboards, forms, wizards, or visual interactions requiring design documentation.
|
|
4
|
+
argument-hint: "[feature-name]"
|
|
5
|
+
user-invocable: false
|
|
6
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
7
|
+
cliVersion: "4.10.8"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# MORPH UI/UX Design - Phase 1.5
|
|
11
|
+
|
|
12
|
+
> INTERNAL: Workflow skill used by /morph-proposal during automated phase orchestration. Not a user command.
|
|
13
|
+
|
|
14
|
+
Conditional phase for features with front-end. Collects UI/UX requirements, generates wireframes, component specs, and user flows.
|
|
15
|
+
|
|
16
|
+
## Prerequisites
|
|
17
|
+
|
|
18
|
+
- [ ] Phase 1 (Setup) completed
|
|
19
|
+
- [ ] Feature has detected UI keywords (blazor, ui, component, page, dashboard, wizard, form, chart)
|
|
20
|
+
- [ ] `ui-designer` agent activated
|
|
21
|
+
|
|
22
|
+
## Recommended Tools
|
|
23
|
+
|
|
24
|
+
> **Ref:** `framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md` for complete guide.
|
|
25
|
+
> **Ref:** `framework/standards/integration/mcp/mcp-tools.md` for MCP reference.
|
|
26
|
+
|
|
27
|
+
| Action | Tool | Alternative |
|
|
28
|
+
|--------|------|-------------|
|
|
29
|
+
| Check existing design system | **Read** `.morph/context/design-system.md` | — |
|
|
30
|
+
| Read user screenshots | **Read** (image file) | — |
|
|
31
|
+
| Search for existing CSS variables | **Grep** `--root:` in `*.css,*.scss` | — |
|
|
32
|
+
| Find existing components | **Glob** `**/Components/**/*.razor` or `**/components/**/*.tsx` | — |
|
|
33
|
+
| UI component documentation | **Context7 MCP** `query_docs({ libraryId, query })` | **WebSearch** + **WebFetch** |
|
|
34
|
+
| Preview existing page | **Playwright MCP** `browser_navigate()` + `browser_take_screenshot()` | **WebFetch** URL |
|
|
35
|
+
| Generate visual mockup | **Playwright MCP** `browser_navigate()` + `browser_resize()` + `browser_take_screenshot()` | HTML file + manual screenshot |
|
|
36
|
+
| Inspect page structure | **Playwright MCP** `browser_snapshot()` | **WebFetch** + manual parse |
|
|
37
|
+
| Test responsive layout | **Playwright MCP** `browser_resize()` + `browser_take_screenshot()` | Manual testing |
|
|
38
|
+
| External design references | **WebSearch** + **WebFetch** | — |
|
|
39
|
+
| Render UI templates | **Bash** `npx morph-spec template render docs/ui-mockups ...` | — |
|
|
40
|
+
| Generate design system from existing CSS | **Bash** `npx morph-spec generate design-system --scan` | — |
|
|
41
|
+
| Update state | **Bash** `npx morph-spec state mark-output ...` | — |
|
|
42
|
+
|
|
43
|
+
**MCPs for this phase:** Playwright (preview, inspection, responsiveness), Context7 (component docs).
|
|
44
|
+
|
|
45
|
+
**Anti-patterns:**
|
|
46
|
+
- WebSearch for MudBlazor docs (use Context7 MCP — more precise)
|
|
47
|
+
- Task agent to read a screenshot (use Read directly on image)
|
|
48
|
+
- Guess component props (use Context7 for actual API)
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Workflow
|
|
53
|
+
|
|
54
|
+
### Step 0: Ensure uiux phase
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npx morph-spec state get $ARGUMENTS
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Check the `"phase"` field in the output:
|
|
61
|
+
|
|
62
|
+
**If `"phase": "uiux"`** → correct phase, proceed.
|
|
63
|
+
|
|
64
|
+
**If `"phase": "setup"`** → execute:
|
|
65
|
+
1. `npx morph-spec phase advance $ARGUMENTS` (→ uiux)
|
|
66
|
+
|
|
67
|
+
**Any other value** → do not proceed — inconsistent state, report to user.
|
|
68
|
+
|
|
69
|
+
> **Rule:** Never write to `2-ui/` until the phase is `uiux`. The hook will block writes.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
### Step 0.5: Check Design System Exists
|
|
74
|
+
|
|
75
|
+
**CRITICAL:** Before starting UI/UX phase, check if a design system exists:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
Read: .morph/context/design-system.md
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
If the file doesn't exist (design system not found):
|
|
82
|
+
|
|
83
|
+
1. **Option A - Automatic scaffold:**
|
|
84
|
+
- The system will automatically create a design system when advancing to implementation
|
|
85
|
+
- You can generate manually now: `npx morph-spec generate design-system`
|
|
86
|
+
|
|
87
|
+
2. **Option B - Create manually:**
|
|
88
|
+
- Create `.morph/context/design-system.md` (project-level, shared)
|
|
89
|
+
- Or `.morph/features/$ARGUMENTS/2-ui/design-system.md` (feature-specific)
|
|
90
|
+
|
|
91
|
+
3. **Option C - Scan existing CSS:**
|
|
92
|
+
- If the project already has CSS with variables: `npx morph-spec generate design-system --scan`
|
|
93
|
+
|
|
94
|
+
**IMPORTANT:**
|
|
95
|
+
- Design system is **mandatory** for UI features
|
|
96
|
+
- Automatic gate will block implementation (Phase 5) if design system doesn't exist
|
|
97
|
+
- Better to create now to ensure visual consistency
|
|
98
|
+
|
|
99
|
+
### Step 1: Detect If Phase Is Needed
|
|
100
|
+
|
|
101
|
+
Check if active agents include `ui-designer`:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npx morph-spec state get $ARGUMENTS
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
If `ui-designer` is NOT in `activeAgents`, skip this phase and continue to Phase 2 (Design).
|
|
108
|
+
|
|
109
|
+
### Step 1.5: Design Thinking — Aesthetic Direction
|
|
110
|
+
|
|
111
|
+
> **Ref:** `framework/standards/frontend/design-system/aesthetic-direction.md`
|
|
112
|
+
|
|
113
|
+
**BEFORE collecting technical requirements**, define visual direction with 4 questions:
|
|
114
|
+
|
|
115
|
+
1. **Purpose**: What problem does it solve? Who uses it? What is the professional context?
|
|
116
|
+
2. **Tone**: What direction? (Minimal Refined / Editorial / Soft Professional / Industrial / Modern Luxury)
|
|
117
|
+
3. **Differentiation**: What is the 1 memorable element of this interface?
|
|
118
|
+
4. **Constraints**: Framework, performance budget, existing brand guidelines
|
|
119
|
+
|
|
120
|
+
**CRITICAL:** Commit to direction BEFORE technical specs. Document in `ui-design-system.md`
|
|
121
|
+
in section `## Aesthetic Direction` (template available in the standard above).
|
|
122
|
+
|
|
123
|
+
**Anti-patterns to avoid:**
|
|
124
|
+
- Purple gradient on white background (AI cliche)
|
|
125
|
+
- Inter/Roboto as display font
|
|
126
|
+
- 3-column card grid without visual differentiation
|
|
127
|
+
- 5-color palette with equal weight (without dominant + accent)
|
|
128
|
+
|
|
129
|
+
### Step 2: Collect User Input
|
|
130
|
+
|
|
131
|
+
**ALWAYS ask the user FIRST:**
|
|
132
|
+
|
|
133
|
+
1. **Layout and style**:
|
|
134
|
+
- Do you have any layout ideas in mind?
|
|
135
|
+
- Do you have visual references? (sites, apps, screenshots)
|
|
136
|
+
- How do you envision the user flow?
|
|
137
|
+
|
|
138
|
+
2. **Components and interactions**:
|
|
139
|
+
- What are the main components of this screen/page?
|
|
140
|
+
- What states need to be considered? (loading, error, empty, success)
|
|
141
|
+
|
|
142
|
+
3. **Reference images**:
|
|
143
|
+
- Do you have example images I can analyze?
|
|
144
|
+
- If YES: use Read tool to read screenshots and extract patterns
|
|
145
|
+
|
|
146
|
+
### Step 3: Choose UI Library
|
|
147
|
+
|
|
148
|
+
Detect the stack from `.morph/config/config.json` and recommend the appropriate library:
|
|
149
|
+
|
|
150
|
+
**Blazor stack:**
|
|
151
|
+
- **Fluent UI Blazor** — dashboards, simple forms, AI components, Microsoft design language
|
|
152
|
+
- **MudBlazor** — advanced data grids, complex charts, material design
|
|
153
|
+
|
|
154
|
+
**Next.js stack:**
|
|
155
|
+
- **shadcn/ui + Radix** (recommended) — composable primitives, full control, Tailwind-native
|
|
156
|
+
- **MUI** — feature-rich, enterprise-grade, material design
|
|
157
|
+
|
|
158
|
+
**Document the decision as an ADR in `decisions.md`** with: context, options considered, decision, and rationale.
|
|
159
|
+
|
|
160
|
+
### Step 3.5: Visual Mockup (Playwright MCP)
|
|
161
|
+
|
|
162
|
+
> **Purpose:** Generate a real HTML preview using project design tokens before writing formal specs.
|
|
163
|
+
> Seeing the actual visual before committing to components prevents misaligned specs.
|
|
164
|
+
|
|
165
|
+
#### 3.5.1 — Generate HTML Mockup
|
|
166
|
+
|
|
167
|
+
Create an HTML file that represents the main screen/layout using **real tokens from `.morph/context/design-system.md`**:
|
|
168
|
+
|
|
169
|
+
**Rules for the HTML:**
|
|
170
|
+
- `<style>` block must have `:root { }` with real values from design-system.md (not Tailwind colors)
|
|
171
|
+
- Tailwind CDN only for layout utilities (flex, grid, padding) — NOT for colors or typography
|
|
172
|
+
- Represents real layout hierarchy and visual weight — not ASCII
|
|
173
|
+
- Include representative content (realistic text, placeholder images)
|
|
174
|
+
- All colors via CSS variables: `color: var(--color-primary)` not `color: #3b82f6`
|
|
175
|
+
|
|
176
|
+
**Save to:** `.morph/features/$ARGUMENTS/2-ui/mockup.html`
|
|
177
|
+
|
|
178
|
+
Example structure:
|
|
179
|
+
```html
|
|
180
|
+
<!DOCTYPE html>
|
|
181
|
+
<html lang="en">
|
|
182
|
+
<head>
|
|
183
|
+
<meta charset="UTF-8">
|
|
184
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
185
|
+
<title>[Feature] Mockup</title>
|
|
186
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
187
|
+
<!-- Load fonts from design-system.md font pair -->
|
|
188
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
189
|
+
<style>
|
|
190
|
+
/* Real tokens from .morph/context/design-system.md */
|
|
191
|
+
:root {
|
|
192
|
+
--color-primary: [value from design-system.md];
|
|
193
|
+
--color-accent: [value from design-system.md];
|
|
194
|
+
--color-surface: [value from design-system.md];
|
|
195
|
+
--color-text-primary: [value from design-system.md];
|
|
196
|
+
--color-text-secondary: [value from design-system.md];
|
|
197
|
+
--font-display: [value from design-system.md];
|
|
198
|
+
--font-body: [value from design-system.md];
|
|
199
|
+
/* ... add all relevant tokens ... */
|
|
200
|
+
}
|
|
201
|
+
body {
|
|
202
|
+
font-family: var(--font-body);
|
|
203
|
+
background-color: var(--color-surface);
|
|
204
|
+
color: var(--color-text-primary);
|
|
205
|
+
}
|
|
206
|
+
h1, h2, h3 { font-family: var(--font-display); }
|
|
207
|
+
</style>
|
|
208
|
+
</head>
|
|
209
|
+
<body>
|
|
210
|
+
<!-- Layout representing the feature's main screen -->
|
|
211
|
+
</body>
|
|
212
|
+
</html>
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
#### 3.5.2 — Screenshot at 3 Breakpoints
|
|
216
|
+
|
|
217
|
+
**Navigate to the file:**
|
|
218
|
+
```
|
|
219
|
+
mcp__plugin_playwright_playwright__browser_navigate({ url: "file:///[ABSOLUTE_PATH_TO].morph/features/$ARGUMENTS/2-ui/mockup.html" })
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**Take screenshots at 3 breakpoints** (resize then screenshot for each):
|
|
223
|
+
|
|
224
|
+
**Mobile (375px):**
|
|
225
|
+
```
|
|
226
|
+
mcp__plugin_playwright_playwright__browser_resize({ width: 375, height: 812 })
|
|
227
|
+
mcp__plugin_playwright_playwright__browser_take_screenshot({}) → save as .morph/features/$ARGUMENTS/2-ui/mockup-mobile.png
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Tablet (768px):**
|
|
231
|
+
```
|
|
232
|
+
mcp__plugin_playwright_playwright__browser_resize({ width: 768, height: 1024 })
|
|
233
|
+
mcp__plugin_playwright_playwright__browser_take_screenshot({}) → save as .morph/features/$ARGUMENTS/2-ui/mockup-tablet.png
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
**Desktop (1440px):**
|
|
237
|
+
```
|
|
238
|
+
mcp__plugin_playwright_playwright__browser_resize({ width: 1440, height: 900 })
|
|
239
|
+
mcp__plugin_playwright_playwright__browser_take_screenshot({}) → save as .morph/features/$ARGUMENTS/2-ui/mockup-desktop.png
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
#### 3.5.3 — Present and Iterate
|
|
243
|
+
|
|
244
|
+
1. **Show all 3 screenshots to the user**
|
|
245
|
+
2. Ask for feedback:
|
|
246
|
+
- "Does this visual direction match your intent?"
|
|
247
|
+
- "Any layout, color, or typography adjustments?"
|
|
248
|
+
3. **Iterate:** Refine `mockup.html` → re-take screenshots → show updated previews
|
|
249
|
+
4. **Continue only when user approves** this visual direction
|
|
250
|
+
|
|
251
|
+
> **Note:** `ui-mockups.md` (Step 4.2) continues to exist as the reference for states and interactions.
|
|
252
|
+
> The PNGs are the visual reference; the .md covers behavior and edge cases.
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
### Step 4: Generate Deliverables
|
|
257
|
+
|
|
258
|
+
Create the following files in `.morph/features/$ARGUMENTS/`:
|
|
259
|
+
|
|
260
|
+
> **Use templates:** Use `npx morph-spec template render` to generate files from templates in `.morph/framework/templates/docs/`. Available templates: `ui-design-system`, `ui-mockups`, `ui-components`, `ui-flows`.
|
|
261
|
+
|
|
262
|
+
#### 4.1. `ui-design-system.md`
|
|
263
|
+
|
|
264
|
+
**If project-level design system exists (`.morph/context/design-system.md`):**
|
|
265
|
+
- Reference it in specs: "Uses project design system at .morph/context/design-system.md"
|
|
266
|
+
- Create `ui-design-system.md` only if there are feature-specific colors/components
|
|
267
|
+
|
|
268
|
+
**If it doesn't exist:**
|
|
269
|
+
- Create complete feature-level design system with:
|
|
270
|
+
- **Section `## Aesthetic Direction`** (use template from `aesthetic-direction.md`):
|
|
271
|
+
direction, font pair, color philosophy, motion intent, composition approach
|
|
272
|
+
- Color palette (primary, secondary, accent, semantic)
|
|
273
|
+
- Typography (heading scales, body text, code)
|
|
274
|
+
- Spacing and layout (grid, margins, paddings)
|
|
275
|
+
- Base components (buttons, inputs, cards)
|
|
276
|
+
|
|
277
|
+
#### 4.2. `ui-mockups.md`
|
|
278
|
+
|
|
279
|
+
ASCII wireframes + descriptions:
|
|
280
|
+
- General layout of each screen/page
|
|
281
|
+
- Component positioning
|
|
282
|
+
- Responsiveness (desktop, tablet, mobile)
|
|
283
|
+
- States (loading, error, empty, success)
|
|
284
|
+
|
|
285
|
+
#### 4.3. `ui-components.md`
|
|
286
|
+
|
|
287
|
+
Technical specs for Fluent UI/MudBlazor components:
|
|
288
|
+
- Component to use (FluentButton, MudDataGrid, etc.)
|
|
289
|
+
- Props and configurations
|
|
290
|
+
- Events and bindings
|
|
291
|
+
- Validations and states
|
|
292
|
+
|
|
293
|
+
#### 4.4. `ui-flows.md`
|
|
294
|
+
|
|
295
|
+
Complete user flows:
|
|
296
|
+
- User stories
|
|
297
|
+
- Flow diagrams (text/ASCII)
|
|
298
|
+
- Edge cases (what happens if...?)
|
|
299
|
+
- Validations and feedback
|
|
300
|
+
|
|
301
|
+
### CHECKPOINT: Validate UI Deliverables
|
|
302
|
+
|
|
303
|
+
**PAUSE - Before proceeding to accessibility:**
|
|
304
|
+
|
|
305
|
+
- [ ] Aesthetic direction defined and documented in `ui-design-system.md`?
|
|
306
|
+
- [ ] Font pair specified (not just Inter/Roboto for display)?
|
|
307
|
+
- [ ] Color philosophy: dominant + accent + rationale documented?
|
|
308
|
+
- [ ] Design system defined (project-level or feature-level)?
|
|
309
|
+
- [ ] Wireframes cover all states (loading, error, empty, success)?
|
|
310
|
+
- [ ] Components specified with actual props from chosen UI library?
|
|
311
|
+
- [ ] Complete user flows with edge cases?
|
|
312
|
+
- [ ] Chosen UI library documented as ADR in `decisions.md`?
|
|
313
|
+
|
|
314
|
+
**If any checkbox is NOT checked:**
|
|
315
|
+
→ Go back and complete the missing deliverable
|
|
316
|
+
|
|
317
|
+
**If ALL checkboxes are checked:**
|
|
318
|
+
→ Proceed to accessibility validation
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
### Step 5: Validate Accessibility and Responsiveness
|
|
323
|
+
|
|
324
|
+
Document in UI files:
|
|
325
|
+
- **WCAG 2.1 Level AA** compliance
|
|
326
|
+
- Adequate color contrast
|
|
327
|
+
- Accessible labels for screen readers
|
|
328
|
+
- Keyboard navigation
|
|
329
|
+
- **Responsive breakpoints**
|
|
330
|
+
- Desktop (>1200px)
|
|
331
|
+
- Tablet (768px - 1199px)
|
|
332
|
+
- Mobile (<768px)
|
|
333
|
+
|
|
334
|
+
### Step 6: Update State
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
npx morph-spec state mark-output $ARGUMENTS ui-design-system
|
|
338
|
+
npx morph-spec state mark-output $ARGUMENTS ui-mockups
|
|
339
|
+
npx morph-spec state mark-output $ARGUMENTS ui-components
|
|
340
|
+
npx morph-spec state mark-output $ARGUMENTS ui-flows
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
> **Format note:** The `mark-output` commands accept BOTH kebab-case (`ui-design-system`)
|
|
344
|
+
> AND camelCase (`uiDesignSystem`). Both formats work equally! Use whichever is more
|
|
345
|
+
> comfortable for you. Examples:
|
|
346
|
+
> - `npx morph-spec state mark-output my-feature uiDesignSystem`
|
|
347
|
+
> - `npx morph-spec state mark-output my-feature ui-design-system`
|
|
348
|
+
|
|
349
|
+
## Generated Outputs
|
|
350
|
+
|
|
351
|
+
- `.morph/features/$ARGUMENTS/2-ui/design-system.md`
|
|
352
|
+
- `.morph/features/$ARGUMENTS/2-ui/mockups.md`
|
|
353
|
+
- `.morph/features/$ARGUMENTS/2-ui/components.md`
|
|
354
|
+
- `.morph/features/$ARGUMENTS/2-ui/flows.md`
|
|
355
|
+
- `.morph/features/$ARGUMENTS/1-design/decisions.md` (updated with UI library ADR)
|
|
356
|
+
|
|
357
|
+
### Step 7: Validate Design with Frontend Review
|
|
358
|
+
|
|
359
|
+
After generating all 4 UI outputs and updating state (Step 6):
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
/frontend-review $ARGUMENTS
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
The skill validates: WCAG token contrast, existence of all outputs, static design accessibility, and generates mockup screenshots if dev server is available.
|
|
366
|
+
|
|
367
|
+
**If frontend-review blocks**, fix issues before presenting to user.
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
## MANDATORY PAUSE
|
|
372
|
+
|
|
373
|
+
Use `AskUserQuestion` to capture explicit approval before advancing:
|
|
374
|
+
|
|
375
|
+
```json
|
|
376
|
+
{
|
|
377
|
+
"questions": [{
|
|
378
|
+
"header": "Approval",
|
|
379
|
+
"question": "UI/UX generated. Approve to advance to technical design?",
|
|
380
|
+
"multiSelect": false,
|
|
381
|
+
"options": [
|
|
382
|
+
{ "label": "Approve UI/UX", "description": "Advance to technical design phase" },
|
|
383
|
+
{ "label": "I have feedback", "description": "Type what you want to adjust in the field below (Other)" }
|
|
384
|
+
]
|
|
385
|
+
}]
|
|
386
|
+
}
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
- **"Approve UI/UX"** →
|
|
390
|
+
```bash
|
|
391
|
+
npx morph-spec approve $ARGUMENTS uiux
|
|
392
|
+
npx morph-spec phase advance $ARGUMENTS
|
|
393
|
+
```
|
|
394
|
+
- **"I have feedback" or "Other"** → apply the received feedback and repeat this PAUSE
|
|
395
|
+
|
|
396
|
+
## Advancement Criteria
|
|
397
|
+
|
|
398
|
+
- [x] User input collected (layout, references)
|
|
399
|
+
- [x] UI library chosen and justified (ADR)
|
|
400
|
+
- [x] 4 deliverables created (design-system, mockups, components, flows)
|
|
401
|
+
- [x] WCAG 2.1 accessibility documented
|
|
402
|
+
- [x] Responsiveness specified
|
|
403
|
+
- [x] State updated
|
|
404
|
+
- [x] User approved UI/UX
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
## Phase Outputs
|
|
409
|
+
|
|
410
|
+
<!-- morph-outputs:uiux -->
|
|
411
|
+
| Output | Caminho |
|
|
412
|
+
|--------|---------|
|
|
413
|
+
| `uiDesignSystem` | `.morph/features/{feature}/2-ui/design-system.md` |
|
|
414
|
+
| `uiMockups` | `.morph/features/{feature}/2-ui/mockups.md` |
|
|
415
|
+
| `uiComponents` | `.morph/features/{feature}/2-ui/components.md` |
|
|
416
|
+
| `uiFlows` | `.morph/features/{feature}/2-ui/flows.md` |
|
|
417
|
+
| `uiMockupHtml` | `.morph/features/{feature}/2-ui/mockup.html` |
|
|
418
|
+
| `uiMockupMobile` | `.morph/features/{feature}/2-ui/mockup-mobile.png` |
|
|
419
|
+
| `uiMockupTablet` | `.morph/features/{feature}/2-ui/mockup-tablet.png` |
|
|
420
|
+
| `uiMockupDesktop` | `.morph/features/{feature}/2-ui/mockup-desktop.png` |
|
|
421
|
+
<!-- /morph-outputs -->
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
324
425
|
Continue automatically to Phase 2 (Design) after approval.
|