@dedesfr/prompter 0.7.8 → 0.7.9

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 (37) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cli/index.js +1 -1
  3. package/dist/core/config.d.ts.map +1 -1
  4. package/dist/core/config.js +3 -1
  5. package/dist/core/config.js.map +1 -1
  6. package/dist/core/configurators/slash/droid.d.ts +9 -0
  7. package/dist/core/configurators/slash/droid.d.ts.map +1 -0
  8. package/dist/core/configurators/slash/droid.js +36 -0
  9. package/dist/core/configurators/slash/droid.js.map +1 -0
  10. package/dist/core/configurators/slash/forge.d.ts +9 -0
  11. package/dist/core/configurators/slash/forge.d.ts.map +1 -0
  12. package/dist/core/configurators/slash/forge.js +36 -0
  13. package/dist/core/configurators/slash/forge.js.map +1 -0
  14. package/dist/core/configurators/slash/index.d.ts +2 -0
  15. package/dist/core/configurators/slash/index.d.ts.map +1 -1
  16. package/dist/core/configurators/slash/index.js +2 -0
  17. package/dist/core/configurators/slash/index.js.map +1 -1
  18. package/dist/core/configurators/slash/registry.d.ts.map +1 -1
  19. package/dist/core/configurators/slash/registry.js +6 -0
  20. package/dist/core/configurators/slash/registry.js.map +1 -1
  21. package/package.json +1 -1
  22. package/skills/design-system-generator/SKILL.md +324 -0
  23. package/skills/design-system-generator/assets/design-system-template.md +348 -0
  24. package/skills/design-system-generator/references/extraction-patterns.md +321 -0
  25. package/skills/laravel-code-review/SKILL.md +383 -0
  26. package/skills/laravel-code-review/assets/report-template-agent.md +195 -0
  27. package/skills/laravel-code-review/assets/report-template-compact.md +79 -0
  28. package/skills/laravel-code-review/assets/report-template-full.md +253 -0
  29. package/skills/laravel-code-review/assets/report-template-human.md +159 -0
  30. package/skills/laravel-code-review/references/laravel-patterns.md +571 -0
  31. package/skills/laravel-code-review/references/php84-features.md +442 -0
  32. package/src/cli/index.ts +1 -1
  33. package/src/core/config.ts +3 -1
  34. package/src/core/configurators/slash/droid.ts +40 -0
  35. package/src/core/configurators/slash/forge.ts +40 -0
  36. package/src/core/configurators/slash/index.ts +2 -0
  37. package/src/core/configurators/slash/registry.ts +6 -0
@@ -0,0 +1,348 @@
1
+ # {{PROJECT_NAME}} Design System
2
+
3
+ > **Generated:** {{TIMESTAMP}}
4
+ > **Source:** {{INPUT_DESCRIPTION}}
5
+ > **Format Version:** 1.0
6
+
7
+ ---
8
+
9
+ ## Table of Contents
10
+
11
+ - [Colors](#colors)
12
+ - [Typography](#typography)
13
+ - [Spacing](#spacing)
14
+ - [Layout & Breakpoints](#layout--breakpoints)
15
+ - [Borders & Radii](#borders--radii)
16
+ - [Shadows & Elevation](#shadows--elevation)
17
+ - [Transitions & Animation](#transitions--animation)
18
+ - [Z-Index Scale](#z-index-scale)
19
+ - [Components](#components)
20
+
21
+ ---
22
+
23
+ ## Colors
24
+
25
+ ### Primary
26
+
27
+ | Token | Value | Swatch | HSL |
28
+ |-------|-------|--------|-----|
29
+ | `--ds-primary-50` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | `{{HSL}}` |
30
+ | `--ds-primary-100` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | `{{HSL}}` |
31
+ | `--ds-primary-200` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | `{{HSL}}` |
32
+ | `--ds-primary-300` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | `{{HSL}}` |
33
+ | `--ds-primary-400` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | `{{HSL}}` |
34
+ | `--ds-primary-500` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | `{{HSL}}` |
35
+ | `--ds-primary-600` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | `{{HSL}}` |
36
+ | `--ds-primary-700` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | `{{HSL}}` |
37
+ | `--ds-primary-800` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | `{{HSL}}` |
38
+ | `--ds-primary-900` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | `{{HSL}}` |
39
+ | `--ds-primary-950` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | `{{HSL}}` |
40
+
41
+ <!-- Repeat for: Secondary, Accent, Neutral, Success, Warning, Error, Info -->
42
+ <!-- Remove any color group that has no extracted tokens -->
43
+
44
+ ### Secondary
45
+
46
+ | Token | Value | Swatch | HSL |
47
+ |-------|-------|--------|-----|
48
+ | `--ds-secondary-*` | ... | ... | ... |
49
+
50
+ ### Accent
51
+
52
+ | Token | Value | Swatch | HSL |
53
+ |-------|-------|--------|-----|
54
+ | `--ds-accent-*` | ... | ... | ... |
55
+
56
+ ### Neutral
57
+
58
+ | Token | Value | Swatch | HSL |
59
+ |-------|-------|--------|-----|
60
+ | `--ds-neutral-*` | ... | ... | ... |
61
+
62
+ ### Semantic
63
+
64
+ | Token | Value | Swatch | Usage |
65
+ |-------|-------|--------|-------|
66
+ | `--ds-success` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | Positive actions, confirmations |
67
+ | `--ds-warning` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | Caution states, alerts |
68
+ | `--ds-error` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | Error states, destructive actions |
69
+ | `--ds-info` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | Informational states |
70
+
71
+ ### Surface & Background
72
+
73
+ | Token | Value | Swatch | Usage |
74
+ |-------|-------|--------|-------|
75
+ | `--ds-bg-base` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle;border:1px solid #ddd"></span> | Page background |
76
+ | `--ds-bg-surface` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle;border:1px solid #ddd"></span> | Card/panel background |
77
+ | `--ds-bg-muted` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle;border:1px solid #ddd"></span> | Subtle background fills |
78
+ | `--ds-bg-overlay` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | Modal/dialog overlays |
79
+
80
+ ### Text Colors
81
+
82
+ | Token | Value | Swatch | Usage |
83
+ |-------|-------|--------|-------|
84
+ | `--ds-text-primary` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | Primary body text |
85
+ | `--ds-text-secondary` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | Secondary/muted text |
86
+ | `--ds-text-disabled` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> | Disabled state text |
87
+ | `--ds-text-inverse` | `{{VALUE}}` | <span style="background:{{VALUE}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle;border:1px solid #ddd"></span> | Text on dark backgrounds |
88
+
89
+ ---
90
+
91
+ ## Typography
92
+
93
+ ### Font Families
94
+
95
+ | Token | Value | Usage |
96
+ |-------|-------|-------|
97
+ | `--ds-font-heading` | `{{VALUE}}` | Headings, display text |
98
+ | `--ds-font-body` | `{{VALUE}}` | Body text, paragraphs |
99
+ | `--ds-font-mono` | `{{VALUE}}` | Code, technical content |
100
+
101
+ ### Font Sizes
102
+
103
+ | Token | Value (px) | Value (rem) | Usage |
104
+ |-------|-----------|-------------|-------|
105
+ | `--ds-text-xs` | `{{PX}}` | `{{REM}}` | Fine print, captions |
106
+ | `--ds-text-sm` | `{{PX}}` | `{{REM}}` | Secondary text, labels |
107
+ | `--ds-text-base` | `{{PX}}` | `{{REM}}` | Body text (default) |
108
+ | `--ds-text-lg` | `{{PX}}` | `{{REM}}` | Emphasized body text |
109
+ | `--ds-text-xl` | `{{PX}}` | `{{REM}}` | Section headers |
110
+ | `--ds-text-2xl` | `{{PX}}` | `{{REM}}` | Page headers |
111
+ | `--ds-text-3xl` | `{{PX}}` | `{{REM}}` | Large display text |
112
+ | `--ds-text-4xl` | `{{PX}}` | `{{REM}}` | Hero text |
113
+
114
+ ### Font Weights
115
+
116
+ | Token | Value | Usage |
117
+ |-------|-------|-------|
118
+ | `--ds-font-light` | `300` | Light emphasis |
119
+ | `--ds-font-normal` | `400` | Body text |
120
+ | `--ds-font-medium` | `500` | Subtle emphasis |
121
+ | `--ds-font-semibold` | `600` | Strong emphasis |
122
+ | `--ds-font-bold` | `700` | Headings, CTAs |
123
+
124
+ ### Line Heights
125
+
126
+ | Token | Value | Usage |
127
+ |-------|-------|-------|
128
+ | `--ds-leading-tight` | `{{VALUE}}` | Headings, compact text |
129
+ | `--ds-leading-normal` | `{{VALUE}}` | Body text |
130
+ | `--ds-leading-relaxed` | `{{VALUE}}` | Long-form reading |
131
+
132
+ ### Letter Spacing
133
+
134
+ | Token | Value | Usage |
135
+ |-------|-------|-------|
136
+ | `--ds-tracking-tight` | `{{VALUE}}` | Large headings |
137
+ | `--ds-tracking-normal` | `{{VALUE}}` | Body text |
138
+ | `--ds-tracking-wide` | `{{VALUE}}` | Uppercase labels, buttons |
139
+
140
+ ---
141
+
142
+ ## Spacing
143
+
144
+ **Base unit:** `{{BASE_UNIT}}px`
145
+
146
+ | Token | Value (px) | Value (rem) | Multiplier |
147
+ |-------|-----------|-------------|------------|
148
+ | `--ds-space-0` | `0` | `0` | 0× |
149
+ | `--ds-space-1` | `{{VALUE}}` | `{{REM}}` | 1× |
150
+ | `--ds-space-2` | `{{VALUE}}` | `{{REM}}` | 2× |
151
+ | `--ds-space-3` | `{{VALUE}}` | `{{REM}}` | 3× |
152
+ | `--ds-space-4` | `{{VALUE}}` | `{{REM}}` | 4× |
153
+ | `--ds-space-5` | `{{VALUE}}` | `{{REM}}` | 5× |
154
+ | `--ds-space-6` | `{{VALUE}}` | `{{REM}}` | 6× |
155
+ | `--ds-space-8` | `{{VALUE}}` | `{{REM}}` | 8× |
156
+ | `--ds-space-10` | `{{VALUE}}` | `{{REM}}` | 10× |
157
+ | `--ds-space-12` | `{{VALUE}}` | `{{REM}}` | 12× |
158
+ | `--ds-space-16` | `{{VALUE}}` | `{{REM}}` | 16× |
159
+ | `--ds-space-20` | `{{VALUE}}` | `{{REM}}` | 20× |
160
+ | `--ds-space-24` | `{{VALUE}}` | `{{REM}}` | 24× |
161
+
162
+ ---
163
+
164
+ ## Layout & Breakpoints
165
+
166
+ ### Breakpoints
167
+
168
+ | Token | Value | Description |
169
+ |-------|-------|-------------|
170
+ | `--ds-screen-sm` | `{{VALUE}}` | Small devices (phones landscape) |
171
+ | `--ds-screen-md` | `{{VALUE}}` | Medium devices (tablets) |
172
+ | `--ds-screen-lg` | `{{VALUE}}` | Large devices (desktops) |
173
+ | `--ds-screen-xl` | `{{VALUE}}` | Extra large devices (wide desktops) |
174
+ | `--ds-screen-2xl` | `{{VALUE}}` | Ultra wide displays |
175
+
176
+ ### Container
177
+
178
+ | Token | Value | Usage |
179
+ |-------|-------|-------|
180
+ | `--ds-container-sm` | `{{VALUE}}` | Narrow content (articles) |
181
+ | `--ds-container-md` | `{{VALUE}}` | Standard content |
182
+ | `--ds-container-lg` | `{{VALUE}}` | Wide content |
183
+ | `--ds-container-xl` | `{{VALUE}}` | Full-width content |
184
+
185
+ ---
186
+
187
+ ## Borders & Radii
188
+
189
+ ### Border Widths
190
+
191
+ | Token | Value | Usage |
192
+ |-------|-------|-------|
193
+ | `--ds-border-0` | `0px` | No border |
194
+ | `--ds-border-1` | `1px` | Default borders |
195
+ | `--ds-border-2` | `2px` | Emphasized borders |
196
+ | `--ds-border-4` | `4px` | Heavy borders |
197
+
198
+ ### Border Radii
199
+
200
+ | Token | Value | Preview | Usage |
201
+ |-------|-------|---------|-------|
202
+ | `--ds-radius-none` | `0px` | <span style="width:24px;height:24px;display:inline-block;background:#6366f1;border-radius:0px"></span> | Sharp corners |
203
+ | `--ds-radius-sm` | `{{VALUE}}` | <span style="width:24px;height:24px;display:inline-block;background:#6366f1;border-radius:{{VALUE}}"></span> | Subtle rounding |
204
+ | `--ds-radius-md` | `{{VALUE}}` | <span style="width:24px;height:24px;display:inline-block;background:#6366f1;border-radius:{{VALUE}}"></span> | Default rounding |
205
+ | `--ds-radius-lg` | `{{VALUE}}` | <span style="width:24px;height:24px;display:inline-block;background:#6366f1;border-radius:{{VALUE}}"></span> | Prominent rounding |
206
+ | `--ds-radius-xl` | `{{VALUE}}` | <span style="width:24px;height:24px;display:inline-block;background:#6366f1;border-radius:{{VALUE}}"></span> | Heavy rounding |
207
+ | `--ds-radius-full` | `9999px` | <span style="width:24px;height:24px;display:inline-block;background:#6366f1;border-radius:9999px"></span> | Circular/pill shapes |
208
+
209
+ ---
210
+
211
+ ## Shadows & Elevation
212
+
213
+ | Token | Value | Usage |
214
+ |-------|-------|-------|
215
+ | `--ds-shadow-sm` | `{{VALUE}}` | Subtle depth (cards at rest) |
216
+ | `--ds-shadow-md` | `{{VALUE}}` | Medium depth (dropdowns) |
217
+ | `--ds-shadow-lg` | `{{VALUE}}` | Strong depth (modals, popovers) |
218
+ | `--ds-shadow-xl` | `{{VALUE}}` | Maximum depth (floating elements) |
219
+ | `--ds-shadow-inner` | `{{VALUE}}` | Inset shadow (pressed states) |
220
+
221
+ ---
222
+
223
+ ## Transitions & Animation
224
+
225
+ ### Durations
226
+
227
+ | Token | Value | Usage |
228
+ |-------|-------|-------|
229
+ | `--ds-duration-fast` | `{{VALUE}}` | Micro-interactions (hover, focus) |
230
+ | `--ds-duration-normal` | `{{VALUE}}` | Standard transitions |
231
+ | `--ds-duration-slow` | `{{VALUE}}` | Complex animations, page transitions |
232
+
233
+ ### Easing Functions
234
+
235
+ | Token | Value | Usage |
236
+ |-------|-------|-------|
237
+ | `--ds-ease-default` | `{{VALUE}}` | General purpose |
238
+ | `--ds-ease-in` | `{{VALUE}}` | Elements exiting view |
239
+ | `--ds-ease-out` | `{{VALUE}}` | Elements entering view |
240
+ | `--ds-ease-in-out` | `{{VALUE}}` | Elements moving in view |
241
+
242
+ ---
243
+
244
+ ## Z-Index Scale
245
+
246
+ | Token | Value | Usage |
247
+ |-------|-------|-------|
248
+ | `--ds-z-base` | `0` | Default stacking |
249
+ | `--ds-z-dropdown` | `{{VALUE}}` | Dropdown menus |
250
+ | `--ds-z-sticky` | `{{VALUE}}` | Sticky headers |
251
+ | `--ds-z-overlay` | `{{VALUE}}` | Backdrop overlays |
252
+ | `--ds-z-modal` | `{{VALUE}}` | Modal dialogs |
253
+ | `--ds-z-popover` | `{{VALUE}}` | Popovers, tooltips |
254
+ | `--ds-z-toast` | `{{VALUE}}` | Toast notifications |
255
+
256
+ ---
257
+
258
+ ## Components
259
+
260
+ <!-- Repeat this block for each identified component -->
261
+
262
+ ### {{ComponentName}}
263
+
264
+ **Description:** {{Brief description of the component}}
265
+
266
+ #### Variants
267
+
268
+ | Variant | Preview | Usage |
269
+ |---------|---------|-------|
270
+ | `primary` | {{visual or code example}} | Main CTA |
271
+ | `secondary` | {{visual or code example}} | Secondary actions |
272
+ | `outline` | {{visual or code example}} | Tertiary actions |
273
+ | `ghost` | {{visual or code example}} | Subtle actions |
274
+
275
+ #### Sizes
276
+
277
+ | Size | Font Size | Padding | Height |
278
+ |------|-----------|---------|--------|
279
+ | `sm` | `{{VALUE}}` | `{{VALUE}}` | `{{VALUE}}` |
280
+ | `md` | `{{VALUE}}` | `{{VALUE}}` | `{{VALUE}}` |
281
+ | `lg` | `{{VALUE}}` | `{{VALUE}}` | `{{VALUE}}` |
282
+
283
+ #### States
284
+
285
+ | State | Background | Border | Text | Shadow |
286
+ |-------|-----------|--------|------|--------|
287
+ | Default | `{{VALUE}}` | `{{VALUE}}` | `{{VALUE}}` | `{{VALUE}}` |
288
+ | Hover | `{{VALUE}}` | `{{VALUE}}` | `{{VALUE}}` | `{{VALUE}}` |
289
+ | Focus | `{{VALUE}}` | `{{VALUE}}` | `{{VALUE}}` | `{{VALUE}}` |
290
+ | Active | `{{VALUE}}` | `{{VALUE}}` | `{{VALUE}}` | `{{VALUE}}` |
291
+ | Disabled | `{{VALUE}}` | `{{VALUE}}` | `{{VALUE}}` | `{{VALUE}}` |
292
+
293
+ #### Tokens Used
294
+
295
+ ```
296
+ --ds-primary-500, --ds-primary-600 (hover)
297
+ --ds-radius-md
298
+ --ds-shadow-sm
299
+ --ds-font-medium
300
+ --ds-text-sm (sm), --ds-text-base (md), --ds-text-lg (lg)
301
+ ```
302
+
303
+ <!-- End component block -->
304
+
305
+ ---
306
+
307
+ ## Dark Mode
308
+
309
+ <!-- Include only if dark mode tokens were detected -->
310
+
311
+ | Light Token | Light Value | Dark Value | Swatch (Dark) |
312
+ |-------------|------------|------------|----------------|
313
+ | `--ds-bg-base` | `{{LIGHT}}` | `{{DARK}}` | <span style="background:{{DARK}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> |
314
+ | `--ds-bg-surface` | `{{LIGHT}}` | `{{DARK}}` | <span style="background:{{DARK}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> |
315
+ | `--ds-text-primary` | `{{LIGHT}}` | `{{DARK}}` | <span style="background:{{DARK}};width:24px;height:24px;display:inline-block;border-radius:4px;vertical-align:middle"></span> |
316
+
317
+ ---
318
+
319
+ ## Quick Reference — CSS Variables
320
+
321
+ ```css
322
+ :root {
323
+ /* Colors */
324
+ {{COLOR_VARIABLES}}
325
+
326
+ /* Typography */
327
+ {{TYPOGRAPHY_VARIABLES}}
328
+
329
+ /* Spacing */
330
+ {{SPACING_VARIABLES}}
331
+
332
+ /* Borders & Radii */
333
+ {{BORDER_VARIABLES}}
334
+
335
+ /* Shadows */
336
+ {{SHADOW_VARIABLES}}
337
+
338
+ /* Transitions */
339
+ {{TRANSITION_VARIABLES}}
340
+
341
+ /* Z-Index */
342
+ {{ZINDEX_VARIABLES}}
343
+ }
344
+ ```
345
+
346
+ ---
347
+
348
+ *Generated by Design System Generator skill*
@@ -0,0 +1,321 @@
1
+ # Extraction Patterns Reference
2
+
3
+ Mapping rules and regex patterns for extracting design tokens from CSS, HTML, React, and Tailwind sources.
4
+
5
+ ---
6
+
7
+ ## CSS Custom Properties
8
+
9
+ Extract all `--` prefixed declarations from `:root`, `html`, `body`, or theme selectors.
10
+
11
+ ```regex
12
+ --[\w-]+\s*:\s*[^;]+
13
+ ```
14
+
15
+ Group by prefix conventions:
16
+ - `--color-*`, `--c-*` → Colors
17
+ - `--font-*`, `--text-*`, `--fs-*` → Typography
18
+ - `--space-*`, `--spacing-*`, `--gap-*` → Spacing
19
+ - `--radius-*`, `--rounded-*`, `--br-*` → Border Radii
20
+ - `--shadow-*`, `--elevation-*` → Shadows
21
+ - `--z-*`, `--zindex-*` → Z-Index
22
+ - `--duration-*`, `--transition-*`, `--ease-*` → Transitions
23
+
24
+ ---
25
+
26
+ ## Color Extraction
27
+
28
+ ### From CSS declarations
29
+
30
+ Target properties:
31
+ ```
32
+ color, background-color, background, border-color, outline-color,
33
+ fill, stroke, text-decoration-color, accent-color, caret-color,
34
+ box-shadow (color component), --*-color
35
+ ```
36
+
37
+ ### Color format normalization
38
+
39
+ Convert all formats to hex with HSL annotation:
40
+ - `#RGB` → expand to `#RRGGBB`
41
+ - `rgb(R, G, B)` → convert to hex
42
+ - `rgba(R, G, B, A)` → note alpha separately
43
+ - `hsl(H, S%, L%)` → convert to hex, keep HSL as annotation
44
+ - `oklch(L C H)` → convert to hex equivalent
45
+ - Named colors (`red`, `blue`) → convert to hex
46
+
47
+ ### Semantic color grouping heuristics
48
+
49
+ | CSS Pattern | Likely Category |
50
+ |-------------|----------------|
51
+ | `--primary*`, `--brand*`, `--accent*` | Primary/Accent |
52
+ | `--secondary*` | Secondary |
53
+ | `--gray*`, `--grey*`, `--neutral*`, `--slate*` | Neutral |
54
+ | `--success*`, `--green*`, `--positive*` | Success |
55
+ | `--warning*`, `--yellow*`, `--amber*`, `--caution*` | Warning |
56
+ | `--error*`, `--red*`, `--danger*`, `--destructive*` | Error |
57
+ | `--info*`, `--blue*` | Info |
58
+ | `--bg*`, `--background*`, `--surface*` | Surface |
59
+ | `--text*`, `--fg*`, `--foreground*` | Text |
60
+
61
+ ### Color scale detection
62
+
63
+ If multiple shades of the same hue exist, sort by lightness and assign scale numbers:
64
+ - Lightest → 50
65
+ - Darkest → 950
66
+ - Map intermediate values to nearest: 100, 200, 300, 400, 500, 600, 700, 800, 900
67
+
68
+ ---
69
+
70
+ ## Typography Extraction
71
+
72
+ ### Font family detection
73
+
74
+ Target properties: `font-family`, `--font-*`
75
+
76
+ Classify by usage:
77
+ - Serif/Sans-serif → heading or body
78
+ - Monospace → code/mono
79
+ - If only one family found → assign to both heading + body
80
+
81
+ ### Font size scale building
82
+
83
+ Target properties: `font-size`, `--text-*`, `--fs-*`
84
+
85
+ 1. Collect all unique `font-size` values
86
+ 2. Sort ascending
87
+ 3. Map to scale:
88
+
89
+ | Range (px) | Token |
90
+ |-----------|-------|
91
+ | 10–11 | `xs` |
92
+ | 12–13 | `sm` |
93
+ | 14–16 | `base` |
94
+ | 17–19 | `lg` |
95
+ | 20–23 | `xl` |
96
+ | 24–29 | `2xl` |
97
+ | 30–35 | `3xl` |
98
+ | 36+ | `4xl` |
99
+
100
+ ### Font weight mapping
101
+
102
+ Collect all `font-weight` values. Map to named tokens:
103
+ - `100` → thin, `200` → extralight, `300` → light
104
+ - `400` → normal, `500` → medium, `600` → semibold
105
+ - `700` → bold, `800` → extrabold, `900` → black
106
+
107
+ ---
108
+
109
+ ## Spacing Extraction
110
+
111
+ ### Collecting spacing values
112
+
113
+ Target properties:
114
+ ```
115
+ margin, margin-top/right/bottom/left,
116
+ padding, padding-top/right/bottom/left,
117
+ gap, row-gap, column-gap, grid-gap,
118
+ top, right, bottom, left (when used for spacing)
119
+ ```
120
+
121
+ ### Base unit detection
122
+
123
+ 1. Collect all spacing values
124
+ 2. Find GCD (Greatest Common Divisor) of the most common values
125
+ 3. Typical base units: `4px`, `8px`
126
+ 4. If values follow `4, 8, 12, 16, 20, 24, 32` → base = 4px
127
+ 5. If values follow `8, 16, 24, 32, 40, 48, 64` → base = 8px
128
+
129
+ ### Scale normalization
130
+
131
+ Sort unique values and assign multipliers relative to base:
132
+ ```
133
+ 0px → space-0 (0×)
134
+ 4px → space-1 (1×)
135
+ 8px → space-2 (2×)
136
+ 12px → space-3 (3×)
137
+ 16px → space-4 (4×)
138
+ ...
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Border & Radius Extraction
144
+
145
+ ### Border radius values
146
+
147
+ Target: `border-radius`, `border-*-radius`, `--radius-*`
148
+
149
+ Map to scale:
150
+ | Range (px) | Token |
151
+ |-----------|-------|
152
+ | 0 | `none` |
153
+ | 1–3 | `sm` |
154
+ | 4–7 | `md` |
155
+ | 8–11 | `lg` |
156
+ | 12–15 | `xl` |
157
+ | 16+ | `2xl` |
158
+ | 9999px, 50% | `full` |
159
+
160
+ ---
161
+
162
+ ## Shadow Extraction
163
+
164
+ Target: `box-shadow`, `text-shadow`, `--shadow-*`
165
+
166
+ Parse shadow values into components:
167
+ ```
168
+ box-shadow: <offset-x> <offset-y> <blur> <spread> <color>
169
+ ```
170
+
171
+ Map to elevation scale by blur radius:
172
+ | Blur (px) | Token |
173
+ |----------|-------|
174
+ | 1–4 | `sm` |
175
+ | 5–10 | `md` |
176
+ | 11–20 | `lg` |
177
+ | 21+ | `xl` |
178
+ | `inset` keyword | `inner` |
179
+
180
+ ---
181
+
182
+ ## Breakpoint Extraction
183
+
184
+ Target: `@media` queries with `min-width` or `max-width`
185
+
186
+ ```regex
187
+ @media\s*\([^)]*(?:min|max)-width\s*:\s*([\d.]+(?:px|em|rem))[^)]*\)
188
+ ```
189
+
190
+ Common breakpoint conventions:
191
+ | Value | Token |
192
+ |-------|-------|
193
+ | 640px / 40em | `sm` |
194
+ | 768px / 48em | `md` |
195
+ | 1024px / 64em | `lg` |
196
+ | 1280px / 80em | `xl` |
197
+ | 1536px / 96em | `2xl` |
198
+
199
+ ---
200
+
201
+ ## Transition Extraction
202
+
203
+ Target: `transition`, `transition-duration`, `transition-timing-function`, `animation-duration`
204
+
205
+ ### Duration bucketing
206
+
207
+ | Range (ms) | Token |
208
+ |-----------|-------|
209
+ | 50–100 | `fast` |
210
+ | 150–300 | `normal` |
211
+ | 300–500 | `slow` |
212
+
213
+ ### Easing classification
214
+
215
+ | Value | Token |
216
+ |-------|-------|
217
+ | `ease` | `default` |
218
+ | `ease-in`, `cubic-bezier(0.4, 0, 1, 1)` | `in` |
219
+ | `ease-out`, `cubic-bezier(0, 0, 0.2, 1)` | `out` |
220
+ | `ease-in-out`, `cubic-bezier(0.4, 0, 0.2, 1)` | `in-out` |
221
+
222
+ ---
223
+
224
+ ## Z-Index Extraction
225
+
226
+ Target: `z-index`, `--z-*`
227
+
228
+ ### Semantic assignment heuristics
229
+
230
+ Assign names based on context (selector or class name):
231
+ | Selector Pattern | Token |
232
+ |-----------------|-------|
233
+ | `.dropdown*`, `.menu*`, `.select*` | `dropdown` |
234
+ | `.sticky*`, `.fixed-header*` | `sticky` |
235
+ | `.overlay*`, `.backdrop*` | `overlay` |
236
+ | `.modal*`, `.dialog*` | `modal` |
237
+ | `.popover*`, `.tooltip*` | `popover` |
238
+ | `.toast*`, `.notification*`, `.snackbar*` | `toast` |
239
+
240
+ ---
241
+
242
+ ## Tailwind Class Extraction
243
+
244
+ When input uses Tailwind utility classes, map classes to tokens:
245
+
246
+ ### Color classes
247
+ ```regex
248
+ (?:bg|text|border|ring|fill|stroke)-(?:[\w]+-)?(?:\d{2,3}|black|white)
249
+ ```
250
+ Map to theme colors via `tailwind.config.js` or default palette.
251
+
252
+ ### Spacing classes
253
+ ```regex
254
+ (?:m|p|gap|space-[xy])-(?:\d+(?:\.\d+)?|px|auto)
255
+ ```
256
+ Convert Tailwind spacing units: multiply by 4px (default).
257
+
258
+ ### Typography classes
259
+ ```regex
260
+ (?:text|font|leading|tracking)-(?:xs|sm|base|lg|xl|[\d]xl|thin|light|normal|medium|semibold|bold|extrabold|black|tight|snug|normal|relaxed|loose|tighter|wider)
261
+ ```
262
+
263
+ ### Border/Radius classes
264
+ ```regex
265
+ rounded(?:-(?:sm|md|lg|xl|2xl|3xl|full|none))?
266
+ border(?:-(?:\d+))?
267
+ ```
268
+
269
+ ---
270
+
271
+ ## React/JSX Pattern Extraction
272
+
273
+ ### Styled-components / Emotion
274
+
275
+ Extract template literals from `styled.*` or `css` tagged templates:
276
+ ```regex
277
+ styled\.(\w+)`([^`]*)`
278
+ css`([^`]*)`
279
+ ```
280
+
281
+ ### Style objects
282
+
283
+ Extract from `style={{ }}` JSX attributes:
284
+ ```regex
285
+ style=\{\{([^}]*)\}\}
286
+ ```
287
+
288
+ Convert camelCase properties to kebab-case for token extraction.
289
+
290
+ ### Theme objects
291
+
292
+ Look for theme/token files:
293
+ - `theme.ts`, `theme.js`, `tokens.ts`, `tokens.js`
294
+ - `ThemeProvider` usage pointing to theme config
295
+ - `createTheme()`, `extendTheme()` calls
296
+
297
+ Extract nested token objects and flatten to design tokens.
298
+
299
+ ---
300
+
301
+ ## Dark Mode Detection
302
+
303
+ ### CSS strategies
304
+ - `@media (prefers-color-scheme: dark)` blocks
305
+ - `.dark` class selector overrides
306
+ - `[data-theme="dark"]` attribute selectors
307
+
308
+ ### Tailwind dark mode
309
+ - `dark:` prefix classes
310
+ - Check `darkMode` config in `tailwind.config.js`
311
+
312
+ When dark mode is detected, create a parallel token set documenting both light and dark values.
313
+
314
+ ---
315
+
316
+ ## Deduplication Rules
317
+
318
+ 1. **Near-identical colors**: Merge colors within ΔE < 3 (perceptual difference). Keep the more frequently used value.
319
+ 2. **Similar spacing**: If two values differ by ≤1px, keep the one that fits the base unit grid.
320
+ 3. **Duplicate fonts**: Same family with different quoting → keep one.
321
+ 4. **Shadow variants**: If two shadows only differ by color, document as one shadow with color token reference.