@cliangdev/flux-plugin 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/README.md +11 -7
  2. package/agents/coder.md +150 -25
  3. package/bin/install.cjs +171 -16
  4. package/commands/breakdown.md +47 -10
  5. package/commands/dashboard.md +29 -0
  6. package/commands/flux.md +92 -12
  7. package/commands/implement.md +166 -17
  8. package/commands/linear.md +6 -5
  9. package/commands/prd.md +996 -82
  10. package/manifest.json +2 -1
  11. package/package.json +9 -11
  12. package/skills/flux-orchestrator/SKILL.md +11 -3
  13. package/skills/prd-writer/SKILL.md +761 -0
  14. package/skills/ux-ui-design/SKILL.md +346 -0
  15. package/skills/ux-ui-design/references/design-tokens.md +359 -0
  16. package/src/__tests__/version.test.ts +37 -0
  17. package/src/adapters/local/.gitkeep +0 -0
  18. package/src/dashboard/__tests__/api.test.ts +211 -0
  19. package/src/dashboard/browser.ts +35 -0
  20. package/src/dashboard/public/app.js +869 -0
  21. package/src/dashboard/public/index.html +90 -0
  22. package/src/dashboard/public/styles.css +807 -0
  23. package/src/dashboard/public/vendor/highlight.css +10 -0
  24. package/src/dashboard/public/vendor/highlight.min.js +8422 -0
  25. package/src/dashboard/public/vendor/marked.min.js +2210 -0
  26. package/src/dashboard/server.ts +296 -0
  27. package/src/dashboard/watchers.ts +83 -0
  28. package/src/server/__tests__/config.test.ts +163 -0
  29. package/src/server/adapters/__tests__/a-client-linear.test.ts +197 -0
  30. package/src/server/adapters/__tests__/adapter-factory.test.ts +230 -0
  31. package/src/server/adapters/__tests__/dependency-ops.test.ts +429 -0
  32. package/src/server/adapters/__tests__/document-ops.test.ts +306 -0
  33. package/src/server/adapters/__tests__/linear-adapter.test.ts +91 -0
  34. package/src/server/adapters/__tests__/linear-config.test.ts +425 -0
  35. package/src/server/adapters/__tests__/linear-criteria-parser.test.ts +287 -0
  36. package/src/server/adapters/__tests__/linear-description-test.ts +238 -0
  37. package/src/server/adapters/__tests__/linear-epic-crud.test.ts +496 -0
  38. package/src/server/adapters/__tests__/linear-mappers-description.test.ts +276 -0
  39. package/src/server/adapters/__tests__/linear-mappers-epic.test.ts +294 -0
  40. package/src/server/adapters/__tests__/linear-mappers-prd.test.ts +300 -0
  41. package/src/server/adapters/__tests__/linear-mappers-task.test.ts +197 -0
  42. package/src/server/adapters/__tests__/linear-prd-crud.test.ts +620 -0
  43. package/src/server/adapters/__tests__/linear-stats.test.ts +450 -0
  44. package/src/server/adapters/__tests__/linear-task-crud.test.ts +534 -0
  45. package/src/server/adapters/__tests__/linear-types.test.ts +243 -0
  46. package/src/server/adapters/__tests__/status-ops.test.ts +441 -0
  47. package/src/server/adapters/factory.ts +90 -0
  48. package/src/server/adapters/index.ts +9 -0
  49. package/src/server/adapters/linear/adapter.ts +1141 -0
  50. package/src/server/adapters/linear/client.ts +169 -0
  51. package/src/server/adapters/linear/config.ts +152 -0
  52. package/src/server/adapters/linear/helpers/criteria-parser.ts +197 -0
  53. package/src/server/adapters/linear/helpers/index.ts +7 -0
  54. package/src/server/adapters/linear/index.ts +16 -0
  55. package/src/server/adapters/linear/mappers/description.ts +136 -0
  56. package/src/server/adapters/linear/mappers/epic.ts +81 -0
  57. package/src/server/adapters/linear/mappers/index.ts +27 -0
  58. package/src/server/adapters/linear/mappers/prd.ts +178 -0
  59. package/src/server/adapters/linear/mappers/task.ts +82 -0
  60. package/src/server/adapters/linear/types.ts +264 -0
  61. package/src/server/adapters/local-adapter.ts +1009 -0
  62. package/src/server/adapters/types.ts +293 -0
  63. package/src/server/config.ts +73 -0
  64. package/src/server/db/__tests__/queries.test.ts +473 -0
  65. package/src/server/db/ids.ts +17 -0
  66. package/src/server/db/index.ts +69 -0
  67. package/src/server/db/queries.ts +142 -0
  68. package/src/server/db/refs.ts +60 -0
  69. package/src/server/db/schema.ts +97 -0
  70. package/src/server/db/sqlite.ts +10 -0
  71. package/src/server/index.ts +81 -0
  72. package/src/server/tools/__tests__/crud.test.ts +411 -0
  73. package/src/server/tools/__tests__/get-version.test.ts +27 -0
  74. package/src/server/tools/__tests__/mcp-interface.test.ts +479 -0
  75. package/src/server/tools/__tests__/query.test.ts +405 -0
  76. package/src/server/tools/__tests__/z-configure-linear.test.ts +511 -0
  77. package/src/server/tools/__tests__/z-get-linear-url.test.ts +108 -0
  78. package/src/server/tools/configure-linear.ts +373 -0
  79. package/src/server/tools/create-epic.ts +44 -0
  80. package/src/server/tools/create-prd.ts +40 -0
  81. package/src/server/tools/create-task.ts +47 -0
  82. package/src/server/tools/criteria.ts +50 -0
  83. package/src/server/tools/delete-entity.ts +76 -0
  84. package/src/server/tools/dependencies.ts +55 -0
  85. package/src/server/tools/get-entity.ts +240 -0
  86. package/src/server/tools/get-linear-url.ts +28 -0
  87. package/src/server/tools/get-stats.ts +52 -0
  88. package/src/server/tools/get-version.ts +20 -0
  89. package/src/server/tools/index.ts +158 -0
  90. package/src/server/tools/init-project.ts +108 -0
  91. package/src/server/tools/query-entities.ts +167 -0
  92. package/src/server/tools/render-status.ts +219 -0
  93. package/src/server/tools/update-entity.ts +140 -0
  94. package/src/server/tools/update-status.ts +166 -0
  95. package/src/server/utils/__tests__/mcp-response.test.ts +331 -0
  96. package/src/server/utils/logger.ts +9 -0
  97. package/src/server/utils/mcp-response.ts +254 -0
  98. package/src/server/utils/status-transitions.ts +160 -0
  99. package/src/status-line/__tests__/status-line.test.ts +215 -0
  100. package/src/status-line/index.ts +147 -0
  101. package/src/utils/__tests__/chalk-import.test.ts +32 -0
  102. package/src/utils/__tests__/display.test.ts +97 -0
  103. package/src/utils/__tests__/status-renderer.test.ts +310 -0
  104. package/src/utils/display.ts +62 -0
  105. package/src/utils/status-renderer.ts +214 -0
  106. package/src/version.ts +5 -0
  107. package/dist/server/index.js +0 -87063
  108. package/skills/prd-template/SKILL.md +0 -242
@@ -0,0 +1,346 @@
1
+ ---
2
+ name: flux:ux-ui-design
3
+ description: Expert UX/UI design guidance for creating simple, user-focused experiences with clean, cohesive interfaces. Use when designing or reviewing UI components, layouts, navigation, forms, or any user-facing interface. Applies human-centered design principles and explicitly avoids AI slop patterns (generic, over-designed, feature-bloated interfaces). Triggers on UI implementation, design decisions, component creation, or layout work.
4
+ user-invocable: false
5
+ ---
6
+
7
+ # UX/UI Design Skill
8
+
9
+ Design guidance for creating interfaces that are simple for users and visually clean—not generic AI slop.
10
+
11
+ ## Core Philosophy
12
+
13
+ **UX**: Remove friction. Every interaction should feel effortless.
14
+ **UI**: Less is more. Every element earns its place.
15
+
16
+ ---
17
+
18
+ ## UX Principles
19
+
20
+ ### 1. Reduce Cognitive Load
21
+
22
+ Users form opinions in 50ms. Simplify ruthlessly.
23
+
24
+ - **One primary action per screen** — Secondary actions stay subtle
25
+ - **Progressive disclosure** — Show basics upfront, reveal complexity on demand
26
+ - **Predictable patterns** — Consistency reduces learning curve
27
+
28
+ ```
29
+ ❌ Dashboard with 12 cards, 5 CTAs, sidebar, and floating action button
30
+ ✅ Dashboard with 3 key metrics, one primary action, minimal navigation
31
+ ```
32
+
33
+ ### 2. Design for Intent, Not Features
34
+
35
+ Start with user goals, not feature lists.
36
+
37
+ | User Intent | Good Design | Bad Design |
38
+ |-------------|-------------|------------|
39
+ | "Find a product" | Search bar prominent, filters accessible | Feature tour modal on load |
40
+ | "Complete checkout" | Linear flow, minimal fields | Upsells interrupting every step |
41
+ | "Check status" | Status visible immediately | Requires 3 clicks to find |
42
+
43
+ ### 3. Respect User Time
44
+
45
+ - **Minimize steps** — Combine related actions
46
+ - **Smart defaults** — Pre-fill what you can infer
47
+ - **Instant feedback** — Show loading states, confirm actions immediately
48
+ - **Remember state** — Don't make users repeat themselves
49
+
50
+ ### 4. Error Prevention Over Error Messages
51
+
52
+ Design to prevent errors, not just handle them.
53
+
54
+ ```
55
+ ❌ "Invalid email format" after submit
56
+ ✅ Real-time validation as user types
57
+
58
+ ❌ Delete button with no confirmation
59
+ ✅ Undo within 5 seconds, or confirmation for destructive actions
60
+ ```
61
+
62
+ ---
63
+
64
+ ## UI Principles
65
+
66
+ ### 1. Visual Hierarchy
67
+
68
+ Guide attention through deliberate contrast.
69
+
70
+ **Size**: Larger = more important
71
+ **Color**: Accent colors for actions, muted for secondary
72
+ **Space**: Whitespace groups related elements, separates sections
73
+ **Position**: Top-left starts the reading flow (LTR languages)
74
+
75
+ ```
76
+ Primary action: Bold, accent color, prominent size
77
+ Secondary action: Outlined or text-only, subdued
78
+ Tertiary action: Text link, smallest
79
+ ```
80
+
81
+ ### 2. Limited Color Palette
82
+
83
+ 95% of minimalist interfaces use a restricted palette.
84
+
85
+ **Core palette structure:**
86
+ - 1 neutral background (white, off-white, or dark mode equivalent)
87
+ - 1-2 accent colors (one primary, one optional secondary)
88
+ - Semantic colors: success (green), warning (amber), error (red), info (blue)
89
+ - Text: 2-3 shades (primary, secondary, disabled)
90
+
91
+ ```css
92
+ /* Example minimal palette */
93
+ --bg-primary: #FFFFFF;
94
+ --bg-secondary: #F8F9FA;
95
+ --text-primary: #1A1A1A;
96
+ --text-secondary: #6B7280;
97
+ --accent: #2563EB;
98
+ --accent-hover: #1D4ED8;
99
+ ```
100
+
101
+ ### 3. Typography
102
+
103
+ One typeface, multiple weights. Never more than two font families.
104
+
105
+ **Hierarchy through weight and size, not different fonts:**
106
+ - Headings: Semibold or bold, larger size
107
+ - Body: Regular weight, comfortable reading size (16px minimum)
108
+ - Captions: Regular or medium, smaller size, secondary color
109
+
110
+ **Line height**: 1.4-1.6 for body text, 1.2-1.3 for headings
111
+
112
+ ### 4. Spacing System
113
+
114
+ Use consistent spacing tokens—never arbitrary values.
115
+
116
+ ```
117
+ 4px (xs) — Tight spacing within components
118
+ 8px (sm) — Related elements
119
+ 16px (md) — Standard spacing
120
+ 24px (lg) — Section separation
121
+ 32px (xl) — Major sections
122
+ 48px (2xl) — Page-level spacing
123
+ ```
124
+
125
+ **Rule**: Space between elements = relationship strength. Closer = more related.
126
+
127
+ ### 5. Whitespace as Design Element
128
+
129
+ Empty space is not wasted space. It:
130
+ - Reduces cognitive load
131
+ - Creates visual breathing room
132
+ - Emphasizes important elements
133
+ - Communicates hierarchy
134
+
135
+ ```
136
+ ❌ Cramped form with no padding
137
+ ✅ Generous padding, grouped fields with clear sections
138
+ ```
139
+
140
+ ---
141
+
142
+ ## Avoiding AI Slop
143
+
144
+ AI slop = generic, over-engineered, feature-bloated design that looks "designed" but lacks soul.
145
+
146
+ ### Red Flags (Don't Do This)
147
+
148
+ | Pattern | Problem | Fix |
149
+ |---------|---------|-----|
150
+ | Gradient everything | Looks like a template | Flat colors, subtle shadows only |
151
+ | Rounded corners on everything | Generic "modern" look | Consistent radius, not excessive |
152
+ | Unnecessary animations | Distracting, slow | Purposeful micro-interactions only |
153
+ | Stock illustrations everywhere | Feels corporate/hollow | Use sparingly or not at all |
154
+ | Feature overload | "Look how much it does!" | Ship less, ship focused |
155
+ | Symmetric grids always | Predictable, boring | Intentional asymmetry when appropriate |
156
+ | Drop shadows on everything | Cluttered, dated | Minimal elevation, purposeful depth |
157
+ | Glassmorphism/neumorphism by default | Trendy but often inaccessible | Use sparingly, ensure contrast |
158
+
159
+ ### AI Slop Content Patterns to Avoid
160
+
161
+ - Generic hero sections with vague taglines ("Empower your workflow")
162
+ - Cookie-cutter landing page layouts
163
+ - Feature grids with icons that could apply to anything
164
+ - Excessive use of buzzwords in UI copy
165
+ - Decorative elements that add no meaning
166
+
167
+ ### What Makes Design Feel Human
168
+
169
+ - **Personality in copywriting** — Real voice, not corporate speak
170
+ - **Intentional imperfection** — Hand-drawn elements, custom illustrations
171
+ - **Constraint** — Knowing what NOT to include
172
+ - **Context-awareness** — Design serves the specific use case, not generic patterns
173
+ - **Consistency over novelty** — Boring is often better
174
+
175
+ ---
176
+
177
+ ## Component Guidelines
178
+
179
+ ### Buttons
180
+
181
+ ```
182
+ Primary: Solid background, high contrast text, clear CTA
183
+ Secondary: Outlined or ghost, lower visual weight
184
+ Tertiary: Text-only, for less important actions
185
+ Disabled: 50% opacity, no pointer events
186
+
187
+ Sizing:
188
+ - Small: 32px height, compact UI
189
+ - Medium: 40px height, default
190
+ - Large: 48px height, touch targets, primary CTAs
191
+ ```
192
+
193
+ ### Forms
194
+
195
+ - Labels above inputs (not placeholder-as-label)
196
+ - Clear focus states (visible ring, color change)
197
+ - Inline validation, not just on submit
198
+ - Logical tab order
199
+ - Required field indicators (asterisk or text)
200
+ - Helpful hint text for complex fields
201
+
202
+ ```
203
+ ❌ Placeholder text as the only label
204
+ ❌ Error messages appearing somewhere else on screen
205
+ ❌ Submit button disabled with no explanation why
206
+
207
+ ✅ Clear labels, visible focus, inline errors, enabled submit with validation
208
+ ```
209
+
210
+ ### Cards
211
+
212
+ - Consistent padding (16-24px)
213
+ - Clear content hierarchy
214
+ - Single primary action if any
215
+ - Subtle shadow or border, not both
216
+ - Avoid nesting cards within cards
217
+
218
+ ### Navigation
219
+
220
+ - Primary nav: 5-7 items maximum
221
+ - Mobile: Hamburger menu or bottom nav (not both)
222
+ - Current state clearly indicated
223
+ - Breadcrumbs for deep hierarchies
224
+ - Search accessible on complex sites
225
+
226
+ ### Tables
227
+
228
+ - Left-align text, right-align numbers
229
+ - Zebra striping OR grid lines, not both
230
+ - Sticky headers for long tables
231
+ - Sort indicators when sortable
232
+ - Row actions: hover reveal or action column
233
+ - Pagination or infinite scroll, clear indication of more data
234
+
235
+ ### Modals/Dialogs
236
+
237
+ - Clear title describing the action
238
+ - Single primary action, cancel always available
239
+ - Focus trapped within modal
240
+ - Escape key closes (unless destructive action)
241
+ - Background overlay with click-to-close
242
+ - Don't nest modals
243
+
244
+ ---
245
+
246
+ ## Responsive Design
247
+
248
+ ### Breakpoints (Standard)
249
+
250
+ ```
251
+ sm: 640px — Small tablets, large phones landscape
252
+ md: 768px — Tablets portrait
253
+ lg: 1024px — Tablets landscape, small laptops
254
+ xl: 1280px — Desktops
255
+ 2xl: 1536px — Large desktops
256
+ ```
257
+
258
+ ### Mobile-First Patterns
259
+
260
+ - Stack columns on mobile, expand on desktop
261
+ - Touch targets: minimum 44x44px
262
+ - Thumb-friendly zones for critical actions
263
+ - Simplify navigation for mobile
264
+ - Reduce content density, not just shrink
265
+
266
+ ### What Changes on Mobile
267
+
268
+ | Desktop | Mobile |
269
+ |---------|--------|
270
+ | Horizontal nav | Hamburger or bottom nav |
271
+ | Multi-column grid | Single column or 2-col max |
272
+ | Hover states | Tap states (no hover on touch) |
273
+ | Side panels | Full-screen overlays |
274
+ | Data tables | Cards or simplified tables |
275
+
276
+ ---
277
+
278
+ ## Accessibility Checklist
279
+
280
+ Not optional. Design for everyone.
281
+
282
+ - [ ] Color contrast: 4.5:1 minimum for text
283
+ - [ ] Don't rely on color alone (add icons, text, patterns)
284
+ - [ ] Focus states visible and clear
285
+ - [ ] Keyboard navigation works
286
+ - [ ] Alt text on meaningful images
287
+ - [ ] Form labels associated with inputs
288
+ - [ ] Error messages clear and specific
289
+ - [ ] Touch targets 44x44px minimum
290
+ - [ ] Motion can be reduced (respects prefers-reduced-motion)
291
+ - [ ] Text resizable without breaking layout
292
+
293
+ ---
294
+
295
+ ## Implementation Checklist
296
+
297
+ Before shipping any interface:
298
+
299
+ ### UX Verification
300
+ - [ ] Primary action is immediately obvious
301
+ - [ ] User can accomplish goal in minimum steps
302
+ - [ ] Error states are helpful, not just red
303
+ - [ ] Loading states exist for async operations
304
+ - [ ] Empty states guide users to next action
305
+
306
+ ### UI Verification
307
+ - [ ] Spacing follows consistent scale
308
+ - [ ] Typography hierarchy is clear
309
+ - [ ] Color palette is limited and intentional
310
+ - [ ] Components are consistent throughout
311
+ - [ ] No orphan elements (everything aligned to grid)
312
+
313
+ ### Anti-Slop Check
314
+ - [ ] Could remove any element without losing function?
315
+ - [ ] Does every gradient/shadow/animation serve a purpose?
316
+ - [ ] Would a non-designer find it cluttered?
317
+ - [ ] Is the copywriting specific to this product?
318
+ - [ ] Does it look distinct from a template?
319
+
320
+ ---
321
+
322
+ ## Quick Reference
323
+
324
+ ### When Designing
325
+
326
+ 1. **Start with user intent** — What are they trying to do?
327
+ 2. **Minimize choices** — Each decision = cognitive load
328
+ 3. **Establish hierarchy** — What's most important?
329
+ 4. **Apply constraints** — Limited colors, spacing scale, one typeface
330
+ 5. **Remove until it breaks** — Then add back only what's needed
331
+
332
+ ### When Reviewing
333
+
334
+ Ask these questions:
335
+ - Can I remove anything?
336
+ - Is the primary action obvious?
337
+ - Does the spacing feel consistent?
338
+ - Is there unnecessary decoration?
339
+ - Would this work on mobile?
340
+
341
+ ---
342
+
343
+ ## References
344
+
345
+ For detailed design token specifications and component patterns, see:
346
+ - `references/design-tokens.md` — Spacing, color, typography scales
@@ -0,0 +1,359 @@
1
+ # Design Tokens Reference
2
+
3
+ Standardized design values for consistent, scalable interfaces.
4
+
5
+ ## Spacing Scale
6
+
7
+ Use multiples of 4px for all spacing.
8
+
9
+ | Token | Value | Use Case |
10
+ |-------|-------|----------|
11
+ | `--space-0` | 0 | Reset spacing |
12
+ | `--space-1` | 4px | Tight: icon-text gap, inline elements |
13
+ | `--space-2` | 8px | Compact: related elements within a component |
14
+ | `--space-3` | 12px | Default: form field gaps, list item padding |
15
+ | `--space-4` | 16px | Standard: card padding, section gaps |
16
+ | `--space-5` | 20px | Comfortable: grouped content spacing |
17
+ | `--space-6` | 24px | Relaxed: between sections |
18
+ | `--space-8` | 32px | Large: major section separation |
19
+ | `--space-10` | 40px | Generous: page section margins |
20
+ | `--space-12` | 48px | Extra: hero sections, major landmarks |
21
+ | `--space-16` | 64px | Maximum: page-level vertical rhythm |
22
+
23
+ ### CSS Variables
24
+
25
+ ```css
26
+ :root {
27
+ --space-1: 0.25rem; /* 4px */
28
+ --space-2: 0.5rem; /* 8px */
29
+ --space-3: 0.75rem; /* 12px */
30
+ --space-4: 1rem; /* 16px */
31
+ --space-5: 1.25rem; /* 20px */
32
+ --space-6: 1.5rem; /* 24px */
33
+ --space-8: 2rem; /* 32px */
34
+ --space-10: 2.5rem; /* 40px */
35
+ --space-12: 3rem; /* 48px */
36
+ --space-16: 4rem; /* 64px */
37
+ }
38
+ ```
39
+
40
+ ---
41
+
42
+ ## Typography Scale
43
+
44
+ Based on a 1.25 ratio (major third) from 16px base.
45
+
46
+ | Token | Size | Line Height | Use Case |
47
+ |-------|------|-------------|----------|
48
+ | `--text-xs` | 12px | 1.5 | Labels, captions, fine print |
49
+ | `--text-sm` | 14px | 1.5 | Secondary text, table cells |
50
+ | `--text-base` | 16px | 1.5 | Body text, inputs |
51
+ | `--text-lg` | 18px | 1.5 | Lead paragraphs |
52
+ | `--text-xl` | 20px | 1.4 | H4, card titles |
53
+ | `--text-2xl` | 24px | 1.3 | H3 |
54
+ | `--text-3xl` | 30px | 1.3 | H2 |
55
+ | `--text-4xl` | 36px | 1.2 | H1, page titles |
56
+ | `--text-5xl` | 48px | 1.1 | Hero headings |
57
+
58
+ ### Font Weights
59
+
60
+ | Token | Weight | Use Case |
61
+ |-------|--------|----------|
62
+ | `--font-normal` | 400 | Body text |
63
+ | `--font-medium` | 500 | Emphasis, labels |
64
+ | `--font-semibold` | 600 | Subheadings, buttons |
65
+ | `--font-bold` | 700 | Headings, strong emphasis |
66
+
67
+ ### CSS Variables
68
+
69
+ ```css
70
+ :root {
71
+ /* Sizes */
72
+ --text-xs: 0.75rem;
73
+ --text-sm: 0.875rem;
74
+ --text-base: 1rem;
75
+ --text-lg: 1.125rem;
76
+ --text-xl: 1.25rem;
77
+ --text-2xl: 1.5rem;
78
+ --text-3xl: 1.875rem;
79
+ --text-4xl: 2.25rem;
80
+ --text-5xl: 3rem;
81
+
82
+ /* Line heights */
83
+ --leading-tight: 1.2;
84
+ --leading-snug: 1.3;
85
+ --leading-normal: 1.5;
86
+ --leading-relaxed: 1.625;
87
+
88
+ /* Weights */
89
+ --font-normal: 400;
90
+ --font-medium: 500;
91
+ --font-semibold: 600;
92
+ --font-bold: 700;
93
+ }
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Color Tokens
99
+
100
+ ### Neutral Colors (Light Mode)
101
+
102
+ | Token | Value | Use Case |
103
+ |-------|-------|----------|
104
+ | `--neutral-50` | #FAFAFA | Page background |
105
+ | `--neutral-100` | #F5F5F5 | Card backgrounds, subtle fills |
106
+ | `--neutral-200` | #E5E5E5 | Borders, dividers |
107
+ | `--neutral-300` | #D4D4D4 | Disabled borders |
108
+ | `--neutral-400` | #A3A3A3 | Placeholder text |
109
+ | `--neutral-500` | #737373 | Secondary text |
110
+ | `--neutral-600` | #525252 | Body text (secondary) |
111
+ | `--neutral-700` | #404040 | Body text |
112
+ | `--neutral-800` | #262626 | Headings |
113
+ | `--neutral-900` | #171717 | High contrast text |
114
+
115
+ ### Semantic Colors
116
+
117
+ ```css
118
+ :root {
119
+ /* Primary */
120
+ --primary-50: #EFF6FF;
121
+ --primary-100: #DBEAFE;
122
+ --primary-500: #3B82F6;
123
+ --primary-600: #2563EB;
124
+ --primary-700: #1D4ED8;
125
+
126
+ /* Success */
127
+ --success-50: #F0FDF4;
128
+ --success-500: #22C55E;
129
+ --success-700: #15803D;
130
+
131
+ /* Warning */
132
+ --warning-50: #FFFBEB;
133
+ --warning-500: #F59E0B;
134
+ --warning-700: #B45309;
135
+
136
+ /* Error */
137
+ --error-50: #FEF2F2;
138
+ --error-500: #EF4444;
139
+ --error-700: #B91C1C;
140
+
141
+ /* Info */
142
+ --info-50: #EFF6FF;
143
+ --info-500: #3B82F6;
144
+ --info-700: #1D4ED8;
145
+ }
146
+ ```
147
+
148
+ ### Dark Mode Mapping
149
+
150
+ | Light Token | Dark Equivalent |
151
+ |-------------|-----------------|
152
+ | `--neutral-50` (bg) | `--neutral-900` |
153
+ | `--neutral-100` (surface) | `--neutral-800` |
154
+ | `--neutral-200` (border) | `--neutral-700` |
155
+ | `--neutral-700` (text) | `--neutral-200` |
156
+ | `--neutral-900` (heading) | `--neutral-50` |
157
+
158
+ ---
159
+
160
+ ## Border Radius
161
+
162
+ | Token | Value | Use Case |
163
+ |-------|-------|----------|
164
+ | `--radius-none` | 0 | No rounding |
165
+ | `--radius-sm` | 4px | Subtle rounding (inputs, buttons) |
166
+ | `--radius-md` | 6px | Default (cards, modals) |
167
+ | `--radius-lg` | 8px | Prominent elements |
168
+ | `--radius-xl` | 12px | Larger containers |
169
+ | `--radius-2xl` | 16px | Pills, avatars |
170
+ | `--radius-full` | 9999px | Circles, full pills |
171
+
172
+ ### Consistency Rule
173
+
174
+ Pick ONE radius for each component category and stick to it:
175
+ - Buttons: `--radius-sm` or `--radius-md`
176
+ - Cards: `--radius-md` or `--radius-lg`
177
+ - Inputs: Same as buttons
178
+ - Avatars: `--radius-full`
179
+
180
+ ---
181
+
182
+ ## Shadows
183
+
184
+ | Token | Use Case |
185
+ |-------|----------|
186
+ | `--shadow-sm` | Subtle elevation (dropdowns, popovers) |
187
+ | `--shadow-md` | Default cards |
188
+ | `--shadow-lg` | Modals, dialogs |
189
+ | `--shadow-xl` | High emphasis elements |
190
+
191
+ ```css
192
+ :root {
193
+ --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
194
+ --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
195
+ --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
196
+ --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
197
+ }
198
+ ```
199
+
200
+ ### Shadow Guidelines
201
+
202
+ - Use sparingly—most elements need no shadow
203
+ - Shadows indicate elevation/layering
204
+ - Cards on white backgrounds often need only subtle border OR shadow, not both
205
+ - Dark mode: reduce shadow opacity or use lighter shadows
206
+
207
+ ---
208
+
209
+ ## Z-Index Scale
210
+
211
+ | Token | Value | Use Case |
212
+ |-------|-------|----------|
213
+ | `--z-dropdown` | 50 | Dropdowns, popovers |
214
+ | `--z-sticky` | 100 | Sticky headers |
215
+ | `--z-modal` | 200 | Modal dialogs |
216
+ | `--z-toast` | 300 | Toast notifications |
217
+ | `--z-tooltip` | 400 | Tooltips |
218
+
219
+ ---
220
+
221
+ ## Transitions
222
+
223
+ | Token | Duration | Easing | Use Case |
224
+ |-------|----------|--------|----------|
225
+ | `--duration-fast` | 100ms | ease-out | Hover states |
226
+ | `--duration-normal` | 200ms | ease-in-out | Default transitions |
227
+ | `--duration-slow` | 300ms | ease-in-out | Modals, overlays |
228
+
229
+ ```css
230
+ :root {
231
+ --duration-fast: 100ms;
232
+ --duration-normal: 200ms;
233
+ --duration-slow: 300ms;
234
+ --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
235
+ --ease-in: cubic-bezier(0.4, 0, 1, 1);
236
+ --ease-out: cubic-bezier(0, 0, 0.2, 1);
237
+ }
238
+ ```
239
+
240
+ ### Motion Guidelines
241
+
242
+ - Respect `prefers-reduced-motion`
243
+ - Keep transitions under 300ms
244
+ - Use `transform` and `opacity` for performance
245
+ - Avoid animating `width`, `height`, `top`, `left`
246
+
247
+ ---
248
+
249
+ ## Breakpoints
250
+
251
+ | Token | Value | Description |
252
+ |-------|-------|-------------|
253
+ | `--screen-sm` | 640px | Small tablets |
254
+ | `--screen-md` | 768px | Tablets |
255
+ | `--screen-lg` | 1024px | Small laptops |
256
+ | `--screen-xl` | 1280px | Desktops |
257
+ | `--screen-2xl` | 1536px | Large screens |
258
+
259
+ ### Media Query Pattern
260
+
261
+ ```css
262
+ /* Mobile first */
263
+ .component { /* mobile styles */ }
264
+
265
+ @media (min-width: 768px) {
266
+ .component { /* tablet+ styles */ }
267
+ }
268
+
269
+ @media (min-width: 1024px) {
270
+ .component { /* desktop styles */ }
271
+ }
272
+ ```
273
+
274
+ ---
275
+
276
+ ## Component Size Tokens
277
+
278
+ ### Button Sizes
279
+
280
+ | Size | Height | Padding X | Font Size |
281
+ |------|--------|-----------|-----------|
282
+ | `sm` | 32px | 12px | 14px |
283
+ | `md` | 40px | 16px | 14px |
284
+ | `lg` | 48px | 24px | 16px |
285
+
286
+ ### Input Sizes
287
+
288
+ | Size | Height | Padding X | Font Size |
289
+ |------|--------|-----------|-----------|
290
+ | `sm` | 32px | 12px | 14px |
291
+ | `md` | 40px | 14px | 16px |
292
+ | `lg` | 48px | 16px | 16px |
293
+
294
+ ### Icon Sizes
295
+
296
+ | Token | Size | Use Case |
297
+ |-------|------|----------|
298
+ | `--icon-xs` | 12px | Inline with small text |
299
+ | `--icon-sm` | 16px | Inline with body text |
300
+ | `--icon-md` | 20px | Buttons, inputs |
301
+ | `--icon-lg` | 24px | Standalone icons |
302
+ | `--icon-xl` | 32px | Feature icons |
303
+
304
+ ---
305
+
306
+ ## Using Tokens in Practice
307
+
308
+ ### Example: Card Component
309
+
310
+ ```css
311
+ .card {
312
+ background: var(--neutral-50);
313
+ border: 1px solid var(--neutral-200);
314
+ border-radius: var(--radius-lg);
315
+ padding: var(--space-6);
316
+ box-shadow: var(--shadow-sm);
317
+ }
318
+
319
+ .card-title {
320
+ font-size: var(--text-xl);
321
+ font-weight: var(--font-semibold);
322
+ color: var(--neutral-900);
323
+ margin-bottom: var(--space-2);
324
+ }
325
+
326
+ .card-body {
327
+ font-size: var(--text-base);
328
+ color: var(--neutral-700);
329
+ line-height: var(--leading-relaxed);
330
+ }
331
+ ```
332
+
333
+ ### Example: Button Component
334
+
335
+ ```css
336
+ .btn {
337
+ height: 40px;
338
+ padding: 0 var(--space-4);
339
+ font-size: var(--text-sm);
340
+ font-weight: var(--font-semibold);
341
+ border-radius: var(--radius-md);
342
+ transition: all var(--duration-fast) var(--ease-default);
343
+ }
344
+
345
+ .btn-primary {
346
+ background: var(--primary-600);
347
+ color: white;
348
+ }
349
+
350
+ .btn-primary:hover {
351
+ background: var(--primary-700);
352
+ }
353
+
354
+ .btn-secondary {
355
+ background: transparent;
356
+ border: 1px solid var(--neutral-300);
357
+ color: var(--neutral-700);
358
+ }
359
+ ```