@rune-kit/rune 2.10.0 → 2.12.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 (240) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +65 -6
  3. package/commands/rune.md +168 -168
  4. package/compiler/__tests__/detect-invariants.test.js +136 -0
  5. package/compiler/__tests__/doctor-mesh.test.js +229 -0
  6. package/compiler/__tests__/hook-dispatch.test.js +91 -0
  7. package/compiler/__tests__/hooks-antigravity.test.js +118 -0
  8. package/compiler/__tests__/hooks-cursor.test.js +139 -0
  9. package/compiler/__tests__/hooks-install.test.js +305 -0
  10. package/compiler/__tests__/hooks-merge.test.js +204 -0
  11. package/compiler/__tests__/hooks-tiers.test.js +519 -0
  12. package/compiler/__tests__/hooks-windsurf.test.js +115 -0
  13. package/compiler/__tests__/inject-claude-md.test.js +152 -0
  14. package/compiler/__tests__/load-invariants.test.js +408 -0
  15. package/compiler/__tests__/onboard-invariants.test.js +240 -0
  16. package/compiler/adapters/hooks/antigravity.js +140 -0
  17. package/compiler/adapters/hooks/claude.js +166 -0
  18. package/compiler/adapters/hooks/cursor.js +191 -0
  19. package/compiler/adapters/hooks/index.js +82 -0
  20. package/compiler/adapters/hooks/tier-emitter.js +182 -0
  21. package/compiler/adapters/hooks/windsurf.js +202 -0
  22. package/compiler/bin/rune.js +196 -6
  23. package/compiler/commands/hook-dispatch.js +87 -0
  24. package/compiler/commands/hooks/install.js +120 -0
  25. package/compiler/commands/hooks/merge.js +211 -0
  26. package/compiler/commands/hooks/presets.js +116 -0
  27. package/compiler/commands/hooks/status.js +112 -0
  28. package/compiler/commands/hooks/tiers.js +221 -0
  29. package/compiler/commands/hooks/uninstall.js +94 -0
  30. package/compiler/doctor.js +236 -0
  31. package/contexts/dev.md +34 -34
  32. package/contexts/research.md +43 -43
  33. package/contexts/review.md +55 -55
  34. package/extensions/ai-ml/PACK.md +88 -88
  35. package/extensions/ai-ml/skills/ai-agents.md +172 -172
  36. package/extensions/ai-ml/skills/code-sandbox.md +187 -187
  37. package/extensions/ai-ml/skills/deep-research.md +146 -146
  38. package/extensions/ai-ml/skills/embedding-search.md +66 -66
  39. package/extensions/ai-ml/skills/fine-tuning-guide.md +74 -74
  40. package/extensions/ai-ml/skills/llm-architect.md +125 -125
  41. package/extensions/ai-ml/skills/llm-integration.md +64 -64
  42. package/extensions/ai-ml/skills/prompt-patterns.md +72 -72
  43. package/extensions/ai-ml/skills/rag-patterns.md +66 -66
  44. package/extensions/ai-ml/skills/web-extraction.md +114 -114
  45. package/extensions/analytics/PACK.md +92 -92
  46. package/extensions/analytics/skills/ab-testing.md +72 -72
  47. package/extensions/analytics/skills/dashboard-patterns.md +83 -83
  48. package/extensions/analytics/skills/data-validation.md +68 -68
  49. package/extensions/analytics/skills/funnel-analysis.md +81 -81
  50. package/extensions/analytics/skills/sql-patterns.md +57 -57
  51. package/extensions/analytics/skills/statistical-analysis.md +79 -79
  52. package/extensions/analytics/skills/tracking-setup.md +71 -71
  53. package/extensions/backend/PACK.md +104 -104
  54. package/extensions/backend/skills/api-patterns.md +84 -84
  55. package/extensions/backend/skills/async-pipeline.md +193 -193
  56. package/extensions/backend/skills/auth-patterns.md +97 -97
  57. package/extensions/backend/skills/background-jobs.md +133 -133
  58. package/extensions/backend/skills/caching-patterns.md +108 -108
  59. package/extensions/backend/skills/cli-generation.md +133 -133
  60. package/extensions/backend/skills/database-patterns.md +87 -87
  61. package/extensions/backend/skills/middleware-patterns.md +104 -104
  62. package/extensions/chrome-ext/PACK.md +93 -93
  63. package/extensions/chrome-ext/skills/cws-preflight.md +143 -143
  64. package/extensions/chrome-ext/skills/cws-publish.md +104 -104
  65. package/extensions/chrome-ext/skills/ext-ai-integration.md +251 -251
  66. package/extensions/chrome-ext/skills/ext-messaging.md +139 -139
  67. package/extensions/chrome-ext/skills/ext-storage.md +133 -133
  68. package/extensions/chrome-ext/skills/mv3-scaffold.md +164 -164
  69. package/extensions/content/PACK.md +96 -96
  70. package/extensions/content/skills/blog-patterns.md +88 -88
  71. package/extensions/content/skills/cms-integration.md +131 -131
  72. package/extensions/content/skills/content-scoring.md +107 -107
  73. package/extensions/content/skills/i18n.md +83 -83
  74. package/extensions/content/skills/mdx-authoring.md +137 -137
  75. package/extensions/content/skills/reference.md +1014 -1014
  76. package/extensions/content/skills/seo-patterns.md +67 -67
  77. package/extensions/content/skills/video-repurpose.md +153 -153
  78. package/extensions/devops/PACK.md +101 -101
  79. package/extensions/devops/skills/chaos-testing.md +67 -67
  80. package/extensions/devops/skills/ci-cd.md +75 -75
  81. package/extensions/devops/skills/docker.md +58 -58
  82. package/extensions/devops/skills/edge-serverless.md +163 -163
  83. package/extensions/devops/skills/infra-as-code.md +158 -158
  84. package/extensions/devops/skills/kubernetes.md +110 -110
  85. package/extensions/devops/skills/monitoring.md +57 -57
  86. package/extensions/devops/skills/server-setup.md +64 -64
  87. package/extensions/devops/skills/ssl-domain.md +42 -42
  88. package/extensions/ecommerce/PACK.md +116 -116
  89. package/extensions/ecommerce/skills/cart-system.md +79 -79
  90. package/extensions/ecommerce/skills/inventory-mgmt.md +102 -102
  91. package/extensions/ecommerce/skills/order-management.md +126 -126
  92. package/extensions/ecommerce/skills/payment-integration.md +472 -472
  93. package/extensions/ecommerce/skills/shopify-dev.md +69 -69
  94. package/extensions/ecommerce/skills/subscription-billing.md +93 -93
  95. package/extensions/ecommerce/skills/tax-compliance.md +117 -117
  96. package/extensions/gamedev/PACK.md +142 -142
  97. package/extensions/gamedev/skills/asset-pipeline.md +74 -74
  98. package/extensions/gamedev/skills/audio-system.md +129 -129
  99. package/extensions/gamedev/skills/camera-system.md +87 -87
  100. package/extensions/gamedev/skills/ecs.md +98 -98
  101. package/extensions/gamedev/skills/game-loops.md +72 -72
  102. package/extensions/gamedev/skills/input-system.md +199 -199
  103. package/extensions/gamedev/skills/multiplayer.md +180 -180
  104. package/extensions/gamedev/skills/particles.md +105 -105
  105. package/extensions/gamedev/skills/physics-engine.md +89 -89
  106. package/extensions/gamedev/skills/scene-management.md +146 -146
  107. package/extensions/gamedev/skills/threejs-patterns.md +90 -90
  108. package/extensions/gamedev/skills/webgl.md +71 -71
  109. package/extensions/mobile/PACK.md +106 -106
  110. package/extensions/mobile/skills/app-store-connect.md +152 -152
  111. package/extensions/mobile/skills/app-store-prep.md +66 -66
  112. package/extensions/mobile/skills/deep-linking.md +109 -109
  113. package/extensions/mobile/skills/flutter.md +60 -60
  114. package/extensions/mobile/skills/ios-build-pipeline.md +142 -142
  115. package/extensions/mobile/skills/native-bridge.md +66 -66
  116. package/extensions/mobile/skills/ota-updates.md +97 -97
  117. package/extensions/mobile/skills/push-notifications.md +111 -111
  118. package/extensions/mobile/skills/react-native.md +82 -82
  119. package/extensions/saas/PACK.md +116 -116
  120. package/extensions/saas/skills/billing-integration.md +200 -200
  121. package/extensions/saas/skills/feature-flags.md +130 -130
  122. package/extensions/saas/skills/multi-tenant.md +103 -103
  123. package/extensions/saas/skills/onboarding-flow.md +139 -139
  124. package/extensions/saas/skills/subscription-flow.md +95 -95
  125. package/extensions/saas/skills/team-management.md +144 -144
  126. package/extensions/security/PACK.md +99 -99
  127. package/extensions/security/skills/api-security.md +140 -140
  128. package/extensions/security/skills/compliance.md +68 -68
  129. package/extensions/security/skills/owasp-audit.md +64 -64
  130. package/extensions/security/skills/pentest-patterns.md +77 -77
  131. package/extensions/security/skills/secret-mgmt.md +65 -65
  132. package/extensions/security/skills/supply-chain.md +65 -65
  133. package/extensions/trading/PACK.md +80 -80
  134. package/extensions/trading/skills/chart-components.md +55 -55
  135. package/extensions/trading/skills/experiment-loop.md +125 -125
  136. package/extensions/trading/skills/fintech-patterns.md +47 -47
  137. package/extensions/trading/skills/indicator-library.md +58 -58
  138. package/extensions/trading/skills/quant-analysis.md +111 -111
  139. package/extensions/trading/skills/realtime-data.md +58 -58
  140. package/extensions/trading/skills/trade-logic.md +104 -104
  141. package/extensions/ui/PACK.md +130 -130
  142. package/extensions/ui/skills/a11y-audit.md +91 -91
  143. package/extensions/ui/skills/animation-patterns.md +127 -127
  144. package/extensions/ui/skills/component-patterns.md +100 -100
  145. package/extensions/ui/skills/design-decision.md +108 -108
  146. package/extensions/ui/skills/design-system.md +68 -68
  147. package/extensions/ui/skills/landing-patterns.md +155 -155
  148. package/extensions/ui/skills/palette-picker.md +173 -173
  149. package/extensions/ui/skills/react-health.md +90 -90
  150. package/extensions/ui/skills/type-system.md +125 -125
  151. package/extensions/ui/skills/web-vitals.md +153 -153
  152. package/extensions/zalo/PACK.md +145 -145
  153. package/extensions/zalo/skills/zalo-oa-mcp.md +317 -317
  154. package/extensions/zalo/skills/zalo-oa-messaging.md +429 -429
  155. package/extensions/zalo/skills/zalo-oa-setup.md +236 -236
  156. package/extensions/zalo/skills/zalo-oa-webhook.md +189 -189
  157. package/extensions/zalo/skills/zalo-personal-messaging.md +194 -194
  158. package/extensions/zalo/skills/zalo-personal-setup.md +153 -153
  159. package/extensions/zalo/skills/zalo-rate-guard.md +219 -219
  160. package/hooks/auto-format/index.cjs +48 -48
  161. package/hooks/hooks.json +111 -111
  162. package/hooks/post-session-reflect/index.cjs +189 -189
  163. package/hooks/pre-compact/index.cjs +95 -95
  164. package/hooks/run-hook.cmd +1 -1
  165. package/hooks/secrets-scan/index.cjs +100 -100
  166. package/hooks/session-start/index.cjs +71 -71
  167. package/hooks/typecheck/index.cjs +65 -65
  168. package/package.json +63 -63
  169. package/references/ui-pro-max-data/LICENSE-UI-PRO-MAX +21 -21
  170. package/references/ui-pro-max-data/charts.csv +26 -26
  171. package/references/ui-pro-max-data/colors.csv +161 -161
  172. package/references/ui-pro-max-data/styles.csv +68 -68
  173. package/references/ui-pro-max-data/typography.csv +74 -74
  174. package/references/ui-pro-max-data/ui-reasoning.csv +162 -162
  175. package/references/ui-pro-max-data/ux-guidelines.csv +99 -99
  176. package/skills/adversary/SKILL.md +283 -283
  177. package/skills/asset-creator/SKILL.md +157 -157
  178. package/skills/audit/SKILL.md +147 -2
  179. package/skills/autopsy/SKILL.md +335 -335
  180. package/skills/ba/SKILL.md +85 -1
  181. package/skills/brainstorm/SKILL.md +380 -342
  182. package/skills/browser-pilot/SKILL.md +169 -168
  183. package/skills/constraint-check/SKILL.md +165 -165
  184. package/skills/context-engine/SKILL.md +408 -404
  185. package/skills/cook/SKILL.md +917 -863
  186. package/skills/db/SKILL.md +273 -273
  187. package/skills/debug/SKILL.md +465 -465
  188. package/skills/dependency-doctor/SKILL.md +265 -235
  189. package/skills/deploy/SKILL.md +274 -231
  190. package/skills/design/DESIGN-REFERENCE.md +365 -365
  191. package/skills/design/SKILL.md +590 -589
  192. package/skills/doc-processor/SKILL.md +254 -254
  193. package/skills/docs/SKILL.md +374 -374
  194. package/skills/docs-seeker/SKILL.md +178 -177
  195. package/skills/fix/SKILL.md +332 -330
  196. package/skills/git/SKILL.md +339 -339
  197. package/skills/hallucination-guard/SKILL.md +220 -219
  198. package/skills/incident/SKILL.md +254 -253
  199. package/skills/integrity-check/SKILL.md +169 -169
  200. package/skills/journal/SKILL.md +241 -240
  201. package/skills/launch/SKILL.md +344 -344
  202. package/skills/logic-guardian/SKILL.md +269 -251
  203. package/skills/marketing/SKILL.md +351 -289
  204. package/skills/mcp-builder/SKILL.md +425 -425
  205. package/skills/neural-memory/SKILL.md +359 -362
  206. package/skills/onboard/SKILL.md +432 -403
  207. package/skills/onboard/references/invariants-template.md +76 -0
  208. package/skills/onboard/scripts/detect-invariants.js +439 -0
  209. package/skills/onboard/scripts/inject-claude-md.js +150 -0
  210. package/skills/onboard/scripts/onboard-invariants.js +194 -0
  211. package/skills/perf/SKILL.md +347 -346
  212. package/skills/plan/SKILL.md +435 -428
  213. package/skills/preflight/SKILL.md +415 -415
  214. package/skills/problem-solver/SKILL.md +380 -284
  215. package/skills/rescue/SKILL.md +474 -474
  216. package/skills/research/SKILL.md +4 -0
  217. package/skills/retro/SKILL.md +3 -1
  218. package/skills/review/SKILL.md +614 -588
  219. package/skills/review-intake/SKILL.md +249 -249
  220. package/skills/safeguard/SKILL.md +200 -200
  221. package/skills/sast/SKILL.md +190 -190
  222. package/skills/scaffold/SKILL.md +328 -287
  223. package/skills/scope-guard/SKILL.md +183 -180
  224. package/skills/scout/SKILL.md +269 -263
  225. package/skills/sentinel/SKILL.md +384 -381
  226. package/skills/sentinel-env/SKILL.md +254 -254
  227. package/skills/sequential-thinking/SKILL.md +234 -234
  228. package/skills/session-bridge/SKILL.md +595 -543
  229. package/skills/session-bridge/scripts/load-invariants.js +397 -0
  230. package/skills/skill-forge/SKILL.md +581 -581
  231. package/skills/skill-router/SKILL.md +3 -0
  232. package/skills/slides/SKILL.md +19 -0
  233. package/skills/surgeon/SKILL.md +215 -215
  234. package/skills/team/SKILL.md +557 -537
  235. package/skills/test/SKILL.md +620 -614
  236. package/skills/trend-scout/SKILL.md +145 -145
  237. package/skills/verification/SKILL.md +334 -326
  238. package/skills/video-creator/SKILL.md +201 -201
  239. package/skills/watchdog/SKILL.md +168 -168
  240. package/skills/worktree/SKILL.md +140 -140
@@ -1,589 +1,590 @@
1
- ---
2
- name: design
3
- description: Design system reasoning. Maps product domain to style, palette, typography, and platform-specific patterns. Generates .rune/design-system.md as the shared design contract for all UI-generating skills.
4
- metadata:
5
- author: runedev
6
- version: "0.4.0"
7
- layer: L2
8
- model: sonnet
9
- group: creation
10
- tools: "Read, Write, Edit, Glob, Grep"
11
- ---
12
-
13
- # design
14
-
15
- ## Purpose
16
-
17
- Design system reasoning layer. Converts a product description into a concrete design system — style, color direction, typography pairing, platform conventions, and an explicit anti-pattern list for this domain. Writes `.rune/design-system.md` as the persistent design contract that all UI-generating skills read before producing code. Prevents AI-generated UI from defaulting to generic patterns ("purple accent, card grids, centered everything") that signal "not designed by a human."
18
-
19
- ## Triggers
20
-
21
- - `/rune design` — manual invocation when starting a new UI project
22
- - Called by `cook` (L1): frontend task detected, no `.rune/design-system.md` exists
23
- - Called by `review` (L2): AI anti-pattern detected — recommended to run design skill
24
- - Called by `perf` (L2): Lighthouse Accessibility BLOCK — design foundation may be missing
25
-
26
- ## Calls (outbound)
27
-
28
- - `scout` (L2): detect existing design tokens, component library, platform targets
29
- - `asset-creator` (L3): generate base visual assets (logo, OG image) from design system
30
- - `review` (L2): accessibility violations found → flag for fix in next code review
31
-
32
- ## Called By (inbound)
33
-
34
- - `cook` (L1): before any frontend code generation
35
- - `brainstorm` (L2): when selected approach has UI/UX implications
36
- - `ba` (L2): when requirements include UI/UX components
37
- - `review` (L2): when AI anti-pattern detected in diff
38
- - `perf` (L2): when Lighthouse Accessibility score blocks
39
- - User: `/rune design` direct invocation
40
-
41
- ## Output Files
42
-
43
- ```
44
- .rune/
45
- └── design-system.md # Design contract for all UI-generating skills
46
- ```
47
-
48
- ## Executable Steps
49
-
50
- ### Step 0 — Load Design Reference
51
-
52
- Load the design knowledge base before reasoning:
53
-
54
- 1. Check for user-level override: `~/.claude/docs/design-dna.md`
55
- - If exists → `Read` it. This is the primary reference (user's curated taste).
56
- 2. If no user override → `Read` the baseline: `skills/design/DESIGN-REFERENCE.md` (shipped with Rune)
57
- 3. The loaded reference provides: font pairings, chart selection, component architecture, color principles, UX checklist, interaction patterns, anti-pattern signatures
58
- 4. Apply reference knowledge throughout Steps 3-5 (domain reasoning, token generation, checklist)
59
-
60
- > **Why two layers**: The baseline ships "good enough" universal design knowledge. Users who care about aesthetics create their own `design-dna.md` with curated palettes, font pairings, and style preferences. The design skill works well with either — it just works _better_ with a curated reference.
61
-
62
- ### External Data Source
63
-
64
- Design intelligence data from [UI/UX Pro Max](https://github.com/nextlevelbuilder/ui-ux-pro-max-skill) (MIT, 42.8k★).
65
- Located at `references/ui-pro-max-data/` — 161 palettes, 84 styles, 73 font pairings, 161 reasoning rules, 99 UX guidelines.
66
-
67
- When `references/ui-pro-max-data/` is available:
68
- - Step 2: query `styles.csv` for domain-matched visual styles (expands from 10 → 84)
69
- - Step 3: query `ui-reasoning.csv` for industry-specific design rules (161 rules)
70
- - Step 3: query `colors.csv` for palette alternatives (expands from 10 → 161)
71
- - Step 6 (Anti-AI): cross-check proposed style against reasoning DB if flagged as "AI-generic", suggest 3 alternatives
72
-
73
- ### Step 1 — Discover
74
-
75
- Invoke `scout` to detect:
76
- - **Platform target**: `web` | `ios` (SwiftUI) | `android` (Compose) | `react-native` | `multi-platform`
77
- - **Existing design tokens**: check for `tokens.json`, `design-system/`, `theme.ts`, `tailwind.config.*`, `variables.css`
78
- - **Component library in use**: shadcn/ui | Radix | MUI | Ant Design | custom | none
79
- - **Framework**: Next.js | Vite+React | SvelteKit | Vue | SwiftUI | Jetpack Compose | other
80
-
81
- If `.rune/design-system.md` already exists: Read it, check `Last Updated` date. If < 30 days old, ask user whether to refresh or keep. Do NOT silently overwrite.
82
-
83
- ### Step 2 — Classify Product Domain
84
-
85
- From the user's task description + codebase context, classify product type:
86
-
87
- | Category | Examples |
88
- |----------|---------|
89
- | **Trading/Fintech** | trading dashboard, portfolio tracker, payment app, crypto wallet |
90
- | **SaaS Dashboard** | admin panel, analytics, CRM, project management |
91
- | **Landing/Marketing** | landing page, product site, marketing page, waitlist |
92
- | **Healthcare** | patient portal, medical dashboard, health tracker |
93
- | **E-commerce** | product catalog, cart, checkout, marketplace |
94
- | **Developer Tools** | IDE plugin, CLI dashboard, API explorer, devtool |
95
- | **Creative/Portfolio** | portfolio, design showcase, art gallery, agency site |
96
- | **Social/Community** | social feed, forum, messaging, community platform |
97
- | **Mobile Consumer** | iOS/Android consumer app — entertainment, productivity, lifestyle |
98
- | **AI-Native** | AI assistant interface, chatbot, model explorer |
99
-
100
- If domain is unclear: ask one clarifying question — "Is this closer to X or Y?"
101
-
102
- ### Step 2.5 — Mood-to-Constraint Mapping
103
-
104
- After classifying domain, ask ONE question: **"What should users feel when they use this?"**
105
-
106
- Accept a single mood keyword (or infer from context if obvious). Map mood to concrete design constraints:
107
-
108
- | Mood | Color Temp | Typography Weight | Whitespace | Animation | Shadow |
109
- |------|-----------|-------------------|------------|-----------|--------|
110
- | **Impressed** | Cool (blue-slate) | Heavy display (700-800) | Generous (xl-3xl) | Dramatic reveals (0.8-1.2s ease-out) | Deep, layered |
111
- | **Excited** | Warm (amber-orange) | Bold contrasts (400 vs 800) | Tight-medium (sm-lg) | Energetic springs (0.4-0.6s spring) | Elevation lifts |
112
- | **Calm** | Neutral-warm (stone-sage) | Light-medium (300-500) | Very generous (2xl-3xl) | Slow fades (0.6-0.8s ease-out-quad) | Soft, minimal |
113
- | **Confident** | Cool-neutral (zinc-slate) | Medium-heavy (500-700) | Structured (md-xl) | Precise slides (0.3-0.5s ease) | Crisp, defined |
114
- | **Playful** | Saturated (multi-hue) | Round + bold (600-700) | Medium, irregular (md-lg) | Bouncy springs (0.4-0.6s spring, overshoot) | Hard/comic (3-5px offset) |
115
- | **Techy** | Cold (gray-cyan) | Mono-heavy, crisp (400-600) | Dense, grid-aligned (sm-md) | Sharp snaps (0.15-0.3s ease-out) | Minimal or glow |
116
- | **Professional** | Muted neutrals | System fonts, readable (400-500) | Balanced (md-lg) | Subtle (0.2-0.3s ease) | Standard elevation |
117
- | **Inspired** | Rich-warm (gold-terracotta) | Editorial display (300-700 range) | Asymmetric, generous | Scroll-driven reveals (0.5-0.8s) | Dramatic, directional |
118
-
119
- **Mapping rules:**
120
- 1. Mood constraints OVERRIDE generic domain defaults where they conflict (mood is user intent, domain is convention)
121
- 2. If mood contradicts domain safety (e.g., "Playful" + Healthcare), WARN user: "Playful tone may reduce trust in medical context — proceed?"
122
- 3. Write selected mood + resolved constraints to `.rune/design-system.md` under `## Mood` section
123
- 4. Downstream skills (`animation-patterns`, `palette-picker`, `type-system`) read mood constraints from design-system.md
124
-
125
- **Skip if**: User says "no preference" or "just follow domain defaults" — proceed to Step 3 with domain-only reasoning.
126
-
127
- ### Step 3 — Apply Domain Reasoning Rules
128
-
129
- Map domain to design system parameters:
130
-
131
- **Trading/Fintech:**
132
- ```
133
- Style: Data-Dense Dark
134
- Palette: Neutral dark (#0c1419 bg), semantic colors ONLY for profit/loss
135
- Profit: #00d084 (green) | Loss: #ff6b6b (red)
136
- Accent: #2196f3 (data highlight) NOT purple
137
- Typography: JetBrains Mono 700 for ALL numeric values (prices, P&L, %)
138
- Inter 400 for labels, Inter 600 for headings
139
- Effects: Subtle grid lines, real-time pulse animations on live data
140
- Anti-patterns:
141
- ❌ Gradient washes on data tables (obscures precision)
142
- Accent colors that conflict with profit/loss signal colors
143
- Decorative motion (distracts from live data)
144
- Dark-on-dark text for secondary labels (contrast required)
145
- ```
146
-
147
- **SaaS Dashboard:**
148
- ```
149
- Style: Minimalism or Flat Design
150
- Palette: Professional neutrals, single brand accent (NOT purple unless brand)
151
- Light: #ffffff bg, #f8fafc surface | Dark: #0f172a bg, #1e293b surface
152
- Accent: brand-defined default #6366f1 is acceptable here as a SaaS pattern
153
- Typography: Inter 400/500/600 throughout consistent, readable, data-friendly
154
- Space Grotesk 700 for hero/display only
155
- Effects: Skeleton loaders, subtle hover states, clean data tables
156
- Anti-patterns:
157
- ❌ Card-grid monotony (every section same layout)
158
- Animations that delay data visibility
159
- Missing empty/error states in data tables
160
- ```
161
-
162
- **Landing/Marketing:**
163
- ```
164
- Style: Glassmorphism (current era) or Aurora/Mesh
165
- Palette: Brand-expressive this is the ONE context where bold palette is correct
166
- High-contrast CTAs (must pass 4.5:1 contrast on all backgrounds)
167
- Typography: Space Grotesk 700 for hero display (48–72px)
168
- Inter 400/500 for body max line-width 720px
169
- Effects: Animated mesh gradients, floating glass cards, scroll-triggered reveals
170
- Anti-patterns:
171
- ❌ Generic hero: "big text + diagonal purple-to-blue gradient" — AI signature
172
- Centered layout throughout (breaks directional reading flow)
173
- Missing scroll animations on a static page
174
- CTAs that don't stand out from body copy
175
- ```
176
-
177
- **Healthcare:**
178
- ```
179
- Style: Trust & Authority (clean, clinical, accessible)
180
- Palette: Clean blue/white/green NO red except clinical alerts
181
- #f0f9ff bg, #1e40af accent, #059669 success, #dc2626 CRITICAL_ONLY
182
- Typography: Inter throughout never decorative fonts
183
- Body minimum 16px for readability by older/impaired users
184
- Effects: Minimal subtle hover, no motion by default
185
- Anti-patterns:
186
- ❌ Dark mode as default (patients/elderly → light mode)
187
- Gamification patterns (inappropriate for medical context)
188
- Red for informational messages (reserved for clinical alerts)
189
- Dense data layouts without clear visual hierarchy
190
- ```
191
-
192
- **E-commerce:**
193
- ```
194
- Style: Conversion-Optimized (Warm Minimalism)
195
- Palette: Warm neutrals, high-contrast CTAs
196
- Urgency signals: #ef4444 for "low stock", #f59e0b for "sale"
197
- Typography: Bold product names (Space Grotesk 600+), readable descriptions (Inter 400)
198
- Effects: Hover zoom on product images, add-to-cart pulse, trust badges
199
- Anti-patterns:
200
- ❌ Cluttered above-fold (too many competing CTAs)
201
- Add to cart button that doesn't stand out
202
- Missing product image zoom/gallery
203
- Checkout flow with more than 3 steps visible at once
204
- ```
205
-
206
- **Developer Tools:**
207
- ```
208
- Style: Minimalism or Neubrutalism
209
- Palette: Dark mode default — #0d1117 bg (GitHub-scale), #161b22 surface
210
- Syntax highlighting colors as accent palette
211
- No heavy gradients developers recognize and distrust decorative UI
212
- Typography: JetBrains Mono for code/commands, Inter for prose
213
- Effects: Keyboard shortcuts visible, dense information layout OK
214
- Anti-patterns:
215
- ❌ Decorative animations that delay tool response
216
- Non-monospace font for code blocks or command output
217
- Light mode only (developer tools default to dark)
218
- Visual noise around core functionality
219
- ```
220
-
221
- **Creative/Portfolio:**
222
- ```
223
- Style: Editorial Grid or Glassmorphism or Brutalism (brand-specific)
224
- Palette: MUST be distinctive generic palettes are disqualifying
225
- This is the one category where custom/unusual palettes are required
226
- Typography: Custom or display font as headline (NOT Inter alone)
227
- Font pairing must have contrast: Display + neutral body
228
- Effects: Curated hover reveals, scroll-based reveals, cursor effects
229
- Anti-patterns:
230
- ❌ Generic card grid with equal padding everywhere
231
- Inter-only typography (zero personality)
232
- Stock photo backgrounds
233
- Navigation that looks like every other portfolio
234
- ```
235
-
236
- **AI-Native:**
237
- ```
238
- Style: Minimal Functional or Glassmorphism
239
- Palette: Purple/violet IS acceptable here (it is the AI-native signal)
240
- #7c3aed accent, dark neutral bg, subtle gradients
241
- Typography: Inter throughout clarity over personality
242
- Effects: Typing indicators, streaming text, thinking states
243
- Anti-patterns:
244
- ❌ Purple on non-AI product (exports the AI signal to inappropriate contexts)
245
- Static empty states AI interfaces must show "thinking" states
246
- Missing latency UX (skeleton during generation, cancel button)
247
- ```
248
-
249
- ### Step 4 — Platform-Specific Overrides
250
-
251
- Apply platform conventions on top of domain rules:
252
-
253
- **iOS (SwiftUI / iOS 26+):**
254
- ```
255
- Visual language: Liquid Glass — translucent surfaces with backdrop blur
256
- background: UIBlurEffect or .regularMaterial
257
- border: subtle 1px rgba(white, 0.15) — NOT solid
258
- roundness: aggressive corner radius (16–24px on cards, full on buttons)
259
- Icons: SF Symbols ONLY not Heroicons, not Lucide
260
- Typography: SF Pro familyDynamic Type scaling is mandatory
261
- Safe areas: Content must respect safeAreaInsets on all edges
262
- Anti-patterns:
263
- ❌ Solid-background cards (deprecated in iOS 26 Liquid Glass era)
264
- Custom icon fonts (SF Symbols is the platform contract)
265
- Fixed font sizes (Dynamic Type must be supported)
266
- ```
267
-
268
- **Android (Jetpack Compose / Material 3 Expressive):**
269
- ```
270
- Color: MaterialTheme.colorScheme — dynamic color derived from wallpaper
271
- NEVER hardcode hex colors in Compose use semantic tokens
272
- Shape: Extreme corner expressiveness — use shape variation as affordance signal
273
- Small interactive: RoundedCornerShape(4dp)
274
- Cards/surfaces: RoundedCornerShape(16dp)
275
- FABs: CircleShape
276
- Motion: Spring physics — tween() is almost never the right choice
277
- spring(dampingRatio = Spring.DampingRatioMediumBouncy)
278
- Anti-patterns:
279
- ❌ Hardcoded hex colors (breaks dynamic color contract)
280
- Linear easing (Material 3 Expressive uses spring physics)
281
- Small corner radii (shape expressiveness is a key M3 Expressive principle)
282
- ```
283
-
284
- **Web:**
285
- - Apply domain rules from Step 3
286
- - Default: dark mode support required (`prefers-color-scheme: dark`)
287
- - Responsive: must design for 375px, 768px, 1024px, 1440px breakpoints
288
- - Accessibility: WCAG 2.2 AA minimum
289
-
290
- ### Step 5 — Generate Design System File
291
-
292
- Use `Write` to create `.rune/design-system.md`:
293
-
294
- ```markdown
295
- # Design System: [Project Name]
296
- Last Updated: [YYYY-MM-DD]
297
- Platform: [web | ios | android | multi-platform]
298
- Domain: [product category]
299
- Style: [chosen style]
300
-
301
- ## Color Tokens
302
-
303
- ### Primitive (raw values)
304
- --color-[name]-[scale]: [hex]
305
-
306
- ### Semantic (meaning-mapped)
307
- --bg-base: [value] — page background
308
- --bg-surface: [value] — card/panel background
309
- --bg-elevated: [value] — modal/dropdown background
310
- --text-primary: [value] — primary text
311
- --text-secondary: [value] — secondary/muted text
312
- --border: [value] — default border
313
- --accent: [value] — primary action/brand
314
- --success: [value] — positive/profit signal
315
- --danger: [value] — error/loss signal
316
- --warning: [value] — caution signal
317
-
318
- ## Typography
319
-
320
- | Role | Font | Weight | Size |
321
- |------|------|--------|------|
322
- | Display | [font] | [weight] | [px range] |
323
- | H1 | [font] | [weight] | [px] |
324
- | H2/H3 | [font] | [weight] | [px] |
325
- | Body | [font] | [weight] | [px] |
326
- | Mono/Numbers | [font] | [weight] | [px] |
327
-
328
- Numbers rule: [monospace font] for ALL numeric values in this domain (prices, metrics, IDs)
329
-
330
- ## Spacing (8px base)
331
- xs: 4px | sm: 8px | md: 16px | lg: 24px | xl: 32px | 2xl: 48px | 3xl: 64px
332
-
333
- ## Border Radius
334
- sm: 6px | md: 8px | lg: 12px | xl: 16px | full: 9999px
335
-
336
- ## Effects
337
- [signature effects for this style — gradients, shadows, blur, etc.]
338
-
339
- ## Anti-Patterns (MUST NOT generate these)
340
- [domain-specific list from Step 3 + platform overrides]
341
- - ❌ [anti-pattern 1] [why it fails in this domain]
342
- - ❌ [anti-pattern 2]
343
-
344
- ## Platform Notes
345
- [platform-specific implementation requirements from Step 4]
346
-
347
- ## Component Library
348
- [detected library or "custom"]
349
-
350
- ## Pre-Delivery Checklist
351
- - [ ] Color contrast ≥ 4.5:1 for all text
352
- - [ ] Focus-visible ring on ALL interactive elements (never outline-none alone)
353
- - [ ] Touch targets 24×24px with 8px gap between targets
354
- - [ ] All icon-only buttons have aria-label
355
- - [ ] All inputs have associated <label> or aria-label
356
- - [ ] Empty state, error state, loading state for all async data
357
- - [ ] cursor-pointer on all clickable non-button elements
358
- - [ ] prefers-reduced-motion respected for all animations
359
- - [ ] Dark mode support (or explicit reasoning why not)
360
- - [ ] Responsive tested at 375px / 768px / 1024px / 1440px
361
- ```
362
-
363
- ### Step 5.5 — UI Design Contract (UI-SPEC.md)
364
-
365
- After generating the design system, lock key visual decisions in `.rune/ui-spec.md` — a binding contract that prevents design drift during implementation.
366
-
367
- **Why**: design-system.md defines tokens (what's available). UI-SPEC locks decisions (what was chosen and WHY). Without a spec, each component re-decides layout, density, and hierarchy — causing visual inconsistency.
368
-
369
- **Generate `.rune/ui-spec.md`:**
370
-
371
- ```markdown
372
- # UI Specification: [Project Name]
373
- Locked: [YYYY-MM-DD] | Mood: [selected mood]
374
-
375
- ## Layout Decisions
376
- - Page max-width: [value]px
377
- - Sidebar: [yes/no] — [width]px [fixed/collapsible]
378
- - Content density: [compact/balanced/spacious]
379
- - Card sizing: [uniform/varied] — if varied, specify hierarchy rules
380
-
381
- ## Visual Hierarchy Rules
382
- - Primary action: [color] [size] [weight] — ONE per viewport
383
- - Secondary action: [ghost/outline] stylemax 2 per section
384
- - Data emphasis: [monospace + bold] for numbers, [color accent] for status
385
- - Section separation: [border/spacing/background] pick ONE, be consistent
386
-
387
- ## Component Decisions
388
- - Card style: [elevated/bordered/glass] — reasoning: [why]
389
- - Table style: [striped/bordered/minimal] — reasoning: [why]
390
- - Form layout: [stacked/inline/grid] — reasoning: [why]
391
- - Navigation: [sidebar/topbar/tabs] — reasoning: [why]
392
-
393
- ## Locked Anti-Decisions (things we explicitly chose NOT to do)
394
- - [rejected option] because [reason]
395
- ```
396
-
397
- <HARD-GATE>
398
- UI-SPEC.md is a contract. Once written, changes require explicit user approval ("I want to change the card style"). Skills that generate UI (`cook`, `fix`, `scaffold`) MUST read UI-SPEC.md before producing components. Drift from spec = review finding.
399
- </HARD-GATE>
400
-
401
- ### Step 6 — Accessibility Review
402
-
403
- Run a focused accessibility audit on the design system and any existing UI code. This step ensures the design contract doesn't produce inaccessible outputs.
404
-
405
- **Automated checks** (use Grep on codebase):
406
- 1. **Color contrast**: Verify all text/bg combinations in the design system meet WCAG 2.2 AA (4.5:1 normal text, 3:1 large text). Flag any semantic color pair that fails.
407
- 2. **Focus indicators**: Search for `outline-none`, `outline: none`, `focus:outline-none` without a replacement `focus-visible` ring. Every instance is a violation.
408
- 3. **Touch targets**: Search for buttons/links with explicit small sizing (`w-6 h-6`, `p-1` on interactive elements). Flag anything < 24x24px.
409
- 4. **Missing labels**: Search for `<input` without adjacent `<label` or `aria-label`. Search for icon-only buttons without `aria-label`.
410
- 5. **Semantic HTML**: Flag `<div onClick`, `<span onClick` (should be `<button>`). Flag missing `<nav>`, `<main>`, `<header>` landmarks.
411
- 6. **Motion safety**: Check for animations/transitions without `prefers-reduced-motion` media query or Tailwind `motion-reduce:` variant.
412
-
413
- **Output**: Accessibility audit section in Design Report with pass/fail per check and specific file:line violations.
414
-
415
- If violations found → add them to `.rune/design-system.md` Anti-Patterns section as concrete rules.
416
-
417
- ### Step 6.5 — 6-Pillar Visual Audit
418
-
419
- Score the generated design system across 6 pillars. Each pillar scored 1-4 (1=Poor, 2=Fair, 3=Good, 4=Excellent). Minimum passing score: **18/24** (average 3.0).
420
-
421
- | Pillar | Score 1 (Poor) | Score 2 (Fair) | Score 3 (Good) | Score 4 (Excellent) |
422
- |--------|---------------|----------------|----------------|---------------------|
423
- | **Copy** | Placeholder text, generic CTAs ("Submit"), no voice | Real copy but inconsistent tone | Consistent voice, domain-appropriate, clear CTAs | Personality-rich, scannable, microcopy for every state |
424
- | **Visuals** | Stock photos, generic icons, no visual identity | Consistent icon set, basic imagery | Custom illustrations or curated photography, clear hierarchy | Distinctive visual language, icons tell stories, zero stock |
425
- | **Color** | Default framework palette, no semantic meaning | Brand colors defined but inconsistent usage | Full semantic palette, dark mode, accessible contrast | Mood-aligned, colorblind-safe, context-adaptive (profit/loss/status) |
426
- | **Typography** | Single font, no scale | Font pairing exists but inconsistent sizing | Clear hierarchy (display/heading/body/mono), numbers monospace | Mood-aligned pairing, fluid scaling, platform-native where needed |
427
- | **Spacing** | Inconsistent gaps, cramped or too loose | Base unit defined but not consistently applied | 8px grid, consistent section/component/element spacing | Density variants (compact/default/spacious), rhythm feels intentional |
428
- | **UX** | Missing states (empty/error/loading), no feedback | Basic states exist, some interactive feedback | All states covered, toast/loading/skeleton, focus management | Delightful micro-interactions, smart defaults, zero dead-ends |
429
-
430
- **Audit output:**
431
-
432
- ```
433
- ### Visual Audit Score: [total]/24
434
-
435
- | Pillar | Score | Notes |
436
- |--------|-------|-------|
437
- | Copy | 3 | Consistent voice, missing loading microcopy |
438
- | Visuals | 2 | Using Phosphor icons (good), no custom illustration |
439
- | Color | 4 | Full semantic palette, colorblind alternates defined |
440
- | Typography | 3 | JetBrains Mono for numbers, Inter for prose — solid |
441
- | Spacing | 3 | 8px grid applied, density variants not needed yet |
442
- | UX | 3 | All states covered, micro-interactions in progress |
443
- | **Total** | **18/24** | PASS ship-ready with Copy improvements recommended |
444
- ```
445
-
446
- **If score < 18**: Flag specific weak pillars in Design Report. Add improvement tasks to `.rune/design-system.md` under `## Improvement Backlog`.
447
-
448
- **Registry safety check**: If an existing component library is in use (shadcn, MUI, etc.), verify the design system doesn't conflict with the library's token structure. Flag collisions.
449
-
450
- ### Step 7 — UX Writing Patterns
451
-
452
- Generate microcopy guidelines specific to this product domain. UX writing is part of design — not an afterthought.
453
-
454
- **Domain-specific microcopy rules:**
455
-
456
- | Domain | Tone | Error Pattern | CTA Pattern | Empty State |
457
- |--------|------|---------------|-------------|-------------|
458
- | Trading/Fintech | Precise, neutral, no humor | "Order failed: insufficient margin ($X required)" | "Place Order", "Close Position" | "No open positions. Market opens in 2h 15m." |
459
- | SaaS Dashboard | Professional, helpful | "Couldn't save changes. Try again or contact support." | "Get Started", "Upgrade Plan" | "No data yet. Connect your first integration." |
460
- | E-commerce | Friendly, urgent-capable | "This item is no longer available. Here are similar items." | "Add to Cart", "Buy Now" | "Your cart is empty. Continue shopping?" |
461
- | Healthcare | Calm, clinical, clear | "We couldn't verify your insurance. Please check your member ID." | "Schedule Visit", "View Results" | "No upcoming appointments." |
462
- | Developer Tools | Direct, technical | "Build failed: missing dependency `@types/node`" | "Deploy", "Run Tests" | "No builds yet. Push to trigger CI." |
463
-
464
- **Generate for this project:**
465
- - Error message template: `[What happened] + [Why] + [What to do next]`
466
- - Empty state template: `[What's missing] + [How to fill it]`
467
- - Confirmation template: `[What will happen] + [Reversibility]`
468
- - Loading text: context-appropriate (not just "Loading...")
469
- - Button label rules: verb-first, specific action (not "Submit", "Click Here")
470
-
471
- Add UX writing guidelines to `.rune/design-system.md` under a new `## UX Writing` section.
472
-
473
- ### Step 8 — Report
474
-
475
- Emit design summary to calling skill:
476
-
477
- ```
478
- ## Design Report: [Project Name]
479
-
480
- ### Domain Classification
481
- [product category] — [style chosen] — [platform]
482
-
483
- ### Design System Generated
484
- .rune/design-system.md
485
-
486
- ### Key Decisions
487
- - Accent: [color + reasoning — why this color for this domain]
488
- - Typography: [pairing + reasoning]
489
- - Style: [style name + why it fits this product]
490
-
491
- ### Anti-Patterns Registered (will be flagged by review)
492
- - [n] domain-specific patterns
493
- - ❌ [n] platform-specific patterns
494
-
495
- ### Pre-Delivery Checklist
496
- [count] items to verify before shipping
497
- ```
498
-
499
- ## Output Format
500
-
501
- ```
502
- ## Design Report: TradingOS Dashboard
503
-
504
- ### Domain Classification
505
- Trading/Fintech Data-Dense Dark — Web
506
-
507
- ### Design System Generated
508
- .rune/design-system.md
509
-
510
- ### Key Decisions
511
- - Accent: #2196f3 (blue) — neutral data highlight; profit/loss colors (#00d084/#ff6b6b)
512
- are reserved as semantic signals, not brand colors
513
- - Typography: JetBrains Mono 700 for all numeric values (prices, P&L, %),
514
- Inter 400/600 for prose and labels
515
- - Style: Data-Dense Dark users scan real-time data under time pressure;
516
- decorative elements compete with data for attention
517
-
518
- ### Anti-Patterns Registered
519
- - ❌ 4 domain-specific (gradient wash, conflicting accent colors, decorative motion, dark-on-dark)
520
- - ❌ 1 platform-specific (fixed font sizes not applicable web target)
521
-
522
- ### Pre-Delivery Checklist
523
- 12 items to verify before shipping
524
- ```
525
-
526
- ## Constraints
527
-
528
- 1. MUST classify domain before generating design system — never generate with unknown domain
529
- 2. MUST include anti-pattern list in every design system — a system without anti-patterns is incomplete
530
- 3. MUST NOT use purple/indigo as default accent unless domain is AI-Native or explicitly brand-purple
531
- 4. MUST write `.rune/design-system.md` ephemeral design decisions evaporate; persistence is the point
532
- 5. MUST NOT overwrite existing design-system.md without user confirmation
533
- 6. MUST include platform-specific overrides when platform is iOS or Android
534
-
535
- ## Mesh Gates (L1/L2 only)
536
-
537
- | Gate | Requires | If Missing |
538
- |------|----------|------------|
539
- | Domain Gate | Product domain classified before generating tokens | Ask clarifying question |
540
- | Anti-Pattern Gate | Anti-pattern list derived from domain rules (not generic) | Domain-specific list required |
541
- | Persistence Gate | .rune/design-system.md written before reporting done | Write file first |
542
- | Platform Gate | Platform detected before generating tokens | Default to web, note assumption |
543
-
544
- ## Returns
545
-
546
- | Artifact | Format | Location |
547
- |----------|--------|----------|
548
- | Design system file | Markdown | `.rune/design-system.md` |
549
- | UI specification contract | Markdown | `.rune/ui-spec.md` |
550
- | Design report | Markdown | inline (chat output) |
551
- | Accessibility audit findings | Markdown list | inline + appended to design-system.md |
552
- | Visual audit score | Table (6 pillars × 1-4) | inline + appended to design report |
553
- | UX writing guidelines | Markdown section | `.rune/design-system.md` § UX Writing |
554
-
555
- ## Sharp Edges
556
-
557
- Known failure modes for this skill. Check these before declaring done.
558
-
559
- | Failure Mode | Severity | Mitigation |
560
- |---|---|---|
561
- | Generating generic design system without domain classification | CRITICAL | Domain Gate blocks this — classify first |
562
- | Purple/indigo accent on non-AI-native product | HIGH | Constraint 3 blocks this — re-generate with domain-appropriate accent |
563
- | Anti-pattern list copied from generic sources (not domain-specific) | HIGH | Each anti-pattern must cite why it fails in THIS specific domain |
564
- | design-system.md not written (only reported verbally) | HIGH | Constraint 4 no file = no persistence = future sessions lose design context |
565
- | Mood contradicts domain safety conventions | HIGH | Step 2.5 warns user before proceeding (e.g., Playful + Healthcare) |
566
- | UI-SPEC.md drift components diverge from locked decisions | HIGH | HARD-GATE: cook/fix must read ui-spec.md before generating UI |
567
- | Visual audit score < 18 shipped without improvement plan | MEDIUM | Step 6.5 flags weak pillars and creates backlog items |
568
- | iOS target generating solid-background cards | MEDIUM | Platform Gate: iOS 26 Liquid Glass deprecates this pattern |
569
- | Android target using hardcoded hex colors | MEDIUM | Platform Gate: MaterialTheme.colorScheme is mandatory for dynamic color |
570
-
571
- ## Done When
572
-
573
- - Design reference loaded (user override or baseline)
574
- - Domain classified (one of the 10 categories or explicit custom reasoning)
575
- - Mood mapped to constraints (or explicitly skipped with "domain defaults")
576
- - Design system generated with: colors (primitive + semantic), typography, spacing, effects, anti-patterns
577
- - Platform-specific overrides applied (if iOS/Android target)
578
- - UI-SPEC.md written with locked layout, hierarchy, and component decisions
579
- - Accessibility review completed (6 checks: contrast, focus, touch targets, labels, semantic HTML, motion)
580
- - 6-Pillar Visual Audit scored 18/24 (or weak pillars flagged with improvement tasks)
581
- - UX writing guidelines generated (error, empty state, confirmation, loading, button templates)
582
- - `.rune/design-system.md` written (includes Mood + UX Writing sections)
583
- - `.rune/ui-spec.md` written (design contract for UI-generating skills)
584
- - Design Report emitted with mood, accent/typography reasoning, visual audit score, and anti-pattern count
585
- - Pre-Delivery Checklist included in design-system.md
586
-
587
- ## Cost Profile
588
-
589
- ~2000-5000 tokens input, ~800-1500 tokens output. Sonnet for design reasoning quality.
1
+ ---
2
+ name: design
3
+ description: Design system reasoning. Maps product domain to style, palette, typography, and platform-specific patterns. Generates .rune/design-system.md as the shared design contract for all UI-generating skills.
4
+ metadata:
5
+ author: runedev
6
+ version: "0.4.0"
7
+ layer: L2
8
+ model: sonnet
9
+ group: creation
10
+ tools: "Read, Write, Edit, Glob, Grep"
11
+ ---
12
+
13
+ # design
14
+
15
+ ## Purpose
16
+
17
+ Design system reasoning layer. Converts a product description into a concrete design system — style, color direction, typography pairing, platform conventions, and an explicit anti-pattern list for this domain. Writes `.rune/design-system.md` as the persistent design contract that all UI-generating skills read before producing code. Prevents AI-generated UI from defaulting to generic patterns ("purple accent, card grids, centered everything") that signal "not designed by a human."
18
+
19
+ ## Triggers
20
+
21
+ - `/rune design` — manual invocation when starting a new UI project
22
+ - Called by `cook` (L1): frontend task detected, no `.rune/design-system.md` exists
23
+ - Called by `review` (L2): AI anti-pattern detected — recommended to run design skill
24
+ - Called by `perf` (L2): Lighthouse Accessibility BLOCK — design foundation may be missing
25
+
26
+ ## Calls (outbound)
27
+
28
+ - `scout` (L2): detect existing design tokens, component library, platform targets
29
+ - `asset-creator` (L3): generate base visual assets (logo, OG image) from design system
30
+ - `review` (L2): accessibility violations found → flag for fix in next code review
31
+
32
+ ## Called By (inbound)
33
+
34
+ - `cook` (L1): before any frontend code generation
35
+ - `scaffold` (L1): design system for new project
36
+ - `brainstorm` (L2): when selected approach has UI/UX implications
37
+ - `ba` (L2): when requirements include UI/UX components
38
+ - `review` (L2): when AI anti-pattern detected in diff
39
+ - `perf` (L2): when Lighthouse Accessibility score blocks
40
+ - User: `/rune design` direct invocation
41
+
42
+ ## Output Files
43
+
44
+ ```
45
+ .rune/
46
+ └── design-system.md # Design contract for all UI-generating skills
47
+ ```
48
+
49
+ ## Executable Steps
50
+
51
+ ### Step 0 — Load Design Reference
52
+
53
+ Load the design knowledge base before reasoning:
54
+
55
+ 1. Check for user-level override: `~/.claude/docs/design-dna.md`
56
+ - If exists → `Read` it. This is the primary reference (user's curated taste).
57
+ 2. If no user override `Read` the baseline: `skills/design/DESIGN-REFERENCE.md` (shipped with Rune)
58
+ 3. The loaded reference provides: font pairings, chart selection, component architecture, color principles, UX checklist, interaction patterns, anti-pattern signatures
59
+ 4. Apply reference knowledge throughout Steps 3-5 (domain reasoning, token generation, checklist)
60
+
61
+ > **Why two layers**: The baseline ships "good enough" universal design knowledge. Users who care about aesthetics create their own `design-dna.md` with curated palettes, font pairings, and style preferences. The design skill works well with either — it just works _better_ with a curated reference.
62
+
63
+ ### External Data Source
64
+
65
+ Design intelligence data from [UI/UX Pro Max](https://github.com/nextlevelbuilder/ui-ux-pro-max-skill) (MIT, 42.8k★).
66
+ Located at `references/ui-pro-max-data/` — 161 palettes, 84 styles, 73 font pairings, 161 reasoning rules, 99 UX guidelines.
67
+
68
+ When `references/ui-pro-max-data/` is available:
69
+ - Step 2: query `styles.csv` for domain-matched visual styles (expands from 10 → 84)
70
+ - Step 3: query `ui-reasoning.csv` for industry-specific design rules (161 rules)
71
+ - Step 3: query `colors.csv` for palette alternatives (expands from 10 161)
72
+ - Step 6 (Anti-AI): cross-check proposed style against reasoning DB — if flagged as "AI-generic", suggest 3 alternatives
73
+
74
+ ### Step 1 — Discover
75
+
76
+ Invoke `scout` to detect:
77
+ - **Platform target**: `web` | `ios` (SwiftUI) | `android` (Compose) | `react-native` | `multi-platform`
78
+ - **Existing design tokens**: check for `tokens.json`, `design-system/`, `theme.ts`, `tailwind.config.*`, `variables.css`
79
+ - **Component library in use**: shadcn/ui | Radix | MUI | Ant Design | custom | none
80
+ - **Framework**: Next.js | Vite+React | SvelteKit | Vue | SwiftUI | Jetpack Compose | other
81
+
82
+ If `.rune/design-system.md` already exists: Read it, check `Last Updated` date. If < 30 days old, ask user whether to refresh or keep. Do NOT silently overwrite.
83
+
84
+ ### Step 2 — Classify Product Domain
85
+
86
+ From the user's task description + codebase context, classify product type:
87
+
88
+ | Category | Examples |
89
+ |----------|---------|
90
+ | **Trading/Fintech** | trading dashboard, portfolio tracker, payment app, crypto wallet |
91
+ | **SaaS Dashboard** | admin panel, analytics, CRM, project management |
92
+ | **Landing/Marketing** | landing page, product site, marketing page, waitlist |
93
+ | **Healthcare** | patient portal, medical dashboard, health tracker |
94
+ | **E-commerce** | product catalog, cart, checkout, marketplace |
95
+ | **Developer Tools** | IDE plugin, CLI dashboard, API explorer, devtool |
96
+ | **Creative/Portfolio** | portfolio, design showcase, art gallery, agency site |
97
+ | **Social/Community** | social feed, forum, messaging, community platform |
98
+ | **Mobile Consumer** | iOS/Android consumer app — entertainment, productivity, lifestyle |
99
+ | **AI-Native** | AI assistant interface, chatbot, model explorer |
100
+
101
+ If domain is unclear: ask one clarifying question — "Is this closer to X or Y?"
102
+
103
+ ### Step 2.5 — Mood-to-Constraint Mapping
104
+
105
+ After classifying domain, ask ONE question: **"What should users feel when they use this?"**
106
+
107
+ Accept a single mood keyword (or infer from context if obvious). Map mood to concrete design constraints:
108
+
109
+ | Mood | Color Temp | Typography Weight | Whitespace | Animation | Shadow |
110
+ |------|-----------|-------------------|------------|-----------|--------|
111
+ | **Impressed** | Cool (blue-slate) | Heavy display (700-800) | Generous (xl-3xl) | Dramatic reveals (0.8-1.2s ease-out) | Deep, layered |
112
+ | **Excited** | Warm (amber-orange) | Bold contrasts (400 vs 800) | Tight-medium (sm-lg) | Energetic springs (0.4-0.6s spring) | Elevation lifts |
113
+ | **Calm** | Neutral-warm (stone-sage) | Light-medium (300-500) | Very generous (2xl-3xl) | Slow fades (0.6-0.8s ease-out-quad) | Soft, minimal |
114
+ | **Confident** | Cool-neutral (zinc-slate) | Medium-heavy (500-700) | Structured (md-xl) | Precise slides (0.3-0.5s ease) | Crisp, defined |
115
+ | **Playful** | Saturated (multi-hue) | Round + bold (600-700) | Medium, irregular (md-lg) | Bouncy springs (0.4-0.6s spring, overshoot) | Hard/comic (3-5px offset) |
116
+ | **Techy** | Cold (gray-cyan) | Mono-heavy, crisp (400-600) | Dense, grid-aligned (sm-md) | Sharp snaps (0.15-0.3s ease-out) | Minimal or glow |
117
+ | **Professional** | Muted neutrals | System fonts, readable (400-500) | Balanced (md-lg) | Subtle (0.2-0.3s ease) | Standard elevation |
118
+ | **Inspired** | Rich-warm (gold-terracotta) | Editorial display (300-700 range) | Asymmetric, generous | Scroll-driven reveals (0.5-0.8s) | Dramatic, directional |
119
+
120
+ **Mapping rules:**
121
+ 1. Mood constraints OVERRIDE generic domain defaults where they conflict (mood is user intent, domain is convention)
122
+ 2. If mood contradicts domain safety (e.g., "Playful" + Healthcare), WARN user: "Playful tone may reduce trust in medical context — proceed?"
123
+ 3. Write selected mood + resolved constraints to `.rune/design-system.md` under `## Mood` section
124
+ 4. Downstream skills (`animation-patterns`, `palette-picker`, `type-system`) read mood constraints from design-system.md
125
+
126
+ **Skip if**: User says "no preference" or "just follow domain defaults" — proceed to Step 3 with domain-only reasoning.
127
+
128
+ ### Step 3 — Apply Domain Reasoning Rules
129
+
130
+ Map domain to design system parameters:
131
+
132
+ **Trading/Fintech:**
133
+ ```
134
+ Style: Data-Dense Dark
135
+ Palette: Neutral dark (#0c1419 bg), semantic colors ONLY for profit/loss
136
+ Profit: #00d084 (green) | Loss: #ff6b6b (red)
137
+ Accent: #2196f3 (data highlight) NOT purple
138
+ Typography: JetBrains Mono 700 for ALL numeric values (prices, P&L, %)
139
+ Inter 400 for labels, Inter 600 for headings
140
+ Effects: Subtle grid lines, real-time pulse animations on live data
141
+ Anti-patterns:
142
+ Gradient washes on data tables (obscures precision)
143
+ Accent colors that conflict with profit/loss signal colors
144
+ Decorative motion (distracts from live data)
145
+ ❌ Dark-on-dark text for secondary labels (contrast required)
146
+ ```
147
+
148
+ **SaaS Dashboard:**
149
+ ```
150
+ Style: Minimalism or Flat Design
151
+ Palette: Professional neutrals, single brand accent (NOT purple unless brand)
152
+ Light: #ffffff bg, #f8fafc surface | Dark: #0f172a bg, #1e293b surface
153
+ Accent: brand-defineddefault #6366f1 is acceptable here as a SaaS pattern
154
+ Typography: Inter 400/500/600 throughout consistent, readable, data-friendly
155
+ Space Grotesk 700 for hero/display only
156
+ Effects: Skeleton loaders, subtle hover states, clean data tables
157
+ Anti-patterns:
158
+ Card-grid monotony (every section same layout)
159
+ Animations that delay data visibility
160
+ ❌ Missing empty/error states in data tables
161
+ ```
162
+
163
+ **Landing/Marketing:**
164
+ ```
165
+ Style: Glassmorphism (current era) or Aurora/Mesh
166
+ Palette: Brand-expressive this is the ONE context where bold palette is correct
167
+ High-contrast CTAs (must pass 4.5:1 contrast on all backgrounds)
168
+ Typography: Space Grotesk 700 for hero display (48–72px)
169
+ Inter 400/500 for body max line-width 720px
170
+ Effects: Animated mesh gradients, floating glass cards, scroll-triggered reveals
171
+ Anti-patterns:
172
+ Generic hero: "big text + diagonal purple-to-blue gradient" — AI signature
173
+ Centered layout throughout (breaks directional reading flow)
174
+ Missing scroll animations on a static page
175
+ ❌ CTAs that don't stand out from body copy
176
+ ```
177
+
178
+ **Healthcare:**
179
+ ```
180
+ Style: Trust & Authority (clean, clinical, accessible)
181
+ Palette: Clean blue/white/green NO red except clinical alerts
182
+ #f0f9ff bg, #1e40af accent, #059669 success, #dc2626 CRITICAL_ONLY
183
+ Typography: Inter throughout never decorative fonts
184
+ Body minimum 16px for readability by older/impaired users
185
+ Effects: Minimal — subtle hover, no motion by default
186
+ Anti-patterns:
187
+ Dark mode as default (patients/elderly light mode)
188
+ Gamification patterns (inappropriate for medical context)
189
+ Red for informational messages (reserved for clinical alerts)
190
+ ❌ Dense data layouts without clear visual hierarchy
191
+ ```
192
+
193
+ **E-commerce:**
194
+ ```
195
+ Style: Conversion-Optimized (Warm Minimalism)
196
+ Palette: Warm neutrals, high-contrast CTAs
197
+ Urgency signals: #ef4444 for "low stock", #f59e0b for "sale"
198
+ Typography: Bold product names (Space Grotesk 600+), readable descriptions (Inter 400)
199
+ Effects: Hover zoom on product images, add-to-cart pulse, trust badges
200
+ Anti-patterns:
201
+ Cluttered above-fold (too many competing CTAs)
202
+ Add to cart button that doesn't stand out
203
+ Missing product image zoom/gallery
204
+ ❌ Checkout flow with more than 3 steps visible at once
205
+ ```
206
+
207
+ **Developer Tools:**
208
+ ```
209
+ Style: Minimalism or Neubrutalism
210
+ Palette: Dark mode default #0d1117 bg (GitHub-scale), #161b22 surface
211
+ Syntax highlighting colors as accent palette
212
+ No heavy gradients developers recognize and distrust decorative UI
213
+ Typography: JetBrains Mono for code/commands, Inter for prose
214
+ Effects: Keyboard shortcuts visible, dense information layout OK
215
+ Anti-patterns:
216
+ Decorative animations that delay tool response
217
+ Non-monospace font for code blocks or command output
218
+ Light mode only (developer tools default to dark)
219
+ ❌ Visual noise around core functionality
220
+ ```
221
+
222
+ **Creative/Portfolio:**
223
+ ```
224
+ Style: Editorial Grid or Glassmorphism or Brutalism (brand-specific)
225
+ Palette: MUST be distinctive generic palettes are disqualifying
226
+ This is the one category where custom/unusual palettes are required
227
+ Typography: Custom or display font as headline (NOT Inter alone)
228
+ Font pairing must have contrast: Display + neutral body
229
+ Effects: Curated — hover reveals, scroll-based reveals, cursor effects
230
+ Anti-patterns:
231
+ Generic card grid with equal padding everywhere
232
+ Inter-only typography (zero personality)
233
+ Stock photo backgrounds
234
+ ❌ Navigation that looks like every other portfolio
235
+ ```
236
+
237
+ **AI-Native:**
238
+ ```
239
+ Style: Minimal Functional or Glassmorphism
240
+ Palette: Purple/violet IS acceptable here (it is the AI-native signal)
241
+ #7c3aed accent, dark neutral bg, subtle gradients
242
+ Typography: Inter throughout clarity over personality
243
+ Effects: Typing indicators, streaming text, thinking states
244
+ Anti-patterns:
245
+ Purple on non-AI product (exports the AI signal to inappropriate contexts)
246
+ Static empty states AI interfaces must show "thinking" states
247
+ ❌ Missing latency UX (skeleton during generation, cancel button)
248
+ ```
249
+
250
+ ### Step 4 — Platform-Specific Overrides
251
+
252
+ Apply platform conventions on top of domain rules:
253
+
254
+ **iOS (SwiftUI / iOS 26+):**
255
+ ```
256
+ Visual language: Liquid Glass — translucent surfaces with backdrop blur
257
+ background: UIBlurEffect or .regularMaterial
258
+ border: subtle 1px rgba(white, 0.15) NOT solid
259
+ roundness: aggressive corner radius (16–24px on cards, full on buttons)
260
+ Icons: SF Symbols ONLYnot Heroicons, not Lucide
261
+ Typography: SF Pro family Dynamic Type scaling is mandatory
262
+ Safe areas: Content must respect safeAreaInsets on all edges
263
+ Anti-patterns:
264
+ Solid-background cards (deprecated in iOS 26 Liquid Glass era)
265
+ Custom icon fonts (SF Symbols is the platform contract)
266
+ ❌ Fixed font sizes (Dynamic Type must be supported)
267
+ ```
268
+
269
+ **Android (Jetpack Compose / Material 3 Expressive):**
270
+ ```
271
+ Color: MaterialTheme.colorScheme dynamic color derived from wallpaper
272
+ NEVER hardcode hex colors in Compose — use semantic tokens
273
+ Shape: Extreme corner expressiveness — use shape variation as affordance signal
274
+ Small interactive: RoundedCornerShape(4dp)
275
+ Cards/surfaces: RoundedCornerShape(16dp)
276
+ FABs: CircleShape
277
+ Motion: Spring physics — tween() is almost never the right choice
278
+ spring(dampingRatio = Spring.DampingRatioMediumBouncy)
279
+ Anti-patterns:
280
+ Hardcoded hex colors (breaks dynamic color contract)
281
+ Linear easing (Material 3 Expressive uses spring physics)
282
+ ❌ Small corner radii (shape expressiveness is a key M3 Expressive principle)
283
+ ```
284
+
285
+ **Web:**
286
+ - Apply domain rules from Step 3
287
+ - Default: dark mode support required (`prefers-color-scheme: dark`)
288
+ - Responsive: must design for 375px, 768px, 1024px, 1440px breakpoints
289
+ - Accessibility: WCAG 2.2 AA minimum
290
+
291
+ ### Step 5 — Generate Design System File
292
+
293
+ Use `Write` to create `.rune/design-system.md`:
294
+
295
+ ```markdown
296
+ # Design System: [Project Name]
297
+ Last Updated: [YYYY-MM-DD]
298
+ Platform: [web | ios | android | multi-platform]
299
+ Domain: [product category]
300
+ Style: [chosen style]
301
+
302
+ ## Color Tokens
303
+
304
+ ### Primitive (raw values)
305
+ --color-[name]-[scale]: [hex]
306
+
307
+ ### Semantic (meaning-mapped)
308
+ --bg-base: [value] — page background
309
+ --bg-surface: [value] — card/panel background
310
+ --bg-elevated: [value] — modal/dropdown background
311
+ --text-primary: [value] — primary text
312
+ --text-secondary: [value] — secondary/muted text
313
+ --border: [value] — default border
314
+ --accent: [value] — primary action/brand
315
+ --success: [value] — positive/profit signal
316
+ --danger: [value] — error/loss signal
317
+ --warning: [value] — caution signal
318
+
319
+ ## Typography
320
+
321
+ | Role | Font | Weight | Size |
322
+ |------|------|--------|------|
323
+ | Display | [font] | [weight] | [px range] |
324
+ | H1 | [font] | [weight] | [px] |
325
+ | H2/H3 | [font] | [weight] | [px] |
326
+ | Body | [font] | [weight] | [px] |
327
+ | Mono/Numbers | [font] | [weight] | [px] |
328
+
329
+ Numbers rule: [monospace font] for ALL numeric values in this domain (prices, metrics, IDs)
330
+
331
+ ## Spacing (8px base)
332
+ xs: 4px | sm: 8px | md: 16px | lg: 24px | xl: 32px | 2xl: 48px | 3xl: 64px
333
+
334
+ ## Border Radius
335
+ sm: 6px | md: 8px | lg: 12px | xl: 16px | full: 9999px
336
+
337
+ ## Effects
338
+ [signature effects for this style — gradients, shadows, blur, etc.]
339
+
340
+ ## Anti-Patterns (MUST NOT generate these)
341
+ [domain-specific list from Step 3 + platform overrides]
342
+ - ❌ [anti-pattern 1] — [why it fails in this domain]
343
+ - ❌ [anti-pattern 2]
344
+
345
+ ## Platform Notes
346
+ [platform-specific implementation requirements from Step 4]
347
+
348
+ ## Component Library
349
+ [detected library or "custom"]
350
+
351
+ ## Pre-Delivery Checklist
352
+ - [ ] Color contrast 4.5:1 for all text
353
+ - [ ] Focus-visible ring on ALL interactive elements (never outline-none alone)
354
+ - [ ] Touch targets 24×24px with 8px gap between targets
355
+ - [ ] All icon-only buttons have aria-label
356
+ - [ ] All inputs have associated <label> or aria-label
357
+ - [ ] Empty state, error state, loading state for all async data
358
+ - [ ] cursor-pointer on all clickable non-button elements
359
+ - [ ] prefers-reduced-motion respected for all animations
360
+ - [ ] Dark mode support (or explicit reasoning why not)
361
+ - [ ] Responsive tested at 375px / 768px / 1024px / 1440px
362
+ ```
363
+
364
+ ### Step 5.5 — UI Design Contract (UI-SPEC.md)
365
+
366
+ After generating the design system, lock key visual decisions in `.rune/ui-spec.md` — a binding contract that prevents design drift during implementation.
367
+
368
+ **Why**: design-system.md defines tokens (what's available). UI-SPEC locks decisions (what was chosen and WHY). Without a spec, each component re-decides layout, density, and hierarchy — causing visual inconsistency.
369
+
370
+ **Generate `.rune/ui-spec.md`:**
371
+
372
+ ```markdown
373
+ # UI Specification: [Project Name]
374
+ Locked: [YYYY-MM-DD] | Mood: [selected mood]
375
+
376
+ ## Layout Decisions
377
+ - Page max-width: [value]px
378
+ - Sidebar: [yes/no] — [width]px [fixed/collapsible]
379
+ - Content density: [compact/balanced/spacious]
380
+ - Card sizing: [uniform/varied] — if varied, specify hierarchy rules
381
+
382
+ ## Visual Hierarchy Rules
383
+ - Primary action: [color] [size] [weight] ONE per viewport
384
+ - Secondary action: [ghost/outline] style max 2 per section
385
+ - Data emphasis: [monospace + bold] for numbers, [color accent] for status
386
+ - Section separation: [border/spacing/background] — pick ONE, be consistent
387
+
388
+ ## Component Decisions
389
+ - Card style: [elevated/bordered/glass] — reasoning: [why]
390
+ - Table style: [striped/bordered/minimal] — reasoning: [why]
391
+ - Form layout: [stacked/inline/grid] — reasoning: [why]
392
+ - Navigation: [sidebar/topbar/tabs] — reasoning: [why]
393
+
394
+ ## Locked Anti-Decisions (things we explicitly chose NOT to do)
395
+ - ❌ [rejected option] — because [reason]
396
+ ```
397
+
398
+ <HARD-GATE>
399
+ UI-SPEC.md is a contract. Once written, changes require explicit user approval ("I want to change the card style"). Skills that generate UI (`cook`, `fix`, `scaffold`) MUST read UI-SPEC.md before producing components. Drift from spec = review finding.
400
+ </HARD-GATE>
401
+
402
+ ### Step 6 — Accessibility Review
403
+
404
+ Run a focused accessibility audit on the design system and any existing UI code. This step ensures the design contract doesn't produce inaccessible outputs.
405
+
406
+ **Automated checks** (use Grep on codebase):
407
+ 1. **Color contrast**: Verify all text/bg combinations in the design system meet WCAG 2.2 AA (4.5:1 normal text, 3:1 large text). Flag any semantic color pair that fails.
408
+ 2. **Focus indicators**: Search for `outline-none`, `outline: none`, `focus:outline-none` without a replacement `focus-visible` ring. Every instance is a violation.
409
+ 3. **Touch targets**: Search for buttons/links with explicit small sizing (`w-6 h-6`, `p-1` on interactive elements). Flag anything < 24x24px.
410
+ 4. **Missing labels**: Search for `<input` without adjacent `<label` or `aria-label`. Search for icon-only buttons without `aria-label`.
411
+ 5. **Semantic HTML**: Flag `<div onClick`, `<span onClick` (should be `<button>`). Flag missing `<nav>`, `<main>`, `<header>` landmarks.
412
+ 6. **Motion safety**: Check for animations/transitions without `prefers-reduced-motion` media query or Tailwind `motion-reduce:` variant.
413
+
414
+ **Output**: Accessibility audit section in Design Report with pass/fail per check and specific file:line violations.
415
+
416
+ If violations found → add them to `.rune/design-system.md` Anti-Patterns section as concrete rules.
417
+
418
+ ### Step 6.5 — 6-Pillar Visual Audit
419
+
420
+ Score the generated design system across 6 pillars. Each pillar scored 1-4 (1=Poor, 2=Fair, 3=Good, 4=Excellent). Minimum passing score: **18/24** (average 3.0).
421
+
422
+ | Pillar | Score 1 (Poor) | Score 2 (Fair) | Score 3 (Good) | Score 4 (Excellent) |
423
+ |--------|---------------|----------------|----------------|---------------------|
424
+ | **Copy** | Placeholder text, generic CTAs ("Submit"), no voice | Real copy but inconsistent tone | Consistent voice, domain-appropriate, clear CTAs | Personality-rich, scannable, microcopy for every state |
425
+ | **Visuals** | Stock photos, generic icons, no visual identity | Consistent icon set, basic imagery | Custom illustrations or curated photography, clear hierarchy | Distinctive visual language, icons tell stories, zero stock |
426
+ | **Color** | Default framework palette, no semantic meaning | Brand colors defined but inconsistent usage | Full semantic palette, dark mode, accessible contrast | Mood-aligned, colorblind-safe, context-adaptive (profit/loss/status) |
427
+ | **Typography** | Single font, no scale | Font pairing exists but inconsistent sizing | Clear hierarchy (display/heading/body/mono), numbers monospace | Mood-aligned pairing, fluid scaling, platform-native where needed |
428
+ | **Spacing** | Inconsistent gaps, cramped or too loose | Base unit defined but not consistently applied | 8px grid, consistent section/component/element spacing | Density variants (compact/default/spacious), rhythm feels intentional |
429
+ | **UX** | Missing states (empty/error/loading), no feedback | Basic states exist, some interactive feedback | All states covered, toast/loading/skeleton, focus management | Delightful micro-interactions, smart defaults, zero dead-ends |
430
+
431
+ **Audit output:**
432
+
433
+ ```
434
+ ### Visual Audit Score: [total]/24
435
+
436
+ | Pillar | Score | Notes |
437
+ |--------|-------|-------|
438
+ | Copy | 3 | Consistent voice, missing loading microcopy |
439
+ | Visuals | 2 | Using Phosphor icons (good), no custom illustration |
440
+ | Color | 4 | Full semantic palette, colorblind alternates defined |
441
+ | Typography | 3 | JetBrains Mono for numbers, Inter for prose solid |
442
+ | Spacing | 3 | 8px grid applied, density variants not needed yet |
443
+ | UX | 3 | All states covered, micro-interactions in progress |
444
+ | **Total** | **18/24** | PASS — ship-ready with Copy improvements recommended |
445
+ ```
446
+
447
+ **If score < 18**: Flag specific weak pillars in Design Report. Add improvement tasks to `.rune/design-system.md` under `## Improvement Backlog`.
448
+
449
+ **Registry safety check**: If an existing component library is in use (shadcn, MUI, etc.), verify the design system doesn't conflict with the library's token structure. Flag collisions.
450
+
451
+ ### Step 7 — UX Writing Patterns
452
+
453
+ Generate microcopy guidelines specific to this product domain. UX writing is part of design — not an afterthought.
454
+
455
+ **Domain-specific microcopy rules:**
456
+
457
+ | Domain | Tone | Error Pattern | CTA Pattern | Empty State |
458
+ |--------|------|---------------|-------------|-------------|
459
+ | Trading/Fintech | Precise, neutral, no humor | "Order failed: insufficient margin ($X required)" | "Place Order", "Close Position" | "No open positions. Market opens in 2h 15m." |
460
+ | SaaS Dashboard | Professional, helpful | "Couldn't save changes. Try again or contact support." | "Get Started", "Upgrade Plan" | "No data yet. Connect your first integration." |
461
+ | E-commerce | Friendly, urgent-capable | "This item is no longer available. Here are similar items." | "Add to Cart", "Buy Now" | "Your cart is empty. Continue shopping?" |
462
+ | Healthcare | Calm, clinical, clear | "We couldn't verify your insurance. Please check your member ID." | "Schedule Visit", "View Results" | "No upcoming appointments." |
463
+ | Developer Tools | Direct, technical | "Build failed: missing dependency `@types/node`" | "Deploy", "Run Tests" | "No builds yet. Push to trigger CI." |
464
+
465
+ **Generate for this project:**
466
+ - Error message template: `[What happened] + [Why] + [What to do next]`
467
+ - Empty state template: `[What's missing] + [How to fill it]`
468
+ - Confirmation template: `[What will happen] + [Reversibility]`
469
+ - Loading text: context-appropriate (not just "Loading...")
470
+ - Button label rules: verb-first, specific action (not "Submit", "Click Here")
471
+
472
+ Add UX writing guidelines to `.rune/design-system.md` under a new `## UX Writing` section.
473
+
474
+ ### Step 8 — Report
475
+
476
+ Emit design summary to calling skill:
477
+
478
+ ```
479
+ ## Design Report: [Project Name]
480
+
481
+ ### Domain Classification
482
+ [product category] — [style chosen] — [platform]
483
+
484
+ ### Design System Generated
485
+ .rune/design-system.md
486
+
487
+ ### Key Decisions
488
+ - Accent: [color + reasoning — why this color for this domain]
489
+ - Typography: [pairing + reasoning]
490
+ - Style: [style name + why it fits this product]
491
+
492
+ ### Anti-Patterns Registered (will be flagged by review)
493
+ - ❌ [n] domain-specific patterns
494
+ - ❌ [n] platform-specific patterns
495
+
496
+ ### Pre-Delivery Checklist
497
+ [count] items to verify before shipping
498
+ ```
499
+
500
+ ## Output Format
501
+
502
+ ```
503
+ ## Design Report: TradingOS Dashboard
504
+
505
+ ### Domain Classification
506
+ Trading/Fintech — Data-Dense Dark — Web
507
+
508
+ ### Design System Generated
509
+ .rune/design-system.md
510
+
511
+ ### Key Decisions
512
+ - Accent: #2196f3 (blue) neutral data highlight; profit/loss colors (#00d084/#ff6b6b)
513
+ are reserved as semantic signals, not brand colors
514
+ - Typography: JetBrains Mono 700 for all numeric values (prices, P&L, %),
515
+ Inter 400/600 for prose and labels
516
+ - Style: Data-Dense Dark — users scan real-time data under time pressure;
517
+ decorative elements compete with data for attention
518
+
519
+ ### Anti-Patterns Registered
520
+ - ❌ 4 domain-specific (gradient wash, conflicting accent colors, decorative motion, dark-on-dark)
521
+ - ❌ 1 platform-specific (fixed font sizes not applicable — web target)
522
+
523
+ ### Pre-Delivery Checklist
524
+ 12 items to verify before shipping
525
+ ```
526
+
527
+ ## Constraints
528
+
529
+ 1. MUST classify domain before generating design system — never generate with unknown domain
530
+ 2. MUST include anti-pattern list in every design system a system without anti-patterns is incomplete
531
+ 3. MUST NOT use purple/indigo as default accent unless domain is AI-Native or explicitly brand-purple
532
+ 4. MUST write `.rune/design-system.md` ephemeral design decisions evaporate; persistence is the point
533
+ 5. MUST NOT overwrite existing design-system.md without user confirmation
534
+ 6. MUST include platform-specific overrides when platform is iOS or Android
535
+
536
+ ## Mesh Gates (L1/L2 only)
537
+
538
+ | Gate | Requires | If Missing |
539
+ |------|----------|------------|
540
+ | Domain Gate | Product domain classified before generating tokens | Ask clarifying question |
541
+ | Anti-Pattern Gate | Anti-pattern list derived from domain rules (not generic) | Domain-specific list required |
542
+ | Persistence Gate | .rune/design-system.md written before reporting done | Write file first |
543
+ | Platform Gate | Platform detected before generating tokens | Default to web, note assumption |
544
+
545
+ ## Returns
546
+
547
+ | Artifact | Format | Location |
548
+ |----------|--------|----------|
549
+ | Design system file | Markdown | `.rune/design-system.md` |
550
+ | UI specification contract | Markdown | `.rune/ui-spec.md` |
551
+ | Design report | Markdown | inline (chat output) |
552
+ | Accessibility audit findings | Markdown list | inline + appended to design-system.md |
553
+ | Visual audit score | Table (6 pillars × 1-4) | inline + appended to design report |
554
+ | UX writing guidelines | Markdown section | `.rune/design-system.md` § UX Writing |
555
+
556
+ ## Sharp Edges
557
+
558
+ Known failure modes for this skill. Check these before declaring done.
559
+
560
+ | Failure Mode | Severity | Mitigation |
561
+ |---|---|---|
562
+ | Generating generic design system without domain classification | CRITICAL | Domain Gate blocks this — classify first |
563
+ | Purple/indigo accent on non-AI-native product | HIGH | Constraint 3 blocks this re-generate with domain-appropriate accent |
564
+ | Anti-pattern list copied from generic sources (not domain-specific) | HIGH | Each anti-pattern must cite why it fails in THIS specific domain |
565
+ | design-system.md not written (only reported verbally) | HIGH | Constraint 4 no file = no persistence = future sessions lose design context |
566
+ | Mood contradicts domain safety conventions | HIGH | Step 2.5 warns user before proceeding (e.g., Playful + Healthcare) |
567
+ | UI-SPEC.md drift components diverge from locked decisions | HIGH | HARD-GATE: cook/fix must read ui-spec.md before generating UI |
568
+ | Visual audit score < 18 shipped without improvement plan | MEDIUM | Step 6.5 flags weak pillars and creates backlog items |
569
+ | iOS target generating solid-background cards | MEDIUM | Platform Gate: iOS 26 Liquid Glass deprecates this pattern |
570
+ | Android target using hardcoded hex colors | MEDIUM | Platform Gate: MaterialTheme.colorScheme is mandatory for dynamic color |
571
+
572
+ ## Done When
573
+
574
+ - Design reference loaded (user override or baseline)
575
+ - Domain classified (one of the 10 categories or explicit custom reasoning)
576
+ - Mood mapped to constraints (or explicitly skipped with "domain defaults")
577
+ - Design system generated with: colors (primitive + semantic), typography, spacing, effects, anti-patterns
578
+ - Platform-specific overrides applied (if iOS/Android target)
579
+ - UI-SPEC.md written with locked layout, hierarchy, and component decisions
580
+ - Accessibility review completed (6 checks: contrast, focus, touch targets, labels, semantic HTML, motion)
581
+ - 6-Pillar Visual Audit scored ≥ 18/24 (or weak pillars flagged with improvement tasks)
582
+ - UX writing guidelines generated (error, empty state, confirmation, loading, button templates)
583
+ - `.rune/design-system.md` written (includes Mood + UX Writing sections)
584
+ - `.rune/ui-spec.md` written (design contract for UI-generating skills)
585
+ - Design Report emitted with mood, accent/typography reasoning, visual audit score, and anti-pattern count
586
+ - Pre-Delivery Checklist included in design-system.md
587
+
588
+ ## Cost Profile
589
+
590
+ ~2000-5000 tokens input, ~800-1500 tokens output. Sonnet for design reasoning quality.