@withmata/blueprints 0.3.5 → 0.4.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 (62) hide show
  1. package/.claude/skills/audit/SKILL.md +4 -4
  2. package/.claude/skills/blueprint-catalog/SKILL.md +17 -7
  3. package/.claude/skills/copywrite/SKILL.md +187 -0
  4. package/.claude/skills/copywrite-landing/SKILL.md +489 -0
  5. package/.claude/skills/design-system/SKILL.md +970 -0
  6. package/.claude/skills/new-project/SKILL.md +168 -112
  7. package/.claude/skills/scaffold-auth/SKILL.md +9 -9
  8. package/.claude/skills/scaffold-db/SKILL.md +14 -14
  9. package/.claude/skills/scaffold-env/SKILL.md +4 -4
  10. package/.claude/skills/scaffold-foundation/SKILL.md +15 -15
  11. package/.claude/skills/scaffold-tailwind/SKILL.md +17 -3
  12. package/.claude/skills/scaffold-ui/SKILL.md +155 -36
  13. package/ENGINEERING.md +2 -2
  14. package/blueprints/discovery/design-system/BLUEPRINT.md +1479 -0
  15. package/blueprints/discovery/marketing-copywriting/BLUEPRINT.md +664 -0
  16. package/blueprints/features/auth-better-auth/BLUEPRINT.md +20 -22
  17. package/blueprints/features/db-drizzle-postgres/BLUEPRINT.md +12 -12
  18. package/blueprints/features/db-drizzle-postgres/files/db/src/example-entity.ts +1 -1
  19. package/blueprints/features/db-drizzle-postgres/files/db/src/scripts/seed.ts +1 -1
  20. package/blueprints/features/env-t3/BLUEPRINT.md +1 -1
  21. package/blueprints/features/tailwind-v4/BLUEPRINT.md +9 -2
  22. package/blueprints/features/tailwind-v4/files/tailwind-config/shared-styles.css +80 -1
  23. package/blueprints/features/ui-shared-components/BLUEPRINT.md +411 -78
  24. package/blueprints/features/ui-shared-components/files/ui/components/ui/alert-dialog.tsx +192 -0
  25. package/blueprints/features/ui-shared-components/files/ui/components/ui/avatar.tsx +71 -0
  26. package/blueprints/features/ui-shared-components/files/ui/components/ui/badge.tsx +52 -0
  27. package/blueprints/features/ui-shared-components/files/ui/components/ui/breadcrumb.tsx +122 -0
  28. package/blueprints/features/ui-shared-components/files/ui/components/ui/button.tsx +56 -0
  29. package/blueprints/features/ui-shared-components/files/ui/components/ui/card-select.tsx +72 -0
  30. package/blueprints/features/ui-shared-components/files/ui/components/ui/card.tsx +100 -0
  31. package/blueprints/features/ui-shared-components/files/ui/components/ui/collapsible.tsx +34 -0
  32. package/blueprints/features/ui-shared-components/files/ui/components/ui/combobox.tsx +301 -0
  33. package/blueprints/features/ui-shared-components/files/ui/components/ui/dropdown-menu.tsx +264 -0
  34. package/blueprints/features/ui-shared-components/files/ui/components/ui/empty-state.tsx +43 -0
  35. package/blueprints/features/ui-shared-components/files/ui/components/ui/entity-select.tsx +110 -0
  36. package/blueprints/features/ui-shared-components/files/ui/components/ui/field.tsx +237 -0
  37. package/blueprints/features/ui-shared-components/files/ui/components/ui/form-field.tsx +217 -0
  38. package/blueprints/features/ui-shared-components/files/ui/components/ui/input-group.tsx +161 -0
  39. package/blueprints/features/ui-shared-components/files/ui/components/ui/input.tsx +20 -0
  40. package/blueprints/features/ui-shared-components/files/ui/components/ui/label.tsx +20 -0
  41. package/blueprints/features/ui-shared-components/files/ui/components/ui/org-switcher.tsx +114 -0
  42. package/blueprints/features/ui-shared-components/files/ui/components/ui/page-header.tsx +45 -0
  43. package/blueprints/features/ui-shared-components/files/ui/components/ui/pagination.tsx +52 -0
  44. package/blueprints/features/ui-shared-components/files/ui/components/ui/pill-select.tsx +151 -0
  45. package/blueprints/features/ui-shared-components/files/ui/components/ui/popover.tsx +41 -0
  46. package/blueprints/features/ui-shared-components/files/ui/components/ui/search-input.tsx +49 -0
  47. package/blueprints/features/ui-shared-components/files/ui/components/ui/select.tsx +205 -0
  48. package/blueprints/features/ui-shared-components/files/ui/components/ui/selected-entity-card.tsx +47 -0
  49. package/blueprints/features/ui-shared-components/files/ui/components/ui/separator.tsx +25 -0
  50. package/blueprints/features/ui-shared-components/files/ui/components/ui/sidebar.tsx +389 -0
  51. package/blueprints/features/ui-shared-components/files/ui/components/ui/status-filter.tsx +43 -0
  52. package/blueprints/features/ui-shared-components/files/ui/components/ui/tag-input.tsx +131 -0
  53. package/blueprints/features/ui-shared-components/files/ui/components/ui/textarea.tsx +18 -0
  54. package/blueprints/features/ui-shared-components/files/ui/components/ui/user-menu.tsx +149 -0
  55. package/blueprints/features/ui-shared-components/files/ui/components.json +11 -8
  56. package/blueprints/features/ui-shared-components/files/ui/package.json +20 -11
  57. package/blueprints/foundation/monorepo-turbo/BLUEPRINT.md +19 -20
  58. package/blueprints/foundation/monorepo-turbo/files/root/package.json +1 -1
  59. package/dist/index.js +1 -1
  60. package/package.json +1 -1
  61. package/blueprints/features/tailwind-v4/files/tailwind-config/package.json +0 -20
  62. package/blueprints/foundation/monorepo-turbo/files/root/pnpm-workspace.yaml +0 -5
@@ -0,0 +1,970 @@
1
+ ---
2
+ name: design-system
3
+ description: Define visual identity and generate Tailwind v4 design tokens through a structured design conversation
4
+ ---
5
+
6
+ # Define Design System
7
+
8
+ Define a complete visual identity and generate production-ready Tailwind v4 CSS design tokens through a structured design conversation. This is an educational, conversational process — every decision teaches the user WHY a choice works for their product and audience. The output is both a design reference document and a drop-in CSS file that powers the entire UI.
9
+
10
+ This skill covers visual identity definition and token generation. For scaffolding the Tailwind configuration package, use `/scaffold-tailwind`. For building UI components that consume these tokens, use `/scaffold-ui`.
11
+
12
+ ## Step 1: Read the Blueprint
13
+
14
+ Read the full design system blueprint:
15
+
16
+ ```
17
+ ~/.withmata/blueprints/blueprints/discovery/design-system/BLUEPRINT.md
18
+ ```
19
+
20
+ If not found, run `npx @withmata/blueprints` to install.
21
+
22
+ The BLUEPRINT.md contains the complete methodology: creative direction frameworks, color theory, typography pairing strategy, component styling philosophy, and output specifications. Follow it precisely.
23
+
24
+ ## Step 2: Read Context
25
+
26
+ Check if `.project-context.md` exists in the target project root. If it contains product discovery or other relevant sections, read the available docs:
27
+
28
+ - `docs/product/product-thesis.md` — for product pillars, positioning, value proposition
29
+ - `docs/product/product-brief.md` — for competitive landscape, target market, differentiation
30
+ - `docs/product/users/archetype-*.md` — for audience sensibility, demographics, technical sophistication
31
+ - `docs/pages/landing/*.md` — for brand voice and messaging tone (from marketing copy if available)
32
+
33
+ Map discovery findings to design inputs:
34
+
35
+ - **Product type** → aesthetic direction (SaaS dashboard vs. consumer app vs. developer tool vs. e-commerce vs. content platform — each has distinct visual conventions and user expectations)
36
+ - **Primary archetype** → audience sensibility (technical users expect information density and precision; non-technical users expect clarity and guidance; enterprise buyers expect trust signals and polish)
37
+ - **Core pillars** → what the design should communicate (if "speed" is a pillar, the design should feel fast — tight spacing, sharp corners, minimal animation; if "trust" is a pillar — conservative palette, ample whitespace, professional typography)
38
+ - **Brand voice** (from marketing copy docs if available) → visual tone (a playful voice maps to rounded corners, saturated colors, and generous spacing; a professional voice maps to neutral palettes and structured layouts)
39
+ - **Competitive landscape** → differentiation opportunities (if all competitors use blue, consider a different hue; if all competitors feel corporate, consider a more human approach)
40
+
41
+ Check for existing design work:
42
+
43
+ - If `docs/design/` exists, this is **upgrade mode** — read `docs/design/design-system.md` and `docs/design/shared-styles.css`, show the user what exists, and offer to refine rather than replace
44
+ - If `config/tailwind-config/shared-styles.css` (monorepo) or `src/styles/shared-styles.css` (single-repo) exists from a previous `/scaffold-tailwind` run, note this — the generated tokens will need to be synced there
45
+
46
+ Ask: "Do you have any existing UI work you'd like me to reference? You can share screenshots — I'll analyze the visual language and incorporate elements you like."
47
+
48
+ If the user provides screenshots, analyze them for:
49
+ - Color palette (dominant, accent, neutral tones)
50
+ - Typography style (geometric vs. humanist, weight usage, scale)
51
+ - Spacing density (compact vs. airy)
52
+ - Corner rounding (sharp vs. rounded)
53
+ - Shadow and depth approach
54
+ - Overall mood and personality
55
+
56
+ If no product docs exist, note what context is missing. Gather it conversationally before proceeding — at minimum, understand the product type, target audience, and desired personality.
57
+
58
+ ## Step 3: Creative Direction
59
+
60
+ Present 2-3 creative direction options based on the product context. Each direction is a coherent visual world — not just a color, but a complete aesthetic philosophy that connects to the product and audience.
61
+
62
+ ```
63
+ Based on [product context summary], here are 3 creative directions:
64
+
65
+ 1. **"[Evocative Name]"** — [One paragraph describing the complete visual world: colors,
66
+ typography feel, spacing philosophy, animation personality, and the emotional response
67
+ it creates. Paint a picture the user can see in their mind.]
68
+ *Why it fits: [Specific connection to the product's audience, positioning, or
69
+ competitive differentiation. Reference discovery findings if available.]*
70
+
71
+ 2. **"[Evocative Name]"** — [description]
72
+ *Why it fits: [reasoning]*
73
+
74
+ 3. **"[Evocative Name]"** — [description]
75
+ *Why it fits: [reasoning]*
76
+
77
+ Which direction resonates? You can also mix elements from multiple —
78
+ "I like the colors from 1 but the typography feeling from 3."
79
+ ```
80
+
81
+ The directions should be meaningfully different — not three shades of the same idea. Each should represent a distinct strategic choice about how the product presents itself to its audience.
82
+
83
+ The chosen direction (or hybrid) becomes the **Creative North Star** — a short phrase and paragraph that guides every subsequent decision. Reference it throughout the remaining steps.
84
+
85
+ Wait for the user to choose or combine before proceeding.
86
+
87
+ ## Step 4: Color System
88
+
89
+ This is the most impactful design decision. Colors create immediate emotional responses, establish brand recognition, and directly affect usability. Take time here.
90
+
91
+ ### Research Phase
92
+
93
+ - Use web search to research competitors' visual identities — note their primary hues, saturation levels, and overall palette temperature
94
+ - Identify color differentiation opportunities (if every competitor in the space uses blue, a violet or teal primary creates instant visual distinction)
95
+ - Research color psychology relevant to the product domain (finance → trust/stability, health → calm/clean, creativity → energy/warmth, developer tools → precision/depth)
96
+
97
+ ### Primary Color Proposal
98
+
99
+ Propose the primary color with full oklch rationale:
100
+
101
+ ```
102
+ **Primary Color: oklch(0.55 0.22 270)**
103
+
104
+ **Hue rationale:** Violet (270°) signals creativity and premium quality.
105
+ Your competitors [X, Y, Z] all use blue (220-240°). Shifting to violet
106
+ maintains the trust association of the blue family while creating visual
107
+ distinction and a more modern, premium feel.
108
+
109
+ **Audience alignment:** Your primary archetype [name] values [quality].
110
+ Violet communicates sophistication without feeling corporate — it says
111
+ "thoughtfully designed" rather than "enterprise procurement approved."
112
+
113
+ **Competitive differentiation:** In a landscape of blue SaaS dashboards,
114
+ violet is immediately recognizable. When your users see that hue, they
115
+ know they're in your product.
116
+ ```
117
+
118
+ **Generate evocative names:**
119
+ For each color token, create a descriptive name using the pattern: **evocative adjective(s) + color family**. Never use generic names.
120
+
121
+ Examples:
122
+ - "Deep Indigo" not "primary blue"
123
+ - "Whisper Gray" not "light gray"
124
+ - "Alert Terracotta" not "red"
125
+ - "Warm Barely-There Cream" not "off-white"
126
+
127
+ These names serve dual purposes: they create emotional association for humans and provide AI agents with richer context about the color's character.
128
+
129
+ **Present surface layering stack:**
130
+ Show the explicit elevation model:
131
+ ```
132
+ Layer 0: background — Page canvas
133
+ Layer 1: sidebar — Persistent navigation
134
+ Layer 2: card — Content containers
135
+ Layer 3: popover — Floating elements
136
+ Layer 4: overlay — Modal backdrop
137
+ Layer 5: dialog — Modal content (highest)
138
+ ```
139
+
140
+ Explain separation strategies: tonal shifts (preferred) → shadows (floating) → ghost borders (accessibility).
141
+
142
+ ### Full Palette Construction
143
+
144
+ Build the complete palette — all 31+ semantic tokens in oklch format. Explain the relationship between tokens:
145
+
146
+ **Semantic color tokens (light mode):**
147
+
148
+ | Token | Value | Usage | Relationship |
149
+ |-------|-------|-------|-------------|
150
+ | `--background` | `oklch(...)` | Page background | Lightest surface |
151
+ | `--foreground` | `oklch(...)` | Primary text | Maximum contrast on background |
152
+ | `--card` | `oklch(...)` | Card surfaces | One step above background |
153
+ | `--card-foreground` | `oklch(...)` | Text on cards | Matches foreground or slightly lighter |
154
+ | `--popover` | `oklch(...)` | Dropdown/popover surfaces | Matches card or slightly elevated |
155
+ | `--popover-foreground` | `oklch(...)` | Text in popovers | Matches card-foreground |
156
+ | `--primary` | `oklch(...)` | Primary actions, links | The brand color |
157
+ | `--primary-foreground` | `oklch(...)` | Text on primary surfaces | High contrast on primary |
158
+ | `--secondary` | `oklch(...)` | Secondary actions | Desaturated primary or neutral |
159
+ | `--secondary-foreground` | `oklch(...)` | Text on secondary surfaces | Readable on secondary |
160
+ | `--muted` | `oklch(...)` | Subtle backgrounds | Very low contrast surface |
161
+ | `--muted-foreground` | `oklch(...)` | Subdued text, placeholders | Deliberately lower contrast |
162
+ | `--accent` | `oklch(...)` | Hover states, highlights | Subtle emphasis |
163
+ | `--accent-foreground` | `oklch(...)` | Text on accent surfaces | Readable on accent |
164
+ | `--destructive` | `oklch(...)` | Error states, delete actions | Red family, high urgency |
165
+ | `--border` | `oklch(...)` | Borders, dividers | Subtle separation |
166
+ | `--input` | `oklch(...)` | Input borders | Slightly more visible than border |
167
+ | `--ring` | `oklch(...)` | Focus rings | Visible but not jarring |
168
+ | `--sidebar` | `oklch(...)` | Sidebar background | Slightly different from main bg |
169
+ | `--sidebar-foreground` | `oklch(...)` | Sidebar text | Readable on sidebar |
170
+ | `--sidebar-primary` | `oklch(...)` | Active sidebar items | Brand color variant |
171
+ | `--sidebar-primary-foreground` | `oklch(...)` | Text on active sidebar items | High contrast |
172
+ | `--sidebar-accent` | `oklch(...)` | Sidebar hover states | Subtle highlight |
173
+ | `--sidebar-accent-foreground` | `oklch(...)` | Text on sidebar hover | Readable |
174
+ | `--sidebar-border` | `oklch(...)` | Sidebar borders | Matches or subtler than main border |
175
+ | `--sidebar-ring` | `oklch(...)` | Sidebar focus rings | Matches or subtler than main ring |
176
+ | `--chart-1` through `--chart-5` | `oklch(...)` | Data visualization | Perceptually uniform steps |
177
+
178
+ **Surface hierarchy:** Explain the elevation model — how surfaces layer from base → container → card → elevated → popover, and how each level uses color/shadow to communicate depth.
179
+
180
+ ### Dark Mode
181
+
182
+ Build dark mode variants thoughtfully — not mechanical inversion:
183
+
184
+ - Backgrounds darken, but not to pure black (too harsh on eyes — use `oklch(0.14-0.20 ...)`)
185
+ - Foregrounds lighten, but not to pure white (use `oklch(0.95-0.99 ...)`)
186
+ - Primary color may need lightness/chroma adjustment to maintain contrast ratios
187
+ - Borders shift to semi-transparent white (`oklch(1 0 0 / 10%)`) for natural layering
188
+ - Destructive red shifts warmer and lighter to maintain visibility without screaming
189
+ - Chart colors may need chroma boost to maintain vibrancy on dark backgrounds
190
+
191
+ Present both light and dark palettes side by side. Confirm the complete color system before proceeding.
192
+
193
+ ## Step 5: Typography
194
+
195
+ Typography is the voice of the interface. It carries more information than any other visual element — every word the user reads passes through the type choices.
196
+
197
+ ### Research Phase
198
+
199
+ - Use web search to research font pairings based on the Creative North Star
200
+ - Search Google Fonts and font directories for options that match the product personality
201
+ - Consider the practical requirements: language support, variable font availability, loading performance, licensing
202
+
203
+ ### Propose 2-3 Pairings
204
+
205
+ Each pairing should include a display/heading font and a body font, with clear rationale:
206
+
207
+ ```
208
+ **Option A:** Plus Jakarta Sans (display) + Manrope (body)
209
+ *Classification: Geometric sans + Geometric sans (single-family feel, different optical sizes)*
210
+ *Why: The clean geometry signals modern tech, while Manrope's open apertures ensure
211
+ long-form readability. Good for SaaS dashboards where users spend extended time
212
+ reading data and documentation. Both are variable fonts — excellent loading performance.*
213
+ *Google Fonts: fonts.google.com/specimen/Plus+Jakarta+Sans + fonts.google.com/specimen/Manrope*
214
+
215
+ **Option B:** Inter (display + body) + JetBrains Mono (code)
216
+ *Classification: Neo-grotesque sans (single family)*
217
+ *Why: Inter was designed specifically for computer screens. Its large x-height and
218
+ open apertures make it readable at every size. The tabular numbers are perfect for
219
+ data-heavy interfaces. Boring? Maybe. But boring typography lets the content shine.
220
+ This is the "get out of the way" choice.*
221
+ *Google Fonts: fonts.google.com/specimen/Inter*
222
+
223
+ **Option C:** Instrument Sans (display) + Source Sans 3 (body)
224
+ *Classification: Contemporary sans + Humanist sans*
225
+ *Why: Instrument Sans has subtle personality in its letterforms — just enough character
226
+ to feel distinctive without competing with content. Source Sans 3 is Adobe's workhorse:
227
+ neutral, readable, professional. The contrast between contemporary display and
228
+ humanist body creates visual hierarchy naturally.*
229
+ *Google Fonts: fonts.google.com/specimen/Instrument+Sans + fonts.google.com/specimen/Source+Sans+3*
230
+ ```
231
+
232
+ ### Type Scale
233
+
234
+ Define the complete type scale using CSS custom properties:
235
+
236
+ ```
237
+ --font-sans: "[chosen font]", system-ui, sans-serif;
238
+ --font-mono: "[chosen mono font]", ui-monospace, monospace;
239
+ ```
240
+
241
+ Explain the scale rationale (e.g., major third ratio 1.25, or custom scale based on product needs).
242
+
243
+ Wait for the user to confirm their font choice before proceeding.
244
+
245
+ ## Step 6: Spacing, Rounding & Borders
246
+
247
+ These three decisions create the "personality" of the interface — they're what makes a UI feel sharp, soft, playful, or professional.
248
+
249
+ ### Spacing Base Unit
250
+
251
+ Propose the base spacing unit (typically 4px or 8px) with rationale connected to the creative direction.
252
+
253
+ ### Rounding Personality
254
+
255
+ Present rounding options with vivid visual descriptions so the user can picture each:
256
+
257
+ ```
258
+ **Sharp (radius: 0.25rem / 4px)**
259
+ Clean cuts, editorial precision. Communicates efficiency and seriousness.
260
+ Think Bloomberg Terminal, Linear, Figma. Best for: developer tools, data
261
+ platforms, professional B2B.
262
+
263
+ **Moderate (radius: 0.5rem / 8px)**
264
+ Professional but approachable. The most versatile choice — reads as
265
+ "designed" without being playful. Think Notion, Stripe Dashboard, Vercel.
266
+ Best for: SaaS products, productivity tools, most B2B.
267
+
268
+ **Round (radius: 0.625rem / 10px)**
269
+ Friendly and modern. Softens the interface without feeling childish.
270
+ Think Stripe Marketing, Linear Marketing, Raycast. Best for: consumer-
271
+ facing SaaS, marketplaces, creative tools.
272
+
273
+ **Full (radius: 1rem+ / 16px+)**
274
+ Playful and warm. Creates a casual, consumer-friendly feeling.
275
+ Think Duolingo, Headspace, Notion AI. Best for: consumer apps,
276
+ education, wellness, entertainment.
277
+ ```
278
+
279
+ Recommend the option that best matches the Creative North Star, but let the user choose.
280
+
281
+ ### Border Philosophy
282
+
283
+ Propose the border approach:
284
+
285
+ - **Minimal borders** — rely on spacing and surface color for separation (modern, clean)
286
+ - **Subtle borders** — light borders define containers, inputs get clear boundaries (structured, professional)
287
+ - **Defined borders** — visible borders on most containers (traditional, data-dense UIs)
288
+
289
+ Define the radius scale tokens:
290
+
291
+ ```
292
+ --radius: [base value];
293
+ /* These are derived automatically: */
294
+ --radius-sm: calc(var(--radius) - 4px);
295
+ --radius-md: calc(var(--radius) - 2px);
296
+ --radius-lg: var(--radius);
297
+ --radius-xl: calc(var(--radius) + 4px);
298
+ --radius-2xl: calc(var(--radius) + 8px);
299
+ --radius-3xl: calc(var(--radius) + 12px);
300
+ --radius-4xl: calc(var(--radius) + 16px);
301
+ ```
302
+
303
+ Confirm before proceeding.
304
+
305
+ ## Step 7: Layout & Responsive Behavior
306
+
307
+ Define how the design system adapts across viewport sizes.
308
+
309
+ **Propose grid system:**
310
+ - Container max-width (1280px for content-focused, 1440px for dashboards)
311
+ - Column structure (12-column for complex layouts, simpler for marketing pages)
312
+ - Gutter width (typically 1rem or 1.5rem, derived from base spacing)
313
+
314
+ **Define breakpoints:**
315
+ Present the responsive strategy with Tailwind breakpoint mapping:
316
+ ```
317
+ Mobile: < 640px (sm) — single column, stacked, thumb-friendly
318
+ Tablet: 640-1024px (sm-lg) — 2 columns, sidebar may collapse
319
+ Desktop: 1024-1440px (lg-2xl) — full layout, sidebar expanded
320
+ Large: > 1440px — content max-width, generous margins
321
+ ```
322
+
323
+ **Document responsive component behaviors:**
324
+ Present a table showing how each major component adapts:
325
+
326
+ | Component | Mobile | Tablet | Desktop |
327
+ |-----------|--------|--------|---------|
328
+ | Sidebar | Hidden (hamburger) | Icon-only collapsed | Full expanded |
329
+ | Modals | Full-screen, slide-up | Centered, max-w-lg | Centered |
330
+ | Navigation | Bottom tabs or hamburger | Horizontal condensed | Full horizontal |
331
+ | Card Grid | 1 column | 2 columns | 3-4 columns |
332
+ | Tables | Horizontal scroll | Horizontal scroll | Full table |
333
+ | CTAs | Full width, sticky | Auto width | Auto width |
334
+
335
+ **Touch targets:** Minimum 44x44px (WCAG AA), recommended 48x48px.
336
+
337
+ Confirm layout/responsive decisions before proceeding.
338
+
339
+ ## Step 8: Component Styling Guidelines
340
+
341
+ For each component type, propose specific styling decisions. These are deep, opinionated guidelines that connect back to the Creative North Star. Present as a structured guide the user confirms.
342
+
343
+ ### Buttons
344
+
345
+ - **Primary:** gradient vs. flat fill, shadow on hover or not, active state (scale-down or darken)
346
+ - **Secondary:** outline vs. subtle fill, border weight, hover behavior
347
+ - **Ghost:** hover background (muted or accent), text color change on hover
348
+ - **Destructive:** red intensity, when to use outline vs. fill
349
+ - **Padding per size:** sm / default / lg with specific values
350
+ - **Icon alignment:** gap between icon and label, icon-only button sizing
351
+ - **State transitions:** duration, easing, which properties animate
352
+ - **Disabled state:** opacity level, cursor style, how to communicate "not clickable" accessibly
353
+
354
+ ### Cards
355
+
356
+ - **Surface color:** card token vs. background token, when to elevate
357
+ - **Shadow level:** none / xs / sm — connected to the depth philosophy
358
+ - **Rounding:** uses radius-lg or radius-xl
359
+ - **Internal spacing:** header padding, content padding, footer padding
360
+ - **Border:** visible border or shadow-only separation
361
+ - **Hover state (interactive cards):** shadow lift, border highlight, or subtle background shift
362
+
363
+ ### Inputs
364
+
365
+ - **Style:** filled (muted background) vs. outlined (border only) vs. hybrid (border + subtle fill)
366
+ - **Focus state:** ring glow (primary tinted) vs. border color change vs. both
367
+ - **Error state:** destructive border + helper text, icon indicator, background tint
368
+ - **Label placement:** above (standard) vs. floating vs. inline
369
+ - **Size variants:** sm / default / lg with specific height/padding values
370
+
371
+ ### Modals / Dialogs
372
+
373
+ - **Backdrop:** color and blur intensity (e.g., `oklch(0 0 0 / 50%)` + `backdrop-blur-sm`)
374
+ - **Surface:** card token, elevated shadow
375
+ - **Enter animation:** scale-in + fade or slide-up + fade
376
+ - **Exit animation:** reverse of enter, slightly faster
377
+ - **Rounding:** typically radius-xl or radius-2xl (larger than cards)
378
+
379
+ ### Navigation
380
+
381
+ - **Active indicator:** background highlight, left/bottom border accent, or text weight change
382
+ - **Hover behavior:** background shift, text color change
383
+ - **Collapsed state (sidebar):** icon-only with tooltip, active indicator persists
384
+ - **Mobile behavior:** bottom tab bar vs. hamburger drawer
385
+
386
+ ### Badges
387
+
388
+ - **Rounding:** full radius (pill) vs. matching component radius
389
+ - **Size variants:** sm / default / lg
390
+ - **Color mapping:** which semantic colors map to which badge meanings (success=green, warning=amber, etc.)
391
+
392
+ ### Tables
393
+
394
+ - **Header treatment:** bold text + muted background, or bold text + bottom border only
395
+ - **Row hover:** subtle background highlight
396
+ - **Border approach:** horizontal lines only, full grid, or minimal (zebra striping)
397
+ - **Sticky header behavior:** shadow on scroll
398
+
399
+ ### Forms (Layout)
400
+
401
+ - **Field spacing:** gap between form fields (typically 1.5rem-2rem)
402
+ - **Section grouping:** how to visually separate form sections (heading + border, or spacing only)
403
+ - **Error display:** inline below field, toast notification, or summary at top
404
+ - **Required field indicator:** asterisk, "(required)" text, or mark optional fields instead
405
+
406
+ Present the complete component guide and wait for confirmation before proceeding.
407
+
408
+ ## Step 9: Shadows & Depth
409
+
410
+ Shadows create spatial hierarchy — they tell the user what's "above" what. The shadow system should feel intentional, not arbitrary.
411
+
412
+ ### Shadow Scale
413
+
414
+ Propose the complete shadow scale:
415
+
416
+ ```
417
+ --shadow-xs: [very subtle, for borders/pressed states]
418
+ --shadow-sm: [cards, containers — resting state]
419
+ --shadow-md: [raised cards, interactive hover states]
420
+ --shadow-lg: [dropdowns, popovers, floating elements]
421
+ --shadow-xl: [modals, command palettes]
422
+ --shadow-2xl: [toasts, notifications — highest elevation]
423
+ ```
424
+
425
+ ### Shadow Color Decision
426
+
427
+ - **Neutral shadows:** `oklch(0 0 0 / N%)` — safe, works everywhere
428
+ - **Tinted shadows:** `oklch([hue of primary] / N%)` — more cohesive, adds subtle warmth/coolness
429
+ - Recommend based on creative direction
430
+
431
+ ### Component-Shadow Mapping
432
+
433
+ Map shadow levels to specific component usage:
434
+
435
+ | Component | Resting | Hover | Active |
436
+ |-----------|---------|-------|--------|
437
+ | Card | shadow-sm | shadow-md | — |
438
+ | Button (primary) | shadow-xs | shadow-sm | none |
439
+ | Dropdown | — | — | shadow-lg |
440
+ | Modal | — | — | shadow-xl |
441
+ | Toast | — | — | shadow-2xl |
442
+ | Input | none | none | none (uses ring) |
443
+
444
+ ### Glassmorphism (if applicable)
445
+
446
+ If the creative direction calls for glass/translucent effects, define the recipe:
447
+
448
+ ```
449
+ background: oklch(1 0 0 / 70%);
450
+ backdrop-filter: blur(12px);
451
+ border: 1px solid oklch(1 0 0 / 20%);
452
+ ```
453
+
454
+ Confirm before proceeding.
455
+
456
+ ## Step 10: Animation & Motion
457
+
458
+ Motion gives the interface life — it communicates state changes, guides attention, and creates a sense of craft. But motion that's too slow or too frequent becomes annoying. The goal is motion that feels inevitable, not decorative.
459
+
460
+ ### Duration Scale
461
+
462
+ ```
463
+ --duration-fast: 100ms (micro-interactions: hover, focus, toggle)
464
+ --duration-normal: 200ms (state changes: expand, collapse, fade)
465
+ --duration-slow: 350ms (major transitions: modal enter, page transition)
466
+ ```
467
+
468
+ ### Easing Curves
469
+
470
+ Propose custom easing curves with personality descriptions:
471
+
472
+ ```
473
+ --ease-out: cubic-bezier(0.16, 1, 0.3, 1) — snappy deceleration, feels responsive
474
+ --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1) — smooth, balanced movement
475
+ --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1) — slight overshoot, playful energy
476
+ ```
477
+
478
+ Adjust based on creative direction — sharp/professional UIs use ease-out only; playful UIs can use spring easing.
479
+
480
+ ### Keyframe Animations
481
+
482
+ Define the standard animation set:
483
+
484
+ ```
485
+ @keyframes fade-in — opacity 0 → 1
486
+ @keyframes fade-out — opacity 1 → 0
487
+ @keyframes slide-up — translateY(4px) + opacity 0 → translateY(0) + opacity 1
488
+ @keyframes slide-down — translateY(-4px) + opacity 0 → translateY(0) + opacity 1
489
+ @keyframes scale-in — scale(0.95) + opacity 0 → scale(1) + opacity 1
490
+ @keyframes scale-out — scale(1) + opacity 1 → scale(0.95) + opacity 0
491
+ @keyframes spin — rotate(0deg) → rotate(360deg)
492
+ @keyframes accordion-down — height 0 → var(--radix-accordion-content-height)
493
+ @keyframes accordion-up — reverse of accordion-down
494
+ ```
495
+
496
+ ### Animation Tokens
497
+
498
+ Map keyframes to utility-ready animation tokens:
499
+
500
+ ```
501
+ --animate-fade-in: fade-in [duration] [easing]
502
+ --animate-fade-out: fade-out [duration] [easing]
503
+ --animate-slide-up: slide-up [duration] [easing]
504
+ --animate-slide-down: slide-down [duration] [easing]
505
+ --animate-scale-in: scale-in [duration] [easing]
506
+ --animate-scale-out: scale-out [duration] [easing]
507
+ --animate-spin: spin 1s linear infinite
508
+ --animate-accordion-down: accordion-down [duration] [easing]
509
+ --animate-accordion-up: accordion-up [duration] [easing]
510
+ ```
511
+
512
+ ### Motion Philosophy
513
+
514
+ Define what animates and what doesn't:
515
+
516
+ - **Always animates:** hover/focus states, modal enter/exit, dropdown open/close, accordion expand/collapse, route transitions (if SPA)
517
+ - **Never animates:** initial page render content, scroll position, text content changes
518
+ - **Reduced motion:** all animations respect `prefers-reduced-motion: reduce` — either disabled entirely or replaced with a simple opacity fade
519
+
520
+ Confirm before proceeding to output generation.
521
+
522
+ ## Step 11: Generate Outputs
523
+
524
+ Write both files in the target project:
525
+
526
+ ### File 1: `docs/design/design-system.md`
527
+
528
+ Full design reference document with 14 sections:
529
+
530
+ 1. Creative North Star
531
+ 2. Color Philosophy (with evocative naming table + surface layering diagram)
532
+ 3. Typography
533
+ 4. Spacing & Rhythm
534
+ 5. Rounding
535
+ 6. Layout & Responsive (grid, breakpoints, component adaptation table)
536
+ 7. Elevation & Depth
537
+ 8. Component Guidelines
538
+ 9. Animation & Motion
539
+ 10. Do's and Don'ts (includes "Common AI Mistakes to Prevent" with specific negative constraints)
540
+ 11. How to Use (includes Design Language Translation table mapping Tailwind classes to natural language)
541
+ 12. Agent Context — Design System Quick Reference
542
+
543
+ The Agent Context section (section 12) includes:
544
+ - **Color Map:** flat list of every token with oklch value + Tailwind class
545
+ - **Component Recipes:** ready-to-paste class combinations for buttons, cards, inputs, badges, etc.
546
+ - **Spacing Cheat Sheet:** common spacing patterns with exact values
547
+ - **Surface Layering:** quick reference for which bg-* class to use at each layer
548
+ - **Design Rules (for AI):** 10 imperative rules distilled from Do's and Don'ts
549
+
550
+ Document structure:
551
+
552
+ ```markdown
553
+ # [Product Name] Design System
554
+
555
+ ## Creative North Star
556
+ [The chosen direction name and description — the emotional/aesthetic guiding principle]
557
+
558
+ ## Color Philosophy
559
+ [Palette rationale — why these hues, how they connect to the audience and product]
560
+
561
+ ### Color Reference
562
+
563
+ | Token | Light Mode | Dark Mode | Usage | Tailwind Class |
564
+ |-------|-----------|-----------|-------|---------------|
565
+ | background | oklch(...) | oklch(...) | Page background | `bg-background` |
566
+ | foreground | oklch(...) | oklch(...) | Primary text | `text-foreground` |
567
+ | ... all 31+ tokens ... |
568
+
569
+ ### Surface Hierarchy
570
+ [Base → container → card → elevated → popover explanation]
571
+
572
+ ## Typography
573
+ [Font pairing rationale + import instructions]
574
+
575
+ ### Type Scale
576
+ | Level | Font | Size | Weight | Line Height | Tailwind Class |
577
+ |-------|------|------|--------|-------------|---------------|
578
+ | ... |
579
+
580
+ ## Spacing & Rhythm
581
+ [Base unit, scale, usage guidelines]
582
+
583
+ ## Rounding
584
+ [Personality choice + rationale]
585
+
586
+ ### Radius Scale
587
+ | Token | Value | Usage | Tailwind Class |
588
+ |-------|-------|-------|---------------|
589
+ | radius-sm | ... | Small elements | `rounded-sm` |
590
+ | ... |
591
+
592
+ ## Layout & Responsive
593
+ [Grid system, breakpoints, and component adaptation table from Step 7]
594
+
595
+ ### Grid System
596
+ | Property | Value | Rationale |
597
+ |----------|-------|-----------|
598
+ | Container max-width | ... | ... |
599
+ | Columns | ... | ... |
600
+ | Gutter | ... | ... |
601
+
602
+ ### Breakpoints
603
+ | Name | Range | Tailwind | Layout Behavior |
604
+ |------|-------|----------|----------------|
605
+ | Mobile | < 640px | sm | ... |
606
+ | Tablet | 640-1024px | sm-lg | ... |
607
+ | Desktop | 1024-1440px | lg-2xl | ... |
608
+ | Large | > 1440px | 2xl+ | ... |
609
+
610
+ ### Component Responsive Behaviors
611
+ | Component | Mobile | Tablet | Desktop |
612
+ |-----------|--------|--------|---------|
613
+ | Sidebar | ... | ... | ... |
614
+ | ... |
615
+
616
+ ## Elevation & Depth
617
+ [Shadow philosophy + scale]
618
+
619
+ ### Shadow Scale
620
+ | Token | Value | Usage | Tailwind Class |
621
+ |-------|-------|-------|---------------|
622
+
623
+ ### Border Philosophy
624
+ [When to use borders vs. shadows vs. spacing]
625
+
626
+ ## Component Guidelines
627
+ [Deep, per-component styling guide from Step 8 — buttons, cards, inputs, modals,
628
+ navigation, badges, tables, forms]
629
+
630
+ ## Animation & Motion
631
+ [Philosophy + practical guide]
632
+
633
+ ### Duration Scale
634
+ | Token | Value | Usage |
635
+ |-------|-------|-------|
636
+
637
+ ### Easing Curves
638
+ | Token | Value | Personality |
639
+ |-------|-------|------------|
640
+
641
+ ### Animation Tokens
642
+ | Token | Value | Usage |
643
+ |-------|-------|-------|
644
+
645
+ ## Do's and Don'ts
646
+ [Practical guidelines — what to do, what to avoid, common mistakes]
647
+
648
+ ### Common AI Mistakes to Prevent
649
+ [Specific negative constraints for AI agents generating UI with this design system.
650
+ Examples: "Never use bg-gray-100 — always use bg-muted", "Never hardcode
651
+ colors — always use semantic tokens", "Never mix rounded-full with rounded-lg
652
+ in the same component group"]
653
+
654
+ ## How to Use
655
+ [Practical guide with Tailwind class examples for each token category.
656
+ This is the bridge between design decisions and development.]
657
+
658
+ ### Colors
659
+ `bg-primary`, `text-primary-foreground`, `border-border`, `ring-ring`, etc.
660
+
661
+ ### Typography
662
+ `font-sans`, `font-mono`, how to apply the type scale
663
+
664
+ ### Spacing
665
+ How to use the spacing scale consistently
666
+
667
+ ### Rounding
668
+ `rounded-sm`, `rounded-md`, `rounded-lg`, etc. — when to use which
669
+
670
+ ### Shadows
671
+ `shadow-xs`, `shadow-sm`, etc. — component mapping
672
+
673
+ ### Animation
674
+ `animate-fade-in`, `animate-slide-up`, etc. — when to use which
675
+
676
+ ### Design Language Translation
677
+ | Natural Language | Tailwind Classes | When to Use |
678
+ |-----------------|-----------------|-------------|
679
+ | "Make it feel elevated" | `shadow-md bg-card` | Cards that need visual prominence |
680
+ | "Subtle container" | `bg-muted/50 rounded-lg` | Background sections, grouped content |
681
+ | "Call to action" | `bg-primary text-primary-foreground` | Primary buttons, key links |
682
+ | "De-emphasized" | `text-muted-foreground` | Helper text, timestamps, metadata |
683
+ | "Danger zone" | `bg-destructive text-destructive-foreground` | Delete actions, error states |
684
+ | ... comprehensive mapping of design intent to classes ... |
685
+
686
+ ### Quick Reference
687
+ | I want to... | Use this class |
688
+ |--------------|---------------|
689
+ | Set page background | `bg-background` |
690
+ | Style primary text | `text-foreground` |
691
+ | Style a primary button | `bg-primary text-primary-foreground` |
692
+ | Style a card | `bg-card text-card-foreground rounded-lg shadow-sm` |
693
+ | ... comprehensive mapping ... |
694
+
695
+ ## Agent Context — Design System Quick Reference
696
+
697
+ ### Color Map
698
+ | Token | Light oklch | Dark oklch | Evocative Name | Tailwind Class |
699
+ |-------|------------|-----------|----------------|---------------|
700
+ | background | oklch(...) | oklch(...) | [name] | `bg-background` |
701
+ | ... all tokens ... |
702
+
703
+ ### Component Recipes
704
+ ```
705
+ Primary Button: bg-primary text-primary-foreground rounded-[radius] shadow-xs hover:shadow-sm
706
+ Secondary Button: bg-secondary text-secondary-foreground rounded-[radius]
707
+ Card: bg-card text-card-foreground rounded-lg shadow-sm border
708
+ Input: bg-background border border-input rounded-md ring-ring
709
+ Badge: bg-primary/10 text-primary rounded-full text-xs px-2 py-0.5
710
+ ```
711
+
712
+ ### Spacing Cheat Sheet
713
+ | Pattern | Value | Usage |
714
+ |---------|-------|-------|
715
+ | Component gap | ... | Between sibling elements |
716
+ | Section gap | ... | Between page sections |
717
+ | Card padding | ... | Inside card containers |
718
+ | Input height | ... | Form field height |
719
+
720
+ ### Surface Layering
721
+ | Layer | Token | Tailwind Class | Usage |
722
+ |-------|-------|---------------|-------|
723
+ | 0 | background | `bg-background` | Page canvas |
724
+ | 1 | sidebar | `bg-sidebar` | Persistent navigation |
725
+ | 2 | card | `bg-card` | Content containers |
726
+ | 3 | popover | `bg-popover` | Floating elements |
727
+ | 4 | — | `bg-black/50` | Modal backdrop |
728
+ | 5 | popover | `bg-popover` | Modal/dialog content |
729
+
730
+ ### Design Rules (for AI)
731
+ [10 imperative rules distilled from Do's and Don'ts. Examples:]
732
+ 1. ALWAYS use semantic color tokens (`bg-primary`) — NEVER use raw colors (`bg-blue-500`)
733
+ 2. ALWAYS pair foreground with its matching background (`text-card-foreground` on `bg-card`)
734
+ 3. NEVER mix border-radius scales within a component group
735
+ 4. ALWAYS apply both light and dark mode tokens together
736
+ 5. ALWAYS use the shadow scale for elevation — NEVER use arbitrary shadow values
737
+ 6. ... 5 more project-specific rules ...
738
+ ```
739
+
740
+ ### File 2: `docs/design/shared-styles.css`
741
+
742
+ Production-ready Tailwind v4 CSS that is a **drop-in replacement** for the tailwind-v4 template. Include descriptive comments with evocative names for every color token:
743
+
744
+ ```css
745
+ --primary: oklch(0.488 0.243 264.376); /* Deep Indigo — CTAs, active states */
746
+ --muted: oklch(0.97 0 0); /* Whisper Gray — subtle backgrounds */
747
+ --destructive: oklch(0.58 0.22 27); /* Alert Terracotta — errors, danger */
748
+ ```
749
+
750
+ This makes the CSS self-documenting and gives AI agents context when reading the raw file. Same structure, same variable names, same `@theme` block — only the values change.
751
+
752
+ The file MUST follow this exact structure:
753
+
754
+ ```css
755
+ @import "tailwindcss";
756
+ @import "tw-animate-css";
757
+ @import "shadcn/tailwind.css";
758
+ @import "tailwind-scrollbar-hide/v4";
759
+
760
+ @custom-variant dark (&:is(.dark *));
761
+
762
+ @theme inline {
763
+ /* Map all semantic CSS variables to Tailwind utility classes */
764
+ --color-background: var(--background);
765
+ --color-foreground: var(--foreground);
766
+ --font-sans: var(--font-sans);
767
+ --font-mono: var(--font-mono);
768
+ --color-sidebar-ring: var(--sidebar-ring);
769
+ --color-sidebar-border: var(--sidebar-border);
770
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
771
+ --color-sidebar-accent: var(--sidebar-accent);
772
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
773
+ --color-sidebar-primary: var(--sidebar-primary);
774
+ --color-sidebar-foreground: var(--sidebar-foreground);
775
+ --color-sidebar: var(--sidebar);
776
+ --color-chart-5: var(--chart-5);
777
+ --color-chart-4: var(--chart-4);
778
+ --color-chart-3: var(--chart-3);
779
+ --color-chart-2: var(--chart-2);
780
+ --color-chart-1: var(--chart-1);
781
+ --color-ring: var(--ring);
782
+ --color-input: var(--input);
783
+ --color-border: var(--border);
784
+ --color-destructive: var(--destructive);
785
+ --color-accent-foreground: var(--accent-foreground);
786
+ --color-accent: var(--accent);
787
+ --color-muted-foreground: var(--muted-foreground);
788
+ --color-muted: var(--muted);
789
+ --color-secondary-foreground: var(--secondary-foreground);
790
+ --color-secondary: var(--secondary);
791
+ --color-primary-foreground: var(--primary-foreground);
792
+ --color-primary: var(--primary);
793
+ --color-popover-foreground: var(--popover-foreground);
794
+ --color-popover: var(--popover);
795
+ --color-card-foreground: var(--card-foreground);
796
+ --color-card: var(--card);
797
+ --radius-sm: calc(var(--radius) - 4px);
798
+ --radius-md: calc(var(--radius) - 2px);
799
+ --radius-lg: var(--radius);
800
+ --radius-xl: calc(var(--radius) + 4px);
801
+ --radius-2xl: calc(var(--radius) + 8px);
802
+ --radius-3xl: calc(var(--radius) + 12px);
803
+ --radius-4xl: calc(var(--radius) + 16px);
804
+ }
805
+
806
+ @theme {
807
+ /* Extended tokens: shadows, easing, duration, animations */
808
+ --shadow-xs: ...;
809
+ --shadow-sm: ...;
810
+ --shadow-md: ...;
811
+ --shadow-lg: ...;
812
+ --shadow-xl: ...;
813
+ --shadow-2xl: ...;
814
+
815
+ --ease-out: cubic-bezier(...);
816
+ --ease-in-out: cubic-bezier(...);
817
+ --ease-spring: cubic-bezier(...);
818
+
819
+ --animate-fade-in: fade-in ...;
820
+ --animate-fade-out: fade-out ...;
821
+ --animate-slide-up: slide-up ...;
822
+ --animate-slide-down: slide-down ...;
823
+ --animate-scale-in: scale-in ...;
824
+ --animate-scale-out: scale-out ...;
825
+ --animate-spin: spin 1s linear infinite;
826
+ --animate-accordion-down: accordion-down ...;
827
+ --animate-accordion-up: accordion-up ...;
828
+
829
+ @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
830
+ @keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
831
+ @keyframes slide-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
832
+ @keyframes slide-down { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
833
+ @keyframes scale-in { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
834
+ @keyframes scale-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.95); } }
835
+ @keyframes spin { to { transform: rotate(360deg); } }
836
+ @keyframes accordion-down { from { height: 0; } to { height: var(--radix-accordion-content-height); } }
837
+ @keyframes accordion-up { from { height: var(--radix-accordion-content-height); } to { height: 0; } }
838
+ }
839
+
840
+ :root {
841
+ --background: oklch(...);
842
+ --foreground: oklch(...);
843
+ --card: oklch(...);
844
+ --card-foreground: oklch(...);
845
+ --popover: oklch(...);
846
+ --popover-foreground: oklch(...);
847
+ --primary: oklch(...);
848
+ --primary-foreground: oklch(...);
849
+ --secondary: oklch(...);
850
+ --secondary-foreground: oklch(...);
851
+ --muted: oklch(...);
852
+ --muted-foreground: oklch(...);
853
+ --accent: oklch(...);
854
+ --accent-foreground: oklch(...);
855
+ --destructive: oklch(...);
856
+ --border: oklch(...);
857
+ --input: oklch(...);
858
+ --ring: oklch(...);
859
+ --chart-1: oklch(...);
860
+ --chart-2: oklch(...);
861
+ --chart-3: oklch(...);
862
+ --chart-4: oklch(...);
863
+ --chart-5: oklch(...);
864
+ --radius: ...;
865
+ --font-sans: "...", system-ui, sans-serif;
866
+ --font-mono: "...", ui-monospace, monospace;
867
+ --sidebar: oklch(...);
868
+ --sidebar-foreground: oklch(...);
869
+ --sidebar-primary: oklch(...);
870
+ --sidebar-primary-foreground: oklch(...);
871
+ --sidebar-accent: oklch(...);
872
+ --sidebar-accent-foreground: oklch(...);
873
+ --sidebar-border: oklch(...);
874
+ --sidebar-ring: oklch(...);
875
+ }
876
+
877
+ .dark {
878
+ --background: oklch(...);
879
+ --foreground: oklch(...);
880
+ /* ... all dark mode tokens with thoughtful adjustments ... */
881
+ }
882
+
883
+ @layer base {
884
+ * {
885
+ @apply border-border outline-ring/50;
886
+ }
887
+ body {
888
+ @apply bg-background text-foreground;
889
+ }
890
+ }
891
+ ```
892
+
893
+ All `oklch(...)` values must be filled with the actual colors confirmed in Step 4. All shadow, easing, and animation values must reflect the confirmed decisions from Steps 9-10. The `--font-sans` and `--font-mono` must use the confirmed fonts from Step 5.
894
+
895
+ ### Sync Check
896
+
897
+ After writing both files, check if `config/tailwind-config/shared-styles.css` (monorepo) or `src/styles/shared-styles.css` (single-repo) already exists from a previous `/scaffold-tailwind` run. If it does:
898
+
899
+ "I see you already have a scaffolded shared-styles.css at [path]. Would you like me to copy the new design tokens there now? This will replace the default palette with your custom design system."
900
+
901
+ If the user confirms, copy `docs/design/shared-styles.css` to the scaffolded location.
902
+
903
+ ### Update Project Context
904
+
905
+ Update `.project-context.md` under `## Installed Blueprints`:
906
+
907
+ ```yaml
908
+ ### design-system
909
+ blueprint: design-system
910
+ installed_at: <date>
911
+ creative_direction: "<north star name>"
912
+ primary_color_hue: <oklch hue value>
913
+ font_display: "<display font name>"
914
+ font_body: "<body font name>"
915
+ rounding: "<personality name>"
916
+ artifacts:
917
+ - docs/design/design-system.md
918
+ - docs/design/shared-styles.css
919
+ ```
920
+
921
+ ### Append to Project Maintenance Skill
922
+
923
+ Append to `<project>/.claude/skills/project-maintenance/SKILL.md`:
924
+
925
+ ```markdown
926
+ ### design-system maintenance
927
+ - When design tokens change in docs/design/shared-styles.css, sync to config/tailwind-config/shared-styles.css (monorepo) or src/styles/shared-styles.css (single-repo)
928
+ - When updating colors/shadows/radius: verify both light and dark mode tokens are updated together
929
+ - When changing font families: ensure fonts are imported in the app layout (Google Fonts link or @font-face)
930
+ - When adding new CSS variables: add corresponding entries to the @theme inline {} block
931
+ - docs/design/design-system.md is the source of truth for design decisions — update it when making visual changes
932
+ - Run /design-system to regenerate tokens after significant brand or audience changes
933
+ ```
934
+
935
+ ## Step 12: Summary
936
+
937
+ Tell the user:
938
+
939
+ - What was created — design system document (`docs/design/design-system.md`) and production CSS tokens (`docs/design/shared-styles.css`)
940
+ - Key design decisions and why:
941
+ - Creative direction chosen and what it communicates
942
+ - Primary color hue and differentiation rationale
943
+ - Font pairing and why it fits the audience
944
+ - Rounding personality and what it signals
945
+ - Shadow/depth approach
946
+ - **Font import instructions** — the exact Google Fonts `<link>` tag or `@import` URL to add to the app's `layout.tsx` or `<head>`:
947
+ ```
948
+ Add this to your layout.tsx <head> or app/layout.tsx:
949
+ <link href="https://fonts.googleapis.com/css2?family=..." rel="stylesheet" />
950
+ ```
951
+ - **Tailwind sync status** — whether tokens were synced to the scaffolded `shared-styles.css`, or whether the user needs to run `/scaffold-tailwind` first
952
+ - **Suggested next steps:**
953
+ - If tailwind is not yet scaffolded: "Run `/scaffold-tailwind` — it will auto-detect your design tokens from `docs/design/shared-styles.css`"
954
+ - If tailwind is scaffolded but UI is not: "Run `/scaffold-ui` — components will use your custom design tokens"
955
+ - If both are already scaffolded: "Your design tokens are live. Components will pick up the new palette on next build."
956
+ - **Suggested UI improvements** — based on the design system decisions, note any component-specific suggestions (e.g., "Your round personality would look great with pill-shaped badges — consider updating badge radius if you've already scaffolded UI")
957
+
958
+ ## Important Rules
959
+
960
+ - **Every decision teaches WHY.** This is an educational process. The user is learning design thinking through each step. Don't just propose a color — explain color psychology, competitive context, and audience alignment. Don't just suggest a font — explain what its letterforms communicate and why that matters for this product.
961
+ - **Accept and analyze screenshots.** The user may share existing work, competitor sites, or inspiration images. Analyze the visual language (palette, typography, spacing, depth, mood) and incorporate elements they respond to.
962
+ - **Research fonts for real.** Use web search to find typefaces that match the product personality. Don't default to Inter for everything. Consider the product domain, audience expectations, and competitive landscape when recommending fonts.
963
+ - **oklch format is mandatory.** All colors must use `oklch()` for perceptual uniformity and high-quality dark mode. Never use hex, rgb, or hsl. oklch provides uniform lightness perception across hues, which means a "50% lightness blue" and a "50% lightness yellow" actually look the same brightness — this is impossible with hsl.
964
+ - **The CSS must be a drop-in replacement.** Same import structure, same `@custom-variant`, same `@theme inline {}` variable names, same `:root` and `.dark` token names, same `@layer base` rules as the tailwind-v4 template. Only the VALUES change. The `@theme {}` block adds extended tokens (shadows, easing, animations) that the template doesn't include.
965
+ - **Dark mode is never skipped.** Every project gets both light and dark tokens. Dark mode is not optional — it's an accessibility and user preference requirement.
966
+ - **The "How to Use" section in design-system.md is critical.** It bridges design decisions and development. Include actual Tailwind class examples for every token category, a quick-reference mapping table, and practical patterns like "to style a card, use `bg-card text-card-foreground rounded-lg shadow-sm border`."
967
+ - **Component guidelines must be deep.** Don't just say "buttons use primary color." Specify padding, transition timing, hover behavior, disabled opacity, icon gap, size variants. A developer should be able to implement any component from the guidelines alone.
968
+ - **Confirm at every major step.** Present colors, fonts, rounding, components, shadows, and animations each as a checkpoint. Wait for user confirmation before proceeding. Never rush through multiple decisions without feedback.
969
+ - **Never fabricate brand assets.** If the user mentions an existing logo or brand, ask for specifics rather than assuming colors or fonts.
970
+ - **Respect the Creative North Star.** Once chosen, reference it in every subsequent decision. "This shadow approach aligns with our 'Minimal Precision' direction because..." — it keeps the system coherent.