@morya-ui/setup 0.3.3 → 0.3.5

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 (31) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +107 -103
  3. package/bin/morya-ui-setup.js +14 -14
  4. package/catalog/skills.json +46 -46
  5. package/package.json +1 -1
  6. package/src/cli.mjs +312 -335
  7. package/src/copy-template.mjs +78 -78
  8. package/src/fs-utils.mjs +24 -24
  9. package/src/install.mjs +134 -63
  10. package/src/mcp.mjs +50 -50
  11. package/src/package-json.mjs +30 -30
  12. package/src/skills.mjs +223 -223
  13. package/src/styles.mjs +119 -119
  14. package/template/.agents/skills/morya-ui-pages/SKILL.md +188 -164
  15. package/template/.agents/skills/morya-ui-pages/evals/evals.json +89 -89
  16. package/template/.agents/skills/morya-ui-pages/references/component-index.md +99 -99
  17. package/template/.agents/skills/morya-ui-pages/references/decision-recipes.md +104 -5
  18. package/template/.agents/skills/morya-ui-pages/references/design-system.md +101 -100
  19. package/template/.agents/skills/morya-ui-pages/references/feedback.md +68 -68
  20. package/template/.agents/skills/morya-ui-pages/references/optional-companions.md +62 -34
  21. package/template/.agents/skills/morya-ui-pages/references/page-layouts.md +133 -119
  22. package/template/.agents/skills/morya-ui-pages/references/review-checklist.md +63 -61
  23. package/template/.agents/skills/morya-ui-pages/references/style-presets.md +45 -0
  24. package/template/.agents/skills/morya-ui-pages/references/surfaces.md +91 -89
  25. package/template/.agents/skills/morya-ui-pages/references/visual-craft.md +129 -196
  26. package/template/.cursor/rules/coding-style.mdc +41 -41
  27. package/template/.cursor/rules/component-usage.mdc +41 -41
  28. package/template/.cursor/rules/design-system.mdc +17 -17
  29. package/template/.cursor/rules/page-layout.mdc +97 -78
  30. package/template/DESIGN.md +59 -59
  31. package/template/scripts/check-raw-colors.mjs +74 -74
@@ -1,89 +1,91 @@
1
- # Surface taxonomy
2
-
3
- Pick a lane, then a surface. Prefer project golden pages for **Ops**; use the recipes below for everything else. Always implement interactive controls with `morya-ui`.
4
-
5
- ## Ops (admin / console)
6
-
7
- | Surface | Job | Compose from |
8
- | --- | --- | --- |
9
- | List | Scan, filter, act on many rows | Golden list + [page-layouts.md](page-layouts.md); **create/edit with ≤~8 fields → `MDialog` on the list** |
10
- | Form | Create / edit one entity as a **dedicated page** | Golden form — only when multi-section, many fields, or user asked for an independent form route |
11
- | Dashboard | Orient + jump to work | Golden dashboard |
12
- | Detail | Read-heavy record + secondary actions | `MPageHeader` + sections via `MCard`/`MPageSection`; edit via `MDialog` / `MDrawer` (prefer over a second form route) |
13
- | Settings | Grouped preferences | Narrow `MPageContent` + stacked `MPageSection` / `MTabs` + `MForm` |
14
- | Hybrid list | List + drawer/dialog | **Default Ops CRUD pattern**: list golden + `MDialog`/`MDrawer` form |
15
-
16
- ## Account
17
-
18
- | Surface | Job | Recipe |
19
- | --- | --- | --- |
20
- | Login / register | Authenticate with trust | Golden: MCP `get_golden_page` `login-page` — split brand + `MForm` (`MInput`, `MInputPassword`); form-level errors via token `role="alert"` (not Toast). Brand wash: [visual-craft.md](visual-craft.md) § Atmosphere |
21
- | Invite / accept | Join org | Same shell; show org name clearly |
22
- | Forgot / reset | Recover access | Short form + success state with next step |
23
- | Profile / account | Edit self | Settings-like sections; avatar via `MAvatar` |
24
-
25
- Keep credential forms quiet: one primary CTA, clear labels, no decorative noise beside the brand panel.
26
-
27
- ## Flow
28
-
29
- | Surface | Job | Recipe |
30
- | --- | --- | --- |
31
- | Empty state | Invite first action | Golden: MCP `get_golden_page` `empty-state` — `MEmpty` + primary/secondary `MButton` in `#extra`; dashed shell + radial wash from visual-craft |
32
- | Onboarding | Teach the product path | `MStepper` or paced cards; one decision per step; finish → Ops home |
33
- | Wizard | Multi-step create | `MStepper` + `MForm` per step + sticky actions (`上一步` / `下一步` / `提交`) |
34
- | Success / result | Confirm completion | `MResult status="success"` / `error` + `#footer` next actions (`查看详情` / `返回列表`); same shell idea as `result-page` |
35
-
36
- Copy must tell the user **what to do next**, not celebrate the system.
37
-
38
- ## System
39
-
40
- | Surface | Job | Recipe |
41
- | --- | --- | --- |
42
- | Permission denied | Explain + escape | Golden: MCP `get_golden_page` `result-page` — `MResult status="403"` + `#footer` (not `#extra`) |
43
- | 404 / not found | Reorient | `MResult status="404"` + `返回首页` / `返回上一页` (mirror `result-page` shell) |
44
- | Maintenance / error | Honest status | `MResult status="500"`; what happened + retry + support. Persistent form errors: field `errorMessage` or a token `role="alert"`, not `<MMessage>` as an alert |
45
-
46
- Avoid witty 404 essays that hide the exit paths.
47
-
48
- ## Express (marketing / public)
49
-
50
- Use when the brief is landing, pricing, launch, or docs marketing — **not** for Ops CRUD shells.
51
-
52
- | Surface | Job | Recipe |
53
- | --- | --- | --- |
54
- | Landing | Convert / explain product | Golden: MCP `get_golden_page` `landing-page` — one-job hero; CTAs → `MButton`; chips → `MTag`; FAQ → `MAccordion` |
55
- | Pricing | Choose a plan | Clear plan cards (`MCard`) + primary CTA; highlight recommended plan without clutter |
56
- | Feature showcase | Prove capability | Alternating media/copy; live `M*` demo only if lightweight |
57
- | Docs marketing chrome | Frame documentation | Header + nav using `M*` where suitable; content area stays readable |
58
-
59
- Before coding Express: short design plan in [visual-craft.md](visual-craft.md). Map colors to `--m-*` / theme overrides; do not paste a second kit.
60
-
61
- **Anti-patterns for Express:** inset hero cards instead of a full-bleed thesis; pill-stat strips in the first viewport; purple-on-white / cream-terracotta / broadsheet defaults when the brief did not ask for them.
62
-
63
- ## Overlay
64
-
65
- When the dialog/drawer **is** the task:
66
-
67
- | Surface | Recipe |
68
- | --- | --- |
69
- | Edit / create dialog | `MDialog` + compact `MForm` + footer actions |
70
- | Detail drawer | `MDrawer` + header + sections + optional edit |
71
- | Confirm | `MConfirmDialog` / `MConfirmPopup` — do not reinvent |
72
- | Command menu | `MCommandMenu` for keyboard-first jump / actions |
73
-
74
- Host page stays stable; focus management comes from the overlay component.
75
-
76
- ## Lane mixing
77
-
78
- | Ask | Treat as |
79
- | --- | --- |
80
- | “后台列表 + 好看一点” | Ops first, light craft (spacing/type), no landing hero |
81
- | “登录页有品牌感” | Account + Express craft on brand panel only |
82
- | “产品官网” | Express; Ops patterns do not apply |
83
- | “空状态设计精致一点” | Flow empty + visual-craft signature (one risk) |
84
-
85
- ## MCP hints
86
-
87
- - Ops whole page: `recommend_page` → `get_golden_page` → `get_design_rules`
88
- - Section: `get_page_snippet`
89
- - Any lane: `search` / `get_component` before unfamiliar APIs
1
+ # Surface taxonomy
2
+
3
+ Pick a lane, then a surface. Prefer project golden pages for **Ops**; use the recipes below for everything else. Always implement interactive controls with `morya-ui`.
4
+
5
+ ## Ops (admin / console)
6
+
7
+ | Surface | Job | Compose from |
8
+ | --- | --- | --- |
9
+ | List | Scan, filter, act on many rows | Golden list + [page-layouts.md](page-layouts.md); **create/edit with ≤~8 fields → `MDialog` on the list** |
10
+ | Form | Create / edit one entity as a **dedicated page** | Golden form — only when multi-section, many fields, or user asked for an independent form route |
11
+ | Dashboard | Orient + jump to work | Golden dashboard |
12
+ | Detail | Read-heavy record + secondary actions | `MPageHeader` + sections via `MCard`/`MPageSection`; edit via `MDialog` / `MDrawer` (prefer over a second form route) |
13
+ | Settings | Grouped preferences | Narrow `MPageContent` + stacked `MPageSection` / `MTabs` + `MForm` |
14
+ | Hybrid list | List + drawer/dialog | **Default Ops CRUD pattern**: list golden + `MDialog`/`MDrawer` form |
15
+
16
+ ## Account
17
+
18
+ | Surface | Job | Recipe |
19
+ | --- | --- | --- |
20
+ | Login / register | Authenticate with trust | Golden: MCP `get_golden_page` `login-page` — split brand + `MForm` (`MInput`, `MInputPassword`); form-level errors via token `role="alert"` (not Toast). Brand wash: [visual-craft.md](visual-craft.md) § Atmosphere |
21
+ | Invite / accept | Join org | Same shell; show org name clearly |
22
+ | Forgot / reset | Recover access | Short form + success state with next step |
23
+ | Profile / account | Edit self | Settings-like sections; avatar via `MAvatar` |
24
+
25
+ Keep credential forms quiet: one primary CTA, clear labels, no decorative noise beside the brand panel.
26
+
27
+ ## Flow
28
+
29
+ | Surface | Job | Recipe |
30
+ | --- | --- | --- |
31
+ | Empty state | Invite first action | Golden: MCP `get_golden_page` `empty-state` — `MEmpty` + primary/secondary `MButton` in `#extra`; dashed shell + radial wash from visual-craft |
32
+ | Onboarding | Teach the product path | `MStepper` or paced cards; one decision per step; finish → Ops home |
33
+ | Wizard | Multi-step create | `MStepper` + `MForm` per step + sticky actions (`上一步` / `下一步` / `提交`) |
34
+ | Success / result | Confirm completion | `MResult status="success"` / `error` + `#footer` next actions (`查看详情` / `返回列表`); same shell idea as `result-page` |
35
+
36
+ Copy must tell the user **what to do next**, not celebrate the system.
37
+
38
+ ## System
39
+
40
+ | Surface | Job | Recipe |
41
+ | --- | --- | --- |
42
+ | Permission denied | Explain + escape | Golden: MCP `get_golden_page` `result-page` — `MResult status="403"` + `#footer` (not `#extra`) |
43
+ | 404 / not found | Reorient | `MResult status="404"` + `返回首页` / `返回上一页` (mirror `result-page` shell) |
44
+ | Maintenance / error | Honest status | `MResult status="500"`; what happened + retry + support. Persistent form errors: field `errorMessage` or a token `role="alert"`, not `<MMessage>` as an alert |
45
+
46
+ Avoid witty 404 essays that hide the exit paths.
47
+
48
+ ## Express (marketing / public)
49
+
50
+ Use when the brief is landing, pricing, launch, or docs marketing — **not** for Ops CRUD shells.
51
+
52
+ | Surface | Job | Recipe |
53
+ | --- | --- | --- |
54
+ | Landing | Convert / explain product | Golden: MCP `get_golden_page` `landing-page` — one-job hero; CTAs → `MButton`; chips → `MTag`; FAQ → `MAccordion` |
55
+ | Pricing | Choose a plan | Clear plan cards (`MCard`) + primary CTA; highlight recommended plan without clutter |
56
+ | Feature showcase | Prove capability | Alternating media/copy; live `M*` demo only if lightweight |
57
+ | Docs marketing chrome | Frame documentation | Header + nav using `M*` where suitable; content area stays readable |
58
+
59
+ Before coding Express: short design plan in [visual-craft.md](visual-craft.md). Map colors to `--m-*` / theme overrides; do not paste a second kit.
60
+
61
+ **Anti-patterns for Express:** inset hero cards instead of a full-bleed thesis; pill-stat strips in the first viewport; purple aurora / cream-terracotta / broadsheet / unsolicited glass-neon when the user did not ask.
62
+
63
+ ## Overlay
64
+
65
+ When the dialog/drawer **is** the task:
66
+
67
+ | Surface | Recipe |
68
+ | --- | --- |
69
+ | Edit / create dialog | `MDialog` + compact `MForm` + footer actions |
70
+ | Detail drawer | `MDrawer` + header + sections + optional edit |
71
+ | Confirm | `MConfirmDialog` / `MConfirmPopup` — do not reinvent |
72
+ | Command menu | `MCommandMenu` for keyboard-first jump / actions |
73
+
74
+ Host page stays stable; focus management comes from the overlay component.
75
+
76
+ ## Lane mixing
77
+
78
+ | Ask | Treat as |
79
+ | --- | --- |
80
+ | “后台列表 + 好看一点” | Ops + ask once what “好看” means, or follow any reference they give |
81
+ | “像附件截图一样” | Reference-first style resolution; still M* + `--m-*` |
82
+ | “登录页有品牌感” | Account + Express craft on brand panel only |
83
+ | “产品官网” | Express; Ops patterns do not apply |
84
+ | “空状态设计精致一点” | Flow empty + visual-craft signature (one risk) |
85
+
86
+ ## MCP hints
87
+
88
+ - Ops whole page: `recommend_page({ style? })` → `get_golden_page` → apply `styleDirection` / reference
89
+ - Style: `get_style_direction` (no preset catalog)
90
+ - Section: `get_page_snippet`
91
+ - Any lane: `search` / `get_component` before unfamiliar APIs
@@ -1,196 +1,129 @@
1
- # Visual craft (distilled)
2
-
3
- Portable craft for morya-ui consumers. Inspired by **Frontend Design**, **Impeccable**, and **UI-UX-Pro-Max** — without requiring those skills to be installed. Implementation must still honor the morya-ui contract.
4
-
5
- ## When to lean on craft
6
-
7
- | Lane | Craft intensity | Default pass |
8
- | --- | --- | --- |
9
- | Ops CRUD | Low — clarity, density, golden structure | **Always** run § Ops polish |
10
- | Account / Flow / System | Medium — trust, hierarchy, one calm brand cue | **Always** run § Atmosphere recipes when relevant |
11
- | Express | High — design plan + one signature risk | **Always** run design plan + anti-defaults |
12
-
13
- Do **not** skip craft because the page is “just admin”. Polished Ops is quiet, aligned, and specific — not decorative.
14
-
15
- ## Design plan (Express & branded moments)
16
-
17
- Before code, decide:
18
-
19
- 1. **Color** — 4–6 roles (bg, surface, text, muted, accent, danger). Prefer existing `--m-*`. If the project already customizes theme, extend that system; do not invent a parallel hex soup in scoped CSS.
20
- 2. **Type** — display vs body vs utility. For Ops, stick to theme fonts. For Express, a distinctive pairing is OK if fonts are loadable and fallbacks exist.
21
- 3. **Layout concept** — one sentence + rough hierarchy (ASCII wireframe optional).
22
- 4. **Signature** — the single memorable element (motion, crop, editorial type, product artifact). Everything else quieter.
23
-
24
- Critique the plan: if it looks like the plan you would write for *any* SaaS, revise until it fits **this** subject.
25
-
26
- ## Ops polish (default — every Ops page)
27
-
28
- Apply after the golden block order is correct. These are **required**, not optional taste:
29
-
30
- 1. **One primary** — exactly one filled `severity="primary"` in the main viewport (usually toolbar create / form save). Query can be primary; reset stays secondary.
31
- 2. **Sider icons** — every top-level `MMenu` item has an `icon`; icons come from one set (built-in Tabler names). No random emoji.
32
- 3. **Status cells** — row business state → `MStatus` (dot + label). `MTag` only for categories, filters, or closable chips.
33
- 4. **Row actions** — secondary `text` / `outlined` / `size="small"`; danger only on destructive. Prefer `MSpace` with a consistent gap; avoid a wall of filled buttons.
34
- 5. **Filter rhythm** — search ~`14rem`, compact selects ~`10–12rem`; wrap with `MSpace wrap`. Do not stretch filters full-bleed. Secondary fields → `MPageFilters collapsible` + `#advanced`; active criteria → `MPageFilterChips` + closable `MTag`.
35
- 6. **Empty is designed** — `MEmpty` (or table `#empty` with `MEmpty`) with a next action; never a silent blank table or a lone muted sentence.
36
- 7. **No extra cards** — do not wrap `MPageFilters` / `MTable` in decorative `MCard` “for polish”. Dashboard chart/detail modules may use `MCard`.
37
- 8. **Domain copy** — column labels, placeholders, and empty titles use product vernacular, not “Name / Status / No data”.
38
- 9. **Density** — prefer theme default; use `size="small"` on dense tables inside cards. Do not invent a second spacing scale.
39
- 10. **Quiet chrome** — breadcrumb + toolbar title are enough hierarchy; skip marketing heroes, pill-stat strips, and glow on Ops shells.
40
-
41
- Ops beauty = **alignment + semantics + restraint**, not gradients.
42
-
43
- ## Anti-default looks (AI clusters)
44
-
45
- Avoid spending free axes on these unless the brief asks:
46
-
47
- 1. Warm cream (~`#F4F1EA`) + high-contrast serif + terracotta
48
- 2. Near-black + single acid-green / vermilion accent
49
- 3. Broadsheet: hairline rules, zero radius, dense newspaper columns
50
- 4. Purple-on-white / purple-to-indigo gradient SaaS cliché
51
- 5. Glow stacks, pill chip clouds, emoji as decoration, multi-layer shadows as personality
52
-
53
- Also avoid: Inter/Roboto/Arial as the *expressive* display choice on Express surfaces when the brief allows character (utility UI may keep system/theme fonts).
54
-
55
- ## Hierarchy & composition
56
-
57
- - **Hero is a thesis** (Express): one job in the first viewport — not stats + schedule + promos together.
58
- - **Structure encodes meaning**: numbered steps only when order is real information.
59
- - **Cards**: default off for Express heroes; use `MCard` when it groups an interaction or plan choice.
60
- - **Motion**: orchestrate 2–3 intentional moments max; gate custom CSS motion with `[data-m-motion="full"]` (library intensity from `useMotion`). Prefer transform/opacity over layout thrash.
61
- - **Density**: Ops may be compact; Express needs breathing room — match the lane.
62
-
63
- ## Atmosphere recipes (token-only)
64
-
65
- Copy patterns, remap brand copy. **No hex.** Prefer `color-mix` / gradients from `--m-*`. See golden pages `login-page`, `landing-page`, `empty-state`.
66
-
67
- ### Account — split brand panel
68
-
69
- ```css
70
- .login-brand {
71
- display: flex;
72
- flex-direction: column;
73
- justify-content: flex-end;
74
- gap: var(--m-space-4);
75
- padding: clamp(2rem, 6vw, 4.5rem);
76
- background:
77
- radial-gradient(
78
- 80% 60% at 10% 20%,
79
- color-mix(in srgb, var(--m-color-primary) 22%, transparent),
80
- transparent 55%
81
- ),
82
- linear-gradient(
83
- 165deg,
84
- color-mix(in srgb, var(--m-color-primary) 16%, var(--m-color-surface)) 0%,
85
- var(--m-color-surface) 55%,
86
- color-mix(in srgb, var(--m-color-border) 35%, var(--m-color-surface)) 100%
87
- );
88
- border-right: 1px solid var(--m-color-border);
89
- }
90
- .login-brand__title {
91
- margin: 0;
92
- max-width: 12em;
93
- font-size: clamp(2rem, 4vw, 3rem);
94
- font-weight: 650;
95
- line-height: 1.15;
96
- letter-spacing: -0.03em;
97
- }
98
- ```
99
-
100
- Form side stays calm: one panel ~`22rem`, token `role="alert"` for form-level errors (not Toast, not `<MMessage severity>`).
101
-
102
- ### Express — hero plane
103
-
104
- Full-bleed thesis: brand mark (small) → one headline → one lead → CTA group → **one** dominant visual (timeline, product artifact, or edge-to-edge wash). Atmosphere:
105
-
106
- ```css
107
- .landing-hero__visual {
108
- margin-top: var(--m-space-5);
109
- padding: var(--m-space-5);
110
- border: 1px solid var(--m-color-border);
111
- border-radius: var(--m-radius-md);
112
- background:
113
- linear-gradient(
114
- 135deg,
115
- color-mix(in srgb, var(--m-color-primary) 12%, var(--m-color-surface)),
116
- var(--m-color-surface) 60%
117
- );
118
- }
119
- ```
120
-
121
- Optional micro-motion (one signature only):
122
-
123
- ```css
124
- [data-m-motion="full"] .landing-hero__track span {
125
- animation: m-craft-fade-up 480ms ease both;
126
- }
127
- [data-m-motion="full"] .landing-hero__track span:nth-child(2) { animation-delay: 60ms; }
128
- [data-m-motion="full"] .landing-hero__track span:nth-child(3) { animation-delay: 120ms; }
129
- [data-m-motion="full"] .landing-hero__track span:nth-child(4) { animation-delay: 180ms; }
130
- @keyframes m-craft-fade-up {
131
- from { opacity: 0; transform: translateY(0.4rem); }
132
- to { opacity: 1; transform: translateY(0); }
133
- }
134
- ```
135
-
136
- ### Flow — empty state shell
137
-
138
- ```css
139
- .empty-state-shell {
140
- border: 1px dashed color-mix(in srgb, var(--m-color-border) 80%, var(--m-color-primary));
141
- border-radius: var(--m-radius-md);
142
- background:
143
- radial-gradient(
144
- 120% 80% at 50% 0%,
145
- color-mix(in srgb, var(--m-color-primary) 10%, transparent),
146
- transparent 55%
147
- ),
148
- var(--m-color-surface);
149
- }
150
- ```
151
-
152
- Pair with `MEmpty` + primary next step + optional secondary text button. One memory cue (icon / wash) — no emoji collage.
153
-
154
- ## UX writing
155
-
156
- - Name controls by user intent (`保存更改`), not system guts (`提交表单实体`).
157
- - Active voice; same verb through the flow (Publish → Published).
158
- - Errors: what failed + how to fix; no vague apology.
159
- - Empty states: invitation to act, not a dead end.
160
- - Ops copy stays plain; Express may have voice, still specific to the product.
161
-
162
- ## Polish modes (Impeccable-inspired)
163
-
164
- **Default:** after compose, run a lane-appropriate light pass (§ Ops polish and/or atmosphere).
165
-
166
- When the user asks to improve an existing surface, pick a named mode:
167
-
168
- | Mode | Intent |
169
- | --- | --- |
170
- | `audit` | Hierarchy, contrast, a11y, spacing, anti-patterns — report then fix |
171
- | `clarify` | Labels, errors, empty copy, button verbs |
172
- | `quieter` | Remove competing accents, chips, shadows; keep one focus |
173
- | `bolder` | Strengthen the signature only; do not shout everywhere |
174
- | `typeset` | Scale, weight, line-length, truncation |
175
- | `adapt` | Responsive breakpoints; touch targets |
176
- | `delight` | One tasteful micro-interaction — never clutter |
177
-
178
- Always remediate with `M*` + tokens, not raw replacement controls.
179
-
180
- ## Industry / mood (UI-UX-Pro-Max-inspired)
181
-
182
- For Express briefs that only say “modern / professional / playful”:
183
-
184
- 1. Infer industry from the product (fintech ≠ kids education).
185
- 2. Pick mood keywords (e.g. “editorial + precise”, “warm workshop”, “clinical calm”).
186
- 3. Map mood → token roles and signature — **then** implement with morya-ui.
187
- 4. Discard any suggestion to switch stacks (shadcn, generic Tailwind kit, etc.).
188
-
189
- ## Quality floor (all lanes)
190
-
191
- - Responsive to a usable mobile layout
192
- - Visible `:focus-visible`
193
- - Keyboard reaches primary actions
194
- - No raw theme colors that break dark mode when the app supports it
195
- - Icons decorative vs informative handled correctly (`aria-hidden` vs `aria-label`)
196
- - Craft pass completed for the lane (Ops polish and/or atmosphere) before delivery
1
+ # Visual craft (distilled)
2
+
3
+ Portable craft for morya-ui consumers. Inspired by **Frontend Design**, **Impeccable**, and **UI-UX-Pro-Max** — without requiring those skills. Still honor the morya-ui contract. **No named style-preset catalog.**
4
+
5
+ ## When to lean on craft
6
+
7
+ | Lane | Craft intensity | Default pass |
8
+ | --- | --- | --- |
9
+ | Ops CRUD | Low — clarity, density, golden structure | **Always** run § Ops polish |
10
+ | Account / Flow / System | Medium — trust, hierarchy, one calm brand cue | **Always** run § Shell recipes when relevant |
11
+ | Express | High — design plan + one signature risk | **Always** run design plan + anti-defaults |
12
+
13
+ **Style is not fixed to the golden look.** Resolve direction first ([style-presets.md](style-presets.md)): **user reference / description → prompt cues → ask when uncertain**.
14
+
15
+ ## Companion bridge (distilled)
16
+
17
+ Run companions **after** structure + contract + **resolved style direction**, then remediate with `M*` + `--m-*`.
18
+
19
+ ### Subject first (Frontend Design)
20
+
21
+ - Name **subject**, **audience**, **single job** before visual choices.
22
+ - Personality from the subject’s world — not a generic “SaaS aurora” board.
23
+ - **One signature** per surface; everything else quieter.
24
+ - Signature = type / layout / product artifact / motion — **not** a default gradient wash.
25
+
26
+ ### Mode (Impeccable)
27
+
28
+ | Mode | Use when | Craft budget |
29
+ | --- | --- | --- |
30
+ | **Operate** | Ops lists, forms, settings | Clarity, density, resolved direction; no marketing hero |
31
+ | **Persuade** | Landing, pricing | Design plan + signature; controls still `M*` |
32
+ | **Read** | Docs / long detail | Typeset + measure |
33
+ | **Experience** | Gallery / showcase | Artifact leads |
34
+
35
+ ### Design plan (Express & branded Account)
36
+
37
+ 1. **Color** — roles mapped to `--m-*`. Companions may suggest hex — **map** to tokens.
38
+ 2. **Type** — Ops stick to theme fonts.
39
+ 3. **Layout** — one sentence + hierarchy.
40
+ 4. **Signature** — one memorable element that fits the **user’s** direction.
41
+
42
+ If the plan looks like any-SaaS (purple wash, cream serif, neon glow) and the user did not ask for that, revise. **User reference / words win.**
43
+
44
+ ## Ops polish (baseline)
45
+
46
+ 1. **One primary** filled button in the main viewport.
47
+ 2. **Sider icons** on every top-level `MMenu` item.
48
+ 3. **Status** → `MStatus`; `MTag` for categories/filters only.
49
+ 4. **Row actions** — text / outlined / small.
50
+ 5. **Filter rhythm** — search ~`14rem`, selects ~`10–12rem`.
51
+ 6. **Empty** — `MEmpty` with next action.
52
+ 7. **No extra cards** around filters/table “for polish”.
53
+ 8. **Domain copy**.
54
+ 9. **Density** — follow user cues (`compact` / spacious); don’t invent a second scale.
55
+ 10. **Quiet chrome** — no marketing heroes / glow unless the user asked.
56
+
57
+ Ops beauty = alignment + semantics + restraint, **not** gradients.
58
+
59
+ ## Anti-default looks
60
+
61
+ Unless the user **asks** or a reference **shows** them, do not use:
62
+
63
+ 1. Cream + serif + terracotta
64
+ 2. Acid-green / dual neon on black
65
+ 3. Broadsheet newspaper columns
66
+ 4. Purple aurora / mesh washes (even via `color-mix`)
67
+ 5. Glow stacks, pill clouds, emoji decoration
68
+ 6. Unsolicited glass, neumorph on dense tables, full-page gradients
69
+ 7. Stacked radial + linear “atmosphere” brand panels
70
+
71
+ **Token gradients are not a free pass** — only when the user/reference asks.
72
+
73
+ ## Shell recipes (token-only — defaults are flat)
74
+
75
+ ### Account — split brand panel
76
+
77
+ ```css
78
+ .login-brand {
79
+ display: flex;
80
+ flex-direction: column;
81
+ justify-content: flex-end;
82
+ gap: var(--m-space-4);
83
+ padding: clamp(2rem, 6vw, 4.5rem);
84
+ background: color-mix(in srgb, var(--m-color-primary) 12%, var(--m-color-surface));
85
+ border-right: 1px solid var(--m-color-border);
86
+ }
87
+ ```
88
+
89
+ ### Express — hero plane
90
+
91
+ ```css
92
+ .landing-hero__visual {
93
+ margin-top: var(--m-space-5);
94
+ padding: var(--m-space-5);
95
+ border: 1px solid var(--m-color-border);
96
+ border-radius: var(--m-radius-md);
97
+ background: var(--m-color-surface);
98
+ }
99
+ ```
100
+
101
+ ### Flow — empty shell
102
+
103
+ Prefer stock `MEmpty`. Optional light frame:
104
+
105
+ ```css
106
+ .empty-state-shell {
107
+ border: 1px dashed var(--m-color-border);
108
+ border-radius: var(--m-radius-md);
109
+ background: var(--m-color-surface);
110
+ padding: var(--m-space-6);
111
+ }
112
+ ```
113
+
114
+ If the user asked for glass / gradient / dark-tech, implement **that** request with `--m-*` — do not escalate into AI mesh.
115
+
116
+ ## Polish modes (Impeccable-inspired)
117
+
118
+ | Mode | Intent |
119
+ | --- | --- |
120
+ | `quieter` | Strip competing accents **and unearned gradients/glow/glass** |
121
+ | `bolder` | Strengthen one signature **inside** the user’s direction — do not invent a new face |
122
+ | `polish` / `clarify` / `typeset` / `adapt` / `delight` | As named |
123
+
124
+ ## Quality floor
125
+
126
+ - Responsive, focus visible, keyboard to primary actions
127
+ - No raw hex theme colors
128
+ - Craft pass done; MCP `validate_usage` / `validate_page` when available
129
+ - No unearned AI atmosphere
@@ -1,41 +1,41 @@
1
- ---
2
- description: Vue 3 + TypeScript 业务代码风格(Morya UI 项目)
3
- globs: "**/*.{ts,vue}"
4
- alwaysApply: false
5
- ---
6
-
7
- # 编码风格
8
-
9
- ## Vue
10
-
11
- - 使用 `<script setup lang="ts">`。
12
- - 组件名 PascalCase;模板中用 `M*` 前缀组件。
13
- - `v-model` 与组件库 emit 对齐(如 `v-model:page`)。
14
- - 页面级样式 `scoped`;仅使用 `--m-*` 与设计令牌。
15
-
16
- ## TypeScript
17
-
18
- - Props/emit 显式类型;避免 `any`。
19
- - 异步提交:`loading` ref + `try/finally`。
20
-
21
- ## 文件组织
22
-
23
- ```text
24
- src/
25
- views/ # 路由页面
26
- components/ # 业务组件
27
- composables/ # 复用逻辑
28
- api/ # 请求层
29
- ```
30
-
31
- ## 命名
32
-
33
- - 页面:`UserListView.vue` / `UserFormView.vue`
34
- - 路由 path kebab-case:`/users/create`
35
-
36
- ## 检查
37
-
38
- ```bash
39
- pnpm check:colors # 裸色值扫描
40
- pnpm typecheck
41
- ```
1
+ ---
2
+ description: Vue 3 + TypeScript 业务代码风格(Morya UI 项目)
3
+ globs: "**/*.{ts,vue}"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # 编码风格
8
+
9
+ ## Vue
10
+
11
+ - 使用 `<script setup lang="ts">`。
12
+ - 组件名 PascalCase;模板中用 `M*` 前缀组件。
13
+ - `v-model` 与组件库 emit 对齐(如 `v-model:page`)。
14
+ - 页面级样式 `scoped`;仅使用 `--m-*` 与设计令牌。
15
+
16
+ ## TypeScript
17
+
18
+ - Props/emit 显式类型;避免 `any`。
19
+ - 异步提交:`loading` ref + `try/finally`。
20
+
21
+ ## 文件组织
22
+
23
+ ```text
24
+ src/
25
+ views/ # 路由页面
26
+ components/ # 业务组件
27
+ composables/ # 复用逻辑
28
+ api/ # 请求层
29
+ ```
30
+
31
+ ## 命名
32
+
33
+ - 页面:`UserListView.vue` / `UserFormView.vue`
34
+ - 路由 path kebab-case:`/users/create`
35
+
36
+ ## 检查
37
+
38
+ ```bash
39
+ pnpm check:colors # 裸色值扫描
40
+ pnpm typecheck
41
+ ```