@rune-kit/rune 2.1.1

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 (155) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +357 -0
  3. package/agents/.gitkeep +0 -0
  4. package/agents/architect.md +29 -0
  5. package/agents/asset-creator.md +11 -0
  6. package/agents/audit.md +11 -0
  7. package/agents/autopsy.md +11 -0
  8. package/agents/brainstorm.md +11 -0
  9. package/agents/browser-pilot.md +11 -0
  10. package/agents/coder.md +29 -0
  11. package/agents/completion-gate.md +11 -0
  12. package/agents/constraint-check.md +11 -0
  13. package/agents/context-engine.md +11 -0
  14. package/agents/cook.md +11 -0
  15. package/agents/db.md +11 -0
  16. package/agents/debug.md +11 -0
  17. package/agents/dependency-doctor.md +11 -0
  18. package/agents/deploy.md +11 -0
  19. package/agents/design.md +11 -0
  20. package/agents/docs-seeker.md +11 -0
  21. package/agents/fix.md +11 -0
  22. package/agents/hallucination-guard.md +11 -0
  23. package/agents/incident.md +11 -0
  24. package/agents/integrity-check.md +11 -0
  25. package/agents/journal.md +11 -0
  26. package/agents/launch.md +11 -0
  27. package/agents/logic-guardian.md +11 -0
  28. package/agents/marketing.md +11 -0
  29. package/agents/onboard.md +11 -0
  30. package/agents/perf.md +11 -0
  31. package/agents/plan.md +11 -0
  32. package/agents/preflight.md +11 -0
  33. package/agents/problem-solver.md +11 -0
  34. package/agents/rescue.md +11 -0
  35. package/agents/research.md +11 -0
  36. package/agents/researcher.md +29 -0
  37. package/agents/review-intake.md +11 -0
  38. package/agents/review.md +11 -0
  39. package/agents/reviewer.md +28 -0
  40. package/agents/safeguard.md +11 -0
  41. package/agents/sast.md +11 -0
  42. package/agents/scanner.md +28 -0
  43. package/agents/scope-guard.md +11 -0
  44. package/agents/scout.md +11 -0
  45. package/agents/sentinel.md +11 -0
  46. package/agents/sequential-thinking.md +11 -0
  47. package/agents/session-bridge.md +11 -0
  48. package/agents/skill-forge.md +11 -0
  49. package/agents/skill-router.md +11 -0
  50. package/agents/surgeon.md +11 -0
  51. package/agents/team.md +11 -0
  52. package/agents/test.md +11 -0
  53. package/agents/trend-scout.md +11 -0
  54. package/agents/verification.md +11 -0
  55. package/agents/video-creator.md +11 -0
  56. package/agents/watchdog.md +11 -0
  57. package/agents/worktree.md +11 -0
  58. package/commands/.gitkeep +0 -0
  59. package/commands/rune.md +168 -0
  60. package/compiler/__tests__/openclaw-adapter.test.js +140 -0
  61. package/compiler/__tests__/parser.test.js +55 -0
  62. package/compiler/adapters/antigravity.js +59 -0
  63. package/compiler/adapters/claude.js +37 -0
  64. package/compiler/adapters/cursor.js +67 -0
  65. package/compiler/adapters/generic.js +60 -0
  66. package/compiler/adapters/index.js +45 -0
  67. package/compiler/adapters/openclaw.js +150 -0
  68. package/compiler/adapters/windsurf.js +60 -0
  69. package/compiler/bin/rune.js +288 -0
  70. package/compiler/doctor.js +153 -0
  71. package/compiler/emitter.js +240 -0
  72. package/compiler/parser.js +208 -0
  73. package/compiler/transformer.js +69 -0
  74. package/compiler/transforms/branding.js +27 -0
  75. package/compiler/transforms/cross-references.js +29 -0
  76. package/compiler/transforms/frontmatter.js +38 -0
  77. package/compiler/transforms/hooks.js +68 -0
  78. package/compiler/transforms/subagents.js +36 -0
  79. package/compiler/transforms/tool-names.js +60 -0
  80. package/contexts/dev.md +34 -0
  81. package/contexts/research.md +43 -0
  82. package/contexts/review.md +55 -0
  83. package/extensions/ai-ml/PACK.md +517 -0
  84. package/extensions/analytics/PACK.md +557 -0
  85. package/extensions/backend/PACK.md +678 -0
  86. package/extensions/chrome-ext/PACK.md +995 -0
  87. package/extensions/content/PACK.md +381 -0
  88. package/extensions/devops/PACK.md +520 -0
  89. package/extensions/ecommerce/PACK.md +280 -0
  90. package/extensions/gamedev/PACK.md +393 -0
  91. package/extensions/mobile/PACK.md +273 -0
  92. package/extensions/saas/PACK.md +805 -0
  93. package/extensions/security/PACK.md +536 -0
  94. package/extensions/trading/PACK.md +597 -0
  95. package/extensions/ui/PACK.md +947 -0
  96. package/package.json +47 -0
  97. package/skills/.gitkeep +0 -0
  98. package/skills/adversary/SKILL.md +271 -0
  99. package/skills/asset-creator/SKILL.md +157 -0
  100. package/skills/audit/SKILL.md +466 -0
  101. package/skills/autopsy/SKILL.md +200 -0
  102. package/skills/ba/SKILL.md +279 -0
  103. package/skills/brainstorm/SKILL.md +266 -0
  104. package/skills/browser-pilot/SKILL.md +168 -0
  105. package/skills/completion-gate/SKILL.md +151 -0
  106. package/skills/constraint-check/SKILL.md +165 -0
  107. package/skills/context-engine/SKILL.md +176 -0
  108. package/skills/cook/SKILL.md +636 -0
  109. package/skills/db/SKILL.md +256 -0
  110. package/skills/debug/SKILL.md +240 -0
  111. package/skills/dependency-doctor/SKILL.md +235 -0
  112. package/skills/deploy/SKILL.md +174 -0
  113. package/skills/design/DESIGN-REFERENCE.md +365 -0
  114. package/skills/design/SKILL.md +462 -0
  115. package/skills/doc-processor/SKILL.md +254 -0
  116. package/skills/docs/SKILL.md +336 -0
  117. package/skills/docs-seeker/SKILL.md +166 -0
  118. package/skills/fix/SKILL.md +192 -0
  119. package/skills/git/SKILL.md +285 -0
  120. package/skills/hallucination-guard/SKILL.md +204 -0
  121. package/skills/incident/SKILL.md +241 -0
  122. package/skills/integrity-check/SKILL.md +169 -0
  123. package/skills/journal/SKILL.md +190 -0
  124. package/skills/launch/SKILL.md +330 -0
  125. package/skills/logic-guardian/SKILL.md +240 -0
  126. package/skills/marketing/SKILL.md +229 -0
  127. package/skills/mcp-builder/SKILL.md +311 -0
  128. package/skills/onboard/SKILL.md +298 -0
  129. package/skills/perf/SKILL.md +297 -0
  130. package/skills/plan/SKILL.md +520 -0
  131. package/skills/preflight/SKILL.md +231 -0
  132. package/skills/problem-solver/SKILL.md +284 -0
  133. package/skills/rescue/SKILL.md +434 -0
  134. package/skills/research/SKILL.md +122 -0
  135. package/skills/review/SKILL.md +354 -0
  136. package/skills/review-intake/SKILL.md +222 -0
  137. package/skills/safeguard/SKILL.md +188 -0
  138. package/skills/sast/SKILL.md +190 -0
  139. package/skills/scaffold/SKILL.md +276 -0
  140. package/skills/scope-guard/SKILL.md +150 -0
  141. package/skills/scout/SKILL.md +232 -0
  142. package/skills/sentinel/SKILL.md +320 -0
  143. package/skills/sentinel-env/SKILL.md +226 -0
  144. package/skills/sequential-thinking/SKILL.md +234 -0
  145. package/skills/session-bridge/SKILL.md +287 -0
  146. package/skills/skill-forge/SKILL.md +317 -0
  147. package/skills/skill-router/SKILL.md +267 -0
  148. package/skills/surgeon/SKILL.md +203 -0
  149. package/skills/team/SKILL.md +397 -0
  150. package/skills/test/SKILL.md +271 -0
  151. package/skills/trend-scout/SKILL.md +145 -0
  152. package/skills/verification/SKILL.md +201 -0
  153. package/skills/video-creator/SKILL.md +201 -0
  154. package/skills/watchdog/SKILL.md +166 -0
  155. package/skills/worktree/SKILL.md +140 -0
@@ -0,0 +1,947 @@
1
+ ---
2
+ name: "@rune/ui"
3
+ description: Frontend UI patterns — design systems, color palettes, typography, component architecture, landing page sections, accessibility audits, animation patterns, and design decision mapping.
4
+ metadata:
5
+ author: runedev
6
+ version: "0.2.0"
7
+ layer: L4
8
+ price: "$12"
9
+ target: Frontend developers
10
+ ---
11
+
12
+ # @rune/ui
13
+
14
+ ## Purpose
15
+
16
+ Frontend development accumulates invisible debt: ad-hoc color variables, mismatched font pairings, prop-drilled components, untested accessibility, and janky animations — all before you even decide what the product should *look* like. This pack addresses all layers systematically. Eight skills cover the full UI lifecycle: token consistency, color palette selection, typography pairing, component composability, landing page structure, design-domain mapping, WCAG compliance, and motion polish. Run any skill independently or chain all eight as a comprehensive UI health check + design foundation generator.
17
+
18
+ **Anti-AI Design Contract** (enforced by all skills in this pack):
19
+ - NO gradient blob heroes (purple → pink → blue)
20
+ - NO default indigo/violet (#6366f1) unless it IS the brand color
21
+ - NO Lucide icons — use Phosphor Icons (`@phosphor-icons/react`) or Huge Icons
22
+ - NO uniform card grids — vary sizes, establish visual hierarchy
23
+ - NO centered hero formula (big title + subtitle + 2 buttons stacked)
24
+
25
+ ## Triggers
26
+
27
+ - Auto-trigger: when `*.tsx`, `*.svelte`, `*.vue`, CSS/Tailwind files detected in project
28
+ - `/rune design-system` — generate or enforce design tokens
29
+ - `/rune palette-picker` — select a curated color palette by product type
30
+ - `/rune type-system` — select a typography pairing by product tone
31
+ - `/rune component-patterns` — refactor component architecture
32
+ - `/rune landing-patterns` — generate landing page section structure
33
+ - `/rune design-decision` — map product domain to full style recommendation
34
+ - `/rune a11y-audit` — run accessibility audit
35
+ - `/rune animation-patterns` — add or refine motion design
36
+ - Called by `cook` (L1) when frontend task is detected
37
+ - Called by `review` (L2) when UI code is under review
38
+ - Called by `design` (L2) when visual design decisions needed
39
+
40
+ ## Skills Included
41
+
42
+ ---
43
+
44
+ ### design-system
45
+
46
+ Generate and enforce design system tokens — colors, typography, spacing, shadows, border radius. Detects existing ad-hoc values and consolidates them into a structured token file with full dark/light theme support.
47
+
48
+ #### Workflow
49
+
50
+ **Step 1 — Detect existing tokens**
51
+ Use Grep to scan for hardcoded color values (`#[0-9a-fA-F]{3,6}`, `rgb(`, `hsl(`), spacing (`px`, `rem`), and font sizes across all CSS, Tailwind config, and component files. Build an inventory of values in use.
52
+
53
+ **Step 2 — Generate token file**
54
+ From the inventory, produce a CSS custom properties file (or `tailwind.config` theme extension). Group tokens into semantic layers: primitive → semantic → component. Flag duplicates and near-duplicates (e.g., `#1a1a2e` vs `#1a1a2f`).
55
+
56
+ **Step 3 — Enforce consistency**
57
+ Re-run Grep after token file is written. Any hardcoded value that has a matching token is flagged as a violation. Output a replacement diff for each violation.
58
+
59
+ **Step 4 — Dark/light theme toggle**
60
+ Emit a `[data-theme]`-based theme switcher. Semantic tokens point to different primitives per theme. No JavaScript duplication — CSS handles the switch; JS only toggles the attribute.
61
+
62
+ #### Example
63
+
64
+ ```css
65
+ /* tokens.css — generated by design-system skill */
66
+ :root,
67
+ [data-theme="light"] {
68
+ /* Primitive */
69
+ --color-slate-950: #020617;
70
+ --color-slate-900: #0f172a;
71
+ --color-slate-100: #f1f5f9;
72
+ --color-emerald-500: #10b981;
73
+ --space-4: 1rem;
74
+ --radius-md: 0.5rem;
75
+
76
+ /* Semantic */
77
+ --bg-base: var(--color-slate-100);
78
+ --bg-card: #ffffff;
79
+ --text-primary: var(--color-slate-950);
80
+ --color-primary: var(--color-emerald-500);
81
+ --border-color: rgba(0, 0, 0, 0.1);
82
+ }
83
+
84
+ [data-theme="dark"] {
85
+ --bg-base: var(--color-slate-950);
86
+ --bg-card: var(--color-slate-900);
87
+ --text-primary: #f8fafc;
88
+ --color-primary: var(--color-emerald-500);
89
+ --border-color: rgba(255, 255, 255, 0.08);
90
+ }
91
+ ```
92
+
93
+ ```ts
94
+ // theme-toggle.ts — minimal toggle, no flash on reload
95
+ const stored = localStorage.getItem('theme') ?? 'dark'
96
+ document.documentElement.setAttribute('data-theme', stored)
97
+
98
+ export function toggleTheme() {
99
+ const next = document.documentElement.getAttribute('data-theme') === 'dark' ? 'light' : 'dark'
100
+ document.documentElement.setAttribute('data-theme', next)
101
+ localStorage.setItem('theme', next)
102
+ }
103
+ ```
104
+
105
+ ---
106
+
107
+ ### palette-picker
108
+
109
+ Color palette database organized by product type. 25 curated palettes covering fintech, healthcare, education, gaming, ecommerce, SaaS, social, news/content, productivity, and developer tools — each with CSS custom properties, Tailwind config extension, dark/light variants, and colorblind-safe alternatives.
110
+
111
+ #### Workflow
112
+
113
+ **Step 1 — Detect product type**
114
+ Read `CLAUDE.md`, `README.md`, or ask: "What does this product do?" Classify into one of: fintech | healthcare | education | gaming | ecommerce | saas | social | news-content | productivity | devtools.
115
+
116
+ **Step 2 — Recommend palette**
117
+ Apply the decision tree below. Output the top 2 palette candidates with rationale (mood, contrast profile, brand signal).
118
+
119
+ **Step 3 — Generate token file**
120
+ Emit `palette.css` with CSS custom properties for the chosen palette. Include both dark and light variants. Include Tailwind `theme.extend.colors` block.
121
+
122
+ **Step 4 — Verify contrast ratios**
123
+ Run contrast checks: primary text on background (≥ 4.5:1), large headings (≥ 3:1), interactive elements on their backgrounds. Flag any failure. Substitute colorblind-safe alternative if requested.
124
+
125
+ #### Decision Tree
126
+
127
+ ```
128
+ Product Type → Palette Recommendation
129
+ ─────────────────────────────────────────────────
130
+ fintech / trading → Midnight Profit (dark bg + green/red signals)
131
+ healthcare → Clean Clinic (white/teal, high readability)
132
+ education / kids → Warm Academy (amber/orange, approachable)
133
+ gaming → Neon Arena (dark + electric cyan/magenta)
134
+ ecommerce → Trust Cart (white + amber CTA + forest green)
135
+ saas / dashboard → Slate Precision (slate-900 + blue-500 accents)
136
+ social / community → Gradient Social (slate + violet/fuchsia gradient)
137
+ news / content → Neutral Ink (off-white + near-black, serif-ready)
138
+ productivity / tools → Calm Focus (gray-50 + indigo-700, minimal noise)
139
+ developer tools → Terminal Dark (zinc-950 + emerald-400 mono)
140
+ ```
141
+
142
+ #### Palette Reference
143
+
144
+ ```css
145
+ /* ── PALETTE: Midnight Profit (Fintech/Trading) ─────────────── */
146
+ [data-palette="midnight-profit"][data-theme="dark"] {
147
+ --bg-base: #0c1419;
148
+ --bg-card: #121a20;
149
+ --bg-elevated: #1a2332;
150
+ --text-primary: #ffffff;
151
+ --text-secondary: #a0aeb8;
152
+ --border: #2a3f52;
153
+ --profit: #00d084; /* green — gains */
154
+ --loss: #ff6b6b; /* red — losses */
155
+ --accent: #2196f3;
156
+ /* Colorblind (deuteranopia): profit→#1e88e5, loss→#ffa726 */
157
+ }
158
+ [data-palette="midnight-profit"][data-theme="light"] {
159
+ --bg-base: #faf8f3;
160
+ --bg-card: #f5f0ea;
161
+ --text-primary: #0c1419;
162
+ --text-secondary: #4a5568;
163
+ --border: #d1cfc9;
164
+ --profit: #059669;
165
+ --loss: #dc2626;
166
+ --accent: #1d4ed8;
167
+ }
168
+
169
+ /* ── PALETTE: Clean Clinic (Healthcare) ─────────────────────── */
170
+ [data-palette="clean-clinic"] {
171
+ --bg-base: #f0fafa;
172
+ --bg-card: #ffffff;
173
+ --text-primary: #0d1f2d;
174
+ --text-secondary: #4b6070;
175
+ --border: #c7e8ea;
176
+ --primary: #0891b2; /* cyan-600 */
177
+ --secondary: #0d9488; /* teal-600 */
178
+ --accent: #06b6d4;
179
+ --danger: #ef4444;
180
+ --success: #16a34a;
181
+ }
182
+
183
+ /* ── PALETTE: Slate Precision (SaaS/Dashboard) ───────────────── */
184
+ [data-palette="slate-precision"][data-theme="dark"] {
185
+ --bg-base: #0f172a;
186
+ --bg-card: #1e293b;
187
+ --bg-elevated: #334155;
188
+ --text-primary: #f8fafc;
189
+ --text-secondary: #94a3b8;
190
+ --primary: #3b82f6; /* blue-500 */
191
+ --success: #10b981;
192
+ --danger: #ef4444;
193
+ --warning: #f59e0b;
194
+ }
195
+ [data-palette="slate-precision"][data-theme="light"] {
196
+ --bg-base: #ffffff;
197
+ --bg-card: #f8fafc;
198
+ --bg-elevated: #f1f5f9;
199
+ --text-primary: #0f172a;
200
+ --text-secondary: #475569;
201
+ --primary: #2563eb;
202
+ }
203
+
204
+ /* ── PALETTE: Neon Arena (Gaming) ────────────────────────────── */
205
+ [data-palette="neon-arena"] {
206
+ --bg-base: #080c10;
207
+ --bg-card: #0f1520;
208
+ --text-primary: #e8f4f8;
209
+ --text-secondary: #7a9ab0;
210
+ --primary: #00ffe0; /* electric cyan */
211
+ --secondary: #ff2d78; /* hot magenta */
212
+ --accent: #ffe600; /* warning yellow */
213
+ --border: rgba(0, 255, 224, 0.15);
214
+ }
215
+
216
+ /* ── PALETTE: Trust Cart (Ecommerce) ─────────────────────────── */
217
+ [data-palette="trust-cart"][data-theme="light"] {
218
+ --bg-base: #ffffff;
219
+ --bg-card: #fafafa;
220
+ --text-primary: #111827;
221
+ --text-secondary: #6b7280;
222
+ --cta: #f97316; /* orange-500 — add-to-cart */
223
+ --success: #16a34a; /* forest green — in stock */
224
+ --trust: #1d4ed8; /* blue — secure badge */
225
+ --border: #e5e7eb;
226
+ }
227
+
228
+ /* ── PALETTE: Terminal Dark (Developer Tools) ────────────────── */
229
+ [data-palette="terminal-dark"] {
230
+ --bg-base: #09090b; /* zinc-950 */
231
+ --bg-card: #18181b; /* zinc-900 */
232
+ --bg-elevated: #27272a; /* zinc-800 */
233
+ --text-primary: #fafafa;
234
+ --text-secondary: #a1a1aa;
235
+ --primary: #34d399; /* emerald-400 — code green */
236
+ --accent: #818cf8; /* indigo-400 — links */
237
+ --border: #3f3f46;
238
+ --comment: #71717a;
239
+ }
240
+ ```
241
+
242
+ ```js
243
+ // tailwind.config.js — extending with palette tokens
244
+ /** @type {import('tailwindcss').Config} */
245
+ module.exports = {
246
+ theme: {
247
+ extend: {
248
+ colors: {
249
+ profit: 'var(--profit)',
250
+ loss: 'var(--loss)',
251
+ primary: 'var(--primary)',
252
+ 'bg-base': 'var(--bg-base)',
253
+ 'bg-card': 'var(--bg-card)',
254
+ 'text-primary': 'var(--text-primary)',
255
+ 'text-secondary': 'var(--text-secondary)',
256
+ }
257
+ }
258
+ }
259
+ }
260
+ ```
261
+
262
+ ---
263
+
264
+ ### type-system
265
+
266
+ Typography pairing database — 22 font pairings organized by product vibe. Each pairing includes Google Fonts URL, Tailwind config, size scale from display to caption, weight mapping, and line height ratios. Decision tree maps product type and tone to the right pairing.
267
+
268
+ #### Workflow
269
+
270
+ **Step 1 — Detect product tone**
271
+ Read `CLAUDE.md` or ask: "What is the product tone?" Classify: modern-tech | editorial | playful | corporate | developer | luxury | humanist | brutalist | minimal.
272
+
273
+ **Step 2 — Recommend pairing**
274
+ Apply the decision tree. Output the top 2 pairings with rationale (brand signal, readability score, Google Fonts load weight).
275
+
276
+ **Step 3 — Generate @font-face / config**
277
+ Emit the `<link>` preconnect + stylesheet tag for Google Fonts. Emit Tailwind `fontFamily` config. Emit a CSS type scale (`--text-display` through `--text-caption`).
278
+
279
+ **Step 4 — Verify readability**
280
+ Check: body size ≥ 14px, line-height ≥ 1.5 for body, ≤ 1.25 for headings. Flag any contrast failure using the project's background token.
281
+
282
+ #### Decision Tree
283
+
284
+ ```
285
+ Product Tone → Pairing
286
+ ──────────────────────────────────────────────────────────
287
+ modern tech / saas → Space Grotesk + Inter
288
+ editorial / blog → Playfair Display + Source Serif 4
289
+ playful / kids / app → Fredoka + Nunito
290
+ corporate / enterprise→ IBM Plex Sans + IBM Plex Serif
291
+ developer tools / CLI → JetBrains Mono + Inter
292
+ luxury / fashion → Cormorant Garamond + Montserrat
293
+ humanist / health → DM Sans + DM Serif Display
294
+ brutalist / bold → Bebas Neue + IBM Plex Mono
295
+ minimal / productivity→ Inter + Inter (weight-only hierarchy)
296
+ gaming / esports → Rajdhani + Exo 2
297
+ ```
298
+
299
+ #### Pairing Reference
300
+
301
+ ```html
302
+ <!-- Space Grotesk + Inter (modern-tech / saas) -->
303
+ <link rel="preconnect" href="https://fonts.googleapis.com">
304
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
305
+ <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
306
+
307
+ <!-- Playfair Display + Source Serif 4 (editorial) -->
308
+ <link href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,400&family=Source+Serif+4:wght@400;600&display=swap" rel="stylesheet">
309
+
310
+ <!-- Fredoka + Nunito (playful) -->
311
+ <link href="https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Nunito:wght@400;600&display=swap" rel="stylesheet">
312
+
313
+ <!-- IBM Plex Sans + IBM Plex Serif (corporate) -->
314
+ <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Serif:wght@400;600&display=swap" rel="stylesheet">
315
+
316
+ <!-- JetBrains Mono + Inter (developer tools) -->
317
+ <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
318
+
319
+ <!-- Cormorant Garamond + Montserrat (luxury) -->
320
+ <link href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,600;1,400&family=Montserrat:wght@400;500;700&display=swap" rel="stylesheet">
321
+
322
+ <!-- DM Sans + DM Serif Display (humanist / health) -->
323
+ <link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=DM+Serif+Display&display=swap" rel="stylesheet">
324
+ ```
325
+
326
+ ```css
327
+ /* Type scale — Space Grotesk + Inter pairing */
328
+ :root {
329
+ --font-display: 'Space Grotesk', system-ui, sans-serif;
330
+ --font-body: 'Inter', system-ui, sans-serif;
331
+ --font-mono: 'JetBrains Mono', monospace;
332
+
333
+ /* Scale */
334
+ --text-display: clamp(2.5rem, 5vw, 4.5rem); /* 40–72px */
335
+ --text-h1: clamp(2rem, 4vw, 2.5rem); /* 32–40px */
336
+ --text-h2: clamp(1.375rem, 2.5vw, 1.75rem); /* 22–28px */
337
+ --text-h3: 1.125rem; /* 18px */
338
+ --text-body: 1rem; /* 16px */
339
+ --text-small: 0.875rem; /* 14px */
340
+ --text-caption: 0.75rem; /* 12px */
341
+
342
+ /* Leading */
343
+ --leading-tight: 1.2;
344
+ --leading-snug: 1.35;
345
+ --leading-normal: 1.5;
346
+ --leading-relaxed:1.75;
347
+ }
348
+
349
+ h1, h2, h3 { font-family: var(--font-display); line-height: var(--leading-tight); }
350
+ body { font-family: var(--font-body); line-height: var(--leading-normal); }
351
+ code, pre { font-family: var(--font-mono); }
352
+
353
+ /* Financial numbers — always mono + bold */
354
+ .number, .price, .stat {
355
+ font-family: var(--font-mono);
356
+ font-weight: 700;
357
+ font-variant-numeric: tabular-nums;
358
+ }
359
+ ```
360
+
361
+ ```js
362
+ // tailwind.config.js — font pairing extension
363
+ module.exports = {
364
+ theme: {
365
+ extend: {
366
+ fontFamily: {
367
+ display: ['Space Grotesk', 'system-ui', 'sans-serif'],
368
+ body: ['Inter', 'system-ui', 'sans-serif'],
369
+ mono: ['JetBrains Mono','monospace'],
370
+ },
371
+ fontSize: {
372
+ 'display': ['clamp(2.5rem, 5vw, 4.5rem)', { lineHeight: '1.1' }],
373
+ 'h1': ['clamp(2rem, 4vw, 2.5rem)', { lineHeight: '1.2' }],
374
+ 'h2': ['1.75rem', { lineHeight: '1.3' }],
375
+ 'h3': ['1.125rem', { lineHeight: '1.4' }],
376
+ }
377
+ }
378
+ }
379
+ }
380
+ ```
381
+
382
+ ---
383
+
384
+ ### landing-patterns
385
+
386
+ Landing page section patterns — 12 section archetypes with HTML structure hints, Tailwind classes, responsive rules, and conversion-focused copy guidance. Anti-AI design rules enforced throughout.
387
+
388
+ #### Workflow
389
+
390
+ **Step 1 — Identify page goal**
391
+ Classify: acquisition (email capture / waitlist) | conversion (paid plan) | brand (awareness) | product (feature showcase). Goal determines section priority and CTA placement.
392
+
393
+ **Step 2 — Select section sequence**
394
+ From the section library below, compose a sequence. Recommended base: Hero → Social Proof → Features → How It Works → Testimonials → Pricing → FAQ → CTA Footer. Adjust by goal.
395
+
396
+ **Step 3 — Apply style**
397
+ Pull palette from `palette-picker` and fonts from `type-system`. Apply Anti-AI design rules (see below). Each section gets a distinct visual treatment — do NOT apply the same background/card style to every section.
398
+
399
+ **Step 4 — Responsive audit**
400
+ Every section must work at 375px (mobile), 768px (tablet), 1280px (desktop). Check text wrapping, CTA tap targets (≥ 44px), and image aspect ratios.
401
+
402
+ **Step 5 — Conversion check**
403
+ Verify: primary CTA visible above the fold; social proof within first 2 sections; pricing section has a clear default/recommended plan; FAQ addresses the top 3 objections.
404
+
405
+ #### Section Library
406
+
407
+ ```
408
+ Hero Variants:
409
+ split-hero Left text + right image/video. NOT centered formula.
410
+ asymmetric-hero 60/40 split. Offset grid. Works for SaaS.
411
+ cinematic-hero Full-bleed video/image background. Text overlay. Gaming / brand.
412
+
413
+ Social Proof:
414
+ logo-strip Horizontal scrolling logos. Grayscale → color on hover.
415
+ stats-bar 3–4 large numbers (e.g., "12,000+ teams"). Mono font.
416
+ testimonial-grid Asymmetric card sizes. NOT uniform grid.
417
+ quote-hero Single large pull-quote with avatar. Editorial feel.
418
+
419
+ Features:
420
+ bento-grid Mixed-size cards. Large hero card + smaller supporting.
421
+ alternating-rows Icon + text, alternating left/right. Classic but effective.
422
+ feature-tabs Tab navigation for feature groups. Reduces scroll length.
423
+
424
+ Conversion:
425
+ pricing-toggle Monthly / annual toggle. Recommended tier visually elevated.
426
+ pricing-comparison Feature matrix table. Clear checkmarks, no feature bloat.
427
+ cta-split Left: value reminder. Right: form or button. High conversion.
428
+ floating-cta Sticky bar at bottom on mobile. Dismissable.
429
+
430
+ Discovery:
431
+ faq-accordion Expandable Q&A. Addresses objections in copy, not just features.
432
+ how-it-works 3-step numbered sequence. Icon per step. Progress line optional.
433
+ waitlist-capture Email input + social proof count. ("Join 3,200 on waitlist")
434
+ ```
435
+
436
+ #### Example — Split Hero (Anti-AI compliant)
437
+
438
+ ```tsx
439
+ // ANTI-AI RULES APPLIED:
440
+ // ✅ Split layout — NOT centered hero formula
441
+ // ✅ Custom brand color — NOT default indigo/violet
442
+ // ✅ Phosphor Icons — NOT Lucide
443
+ // ✅ Asymmetric layout — NOT uniform sections
444
+ // ✅ No gradient blob
445
+
446
+ import { ArrowRight, CheckCircle } from '@phosphor-icons/react'
447
+
448
+ export function SplitHero() {
449
+ return (
450
+ <section className="min-h-screen grid lg:grid-cols-[1fr_1.2fr] items-center gap-0">
451
+ {/* Left — copy */}
452
+ <div className="px-8 py-20 lg:px-16 lg:py-0 max-w-xl">
453
+ <span className="inline-flex items-center gap-2 text-sm font-medium text-[var(--primary)] mb-6">
454
+ <CheckCircle weight="fill" size={16} aria-hidden="true" />
455
+ Now in public beta
456
+ </span>
457
+ <h1 className="font-display text-h1 font-bold text-[var(--text-primary)] mb-6 leading-tight">
458
+ Shipping fast starts<br />
459
+ <em className="not-italic text-[var(--primary)]">before the sprint</em>
460
+ </h1>
461
+ <p className="text-[var(--text-secondary)] text-body leading-relaxed mb-8 max-w-md">
462
+ Rune wires your AI coding assistant to a mesh of 55 skills so you spend time building, not prompting.
463
+ </p>
464
+ <div className="flex flex-wrap gap-3">
465
+ <a
466
+ href="/signup"
467
+ className="inline-flex items-center gap-2 px-6 py-3 rounded-lg bg-[var(--primary)] text-white font-semibold text-sm hover:opacity-90 transition-opacity focus-visible:ring-2 focus-visible:ring-[var(--primary)] focus-visible:ring-offset-2"
468
+ >
469
+ Get started free
470
+ <ArrowRight size={16} aria-hidden="true" />
471
+ </a>
472
+ <a
473
+ href="/docs"
474
+ className="inline-flex items-center gap-2 px-6 py-3 rounded-lg border border-[var(--border)] text-[var(--text-primary)] font-semibold text-sm hover:bg-[var(--bg-card)] transition-colors"
475
+ >
476
+ Read the docs
477
+ </a>
478
+ </div>
479
+ </div>
480
+
481
+ {/* Right — visual (product screenshot or illustration) */}
482
+ <div className="relative h-full min-h-[60vh] bg-[var(--bg-card)] overflow-hidden">
483
+ {/* Replace with actual product screenshot */}
484
+ <div className="absolute inset-0 flex items-center justify-center text-[var(--text-secondary)]">
485
+ Product visual
486
+ </div>
487
+ </div>
488
+ </section>
489
+ )
490
+ }
491
+ ```
492
+
493
+ #### Example — Bento Grid Features
494
+
495
+ ```tsx
496
+ // Bento: asymmetric sizing breaks the uniform grid anti-pattern
497
+ export function BentoFeatures() {
498
+ return (
499
+ <section className="py-24 px-6">
500
+ <div className="max-w-5xl mx-auto">
501
+ <h2 className="font-display text-h2 font-semibold text-[var(--text-primary)] mb-12 text-center">
502
+ One mesh. Every workflow.
503
+ </h2>
504
+ {/* Intentionally unequal grid — NOT uniform cards */}
505
+ <div className="grid grid-cols-2 lg:grid-cols-3 gap-4 auto-rows-[200px]">
506
+ {/* Hero card — spans 2 cols × 2 rows */}
507
+ <div className="col-span-2 row-span-2 rounded-xl bg-[var(--bg-card)] border border-[var(--border)] p-8 flex flex-col justify-end">
508
+ <p className="text-xs font-medium text-[var(--primary)] mb-2 uppercase tracking-wide">Orchestration</p>
509
+ <h3 className="text-xl font-bold text-[var(--text-primary)] mb-2">cook — your AI project manager</h3>
510
+ <p className="text-sm text-[var(--text-secondary)]">Phases your work, delegates to the right skill, and escalates when stuck.</p>
511
+ </div>
512
+ {/* Small cards fill remaining cells */}
513
+ <div className="rounded-xl bg-[var(--bg-card)] border border-[var(--border)] p-6 flex flex-col justify-between">
514
+ <p className="text-xs font-medium text-[var(--text-secondary)] uppercase tracking-wide">55 Skills</p>
515
+ <p className="text-2xl font-bold font-mono text-[var(--text-primary)]">5 layers</p>
516
+ </div>
517
+ <div className="rounded-xl bg-[var(--bg-card)] border border-[var(--border)] p-6">
518
+ <p className="text-xs font-medium text-[var(--text-secondary)] uppercase tracking-wide mb-2">Platforms</p>
519
+ <p className="text-sm text-[var(--text-primary)]">Claude Code · Cursor · Windsurf · Antigravity</p>
520
+ </div>
521
+ <div className="col-span-2 rounded-xl bg-[var(--bg-card)] border border-[var(--border)] p-6">
522
+ <p className="text-xs font-medium text-[var(--text-secondary)] uppercase tracking-wide mb-2">Open source</p>
523
+ <p className="text-sm text-[var(--text-primary)]">MIT license. Self-host or install in 30 seconds.</p>
524
+ </div>
525
+ </div>
526
+ </div>
527
+ </section>
528
+ )
529
+ }
530
+ ```
531
+
532
+ ---
533
+
534
+ ### design-decision
535
+
536
+ Product domain → style mapping. Given a product category, outputs a complete design recommendation: visual style, palette, typography pairing, component aesthetic, and a `design-system.md` scaffold. Bridges the gap between "I need to build a UI" and "I know exactly what it should look like."
537
+
538
+ #### Workflow
539
+
540
+ **Step 1 — Classify product domain**
541
+ Read `CLAUDE.md`, `README.md`, or ask: "What problem does this product solve? Who uses it?" Map to one of the 9 domains below.
542
+
543
+ **Step 2 — Recommend style stack**
544
+ Apply the domain → style matrix. Output: visual style name, palette slug, typography pairing, component aesthetic, and 3 reference patterns to avoid ("do NOT do X").
545
+
546
+ **Step 3 — Generate design-system.md**
547
+ Emit a `design-system.md` file in the project root (or `.rune/`) with: color tokens (CSS custom properties), font pairing (Google Fonts link), spacing scale, component aesthetic rules, and anti-patterns for this domain.
548
+
549
+ #### Domain → Style Matrix
550
+
551
+ ```
552
+ Domain Style Palette Typography Component Aesthetic
553
+ ─────────────────────────────────────────────────────────────────────────────────────────────
554
+ Fintech/Trading Dark + Precision midnight-profit Space Grotesk+Mono Dense tables, data overlays
555
+ Healthcare Clean + Calm clean-clinic DM Sans+DM Serif Rounded, soft, spacious
556
+ Education Warm + Friendly warm-academy* Fredoka+Nunito Illustrated, playful cards
557
+ Gaming Dark + Neon neon-arena Rajdhani+Exo 2 Hard edges, glow effects
558
+ Ecommerce Trust + Focused trust-cart Inter+Inter Product-first, clean CTA
559
+ SaaS/Dashboard Precision + Flex slate-precision Space Grotesk+Inter Data-dense, sidebar nav
560
+ Social/Community Vibrant + Engaged gradient-social* Inter+Inter Avatar-heavy, reaction UX
561
+ News/Content Readable + Neutral neutral-ink* Playfair+Source Serif Wide columns, drop caps
562
+ Productivity Minimal + Calm calm-focus* Inter+Inter (weight) Almost no decoration
563
+ DevTools Terminal + Crisp terminal-dark JetBrains Mono+Inter Code blocks, mono emphasis
564
+
565
+ * Palette not shown in palette-picker example block — generate with same CSS custom props pattern.
566
+ ```
567
+
568
+ #### Style Characteristic Reference
569
+
570
+ ```
571
+ glassmorphism When: premium SaaS landing, dark bg hero. Avoid: dense data tables (illegible).
572
+ CSS: background: rgba(255,255,255,0.05); backdrop-filter: blur(12px);
573
+ border: 1px solid rgba(255,255,255,0.1); border-radius: 16px;
574
+
575
+ neubrutalism When: bold brand statement, startup, creative tool. Avoid: healthcare, finance.
576
+ CSS: border: 2px solid #000; box-shadow: 4px 4px 0 #000;
577
+ background: #ffe600; (or other saturated fill)
578
+
579
+ claymorphism When: education, kids, consumer apps. Avoid: enterprise, B2B data tools.
580
+ CSS: border-radius: 20px; box-shadow: 0 8px 0 rgba(0,0,0,0.15),
581
+ inset 0 -4px 0 rgba(0,0,0,0.1); (inflated, soft look)
582
+
583
+ aurora/gradient When: landing page hero ONLY, used sparingly. AVOID as overall theme.
584
+ CSS: background: conic-gradient(from 180deg at 50% 50%, ...); opacity: 0.15;
585
+ (subtle, behind content — never the main visual)
586
+
587
+ flat/minimal When: productivity, devtools, content. Best default for B2B SaaS.
588
+ CSS: No shadows except --shadow-sm. Single accent color. Whitespace-heavy.
589
+
590
+ dark-precision When: fintech, devtools, monitoring. Default dark bg with high-contrast accents.
591
+ CSS: bg #0f172a or darker; mono fonts for data; green/red semantic signals.
592
+ ```
593
+
594
+ #### Example — Generated design-system.md
595
+
596
+ ```markdown
597
+ # Design System: [Product Name]
598
+
599
+ ## Domain
600
+ SaaS Dashboard — B2B productivity tool for engineering teams
601
+
602
+ ## Visual Style
603
+ Flat/Minimal with Slate Precision palette. Dark mode default.
604
+ Do NOT use gradient blobs, glassmorphism panels, or Lucide icons.
605
+
606
+ ## Color Tokens
607
+ [→ See palette.css — generated by palette-picker, slate-precision]
608
+
609
+ ## Typography
610
+ Pairing: Space Grotesk (headings, 600–700) + Inter (body, 400–500)
611
+ [→ See Google Fonts link in type-system output]
612
+
613
+ ## Component Rules
614
+ - Cards: bg-card + border border-[var(--border)] + rounded-lg. NO drop shadows on cards.
615
+ - Buttons: primary = bg-primary text-white. ghost = border + transparent bg.
616
+ - Icons: Phosphor Icons only. Weight: regular for UI, fill for status indicators.
617
+ - Data tables: zebra stripe with bg-elevated on odd rows. Mono font for numbers.
618
+
619
+ ## Anti-Patterns for This Domain
620
+ - No centered hero with 2-button CTA
621
+ - No gradient backgrounds
622
+ - No uniform card grid (vary card sizes by content importance)
623
+ ```
624
+
625
+ ---
626
+
627
+ ### component-patterns
628
+
629
+ Component architecture patterns — compound components, render props, composition, slots. Detects prop-heavy components and guides refactoring toward composable, maintainable architectures.
630
+
631
+ #### Workflow
632
+
633
+ **Step 1 — Detect prop-heavy components**
634
+ Use Grep to find component signatures with more than 8 props (`interface \w+Props \{` then count fields, or scan function parameter lists). Read each flagged file to understand the component's responsibilities.
635
+
636
+ **Step 2 — Classify and suggest pattern**
637
+ For each flagged component, classify by smell: boolean-flag hell → compound component; render logic branching → render props or slots; deeply nested data → context + provider. Output a refactor plan with the specific pattern to apply.
638
+
639
+ **Step 3 — Emit refactored scaffold**
640
+ Write the refactored component skeleton following the compound component pattern. Do not overwrite the original — emit to a `*.refactored.tsx` file for review.
641
+
642
+ **Step 4 — Composition vs inheritance + slot patterns**
643
+ After structural refactor, audit for slot opportunities (Svelte `<slot>`, Vue `v-slot`, React `children` with typed slots). Enforce: prefer composition (pass components as props) over inheritance (extend base class). Flag any `extends React.Component` or class-based patterns for migration.
644
+
645
+ #### Example
646
+
647
+ ```tsx
648
+ // BEFORE: prop-heavy (9 props, hard to extend)
649
+ <Modal title="..." open footer actions size variant onClose onConfirm loading />
650
+
651
+ // AFTER: compound component pattern
652
+ <Modal open onClose={handleClose}>
653
+ <Modal.Header>Confirm Action</Modal.Header>
654
+ <Modal.Body>Are you sure?</Modal.Body>
655
+ <Modal.Footer>
656
+ <Button variant="ghost" onClick={handleClose}>Cancel</Button>
657
+ <Button variant="primary" loading={isLoading} onClick={handleConfirm}>
658
+ Confirm
659
+ </Button>
660
+ </Modal.Footer>
661
+ </Modal>
662
+ ```
663
+
664
+ ```tsx
665
+ // Svelte slot pattern — composition over prop drilling
666
+ // Caller decides what goes in header/footer, component owns layout
667
+ <Card>
668
+ <svelte:fragment slot="header">
669
+ <h3 class="text-h3 font-semibold">Usage this month</h3>
670
+ </svelte:fragment>
671
+
672
+ <MetricChart data={usage} />
673
+
674
+ <svelte:fragment slot="footer">
675
+ <a href="/billing" class="text-sm text-[var(--primary)]">View invoice</a>
676
+ </svelte:fragment>
677
+ </Card>
678
+ ```
679
+
680
+ ```tsx
681
+ // React typed children slots via discriminated union
682
+ type ModalSlot = { as: 'header' | 'body' | 'footer'; children: React.ReactNode }
683
+
684
+ function resolveSlots(children: React.ReactNode) {
685
+ const slots: Record<string, React.ReactNode> = {}
686
+ React.Children.forEach(children, (child) => {
687
+ if (React.isValidElement<ModalSlot>(child) && child.props.as) {
688
+ slots[child.props.as] = child.props.children
689
+ }
690
+ })
691
+ return slots
692
+ }
693
+ ```
694
+
695
+ ---
696
+
697
+ ### a11y-audit
698
+
699
+ Accessibility audit beyond automated tools. Checks WCAG 2.1 AA compliance — focus management, screen reader compatibility, color contrast, ARIA patterns, keyboard navigation, focus traps, and skip navigation.
700
+
701
+ #### Workflow
702
+
703
+ **Step 1 — Automated scan**
704
+ Run `Bash: npx axe-core-cli <url> --reporter json` to capture all automated violations. Parse the JSON output and group by impact: critical → serious → moderate → minor.
705
+
706
+ **Step 2 — Manual WCAG 2.1 AA review**
707
+ Use Grep to find `onClick` on non-button elements (missing keyboard support), `<img` without `alt`, `aria-label` absence on icon-only buttons, and `outline: none` without a focus-visible replacement. Read flagged files and annotate each violation with the WCAG criterion it breaks.
708
+
709
+ **Step 3 — Emit audit report**
710
+ Produce a structured report: automated violations (count by impact), manual violations (file + line + fix), contrast ratios for brand colors (pass/fail at AA). Include a prioritized fix list.
711
+
712
+ **Step 4 — Focus trap audit + skip nav**
713
+ Scan for `Dialog`, `Modal`, `Drawer`, `Popover` components. Verify each has: a focus trap on open (`focus-trap-react` or `aria-modal`), returns focus to trigger on close, has an `aria-labelledby` referencing its title. Also check: first `<a>` in `<body>` is a "Skip to main content" link visible on focus (WCAG 2.4.1).
714
+
715
+ #### Example
716
+
717
+ ```tsx
718
+ // VIOLATION: icon button with no accessible name
719
+ <button onClick={handleClose}>
720
+ <XIcon />
721
+ </button>
722
+
723
+ // FIX: add aria-label; icon is decorative
724
+ <button onClick={handleClose} aria-label="Close dialog">
725
+ <XIcon aria-hidden="true" />
726
+ </button>
727
+
728
+ // VIOLATION: div acting as button (no keyboard, no role)
729
+ <div onClick={handleSubmit}>Submit</div>
730
+
731
+ // FIX: use semantic element
732
+ <button type="button" onClick={handleSubmit}>Submit</button>
733
+ ```
734
+
735
+ ```tsx
736
+ // Focus trap pattern for modals (using focus-trap-react)
737
+ import FocusTrap from 'focus-trap-react'
738
+
739
+ export function Dialog({ open, onClose, title, children }: DialogProps) {
740
+ return open ? (
741
+ <FocusTrap focusTrapOptions={{ onDeactivate: onClose }}>
742
+ <div
743
+ role="dialog"
744
+ aria-modal="true"
745
+ aria-labelledby="dialog-title"
746
+ className="fixed inset-0 z-50 flex items-center justify-center"
747
+ >
748
+ <div className="bg-[var(--bg-card)] rounded-xl p-6 max-w-md w-full shadow-lg">
749
+ <h2 id="dialog-title" className="text-h3 font-semibold mb-4">{title}</h2>
750
+ {children}
751
+ <button
752
+ onClick={onClose}
753
+ aria-label="Close dialog"
754
+ className="absolute top-4 right-4 focus-visible:ring-2 focus-visible:ring-[var(--primary)]"
755
+ >
756
+ <X aria-hidden="true" />
757
+ </button>
758
+ </div>
759
+ </div>
760
+ </FocusTrap>
761
+ ) : null
762
+ }
763
+ ```
764
+
765
+ ```html
766
+ <!-- Skip navigation link — must be FIRST focusable element in <body> -->
767
+ <a
768
+ href="#main-content"
769
+ class="
770
+ sr-only focus:not-sr-only
771
+ fixed top-4 left-4 z-[9999]
772
+ px-4 py-2 rounded-md
773
+ bg-[var(--primary)] text-white font-semibold text-sm
774
+ focus-visible:ring-2 focus-visible:ring-offset-2
775
+ "
776
+ >
777
+ Skip to main content
778
+ </a>
779
+ ```
780
+
781
+ ---
782
+
783
+ ### animation-patterns
784
+
785
+ Motion design patterns — micro-interactions, page transitions, scroll animations, loading states. Applies CSS transitions, Framer Motion, or GSAP based on project stack. Always respects `prefers-reduced-motion`.
786
+
787
+ #### Workflow
788
+
789
+ **Step 1 — Detect interaction points**
790
+ Use Grep to find hover handlers (`onMouseEnter`, `:hover`), route changes (Next.js `useRouter`, SvelteKit `goto`), and loading states (`isLoading`, `isPending`). Read component files to understand where motion can add feedback or polish.
791
+
792
+ **Step 2 — Apply micro-interactions**
793
+ For each interaction point, select the appropriate pattern: hover → scale + shadow lift; button click → press-down (scale 0.97); data load → skeleton pulse then fade-in; route change → slide or fade transition. Emit the updated component with motion classes or Framer Motion variants.
794
+
795
+ **Step 3 — Audit reduced-motion compliance**
796
+ Use Grep to find every animation/transition declaration. Verify each is wrapped in a `prefers-reduced-motion: no-preference` media query or uses Framer Motion's `useReducedMotion()` hook. Flag any that are not.
797
+
798
+ **Step 4 — Page transition patterns**
799
+ Apply View Transitions API for same-document navigations (SvelteKit, Astro, vanilla JS). For React/Next.js, use Framer Motion `AnimatePresence` + `layoutId` for shared layout animations. Emit transition wrapper component with both strategies.
800
+
801
+ #### Example
802
+
803
+ ```tsx
804
+ // Tailwind micro-interaction with reduced-motion respect
805
+ <button
806
+ className="
807
+ transform transition-all duration-200 ease-out
808
+ hover:scale-105 hover:shadow-md
809
+ active:scale-95
810
+ motion-reduce:transform-none motion-reduce:transition-none
811
+ "
812
+ >
813
+ Confirm
814
+ </button>
815
+
816
+ // Framer Motion with reduced-motion hook
817
+ const prefersReduced = useReducedMotion()
818
+
819
+ <motion.div
820
+ initial={{ opacity: 0, y: prefersReduced ? 0 : 16 }}
821
+ animate={{ opacity: 1, y: 0 }}
822
+ transition={{ duration: prefersReduced ? 0 : 0.25 }}
823
+ />
824
+ ```
825
+
826
+ ```tsx
827
+ // Shared layout animation — card expands to modal (Framer Motion)
828
+ // Works because both use the same layoutId="card-{id}"
829
+ function CardGrid({ items }: { items: Item[] }) {
830
+ const [selected, setSelected] = useState<string | null>(null)
831
+ return (
832
+ <>
833
+ {items.map((item) => (
834
+ <motion.div
835
+ key={item.id}
836
+ layoutId={`card-${item.id}`}
837
+ onClick={() => setSelected(item.id)}
838
+ className="rounded-xl bg-[var(--bg-card)] border border-[var(--border)] cursor-pointer"
839
+ >
840
+ <motion.h3 layoutId={`title-${item.id}`}>{item.title}</motion.h3>
841
+ </motion.div>
842
+ ))}
843
+
844
+ <AnimatePresence>
845
+ {selected && (
846
+ <motion.div
847
+ layoutId={`card-${selected}`}
848
+ className="fixed inset-8 z-50 rounded-2xl bg-[var(--bg-card)] p-8"
849
+ >
850
+ <motion.h3 layoutId={`title-${selected}`} className="text-h2 font-bold">
851
+ {items.find(i => i.id === selected)?.title}
852
+ </motion.h3>
853
+ <button onClick={() => setSelected(null)} aria-label="Close">
854
+ <X aria-hidden="true" />
855
+ </button>
856
+ </motion.div>
857
+ )}
858
+ </AnimatePresence>
859
+ </>
860
+ )
861
+ }
862
+ ```
863
+
864
+ ```css
865
+ /* View Transitions API — SvelteKit / Astro page transitions */
866
+ /* In app.css or global stylesheet */
867
+ @media (prefers-reduced-motion: no-preference) {
868
+ ::view-transition-old(root) {
869
+ animation: 200ms ease-out both fade-out;
870
+ }
871
+ ::view-transition-new(root) {
872
+ animation: 250ms ease-in both fade-in;
873
+ }
874
+ }
875
+
876
+ @keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
877
+ @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
878
+
879
+ /* SvelteKit: enable in svelte.config.js → experimental: { viewTransitions: true } */
880
+ ```
881
+
882
+ ---
883
+
884
+ ## Connections
885
+
886
+ ```
887
+ Calls → asset-creator (L3): generate design assets (icons, illustrations)
888
+ Calls → design (L2): escalate when full design review is needed
889
+ Called By ← review (L2): when UI code is being reviewed
890
+ Called By ← cook (L1): when frontend task detected
891
+ Called By ← launch (L1): pre-launch UI quality gate
892
+ Called By ← scaffold (L1): when bootstrapping a new frontend project
893
+ design-decision → palette-picker: feeds palette slug to token generation
894
+ design-decision → type-system: feeds pairing name to font config generation
895
+ landing-patterns → palette-picker: pulls palette for section styling
896
+ landing-patterns → type-system: pulls font pairing for section copy
897
+ ```
898
+
899
+ ## Tech Stack Support
900
+
901
+ | Framework | Styling | Components | Motion |
902
+ |--------------|--------------------|---------------|---------------------|
903
+ | React 19 | TailwindCSS 4 | shadcn/ui | Framer Motion |
904
+ | Next.js 16 | CSS Custom Props | Radix UI | Framer Motion |
905
+ | SvelteKit 5 | CSS Custom Props | Custom | View Transitions API|
906
+ | Vue 3 | TailwindCSS 4 | Headless UI | Vue Transitions |
907
+ | Astro 5 | TailwindCSS 4 | Astro Islands | View Transitions API|
908
+
909
+ ## Constraints
910
+
911
+ 1. MUST respect `prefers-reduced-motion` on every animation — no exceptions.
912
+ 2. MUST NOT overwrite original component files during refactor — emit to `*.refactored.tsx` or provide a diff.
913
+ 3. MUST target WCAG 2.1 AA as the minimum bar for all a11y recommendations (AAA where feasible).
914
+ 4. MUST use project's existing stack (detect from `package.json`) before suggesting new dependencies.
915
+ 5. MUST enforce Anti-AI design rules: no gradient blobs, no default indigo, Phosphor Icons not Lucide, no uniform card grids.
916
+ 6. MUST use Google Fonts CDN only for external font loading — no other external font services.
917
+ 7. Color palettes MUST include colorblind-safe alternatives (deuteranopia minimum).
918
+
919
+ ## Sharp Edges
920
+
921
+ | Failure Mode | Severity | Mitigation |
922
+ |---|---|---|
923
+ | Token generation produces semantic tokens without primitives, causing theme switching to break | HIGH | Always emit 3-layer token structure: primitive → semantic → component |
924
+ | Compound component refactor breaks controlled state (open/value props lost) | HIGH | Audit for controlled vs uncontrolled patterns before emitting scaffold |
925
+ | axe-core misses ARIA live region issues and dynamic content violations | MEDIUM | Supplement automated scan with manual Grep for `setState`/store updates that modify visible content |
926
+ | Framer Motion animations ship without `useReducedMotion` check | HIGH | Grep for `motion.` usage post-edit; flag any missing the hook |
927
+ | Design token enforcement flags third-party library hardcoded values | LOW | Scope Grep to `src/` only; exclude `node_modules` and generated files |
928
+ | palette-picker recommends palette without contrast verification | HIGH | Always run contrast check in Step 4 before emitting palette.css |
929
+ | type-system recommends decorative font for body copy (Cormorant at 14px) | MEDIUM | Flag any pairing where body font is display/serif — warn readability at small sizes |
930
+ | landing-patterns emits centered hero formula (the anti-pattern) | HIGH | Enforce split-hero or asymmetric-hero as defaults; centered-hero requires explicit opt-in |
931
+ | design-decision recommends glassmorphism for data-dense dashboard | MEDIUM | Block glassmorphism recommendation when product domain is fintech, devtools, or productivity |
932
+ | Focus trap missing on modal — keyboard users trapped in page behind overlay | CRITICAL | a11y-audit Step 4 must scan all Dialog/Modal/Drawer/Popover components before audit closes |
933
+
934
+ ## Done When
935
+
936
+ - Token file generated with 3-layer structure; hardcoded values replaced or flagged with diffs; dark/light theme switcher emitted
937
+ - Palette selected, CSS custom properties emitted, contrast ratios verified (≥ 4.5:1 body, ≥ 3:1 large text), colorblind alternatives noted
938
+ - Font pairing selected, Google Fonts link emitted, Tailwind fontFamily config emitted, type scale CSS variables written
939
+ - Component refactor scaffold emitted; original files untouched; slot patterns applied where applicable
940
+ - Landing section sequence composed; Anti-AI rules verified; responsive audit at 375/768/1280px complete; conversion checklist passed
941
+ - Design system .md generated with color, typography, component, and anti-pattern rules for the product domain
942
+ - Axe-core scan shows zero critical/serious violations; focus trap audit complete; skip nav link present
943
+ - All animations pass `prefers-reduced-motion` audit; page transition pattern implemented
944
+
945
+ ## Cost Profile
946
+
947
+ ~18,000–28,000 tokens per full pack run (all 8 skills). Individual skill: ~2,000–4,500 tokens. Sonnet default. Use haiku for detection scans (Step 1 of each skill); escalate to sonnet for generation, refactoring, and report writing. Use `design-decision` first when starting a new project — it reduces token cost of subsequent skills by pre-scoping palette and typography choices.