@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,462 @@
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.3.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
+ - `review` (L2): when AI anti-pattern detected in diff
36
+ - `perf` (L2): when Lighthouse Accessibility score blocks
37
+ - User: `/rune design` direct invocation
38
+
39
+ ## Output Files
40
+
41
+ ```
42
+ .rune/
43
+ └── design-system.md # Design contract for all UI-generating skills
44
+ ```
45
+
46
+ ## Executable Steps
47
+
48
+ ### Step 0 — Load Design Reference
49
+
50
+ Load the design knowledge base before reasoning:
51
+
52
+ 1. Check for user-level override: `~/.claude/docs/design-dna.md`
53
+ - If exists → `Read` it. This is the primary reference (user's curated taste).
54
+ 2. If no user override → `Read` the baseline: `skills/design/DESIGN-REFERENCE.md` (shipped with Rune)
55
+ 3. The loaded reference provides: font pairings, chart selection, component architecture, color principles, UX checklist, interaction patterns, anti-pattern signatures
56
+ 4. Apply reference knowledge throughout Steps 3-5 (domain reasoning, token generation, checklist)
57
+
58
+ > **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.
59
+
60
+ ### Step 1 — Discover
61
+
62
+ Invoke `scout` to detect:
63
+ - **Platform target**: `web` | `ios` (SwiftUI) | `android` (Compose) | `react-native` | `multi-platform`
64
+ - **Existing design tokens**: check for `tokens.json`, `design-system/`, `theme.ts`, `tailwind.config.*`, `variables.css`
65
+ - **Component library in use**: shadcn/ui | Radix | MUI | Ant Design | custom | none
66
+ - **Framework**: Next.js | Vite+React | SvelteKit | Vue | SwiftUI | Jetpack Compose | other
67
+
68
+ 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.
69
+
70
+ ### Step 2 — Classify Product Domain
71
+
72
+ From the user's task description + codebase context, classify product type:
73
+
74
+ | Category | Examples |
75
+ |----------|---------|
76
+ | **Trading/Fintech** | trading dashboard, portfolio tracker, payment app, crypto wallet |
77
+ | **SaaS Dashboard** | admin panel, analytics, CRM, project management |
78
+ | **Landing/Marketing** | landing page, product site, marketing page, waitlist |
79
+ | **Healthcare** | patient portal, medical dashboard, health tracker |
80
+ | **E-commerce** | product catalog, cart, checkout, marketplace |
81
+ | **Developer Tools** | IDE plugin, CLI dashboard, API explorer, devtool |
82
+ | **Creative/Portfolio** | portfolio, design showcase, art gallery, agency site |
83
+ | **Social/Community** | social feed, forum, messaging, community platform |
84
+ | **Mobile Consumer** | iOS/Android consumer app — entertainment, productivity, lifestyle |
85
+ | **AI-Native** | AI assistant interface, chatbot, model explorer |
86
+
87
+ If domain is unclear: ask one clarifying question — "Is this closer to X or Y?"
88
+
89
+ ### Step 3 — Apply Domain Reasoning Rules
90
+
91
+ Map domain to design system parameters:
92
+
93
+ **Trading/Fintech:**
94
+ ```
95
+ Style: Data-Dense Dark
96
+ Palette: Neutral dark (#0c1419 bg), semantic colors ONLY for profit/loss
97
+ Profit: #00d084 (green) | Loss: #ff6b6b (red)
98
+ Accent: #2196f3 (data highlight) — NOT purple
99
+ Typography: JetBrains Mono 700 for ALL numeric values (prices, P&L, %)
100
+ Inter 400 for labels, Inter 600 for headings
101
+ Effects: Subtle grid lines, real-time pulse animations on live data
102
+ Anti-patterns:
103
+ ❌ Gradient washes on data tables (obscures precision)
104
+ ❌ Accent colors that conflict with profit/loss signal colors
105
+ ❌ Decorative motion (distracts from live data)
106
+ ❌ Dark-on-dark text for secondary labels (contrast required)
107
+ ```
108
+
109
+ **SaaS Dashboard:**
110
+ ```
111
+ Style: Minimalism or Flat Design
112
+ Palette: Professional neutrals, single brand accent (NOT purple unless brand)
113
+ Light: #ffffff bg, #f8fafc surface | Dark: #0f172a bg, #1e293b surface
114
+ Accent: brand-defined — default #6366f1 is acceptable here as a SaaS pattern
115
+ Typography: Inter 400/500/600 throughout — consistent, readable, data-friendly
116
+ Space Grotesk 700 for hero/display only
117
+ Effects: Skeleton loaders, subtle hover states, clean data tables
118
+ Anti-patterns:
119
+ ❌ Card-grid monotony (every section same layout)
120
+ ❌ Animations that delay data visibility
121
+ ❌ Missing empty/error states in data tables
122
+ ```
123
+
124
+ **Landing/Marketing:**
125
+ ```
126
+ Style: Glassmorphism (current era) or Aurora/Mesh
127
+ Palette: Brand-expressive — this is the ONE context where bold palette is correct
128
+ High-contrast CTAs (must pass 4.5:1 contrast on all backgrounds)
129
+ Typography: Space Grotesk 700 for hero display (48–72px)
130
+ Inter 400/500 for body — max line-width 720px
131
+ Effects: Animated mesh gradients, floating glass cards, scroll-triggered reveals
132
+ Anti-patterns:
133
+ ❌ Generic hero: "big text + diagonal purple-to-blue gradient" — AI signature
134
+ ❌ Centered layout throughout (breaks directional reading flow)
135
+ ❌ Missing scroll animations on a static page
136
+ ❌ CTAs that don't stand out from body copy
137
+ ```
138
+
139
+ **Healthcare:**
140
+ ```
141
+ Style: Trust & Authority (clean, clinical, accessible)
142
+ Palette: Clean blue/white/green — NO red except clinical alerts
143
+ #f0f9ff bg, #1e40af accent, #059669 success, #dc2626 CRITICAL_ONLY
144
+ Typography: Inter throughout — never decorative fonts
145
+ Body minimum 16px for readability by older/impaired users
146
+ Effects: Minimal — subtle hover, no motion by default
147
+ Anti-patterns:
148
+ ❌ Dark mode as default (patients/elderly → light mode)
149
+ ❌ Gamification patterns (inappropriate for medical context)
150
+ ❌ Red for informational messages (reserved for clinical alerts)
151
+ ❌ Dense data layouts without clear visual hierarchy
152
+ ```
153
+
154
+ **E-commerce:**
155
+ ```
156
+ Style: Conversion-Optimized (Warm Minimalism)
157
+ Palette: Warm neutrals, high-contrast CTAs
158
+ Urgency signals: #ef4444 for "low stock", #f59e0b for "sale"
159
+ Typography: Bold product names (Space Grotesk 600+), readable descriptions (Inter 400)
160
+ Effects: Hover zoom on product images, add-to-cart pulse, trust badges
161
+ Anti-patterns:
162
+ ❌ Cluttered above-fold (too many competing CTAs)
163
+ ❌ Add to cart button that doesn't stand out
164
+ ❌ Missing product image zoom/gallery
165
+ ❌ Checkout flow with more than 3 steps visible at once
166
+ ```
167
+
168
+ **Developer Tools:**
169
+ ```
170
+ Style: Minimalism or Neubrutalism
171
+ Palette: Dark mode default — #0d1117 bg (GitHub-scale), #161b22 surface
172
+ Syntax highlighting colors as accent palette
173
+ No heavy gradients — developers recognize and distrust decorative UI
174
+ Typography: JetBrains Mono for code/commands, Inter for prose
175
+ Effects: Keyboard shortcuts visible, dense information layout OK
176
+ Anti-patterns:
177
+ ❌ Decorative animations that delay tool response
178
+ ❌ Non-monospace font for code blocks or command output
179
+ ❌ Light mode only (developer tools default to dark)
180
+ ❌ Visual noise around core functionality
181
+ ```
182
+
183
+ **Creative/Portfolio:**
184
+ ```
185
+ Style: Editorial Grid or Glassmorphism or Brutalism (brand-specific)
186
+ Palette: MUST be distinctive — generic palettes are disqualifying
187
+ This is the one category where custom/unusual palettes are required
188
+ Typography: Custom or display font as headline (NOT Inter alone)
189
+ Font pairing must have contrast: Display + neutral body
190
+ Effects: Curated — hover reveals, scroll-based reveals, cursor effects
191
+ Anti-patterns:
192
+ ❌ Generic card grid with equal padding everywhere
193
+ ❌ Inter-only typography (zero personality)
194
+ ❌ Stock photo backgrounds
195
+ ❌ Navigation that looks like every other portfolio
196
+ ```
197
+
198
+ **AI-Native:**
199
+ ```
200
+ Style: Minimal Functional or Glassmorphism
201
+ Palette: Purple/violet IS acceptable here (it is the AI-native signal)
202
+ #7c3aed accent, dark neutral bg, subtle gradients
203
+ Typography: Inter throughout — clarity over personality
204
+ Effects: Typing indicators, streaming text, thinking states
205
+ Anti-patterns:
206
+ ❌ Purple on non-AI product (exports the AI signal to inappropriate contexts)
207
+ ❌ Static empty states — AI interfaces must show "thinking" states
208
+ ❌ Missing latency UX (skeleton during generation, cancel button)
209
+ ```
210
+
211
+ ### Step 4 — Platform-Specific Overrides
212
+
213
+ Apply platform conventions on top of domain rules:
214
+
215
+ **iOS (SwiftUI / iOS 26+):**
216
+ ```
217
+ Visual language: Liquid Glass — translucent surfaces with backdrop blur
218
+ background: UIBlurEffect or .regularMaterial
219
+ border: subtle 1px rgba(white, 0.15) — NOT solid
220
+ roundness: aggressive corner radius (16–24px on cards, full on buttons)
221
+ Icons: SF Symbols ONLY — not Heroicons, not Lucide
222
+ Typography: SF Pro family — Dynamic Type scaling is mandatory
223
+ Safe areas: Content must respect safeAreaInsets on all edges
224
+ Anti-patterns:
225
+ ❌ Solid-background cards (deprecated in iOS 26 Liquid Glass era)
226
+ ❌ Custom icon fonts (SF Symbols is the platform contract)
227
+ ❌ Fixed font sizes (Dynamic Type must be supported)
228
+ ```
229
+
230
+ **Android (Jetpack Compose / Material 3 Expressive):**
231
+ ```
232
+ Color: MaterialTheme.colorScheme — dynamic color derived from wallpaper
233
+ NEVER hardcode hex colors in Compose — use semantic tokens
234
+ Shape: Extreme corner expressiveness — use shape variation as affordance signal
235
+ Small interactive: RoundedCornerShape(4dp)
236
+ Cards/surfaces: RoundedCornerShape(16dp)
237
+ FABs: CircleShape
238
+ Motion: Spring physics — tween() is almost never the right choice
239
+ spring(dampingRatio = Spring.DampingRatioMediumBouncy)
240
+ Anti-patterns:
241
+ ❌ Hardcoded hex colors (breaks dynamic color contract)
242
+ ❌ Linear easing (Material 3 Expressive uses spring physics)
243
+ ❌ Small corner radii (shape expressiveness is a key M3 Expressive principle)
244
+ ```
245
+
246
+ **Web:**
247
+ - Apply domain rules from Step 3
248
+ - Default: dark mode support required (`prefers-color-scheme: dark`)
249
+ - Responsive: must design for 375px, 768px, 1024px, 1440px breakpoints
250
+ - Accessibility: WCAG 2.2 AA minimum
251
+
252
+ ### Step 5 — Generate Design System File
253
+
254
+ Use `Write` to create `.rune/design-system.md`:
255
+
256
+ ```markdown
257
+ # Design System: [Project Name]
258
+ Last Updated: [YYYY-MM-DD]
259
+ Platform: [web | ios | android | multi-platform]
260
+ Domain: [product category]
261
+ Style: [chosen style]
262
+
263
+ ## Color Tokens
264
+
265
+ ### Primitive (raw values)
266
+ --color-[name]-[scale]: [hex]
267
+
268
+ ### Semantic (meaning-mapped)
269
+ --bg-base: [value] — page background
270
+ --bg-surface: [value] — card/panel background
271
+ --bg-elevated: [value] — modal/dropdown background
272
+ --text-primary: [value] — primary text
273
+ --text-secondary: [value] — secondary/muted text
274
+ --border: [value] — default border
275
+ --accent: [value] — primary action/brand
276
+ --success: [value] — positive/profit signal
277
+ --danger: [value] — error/loss signal
278
+ --warning: [value] — caution signal
279
+
280
+ ## Typography
281
+
282
+ | Role | Font | Weight | Size |
283
+ |------|------|--------|------|
284
+ | Display | [font] | [weight] | [px range] |
285
+ | H1 | [font] | [weight] | [px] |
286
+ | H2/H3 | [font] | [weight] | [px] |
287
+ | Body | [font] | [weight] | [px] |
288
+ | Mono/Numbers | [font] | [weight] | [px] |
289
+
290
+ Numbers rule: [monospace font] for ALL numeric values in this domain (prices, metrics, IDs)
291
+
292
+ ## Spacing (8px base)
293
+ xs: 4px | sm: 8px | md: 16px | lg: 24px | xl: 32px | 2xl: 48px | 3xl: 64px
294
+
295
+ ## Border Radius
296
+ sm: 6px | md: 8px | lg: 12px | xl: 16px | full: 9999px
297
+
298
+ ## Effects
299
+ [signature effects for this style — gradients, shadows, blur, etc.]
300
+
301
+ ## Anti-Patterns (MUST NOT generate these)
302
+ [domain-specific list from Step 3 + platform overrides]
303
+ - ❌ [anti-pattern 1] — [why it fails in this domain]
304
+ - ❌ [anti-pattern 2]
305
+
306
+ ## Platform Notes
307
+ [platform-specific implementation requirements from Step 4]
308
+
309
+ ## Component Library
310
+ [detected library or "custom"]
311
+
312
+ ## Pre-Delivery Checklist
313
+ - [ ] Color contrast ≥ 4.5:1 for all text
314
+ - [ ] Focus-visible ring on ALL interactive elements (never outline-none alone)
315
+ - [ ] Touch targets ≥ 24×24px with 8px gap between targets
316
+ - [ ] All icon-only buttons have aria-label
317
+ - [ ] All inputs have associated <label> or aria-label
318
+ - [ ] Empty state, error state, loading state for all async data
319
+ - [ ] cursor-pointer on all clickable non-button elements
320
+ - [ ] prefers-reduced-motion respected for all animations
321
+ - [ ] Dark mode support (or explicit reasoning why not)
322
+ - [ ] Responsive tested at 375px / 768px / 1024px / 1440px
323
+ ```
324
+
325
+ ### Step 6 — Accessibility Review
326
+
327
+ 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.
328
+
329
+ **Automated checks** (use Grep on codebase):
330
+ 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.
331
+ 2. **Focus indicators**: Search for `outline-none`, `outline: none`, `focus:outline-none` without a replacement `focus-visible` ring. Every instance is a violation.
332
+ 3. **Touch targets**: Search for buttons/links with explicit small sizing (`w-6 h-6`, `p-1` on interactive elements). Flag anything < 24x24px.
333
+ 4. **Missing labels**: Search for `<input` without adjacent `<label` or `aria-label`. Search for icon-only buttons without `aria-label`.
334
+ 5. **Semantic HTML**: Flag `<div onClick`, `<span onClick` (should be `<button>`). Flag missing `<nav>`, `<main>`, `<header>` landmarks.
335
+ 6. **Motion safety**: Check for animations/transitions without `prefers-reduced-motion` media query or Tailwind `motion-reduce:` variant.
336
+
337
+ **Output**: Accessibility audit section in Design Report with pass/fail per check and specific file:line violations.
338
+
339
+ If violations found → add them to `.rune/design-system.md` Anti-Patterns section as concrete rules.
340
+
341
+ ### Step 7 — UX Writing Patterns
342
+
343
+ Generate microcopy guidelines specific to this product domain. UX writing is part of design — not an afterthought.
344
+
345
+ **Domain-specific microcopy rules:**
346
+
347
+ | Domain | Tone | Error Pattern | CTA Pattern | Empty State |
348
+ |--------|------|---------------|-------------|-------------|
349
+ | Trading/Fintech | Precise, neutral, no humor | "Order failed: insufficient margin ($X required)" | "Place Order", "Close Position" | "No open positions. Market opens in 2h 15m." |
350
+ | SaaS Dashboard | Professional, helpful | "Couldn't save changes. Try again or contact support." | "Get Started", "Upgrade Plan" | "No data yet. Connect your first integration." |
351
+ | 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?" |
352
+ | Healthcare | Calm, clinical, clear | "We couldn't verify your insurance. Please check your member ID." | "Schedule Visit", "View Results" | "No upcoming appointments." |
353
+ | Developer Tools | Direct, technical | "Build failed: missing dependency `@types/node`" | "Deploy", "Run Tests" | "No builds yet. Push to trigger CI." |
354
+
355
+ **Generate for this project:**
356
+ - Error message template: `[What happened] + [Why] + [What to do next]`
357
+ - Empty state template: `[What's missing] + [How to fill it]`
358
+ - Confirmation template: `[What will happen] + [Reversibility]`
359
+ - Loading text: context-appropriate (not just "Loading...")
360
+ - Button label rules: verb-first, specific action (not "Submit", "Click Here")
361
+
362
+ Add UX writing guidelines to `.rune/design-system.md` under a new `## UX Writing` section.
363
+
364
+ ### Step 8 — Report
365
+
366
+ Emit design summary to calling skill:
367
+
368
+ ```
369
+ ## Design Report: [Project Name]
370
+
371
+ ### Domain Classification
372
+ [product category] — [style chosen] — [platform]
373
+
374
+ ### Design System Generated
375
+ .rune/design-system.md
376
+
377
+ ### Key Decisions
378
+ - Accent: [color + reasoning — why this color for this domain]
379
+ - Typography: [pairing + reasoning]
380
+ - Style: [style name + why it fits this product]
381
+
382
+ ### Anti-Patterns Registered (will be flagged by review)
383
+ - ❌ [n] domain-specific patterns
384
+ - ❌ [n] platform-specific patterns
385
+
386
+ ### Pre-Delivery Checklist
387
+ [count] items to verify before shipping
388
+ ```
389
+
390
+ ## Output Format
391
+
392
+ ```
393
+ ## Design Report: TradingOS Dashboard
394
+
395
+ ### Domain Classification
396
+ Trading/Fintech — Data-Dense Dark — Web
397
+
398
+ ### Design System Generated
399
+ .rune/design-system.md
400
+
401
+ ### Key Decisions
402
+ - Accent: #2196f3 (blue) — neutral data highlight; profit/loss colors (#00d084/#ff6b6b)
403
+ are reserved as semantic signals, not brand colors
404
+ - Typography: JetBrains Mono 700 for all numeric values (prices, P&L, %),
405
+ Inter 400/600 for prose and labels
406
+ - Style: Data-Dense Dark — users scan real-time data under time pressure;
407
+ decorative elements compete with data for attention
408
+
409
+ ### Anti-Patterns Registered
410
+ - ❌ 4 domain-specific (gradient wash, conflicting accent colors, decorative motion, dark-on-dark)
411
+ - ❌ 1 platform-specific (fixed font sizes not applicable — web target)
412
+
413
+ ### Pre-Delivery Checklist
414
+ 12 items to verify before shipping
415
+ ```
416
+
417
+ ## Constraints
418
+
419
+ 1. MUST classify domain before generating design system — never generate with unknown domain
420
+ 2. MUST include anti-pattern list in every design system — a system without anti-patterns is incomplete
421
+ 3. MUST NOT use purple/indigo as default accent unless domain is AI-Native or explicitly brand-purple
422
+ 4. MUST write `.rune/design-system.md` — ephemeral design decisions evaporate; persistence is the point
423
+ 5. MUST NOT overwrite existing design-system.md without user confirmation
424
+ 6. MUST include platform-specific overrides when platform is iOS or Android
425
+
426
+ ## Mesh Gates (L1/L2 only)
427
+
428
+ | Gate | Requires | If Missing |
429
+ |------|----------|------------|
430
+ | Domain Gate | Product domain classified before generating tokens | Ask clarifying question |
431
+ | Anti-Pattern Gate | Anti-pattern list derived from domain rules (not generic) | Domain-specific list required |
432
+ | Persistence Gate | .rune/design-system.md written before reporting done | Write file first |
433
+ | Platform Gate | Platform detected before generating tokens | Default to web, note assumption |
434
+
435
+ ## Sharp Edges
436
+
437
+ Known failure modes for this skill. Check these before declaring done.
438
+
439
+ | Failure Mode | Severity | Mitigation |
440
+ |---|---|---|
441
+ | Generating generic design system without domain classification | CRITICAL | Domain Gate blocks this — classify first |
442
+ | Purple/indigo accent on non-AI-native product | HIGH | Constraint 3 blocks this — re-generate with domain-appropriate accent |
443
+ | Anti-pattern list copied from generic sources (not domain-specific) | HIGH | Each anti-pattern must cite why it fails in THIS specific domain |
444
+ | design-system.md not written (only reported verbally) | HIGH | Constraint 4 — no file = no persistence = future sessions lose design context |
445
+ | iOS target generating solid-background cards | MEDIUM | Platform Gate: iOS 26 Liquid Glass deprecates this pattern |
446
+ | Android target using hardcoded hex colors | MEDIUM | Platform Gate: MaterialTheme.colorScheme is mandatory for dynamic color |
447
+
448
+ ## Done When
449
+
450
+ - Design reference loaded (user override or baseline)
451
+ - Domain classified (one of the 10 categories or explicit custom reasoning)
452
+ - Design system generated with: colors (primitive + semantic), typography, spacing, effects, anti-patterns
453
+ - Platform-specific overrides applied (if iOS/Android target)
454
+ - Accessibility review completed (6 checks: contrast, focus, touch targets, labels, semantic HTML, motion)
455
+ - UX writing guidelines generated (error, empty state, confirmation, loading, button templates)
456
+ - `.rune/design-system.md` written (includes UX Writing section)
457
+ - Design Report emitted with accent/typography reasoning and anti-pattern count
458
+ - Pre-Delivery Checklist included in design-system.md
459
+
460
+ ## Cost Profile
461
+
462
+ ~2000-5000 tokens input, ~800-1500 tokens output. Sonnet for design reasoning quality.