@shavin/skills 0.0.0-stage → 0.1.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 (80) hide show
  1. package/AGENTS.md +193 -0
  2. package/CHANGELOG.md +27 -0
  3. package/LICENSE +21 -0
  4. package/README.md +48 -2
  5. package/bin/hex-policy.mjs +157 -0
  6. package/bin/install.mjs +219 -0
  7. package/bin/lint-tokens.mjs +178 -0
  8. package/build.mjs +540 -0
  9. package/commands/add-composition.md +14 -0
  10. package/commands/apply-theme.md +59 -0
  11. package/commands/audit-layout.md +15 -0
  12. package/commands/audit-ui.md +42 -0
  13. package/commands/compose-page.md +16 -0
  14. package/commands/create-block.md +79 -0
  15. package/commands/create-primitive.md +40 -0
  16. package/commands/create-screen.md +45 -0
  17. package/commands/create-theme.md +41 -0
  18. package/cursor/shavin.mdc +14 -0
  19. package/package.json +66 -4
  20. package/posix-path.mjs +7 -0
  21. package/skills/core-rules.md +294 -0
  22. package/skills/layout-choreography/SKILL.md +102 -0
  23. package/skills/layout-choreography/references/fallbacks-and-accessibility.md +76 -0
  24. package/skills/layout-choreography/references/scenes.md +113 -0
  25. package/skills/layout-choreography/references/shavin-timelines.md +100 -0
  26. package/skills/layout-choreography/references/tech-and-performance.md +147 -0
  27. package/skills/layout-compositions/SKILL.md +149 -0
  28. package/skills/layout-compositions/references/adapters/shavin-ui.md +122 -0
  29. package/skills/layout-compositions/references/adapters/tailwind-html.md +100 -0
  30. package/skills/layout-compositions/references/component-language.md +105 -0
  31. package/skills/layout-compositions/references/compositions/conversion.md +286 -0
  32. package/skills/layout-compositions/references/compositions/documentation.md +125 -0
  33. package/skills/layout-compositions/references/compositions/editorial.md +126 -0
  34. package/skills/layout-compositions/references/compositions/expressive.md +151 -0
  35. package/skills/layout-compositions/references/compositions/features.md +262 -0
  36. package/skills/layout-compositions/references/compositions/gallery.md +172 -0
  37. package/skills/layout-compositions/references/compositions/hero.md +184 -0
  38. package/skills/layout-compositions/references/compositions/proof.md +194 -0
  39. package/skills/layout-compositions/references/compositions/structural.md +173 -0
  40. package/skills/layout-compositions/references/distinctiveness.md +65 -0
  41. package/skills/layout-compositions/references/foundations.md +119 -0
  42. package/skills/layout-compositions/references/metadata-schema.md +64 -0
  43. package/skills/layout-compositions/references/page-recipes.md +143 -0
  44. package/skills/layout-compositions/references/selection-guide.md +207 -0
  45. package/skills/layout-compositions/references/treatments.md +60 -0
  46. package/skills/layout-compositions/references/unsection-source-examples.md +92 -0
  47. package/skills/layout-compositions/references/visual-review.md +40 -0
  48. package/skills/layout-compositions/scripts/render_wireframes.py +138 -0
  49. package/skills/layout-compositions/scripts/validate_library.py +165 -0
  50. package/skills/layout-motion/SKILL.md +83 -0
  51. package/skills/layout-motion/references/composition-motion-map.md +69 -0
  52. package/skills/layout-motion/references/presets.md +209 -0
  53. package/skills/layout-motion/references/tokens.md +100 -0
  54. package/skills/shavin-app/SKILL.md +242 -0
  55. package/skills/shavin-app/patterns.md +35 -0
  56. package/skills/shavin-studio/SKILL.md +97 -0
  57. package/skills/shavin-webpage/SKILL.md +210 -0
  58. package/skills/shavin-webpage/editorial-craft.md +117 -0
  59. package/skills/shavin-webpage/page-architecture.md +137 -0
  60. package/skills/shavin-webpage/style-recipes.md +107 -0
  61. package/skills/visual-compositor/SKILL.md +200 -0
  62. package/skills/visual-compositor/anti-patterns.md +109 -0
  63. package/skills/visual-compositor/audit-checklist.md +162 -0
  64. package/skills/visual-compositor/cognitive-layer.md +287 -0
  65. package/skills/visual-compositor/composition-motion-map.md +167 -0
  66. package/skills/visual-compositor/concentric-laws.md +147 -0
  67. package/skills/visual-compositor/docs-mode.md +32 -0
  68. package/skills/visual-compositor/editorial-mode.md +48 -0
  69. package/skills/visual-compositor/font-pairings.md +224 -0
  70. package/skills/visual-compositor/graphics-and-assets.md +128 -0
  71. package/skills/visual-compositor/interface-polish.md +125 -0
  72. package/skills/visual-compositor/layout-restraint.md +80 -0
  73. package/skills/visual-compositor/motion-and-physics.md +257 -0
  74. package/skills/visual-compositor/page-motion-presets.md +246 -0
  75. package/skills/visual-compositor/references/EDITORIAL_EXPRESSIVE.md +163 -0
  76. package/skills/visual-compositor/spacing-core.md +386 -0
  77. package/skills/visual-compositor/spacing-dense.md +63 -0
  78. package/skills/visual-compositor/spacing-marketing.md +192 -0
  79. package/skills/visual-compositor/typography-rules.md +114 -0
  80. package/token-budget.json +86 -0
@@ -0,0 +1,48 @@
1
+ # Editorial & Expressive Mode
2
+
3
+ > **Load priority:** Loaded ONLY for EDITORIAL mode (full) and HYBRID mode (hero/marquee sections only).
4
+ > **Token cost:** ~0.5K tokens.
5
+ > **Active for:** `EDITORIAL` (full), `HYBRID` (hero/marquee sections), `MARKETING` (hero section only)
6
+
7
+ ---
8
+
9
+ ## Quick Reference
10
+
11
+ Editorial mode enables 8 advanced capabilities:
12
+
13
+ 1. **Motion Architecture** — Scroll-triggered animations, parallax, easing curves
14
+ 2. **Editorial Typography** — Fluid sizing with `clamp()`, extreme contrast ratios
15
+ 3. **Z-Axis Depth** — 3D transforms, layered depth, grid escape
16
+ 4. **Asymmetric Grid** — Golden ratio, intentional imbalance
17
+ 5. **Section Transitions** — Diagonal clip-paths, overlapping sections
18
+ 6. **Color Atmosphere** — Grain textures, glassmorphism, radial glows
19
+ 7. **Theatrical White Space** — Breath sections, void minimums
20
+ 8. **Hero Scale** — Full viewport height with `100dvh`
21
+
22
+ ---
23
+
24
+ ## Detailed Reference
25
+
26
+ For complete implementation details, code examples, and anti-patterns:
27
+
28
+ **→ Load `references/EDITORIAL_EXPRESSIVE.md`** (~1K tokens)
29
+
30
+ This file contains:
31
+ - Full motion architecture (easing curves, scroll triggers, parallax ratios)
32
+ - Typography contrast rules and clamp() examples
33
+ - Z-index scale and 3D transform patterns
34
+ - Grid escape and asymmetric layout code
35
+ - Section transition techniques
36
+ - Color atmosphere implementations
37
+ - Theatrical spacing guidelines
38
+ - Hero scale patterns with `100dvh`
39
+ - Editorial-specific anti-patterns table
40
+
41
+ ---
42
+
43
+ ## When to Load
44
+
45
+ - **EDITORIAL mode:** Load this file + `references/EDITORIAL_EXPRESSIVE.md`
46
+ - **HYBRID mode:** Load this file + `references/EDITORIAL_EXPRESSIVE.md` for hero sections only
47
+ - **MARKETING mode:** Skip (unless building a hero with editorial techniques)
48
+ - **STRUCTURAL mode:** Skip entirely
@@ -0,0 +1,224 @@
1
+ # Font Pairings by Mode
2
+
3
+ > **Load priority:** Loaded when making font decisions. Use `get_skill_mode` to determine which mode's pairings to load.
4
+ > **Token cost:** ~2.8K tokens.
5
+ > **Mode-specific:** Each mode has different emotional register — fonts must match it.
6
+
7
+ ---
8
+
9
+ ## Defaults
10
+
11
+ - The default pairing is `Rethink Sans` (display) + `Inter` (body), set by the default theme. It is the built-in fallback, not a design decision. For a new site or page, choose the theme from the brief as described under "Theme for a new site or page" below.
12
+ - Do not use `Space Grotesk` as the display font unless asked: it is the most common AI default.
13
+
14
+ ---
15
+
16
+ ## Theme for a new site or page
17
+
18
+ If `SHAVIN.md` still says `UNSET` for Primary Brand or Display / Body Font (or `.shavin/config.json` has `brandConfirmed: false`) and the user did not name colours or fonts, choose them from the brief before building:
19
+
20
+ 1. A brand colour: a preset name or a hex that fits the audience and mood. Do not default to `monochrome`.
21
+ 2. A display and body font pair from the pairings below, matched to the mode.
22
+ 3. A mode that fits the content: light for editorial and content-led pages, dark only where the product suits it.
23
+ 4. One sentence of reasoning (audience, mood).
24
+
25
+ Apply them with `npx @shavin/cli brand --color <preset|#hex> --display-font <name> --body-font <name> --mode <dark-first|light-first|system>`. Without a shell, set the same values on `ThemeProvider` (`brandColor`, `displayFont`, `bodyFont`, `defaultTheme`) and in the `SHAVIN.md` and `.shavin/config.json` lines by hand.
26
+
27
+ After the first page, tell the user in two sentences what you chose and why, and offer two alternatives. If they accept or do not answer, run `npx @shavin/cli brand --confirm`. If they pick another, run `brand` with the new values and `--confirm`. Ask once, never again once confirmed.
28
+
29
+ ---
30
+
31
+ ## How @shavin/ui Loads Fonts
32
+
33
+ Use the Shavin font loader — never hardcode `@import` or raw `<link>` tags in components:
34
+
35
+ ```ts
36
+ import { applyDisplayFontPreset, applyBodyFontPreset, loadGoogleFont } from "@shavin/ui/lib/theme-presets";
37
+
38
+ // Apply a curated pairing for the active mode:
39
+ applyDisplayFontPreset("Fraunces"); // sets --font-display
40
+ applyBodyFontPreset("Inter"); // sets --font-body
41
+ ```
42
+
43
+ Set fonts on the provider first; it loads them:
44
+
45
+ ```tsx
46
+ <ThemeProvider displayFont="Fraunces" bodyFont="Inter">{children}</ThemeProvider>
47
+ ```
48
+
49
+ Fonts in the `ThemeProvider` presets load with that one prop. Any other Google font loads with `loadGoogleFont("Name")`; a font that is not on Google Fonts cannot be loaded this way. `next/font/google` in `layout.tsx` is the fallback only (see `core-rules.md` §5).
50
+
51
+ ---
52
+
53
+ ## Pairing Vocabulary
54
+
55
+ Every pairing has two roles:
56
+
57
+ | Role | CSS var | Controls |
58
+ | ----------- | ---------------- | ------------------------------------------ |
59
+ | **Display** | `--font-display` | Hero headings, section titles, pull-quotes |
60
+ | **Body** | `--font-body` | Body copy, UI labels, captions, form text |
61
+ | **Subheading** | `--font-subheading` | h3-h6 headings (card, step and list titles). Defaults to the body font |
62
+
63
+ `<Heading>` picks the role from its tag: h1/h2 and display sizes use display, h3-h6 use subheading. Do not add `font-display` or `font-sans` to an h3-h6 by hand. To change it for a whole theme, set `<ThemeProvider subheadingFont="display">` (or a font name). Display faces lose strength at small sizes, which is why subheadings follow the body font by default.
64
+
65
+ Rules:
66
+
67
+ - Display font supplies **personality and emotional register**. It is the voice.
68
+ - Body font supplies **legibility and neutrality**. It is the words.
69
+ - They must contrast each other — two geometric sans-serifs paired together is noise, not pairing.
70
+ - Body font must be a workhorse: highly legible at 14px–16px, tested on retina and non-retina, comfortable in long paragraphs.
71
+
72
+ ---
73
+
74
+ ## MARKETING Mode — Curated Pairings
75
+
76
+ > Register: Professional, modern, credible. Functional beauty. Like Vercel, Stripe, Linear's website.
77
+
78
+ | Pairing Name | Display | Body | Personality | Best for |
79
+ | ------------------------- | ----------------------------------- | --------- | -------------------------------------------------------- | ------------------------------------------- |
80
+ | **Shavin default** _(default)_ | `Rethink Sans` (humanist grotesque) | `Inter` | Neutral, modern, credible | Most SaaS, product and marketing sites |
81
+ | **Warm Authority** | `Fraunces` (serif) | `Inter` | Warm authority — the serif adds craft to a modern system | SaaS homepages, design tools, product sites |
82
+ | **Geometric Power** | `Host Grotesk` (grotesque sans) | `Inter` | Bold, technical, forward-looking | Dev tools, infra products, APIs |
83
+ | **Editorial Clean** | `Outfit` (variable geometric) | `DM Sans` | Friendly precision — rounded geometry, approachable | Consumer SaaS, productivity, onboarding |
84
+ | **Classic Trust** | `Playfair Display` (didone serif) | `Inter` | Legacy credibility — financial, legal, established | Finance, enterprise, professional services |
85
+ | **Minimal Modern** | `Inter` (as display at bold weight) | `Inter` | Ultra-clean, system-native feel | Documentation portals, technical references |
86
+
87
+ ```ts
88
+ // Warm Authority (Fraunces + Inter): a serif-led brand
89
+ applyDisplayFontPreset("Fraunces");
90
+ applyBodyFontPreset("Inter");
91
+
92
+ // Usage in JSX:
93
+ <Heading as="h1" size="3xl" weight="bold">
94
+ Build with intention.
95
+ </Heading>
96
+ <Text size="md" color="subtle">
97
+ Supporting description in Inter — legible, neutral, workmanlike.
98
+ </Text>
99
+ ```
100
+
101
+ ---
102
+
103
+ ## STRUCTURAL Mode — Curated Pairings
104
+
105
+ > Register: Dense, efficient, productivity-first. Like Linear app, Figma, Notion, Raycast. Type serves data, never decorates it.
106
+
107
+ | Pairing Name | Display | Body | Personality | Best for |
108
+ | ------------------------------------ | ----------------------- | --------- | ---------------------------------------------- | ---------------------------------------- |
109
+ | **Shavin default** _(default)_ | `Rethink Sans` | `Inter` | Neutral headings over a workhorse body | Dashboards, admin consoles, data grids |
110
+ | **Invisible System** | `Inter` | `Inter` | Zero personality by design | Maximum-density data grids |
111
+ | **Technical Precision** | `JetBrains Mono` (mono) | `Inter` | Code-adjacent — signals developer tools | IDE UIs, log viewers, terminal emulators |
112
+ | **Sharp Efficiency** | `Geist` | `Geist` | Vercel's system — ultra-clean, strong numerals | Internal tools, metrics dashboards |
113
+ | **Warm Productivity** | `Outfit` | `DM Sans` | Slightly softer — less cold than Inter | B2C apps, consumer productivity |
114
+
115
+ ```ts
116
+ // Invisible System (Inter + Inter), for maximum density only
117
+ applyDisplayFontPreset("Inter");
118
+ applyBodyFontPreset("Inter");
119
+
120
+ // Keep display and body the same font only for maximum density.
121
+ // Otherwise the theme default (Rethink Sans + Inter) applies: contrast comes from size and weight.
122
+ ```
123
+
124
+ **Key rule for STRUCTURAL:** Never use a serif or expressive display font in an app UI. It destroys scan speed. A Fraunces heading inside a dashboard sidebar looks broken, not premium.
125
+
126
+ ---
127
+
128
+ ## EDITORIAL Mode — Curated Pairings
129
+
130
+ > Register: Expressive, art-directed, cinematic. Type is visual material, not just labels. Like apple.com, awwwards SOTD sites, luxury brand experiences.
131
+
132
+ | Pairing Name | Display | Body | Personality | Best for |
133
+ | ------------------------------ | ----------------------------------------- | ------------------- | ---------------------------------------------------------- | ----------------------------------------------- |
134
+ | **High Editorial** _(default)_ | `Fraunces` (variable optical, italic) | `Inter` | The contrast of old-world letterpress vs modern clean grid | Agency portfolios, brand launches, luxury |
135
+ | **Contrast Serif** | `Playfair Display` (high-contrast didone) | `DM Mono` | Dramatic hairlines + monospace body — cinematic tension | Fashion, luxury goods, editorial photography |
136
+ | **New Wave** | `Funnel Display` | `Lora` (serif body) | Unexpectedly bold grotesque display + serif reading | Creative studios, modern magazines |
137
+ | **Typographic Void** | `Bebas Neue` (condensed all-caps) | `Inter` (light) | Maximum scale contrast — headline as image | Music, entertainment, sport, high-energy brands |
138
+ | **Organic Luxury** | `Cormorant Garamond` (thin elegant serif) | `DM Sans` | Delicate, aristocratic, fashion-forward | Perfume, jewellery, haute couture, hotels |
139
+ | **Brutalist** | `Space Mono` (typewriter mono) | `Space Mono` | Anti-design design — intentionally raw | Art, experimental, tech-art, indie labels |
140
+
141
+ ```ts
142
+ // High Editorial pairing — Fraunces italic + Inter
143
+ applyDisplayFontPreset("Fraunces");
144
+ applyBodyFontPreset("Inter");
145
+
146
+ // In editorial mode, the display font plays at EXTREME scale
147
+ // clamp() produces the fluid sizing that makes it feel alive
148
+ ```
149
+
150
+ ```jsx
151
+ // Editorial display heading — type as visual material
152
+ <Heading
153
+ as="h1"
154
+ className="italic font-black leading-none tracking-tighter"
155
+ style={{ fontSize: "clamp(4rem, 12vw, 12rem)" }}
156
+ >
157
+ Craft,<br />not code.
158
+ </Heading>
159
+
160
+ // Body remains Inter for legibility contrast
161
+ <Text size="lg" color="subtle" className="leading-relaxed max-w-prose">
162
+ Supporting text — the neutral counterweight to the expressive display.
163
+ </Text>
164
+ ```
165
+
166
+ **Editorial contrast ratios for type pairings:**
167
+
168
+ ```
169
+ Display size : Body size = 6:1 minimum in editorial mode (vs 2:1 in marketing)
170
+ Display weight: bold/black (700–900) vs body weight: regular (400)
171
+ Display style: italic OR condensed OR all-caps (one axis of expression, not all three)
172
+ ```
173
+
174
+ ---
175
+
176
+ ## HYBRID Mode — Pairing Strategy
177
+
178
+ > Marketing hero → MARKETING pairing. App/interactive section → STRUCTURAL pairing.
179
+ > The transition between sections is the only place where font family changes are acceptable within a single page.
180
+
181
+ ```
182
+ Hero section: marketing pairing (default Rethink Sans + Inter; Fraunces + Inter for a serif brand)
183
+ Product UI demo: structural pairing (default Rethink Sans + Inter)
184
+ Footer/CTA: Return to the marketing pairing
185
+ ```
186
+
187
+ Never switch font families mid-section. The boundary must be a deliberate section transition.
188
+
189
+ ---
190
+
191
+ ## Quick Decision Tree
192
+
193
+ ```
194
+ User said "fancy" / "expressive" / "awwwards" / "editorial"?
195
+ → EDITORIAL mode → pick from editorial pairings based on brand energy:
196
+ Luxury/fashion? → Cormorant + DM Sans
197
+ Agency/portfolio? → Fraunces italic + Inter (default)
198
+ Cinematic/dramatic? → Playfair Display + DM Mono
199
+ Brutalist/raw? → Space Mono + Space Mono
200
+
201
+ User said "landing page" / "marketing site" / "SaaS homepage"?
202
+ → MARKETING mode → Rethink Sans + Inter (the theme default); Fraunces + Inter for serif-led brands
203
+ Finance/enterprise? → Playfair + Inter
204
+ Dev tools/APIs? → Host Grotesk + Inter
205
+ Minimal docs? → Inter + Inter
206
+
207
+ User said "dashboard" / "app" / "admin" / "tool"?
208
+ → STRUCTURAL mode → the theme default (Rethink Sans + Inter); Inter + Inter only for maximum density
209
+ ```
210
+
211
+ ---
212
+
213
+ ## Anti-Patterns
214
+
215
+ ```
216
+ ✗ Serif display font inside a dashboard sidebar nav
217
+ ✗ Two serif fonts paired together (no neutrality; both compete)
218
+ ✗ Two geometric sans-serifs paired together (no contrast; both blend)
219
+ ✗ All-caps condensed body text (destroys readability at body size)
220
+ ✗ Variable font with no axis control (WGHT/ITAL not specified = browser default = ugly)
221
+ ✗ Loading more than 2 font families on a single page (HTTP cost + style noise)
222
+ ✗ Space Grotesk as the default display font (the most common AI default); use it only when asked
223
+ ✗ Using font-family in raw className strings — always via --font-display / --font-body vars
224
+ ```
@@ -0,0 +1,128 @@
1
+ # Graphics, Assets, Backgrounds & Atmospheric Depth
2
+
3
+ > **Load priority:** MARKETING, EDITORIAL, and HYBRID modes.
4
+ > **Token cost:** ~2.5K tokens.
5
+ > **Companion to:** `layout-restraint.md` (anti-bloat) and `spacing-marketing.md` (visual weight).
6
+
7
+ This section defines the strict standards for atmospheric visual depth, asset curation, background textures, and image selection in @shavin interfaces.
8
+
9
+ ---
10
+
11
+ ## 1. Atmospheric Depth over Flatness (The Anti-Wireframe Law)
12
+
13
+ A common AI failure mode is **defensive minimalism**: mistaking strict design-system token discipline for sterile, flat white boxes, black text, and zero visual atmosphere.
14
+
15
+ > [!IMPORTANT]
16
+ > **Token purity does NOT mean flat wireframes.**
17
+ > You can—and MUST—create rich, layered atmospheric depth using token-compliant pastel mesh overlays, backdrop blurs, subtle glassmorphic panels, and directional scrims.
18
+
19
+ ### The 4-Layer Atmospheric Depth Stack
20
+
21
+ ```
22
+ ┌─────────────────────────────────────────────────────────────┐
23
+ │ 4. Foreground Content │ text-fg, text-fg-subtle, Button, Controls
24
+ ├─────────────────────────────────────────────────────────────┤
25
+ │ 3. Frosted Surface Panels & Scrims │ bg-surface/75 backdrop-blur-md border border-hairline/70
26
+ ├─────────────────────────────────────────────────────────────┤
27
+ │ 2. Decorative Atmospheric Asset / Pastel Mesh Texture │ 3D abstract render, soft pastel mesh, procedural contours
28
+ ├─────────────────────────────────────────────────────────────┤
29
+ │ 1. Canvas Base │ bg-canvas
30
+ └─────────────────────────────────────────────────────────────┘
31
+ ```
32
+
33
+ 1. **Canvas Base (`bg-canvas`)**: The foundational canvas plane.
34
+ 2. **Atmospheric Mesh / Texture**: Purely decorative, subtle ambient textures or abstract 3D assets that give the viewport dimensionality without interfering with reading flow.
35
+ 3. **Frosted Surface Panels & Scrims (`data-panel`)**: Translucent surface containers (`bg-surface/80 backdrop-blur-md border border-hairline/70 shadow-panel`) or directional gradient masks (`bg-gradient-to-t from-canvas via-canvas/80 to-transparent`) that protect text legibility.
36
+ 4. **Foreground Content**: High-contrast typography and interactive controls.
37
+
38
+ ---
39
+
40
+ ## 2. The Ban on AI-Slop Ambient Brand Glows
41
+
42
+ One of the most recognizable "AI slop" hallmarks is dropping a garish, highly saturated glowing orb into a layout:
43
+
44
+ ```tsx
45
+ // ❌ FORBIDDEN: AI-Slop Ambient Brand Glow Orb
46
+ <div className="absolute -top-24 -left-24 w-96 h-96 bg-brand/20 rounded-full blur-3xl pointer-events-none" />
47
+ ```
48
+
49
+ Why this is banned:
50
+ - It looks like an unconsidered prompt artifact from 2023-era generic web templates.
51
+ - It over-saturates the viewport and creates harsh color halos around typography.
52
+ - It clashes with Radix/Shavin semantic themes when switching between brand palettes.
53
+
54
+ ### The Replacement: Soft Pastel Mesh Textures
55
+
56
+ Instead of single saturated brand orbs, use **diffuse pastel meshes** and multi-stop subtle gradients:
57
+
58
+ ```tsx
59
+ // ✅ RECOMMENDED: Atmospheric Pastel Mesh Layer
60
+ <div
61
+ className="pointer-events-none absolute inset-0 overflow-hidden opacity-30 dark:opacity-15"
62
+ aria-hidden="true"
63
+ style={{
64
+ background: "radial-gradient(ellipse 80% 50% at 50% -20%, rgba(120, 119, 198, 0.25), rgba(255, 255, 255, 0)), radial-gradient(ellipse 60% 40% at 80% 10%, rgba(56, 189, 248, 0.15), transparent)",
65
+ maskImage: "linear-gradient(to bottom, black 0%, black 60%, transparent 100%)",
66
+ WebkitMaskImage: "linear-gradient(to bottom, black 0%, black 60%, transparent 100%)",
67
+ }}
68
+ />
69
+ ```
70
+
71
+ **Pastel Mesh Rules:**
72
+ - **Palette**: Always prefer soft, desaturated pastel tones (lavender, soft sage, mist blue, pale slate, warm pearl) over high-chroma electric neons.
73
+ - **Opacity ceiling**: Max 30%–40% in light mode; max 15%–25% in dark mode.
74
+ - **Edge Dissolve**: Always dissolve the mesh into the canvas using `maskImage: linear-gradient(to bottom, black 0%, black 65%, transparent 100%)`.
75
+
76
+ ---
77
+
78
+ ## 3. Asset Selection: Aesthetic Abstraction over Literal Stock Photos
79
+
80
+ Another major AI slop trap is dumping **context-heavy literal stock photos** into blocks, templates, and heroes (e.g. photos of people typing on laptops in coffee shops, generic corporate boardrooms, or tiny screenshots packed with unreadable micro-copy).
81
+
82
+ > [!WARNING]
83
+ > **NEVER dump context-heavy literal stock photos into blocks or templates.**
84
+ > Literal stock photos look cheap, dated, break brand cohesion, and make the layout look cluttered.
85
+
86
+ ### What to Use Instead: Premium Asset Categories
87
+
88
+ | Asset Category | Description | When to Use | Example Sources / Treatments |
89
+ |---|---|---|---|
90
+ | **1. Curated Editorial Photography** | Atmospheric, art-directed photos (landscape, architecture, texture, considered portraiture) — never cliché office stock. | Hero / main media with copy on top behind a scrim; also anywhere as highlights for visual balance (not only people/testimonials). | Lummi (`assets.lummi.ai`), Unsplash, or user-supplied, via layout bg props `bgImage` + `bgOverlays` (e.g. `"scrim-left"`, `"dark-20"`). |
91
+ | **2. Mesh Gradients & Animated Backgrounds** | Fixed pastel meshes or theme-brand mesh, optionally drifting; or a calm looping video. | Hero / statement / closing CTA backdrops. | `bgOverlays="mesh-lime"` / `mesh-night` / `mesh-mint` / `mesh-peach` / `mesh-brand` (append `-animated`); Pexels video via `bgVideo` + `bgPoster`. |
92
+ | **3. Abstract Atmospheric Textures** | Soft procedural contours, blurred chromatic grain, delicate light-refracting prism glass, architectural minimalism. | Full-bleed section backdrops, card backgrounds, bento brand tiles. | Subtle generative gradient textures, architectural cast shadows, or minimalist macro glass photography. |
93
+ | **4. 3D Abstract Renders (optional, decorative only)** | Translucent glass ribbons, geometric pastel shapes, iridescent solids. | Optional decorative graphics only — **never** focal hero/feature media. | Lummi/Unsplash renders with neutral or transparent backgrounds. |
94
+
95
+ > Product mockups / UI screenshots rebuilt from Shavin primitives are **not** default imagery. Use them only when you are highly confident of the result (rare); never tiny raster screenshots.
96
+
97
+ ---
98
+
99
+ ## 4. Directional Scrims & Contrast Protection
100
+
101
+ When placing text or controls over any photo, mesh, video, or texture, text readability must never depend on the image staying dark or light:
102
+
103
+ ```tsx
104
+ // ✅ Directional Scrim protecting text readability
105
+ <div className="relative overflow-hidden rounded-[var(--radius-panel)] border border-hairline bg-surface">
106
+ {/* Background Texture / Abstract Render */}
107
+ <img
108
+ src="https://images.unsplash.com/photo-..."
109
+ alt="Atmospheric editorial photograph"
110
+ className="absolute inset-0 h-full w-full object-cover opacity-60"
111
+ />
112
+
113
+ {/* Protective Directional Scrim */}
114
+ <div className="absolute inset-0 bg-gradient-to-t from-surface via-surface/80 to-transparent" />
115
+
116
+ {/* Content Area */}
117
+ <div className="relative z-10 p-8 md:p-12">
118
+ <h3 className="text-2xl font-semibold text-fg">Atmospheric Clarity</h3>
119
+ <p className="mt-2 text-sm text-fg-subtle">Text remains 100% accessible against any background texture.</p>
120
+ </div>
121
+ </div>
122
+ ```
123
+
124
+ **Scrim Checklist:**
125
+ - [ ] Uses semantic token (`from-surface`, `via-surface/80`, `from-canvas`), NEVER hardcoded `#000` or `#fff`.
126
+ - [ ] Title text keeps at least 4.5:1 contrast, WCAG 2.2 AA (`text-fg`).
127
+ - [ ] Subtitle text uses `text-fg-subtle` — **except on media**: over photos/mesh/video use `text-fg-muted` for subtitles/overlines, with `surface="dark-always"` (or `light-always`) on the media container.
128
+ - [ ] Prefer layout bg props (`bgImage` / `bgVideo` + `bgPoster` / `bgOverlays`) over hand-rolled layers: e.g. `bgOverlays="scrim-left, dark-20"`, `"mesh-lime-animated, dark-20"`, `"fade-canvas"`. Mesh presets: `mesh-lime`, `mesh-night`, `mesh-mint`, `mesh-peach`, `mesh-brand` (+`-animated`). See `layout-compositions/references/adapters/shavin-ui.md` §4b.
@@ -0,0 +1,125 @@
1
+ # Interface Polish & Tactile Craftsmanship
2
+
3
+ > **Load priority:** ALL MODES.
4
+ > **Token cost:** ~2.5K tokens.
5
+ > **Synthesized from:** Rauno Freiberg (Make Interfaces Feel Better), Emil Kowalski (Animation Craft), and Meng To (Design-First Systems).
6
+
7
+ This file defines the micro-craftsmanship rules that elevate digital interfaces from synthetic AI wireframes into bespoke, high-end software experiences.
8
+
9
+ ---
10
+
11
+ ## 1. Tactile Press Feedback (`scale(0.96)`)
12
+
13
+ Physical feedback on click makes UI feel responsive, tactile, and grounded:
14
+
15
+ ```tsx
16
+ // ✅ Tactile scale on press
17
+ <Button
18
+ size="md"
19
+ variant="solid"
20
+ tone="brand"
21
+ className="active:scale-[0.96] transition-transform duration-150"
22
+ >
23
+ Start Building Free
24
+ </Button>
25
+ ```
26
+
27
+ **Rules:**
28
+ - Always use `0.96` for button and interactive card press states.
29
+ - **Never use a scale smaller than 0.95** (anything below `0.95` feels exaggerated and bouncy).
30
+ - Always pair with `transition-transform duration-150`.
31
+
32
+ ---
33
+
34
+ ## 2. Proximity before Containers (The Anti-Box Law)
35
+
36
+ A classic failure of AI layout design is **over-containment**: wrapping every single piece of content, metric, or feature in its own bordered card or box.
37
+
38
+ > [!IMPORTANT]
39
+ > **Use proximity to group related items before reaching for a container.**
40
+ > Related elements sit close together (`gap-2` to `gap-4`); distinct conceptual groups are separated by whitespace (`gap-8` to `gap-12`). Turning every list item into a card makes layouts look like clunky spreadsheets.
41
+
42
+ ### Container Audit
43
+ - If 3 metric items share a card, use a clean horizontal layout with subtle dividers or simple spacing—do NOT wrap each metric in its own nested sub-card.
44
+ - Reserve `<Card>` for top-level interactive surfaces and primary focal units.
45
+
46
+ ---
47
+
48
+ ## 3. Hierarchy before Labels
49
+
50
+ > **Governing principle:** Prefer typographic hierarchy (size, weight, color, spacing) over decorative elements for structural labeling. See `visual-compositor/anti-patterns.md` AP-04 (Badge Soup) & AP-08 (Status-Chip Soup).
51
+
52
+ - **Size, weight, placement, and contrast** must do 90% of the work.
53
+ - Do NOT add a badge above a title unless it conveys an urgent state change (e.g. `v2.4 Active` or `Failed`).
54
+ - At most 1 concise badge per view. Section labels are optional; plain overline text only where it adds information.
55
+
56
+ ---
57
+
58
+ ## 4. The Lummi-Mesh Atmospheric Recipe
59
+
60
+ To get the warm, high-end atmospheric depth of flagship landing pages, put a photographic or mesh backdrop behind the content with a scrim that keeps text at 4.5:1 or better (measure it). Use the layout bg props (`@shavin/ui`); never hand-build the layers. Photography gives organic colour shifts a CSS gradient cannot, and the scrim diffuses it so the text stays crisp.
61
+
62
+ ```tsx
63
+ <Section size="hero" surface="dark-always" bgImage="https://assets.lummi.ai/…" bgOverlays="scrim-left, dark-20">…</Section>
64
+ <Section size="hero" surface="dark-always" bgOverlays="mesh-night, dark-20">…</Section>
65
+ <Section size="hero" surface="dark-always" bgVideo="…pexels…" bgPoster="…" bgOverlays="scrim-left, fade-canvas">…</Section>
66
+ ```
67
+
68
+ - Meshes: `mesh-lime|mint|dawn|peach|rose|night` (fixed palettes), `mesh-brand` (follows the theme); `-animated` = slow drift, off under reduced motion. `scrim-left` for left copy; `fade-canvas` dissolves into page. Radial/hex-alpha syntax: `adapters/shavin-ui.md` §4b.
69
+ - Always set `surface` on a mesh or custom gradient: `dark-always` for `mesh-night` and other dark backdrops, `light-always` for pale ones. Photos, video and fx default to `dark-always` with a scrim, but say it anyway.
70
+ - Dark media: `surface="dark-always"`; subtitles `text-fg-muted`, not `-subtle`.
71
+
72
+ ---
73
+
74
+ ## 5. Hardware-Accelerated Motion Principles (Emil Kowalski)
75
+
76
+ 1. **Animate Compositor Properties Only**:
77
+ - Animate `transform` and `opacity`.
78
+ - **NEVER** animate layout geometry: `width`, `height`, `top`, `left`, `margin`, `padding` (causes expensive CPU reflows and frame drops).
79
+ 2. **Never Write `transition: all`**:
80
+ - Always declare explicit properties: `transition-transform`, `transition-opacity`, `transition-colors`.
81
+ 3. **Asymmetric Enter/Exit Timing**:
82
+ - Interactive exits must be fast and snappy: `150ms–200ms ease-out`.
83
+ - Entrances can be slightly smoother and more deliberate: `250ms–350ms cubic-bezier(0.16, 1, 0.3, 1)`.
84
+ 4. **Stagger Cascades**:
85
+ - When revealing a list of items, stagger by `30ms–50ms` per item. Never exceed 300ms total stagger time.
86
+
87
+ ---
88
+
89
+ ## 6. Icon Optical Weight & Alignment (Rauno Freiberg)
90
+
91
+ - **Match Icon Stroke to Text Weight**:
92
+ - `1.5px` stroke beside regular text (weight 400).
93
+ - `2px` stroke beside semibold text (weight 600).
94
+ - **One Icon Family**: Never mix Lucide icons with custom SVGs, Phosphor, or emojis.
95
+ - **Vertical Alignment**: In inline flex rows, always pair icons with `align="center"` and ensure icons have `shrink-0` to prevent distortion.
96
+
97
+ ---
98
+
99
+ ## 7. Optical Centering & Asymmetric Compensation (Rauno Freiberg)
100
+
101
+ When geometric math looks visually off balance to the human eye, always align optically:
102
+
103
+ ### 1. Button Padding with Icon
104
+ Icons have less visual density than letters. When placing an icon on the right side of a button:
105
+ $$\text{Icon-Side Padding} = \text{Text-Side Padding} - 2\text{px}$$
106
+ ```tsx
107
+ // ✅ Optical balance: pl-4 (16px) paired with pr-3.5 (14px)
108
+ <Button className="pl-4 pr-3.5" iconRight={<Icon name="ArrowRight" size="sm" />}>
109
+ Continue
110
+ </Button>
111
+ ```
112
+
113
+ ### 2. Play Button Triangle Shift
114
+ The geometric bounding box center of a triangle $\neq$ its visual center of mass. Always nudge play icons 2px to the right:
115
+ ```tsx
116
+ // ✅ Shift play triangle 2px right to achieve optical center
117
+ <IconButton aria-label="Play">
118
+ <Icon name="Play" size="md" className="ml-0.5" />
119
+ </IconButton>
120
+ ```
121
+
122
+ ### 3. Shadows Instead of Solid Borders for Adaptive Surfaces
123
+ Solid border lines (`border border-hairline`) can look harsh and rigid when placed over multi-tonal photographic or mesh backgrounds.
124
+ - For elevated cards and floating surfaces, prefer layered subtle box shadows (`shadow-panel`, `shadow-card`) which adapt naturally across variable backgrounds through alpha transparency.
125
+
@@ -0,0 +1,80 @@
1
+ # Layout Restraint, Spatial Breathing Room & Anti-Bloat
2
+
3
+ > **Load priority:** ALL MODES (especially MARKETING, EDITORIAL, and SaaS blocks).
4
+ > **Token cost:** ~2.5K tokens.
5
+ > **Companion to:** `graphics-and-assets.md` (atmospheric depth) and `spacing-marketing.md` (visual weight).
6
+
7
+ This section addresses a primary cause of low-quality AI-generated UI: **layout bloat and content dumping**. When AI models attempt to appear thorough, they frequently generate cluttered, text-heavy wireframes that feel machine-assembled rather than human-curated.
8
+
9
+ ---
10
+
11
+ ## 1. The Content Bloat Trap ("AI Wireframe Slop")
12
+
13
+ The following named anti-patterns are the primary causes of AI-generated layout degradation. Each is documented with code examples and remediation in `visual-compositor/anti-patterns.md`:
14
+ - **AP-05 Paragraph Walls**: 3–4 lines of dense marketing prose under every heading.
15
+ - **AP-06 Metric Clutter**: 4–6 telemetry boxes jammed into the hero.
16
+ - **AP-04 Badge Soup**: Multiple colored pills stacked above a heading.
17
+ - **AP-07 Kitchen-Sink Bento Grids**: 6–8 miniature cards with no breathing room.
18
+
19
+ > [!CAUTION]
20
+ > A layout stuffed with dense text and micro-widgets does not look "production-ready"—it looks like a wireframe draft that hasn't undergone editorial distillation.
21
+
22
+ ---
23
+
24
+ ## 2. The "Single Clear Thought" Principle
25
+
26
+ Every section, hero, or template block must communicate **exactly one clear idea** effortlessly within 3 seconds.
27
+
28
+ ```
29
+ ┌─────────────────────────────────────────────────────────────┐
30
+ │ Overline Label (Optional, single concise text) │
31
+ │ │
32
+ │ Headline (4–8 words, punchy, confident, text-fg) │
33
+ │ │
34
+ │ Subtitle (1–2 sentences max, 15–25 words, text-fg-subtle) │
35
+ │ │
36
+ │ Action Group (1 primary Button + 1 subtle ghost/link) │
37
+ │ │
38
+ │ Trust Row (Clean horizontal inline markers) │
39
+ └─────────────────────────────────────────────────────────────┘
40
+ ```
41
+
42
+ ### The Distillation Budget
43
+
44
+ | Element | Maximum Allowed | Recommended Treatment |
45
+ |---|---|---|
46
+ | **Top Label** | Optional: 1 overline text or badge, often none | Only where it adds information. Small, subtle, `uppercase tracking-wider text-fg-subtle`. Badge only for stateful labels. |
47
+ | **Headline** | 4 to 8 words | Large (`text-4xl` to `text-6xl`), tight leading, confident. |
48
+ | **Subtitle** | 15 to 25 words (1–2 sentences) | `text-fg-subtle`, clear value proposition, no corporate jargon. |
49
+ | **Call-to-Action** | 2 buttons max | 1 Primary (`bg-brand` or solid `bg-fg`), 1 Secondary (outline or ghost). |
50
+ | **Trust Markers** | 1 horizontal line | Inline `<Icon name="Check" size="xs" />` markers (Zero config, 100% TypeScript) or 4–5 subtle monochrome logos. Never a multi-card metric grid inside a hero! |
51
+
52
+ ---
53
+
54
+ ## 3. Generous Spatial Breathing Room
55
+
56
+ High-end digital products convey confidence through **negative space**, not density.
57
+
58
+ ### Spacing Scale Rules
59
+ - **Section Vertical Rhythm**:
60
+ - `<Section size>`: `hero` `py-24 md:py-32` · `body` `py-16 md:py-24` · `strip` `py-10 md:py-14` · `compact` `py-8 md:py-12` (app only). Marketing floor `py-12` mobile. Canonical: `layout-compositions/references/foundations.md` §3.
61
+ - **Card & Surface Internal Padding**:
62
+ - Hero focal containers: `p-8 md:p-12`.
63
+ - Secondary feature cards: `p-6 md:p-8`.
64
+ - Dense widgets: `p-4 md:p-5`.
65
+ - **Grid Restraint**:
66
+ - Bento grids: 3 to 4 thoughtfully balanced cards maximum.
67
+ - Multi-column feature grids: 3 columns maximum on desktop, with generous `gap-6` or `gap-8`.
68
+ - **Whitespace is not empty space**: It is an active structural element that elevates the perceived value and luxury of the interface.
69
+
70
+ ---
71
+
72
+ ## 4. Anti-Bloat Pre-Flight Audit
73
+
74
+ Before submitting any layout, block, or screen, audit against these 5 checks:
75
+
76
+ 1. [ ] **Can a user scan the core value in under 3 seconds?** If they have to read a paragraph, cut 50% of the words.
77
+ 2. [ ] **Did you add a metric grid inside the hero?** If yes, remove it or move it to a dedicated proof section below the fold.
78
+ 3. [ ] **Are there multiple competing badges or labels?** Drop labels that add no information; use plain overline text instead of a badge where one is warranted. Keep at most 1 `<Badge>` per section (only for stateful labels).
79
+ 4. [ ] **Does the container feel crammed?** Increase `py-*` on the section and `p-*` on the surfaces.
80
+ 5. [ ] **Is the layout airy and focused?** Ensure the primary CTA stands out with clear vertical margin (`mt-6` to `mt-8`).