@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,287 @@
1
+ # Cognitive Layer
2
+
3
+ > **Load priority:** Loaded at the START of UI tasks, before implementation begins.
4
+ > **Token cost:** ~2K tokens.
5
+ > **Purpose:** Reason about perception and purpose before writing components.
6
+ > **Source:** Distilled from Visual Language Skills framework.
7
+
8
+ ---
9
+
10
+ ## Pre-Generation Checklist
11
+
12
+ **Complete before writing any component.**
13
+
14
+ ### 1. Cognitive Goal
15
+ What must users understand within 3 seconds of seeing this screen?
16
+ - Write as one sentence
17
+ - If you cannot, the screen has no clear purpose
18
+ - Example: "Users must see their current balance and recent transactions"
19
+
20
+ ### 2. Visual Hierarchy
21
+ What gets attention first? Second? Last?
22
+ - Exactly ONE primary focal point
23
+ - If multiple elements compete for primary attention, there is no hierarchy
24
+ - Use size, weight, color, and spacing to create clear order
25
+
26
+ ### 3. Relationship Map
27
+ Which elements belong together conceptually?
28
+ - Proximity must reflect conceptual relationships, not grid columns
29
+ - Related items closer together, distinct items separated
30
+ - Use spacing to communicate structure (see `spacing-core.md`)
31
+
32
+ ### 4. Available Actions
33
+ What can users do here?
34
+ - Each action must be visually signaled BEFORE users look for it
35
+ - Hidden actions are effectively absent actions
36
+ - Primary action must be unmistakable (see Action Hierarchy below)
37
+
38
+ ### 5. All States
39
+ For every interactive element or data surface, define:
40
+ - **Loading** — skeleton, spinner, or progress bar
41
+ - **Empty** — onboarding message with next action, not blank space
42
+ - **Error** — explanation + recovery path, not just "Error occurred"
43
+ - **Success** — confirmation feedback (toast, inline message, state change)
44
+
45
+ Missing states are not acceptable. They are moments where the interface goes silent and users lose trust.
46
+
47
+ ### 6. Orientation (multi-page systems)
48
+ - Can users tell where they are? (active nav state, page title, breadcrumb)
49
+ - Can they see where they can go? (visible navigation options)
50
+ - Can they get back to where they were? (back button, browser history, clear path)
51
+
52
+ ---
53
+
54
+ ## State Coverage Rules
55
+
56
+ ### Loading States
57
+
58
+ **Acknowledge immediately.** Users must know their action was received.
59
+
60
+ **Match feedback to wait duration:**
61
+ - < 1 second: subtle button state change (disabled + cursor change)
62
+ - 1-3 seconds: spinner or skeleton
63
+ - 3-10 seconds: progress bar or percentage
64
+ - > 10 seconds: explanation + estimated time + option to cancel
65
+
66
+ **Preserve context.** Never reset scroll position, clear inputs, or remove existing content during loading.
67
+
68
+ **Show progress when possible.** "Uploading 68%" feels shorter than an infinite spinner.
69
+
70
+ ### Empty States
71
+
72
+ **Explain before suggesting.** Answer "Why is this empty?" before "What should I do?"
73
+
74
+ **Different causes, different messages:**
75
+ - Nothing created yet → onboarding + first action
76
+ - No search results → "No matches for X" + suggestion to refine
77
+ - Access restricted → explanation + contact/upgrade path
78
+ - Temporary unavailability → "Try again" + refresh action
79
+
80
+ **Make next step obvious.** Every empty state should guide progress with a clear action.
81
+
82
+ **Clarity over decoration.** Illustrations add warmth but cannot replace explanation.
83
+
84
+ ### Error States
85
+
86
+ **Explain what happened.** Not just "Error 500" but "We couldn't save your changes because the server is temporarily unavailable."
87
+
88
+ **Provide recovery path.** Not just what failed but what to do next:
89
+ - Retry button
90
+ - Alternative action
91
+ - Contact support link
92
+ - Undo option
93
+
94
+ **Match tone to severity.** Form validation = inline correction. Network failure = banner with retry. Critical error = modal with support contact.
95
+
96
+ ---
97
+
98
+ ## Affordance Rules
99
+
100
+ **Interactive elements must visually signal interactivity BEFORE hover.**
101
+
102
+ ### Visual Signifiers
103
+
104
+ **Buttons:**
105
+ - Background color distinct from surrounding content
106
+ - Subtle shadow or border to suggest pressability
107
+ - Cursor change to pointer on hover
108
+
109
+ **Links:**
110
+ - Color distinct from body text
111
+ - Underline or clear visual treatment
112
+ - Hover state (color change, underline appears)
113
+
114
+ **Cards (if clickable):**
115
+ - Cursor change to pointer on hover
116
+ - Subtle elevation change or border highlight on hover
117
+ - Clear visual distinction from static content
118
+
119
+ **Input fields:**
120
+ - Border or background distinct from surrounding area
121
+ - Focus state (ring, border color change)
122
+ - Placeholder text suggests input type
123
+
124
+ ### Anti-Patterns
125
+
126
+ ```
127
+ ✗ Relying on hover as the only affordance
128
+ ✗ Cards that look clickable but are static
129
+ ✗ Buttons that look like plain text
130
+ ✗ Links that don't look like links
131
+ ✗ Input fields with no visual boundary
132
+ ✗ Interactive elements indistinguishable from static ones
133
+ ```
134
+
135
+ **Why these fail:** Users scan before they interact. If they cannot predict what is interactive, they hesitate. Hidden actions are effectively absent actions.
136
+
137
+ ---
138
+
139
+ ## Action Hierarchy
140
+
141
+ **Visual priority reflects decision priority.**
142
+
143
+ ### Commitment Matches Consequence
144
+
145
+ **Low risk** (undoable, reversible):
146
+ - Like, save, bookmark
147
+ - Minimal visual weight, quick interaction
148
+ - No confirmation needed
149
+
150
+ **Medium risk** (harder to undo):
151
+ - Submit form, publish post, send message
152
+ - Primary button treatment
153
+ - Clear label describing outcome ("Send Message" not "Submit")
154
+
155
+ **High risk** (destructive, irreversible):
156
+ - Delete account, cancel subscription, remove data
157
+ - Red/danger color treatment
158
+ - Confirmation dialog or secondary action
159
+ - Clear explanation of consequence
160
+
161
+ ### Label Rules
162
+
163
+ **Describe outcome, not implementation:**
164
+ - ✓ "Save Draft" (describes what happens)
165
+ - ✗ "Submit" (vague, implementation-focused)
166
+
167
+ **Be specific:**
168
+ - ✓ "Delete Project" (clear consequence)
169
+ - ✗ "Delete" (ambiguous)
170
+
171
+ ### Placement
172
+
173
+ - Primary action: most prominent position, usually bottom-right or top-right
174
+ - Secondary actions: less prominent, adjacent to primary
175
+ - Destructive actions: separated from primary, often in different section
176
+ - Consistent placement across similar screens
177
+
178
+ ---
179
+
180
+ ## Navigation & Orientation
181
+
182
+ **Users must always know where they are, where they can go, and how to return.**
183
+
184
+ ### Orientation Signals
185
+
186
+ **Active state:** Current page/section highlighted in navigation
187
+ **Page title:** Clear, descriptive, matches navigation label
188
+ **Breadcrumb:** Shows path from home to current location
189
+ **URL:** Reflects hierarchy (if applicable)
190
+
191
+ ### Navigation Types
192
+
193
+ **Global navigation:**
194
+ - Major sections (Dashboard, Projects, Settings)
195
+ - Persistent across all pages
196
+ - Stable structure (don't move landmarks)
197
+
198
+ **Local navigation:**
199
+ - Tabs, subsections within one area
200
+ - Contextual to current section
201
+ - Clear relationship to global nav
202
+
203
+ ### Anti-Patterns
204
+
205
+ ```
206
+ ✗ Navigation with no active/current state
207
+ ✗ Icons without labels where ambiguity exists
208
+ ✗ Changing menu structure frequently
209
+ ✗ Hidden primary navigation
210
+ ✗ Multiple navigation systems that contradict each other
211
+ ✗ Users cannot answer "Where am I?"
212
+ ```
213
+
214
+ ---
215
+
216
+ ## Progressive Disclosure
217
+
218
+ **Reveal complexity when it becomes useful, not all at once.**
219
+
220
+ ### Principles
221
+
222
+ **Match information to immediate goal:**
223
+ - Show only what's needed for current task
224
+ - Defer advanced options until relevant
225
+ - Build confidence through small successes
226
+
227
+ **Disclosure exists at every scale:**
228
+ - **Content:** Summaries before details, expandable sections
229
+ - **Actions:** Primary visible, advanced available but less prominent
230
+ - **Navigation:** Frequent destinations immediate, rare accessible without competing
231
+ - **Configuration:** Basic settings first, advanced when needed
232
+
233
+ **Hidden does not mean lost:**
234
+ - Delay visibility, don't remove capability
235
+ - Power users should find advanced features without overwhelming beginners
236
+ - Progressive disclosure ≠ hiding critical functionality
237
+
238
+ ### Anti-Patterns
239
+
240
+ ```
241
+ ✗ Showing all features during onboarding
242
+ ✗ Hiding critical functionality
243
+ ✗ Long forms asking for unnecessary information upfront
244
+ ✗ Advanced settings visible by default
245
+ ✗ Treating hidden features as afterthoughts
246
+ ```
247
+
248
+ ---
249
+
250
+ ## Integration With Implementation Layer
251
+
252
+ This file provides the **why** (cognitive reasoning). Other files provide the **how** (implementation):
253
+
254
+ - `concentric-laws.md` — radius tokens and nesting rules
255
+ - `spacing-core.md` — spacing scale, section architecture, flex/grid rules
256
+ - `spacing-marketing.md` — hierarchy, visual weight, negative space (MARKETING/EDITORIAL)
257
+ - `spacing-dense.md` — density framework (STRUCTURAL/dashboards)
258
+ - `font-pairings.md` — typography and font loading rules
259
+ - `audit-checklist.md` — master anti-pattern table (spatial/layout violations)
260
+
261
+ **Workflow:**
262
+ 1. Complete pre-generation checklist (this file)
263
+ 2. Select mode (STRUCTURAL/MARKETING/EDITORIAL)
264
+ 3. Apply implementation rules (other files)
265
+ 4. Run post-generation audit (`audit-checklist.md`)
266
+
267
+ **The test:**
268
+ > Can you explain why every element on this screen exists — in terms of what the user needs to understand, not what component was available?
269
+
270
+ If you cannot, the UI is not ready.
271
+
272
+ ---
273
+
274
+ ## Quick Reference
275
+
276
+ **When to load this file:**
277
+ - Starting any UI task (always loaded)
278
+ - Reviewing whether a layout communicates structure
279
+ - Diagnosing why an interface feels confusing
280
+ - Building multi-step flows or complex screens
281
+
282
+ **Token cost:** ~2K tokens (always loaded)
283
+
284
+ **Related files:**
285
+ - `audit-checklist.md` — master anti-pattern table
286
+ - `spacing-core.md` — relationship through spacing
287
+ - `concentric-laws.md` — boundaries and containers
@@ -0,0 +1,167 @@
1
+ # Composition → Motion Map
2
+
3
+ > Suggested motion presets per layout composition. Reference: `page-motion-presets.md` for preset recipes. The authoritative composition-motion-map now lives in the `layout-motion` skill (`layout-motion/references/composition-motion-map.md`) — this file remains as a visual-compositor-internal convenience. The 57 compositions are defined in the `layout-compositions` skill. "None" is a valid and often best answer. Pick one or two per page section, not all of them.
4
+
5
+ ---
6
+
7
+ ## How to Use
8
+
9
+ 1. Look up the composition you're using (e.g. `H2: Split Hero`).
10
+ 2. Find the suggested preset(s) in the table below.
11
+ 3. Apply using motion tokens — never hardcode durations/distances.
12
+ 4. **When in doubt, choose "None".** Static is better than gratuitous motion.
13
+
14
+ The `◆` symbol marks compositions whose metadata allows a stagger choreography scene on top. These are hero-level or major-transition sections where layered entrance is appropriate.
15
+
16
+ ---
17
+
18
+ ## Hero Compositions
19
+
20
+ | ID | Composition | Suggested Preset | Notes |
21
+ |---|---|---|---|
22
+ | H1 ◆ | Centered Statement Hero | **P4** (Word-Reveal) on tagline + **P3** (Split-Stagger) on CTA/preview | Word-by-word headline reveal is the "Tagline Reveal Moment" — use exactly once per page. Stagger the supporting elements below. |
23
+ | H2 ◆ | Split Hero (Left Text + Right Visual) | **P3** (Split-Stagger) on left column + **P5** (Scale-In) on right visual | Left text layers stagger in reading order; right visual scales in slightly later (set `--i` 1 higher than last text layer). |
24
+ | H3 ◆ | Asymmetric Hero (7/5 Split) | **P2** (Blur-Rise) on display heading + **P5** (Scale-In) on floating visual | Cinematic blur-rise for the large display type. Visual scales in with slight delay. Premium feel. |
25
+ | H4 | Full-Bleed Video/Gradient Hero | **None** or **P1** (Fade-Rise) on text overlay only | The background media/video IS the motion. Adding entrance animation on top competes. Only fade in the text overlay if needed. |
26
+ | **H5** ◆ | **Logo Cloud Hero** (text + trust logos) | **P3** (Split-Stagger) on text + **P1** (Fade-Rise) on logo row | New composition. Text staggers, logos fade in as a single row after text settles. |
27
+ | **ST** ◆ | **Sticky Two-Column** (sticky text + scrolling visual) | **P1** (Fade-Rise) on first viewport only | New composition. Sticky text column doesn't need re-animation on scroll. Fade-rise the first visible visual panel only. Subsequent scroll visuals are static — the scroll itself is the motion. |
28
+
29
+ ---
30
+
31
+ ## Feature / Info Compositions
32
+
33
+ | ID | Composition | Suggested Preset | Notes |
34
+ |---|---|---|---|
35
+ | F1 | 3-Column Feature Grid | **P1** (Fade-Rise) per card with `--i` increment | Gentle staggered fade. Cards rise 16px with opacity. Keep it subtle — feature grids are read, not performed. |
36
+ | F2 | Bento Grid (Mixed-Size) | **P5** (Scale-In) per card with `--i` increment | Scale-in suits the bento aesthetic — cards "place" themselves. Larger cells get lower `--i` (appear first). |
37
+ | F3 | Alternating Z-Pattern | **P2** (Blur-Rise) per row with `--i` increment | Each row blurs in as the user scrolls to it. Use `IntersectionObserver`. One row at a time — not all at once. |
38
+ | F4 | Stacked Card Carousel | **None** | The carousel scroll/snap IS the interaction. Adding entrance motion to a horizontally scrolling element is noise. |
39
+ | F5 | Tabbed Feature Explorer | **None** on tab content; **P1** (Fade-Rise) on initial load only | Tab switches are "tens of times/day" frequency — no animation on switch. Only the first load gets a gentle fade. |
40
+ | **F6** | **Logo Marquee + Feature** (marquee strip above feature grid) | **None** on marquee + **P1** (Fade-Rise) on grid | New composition. The marquee is already animated (infinite scroll). Don't double-animate. Fade in the grid below. |
41
+
42
+ ---
43
+
44
+ ## Stats / Metrics Compositions
45
+
46
+ | ID | Composition | Suggested Preset | Notes |
47
+ |---|---|---|---|
48
+ | S1 | Horizontal Stat Bar | **P1** (Fade-Rise) as a single block | Don't stagger individual stats — they're meant to be scanned as a unit. One fade for the whole bar. |
49
+ | S2 | Large Number + Description Grid | **P5** (Scale-In) per cell with `--i` increment | Large numbers have more visual weight — scale-in feels like they're "landing". 60ms stagger between cells. |
50
+ | S3 | Animated Count-Up Row | Custom (count-up JS) | Count-up is a JS-driven animation, not a CSS preset. Under reduced-motion, skip the count-up and show final numbers directly. |
51
+
52
+ ---
53
+
54
+ ## CTA Compositions
55
+
56
+ | ID | Composition | Suggested Preset | Notes |
57
+ |---|---|---|---|
58
+ | C1 | Centered CTA Banner | **None** | CTAs are conversion-critical — they should be instantly visible. No entrance delay. If the section is below the fold, a single **P1** (Fade-Rise) on scroll-into-view is acceptable. |
59
+ | C2 | Split CTA (Text + Code Snippet) | **None** | Same as C1. The code snippet should be immediately readable. |
60
+ | C3 | Full-Width Gradient CTA | **None** | The gradient/atmosphere provides enough visual interest. Static CTA. |
61
+ | **C4** | **Inline Sign-Up** (email input + button inside hero or feature) | **None** | New composition. The form is functional, not decorative. Instant availability. |
62
+
63
+ ---
64
+
65
+ ## Testimonial / Social Proof Compositions
66
+
67
+ | ID | Composition | Suggested Preset | Notes |
68
+ |---|---|---|---|
69
+ | T1 | Single Large Quote | **P2** (Blur-Rise) on quote text | One cinematic reveal for a single quote — appropriate because it's a "rare" section. Blur-rise adds gravitas. |
70
+ | T2 | 3-Column Testimonial Cards | **P1** (Fade-Rise) per card with `--i` increment | Subtle staggered fade. 60ms between cards. |
71
+ | T3 | Logo Grid (Wordless Trust) | **None** | Logos are reference, not content. They should be immediately visible. |
72
+ | T4 | Marquee Logo Strip | **None** | The marquee is the motion. No entrance needed. |
73
+
74
+ ---
75
+
76
+ ## FAQ / Accordion Compositions
77
+
78
+ | ID | Composition | Suggested Preset | Notes |
79
+ |---|---|---|---|
80
+ | Q1 | Two-Column FAQ | **None** | FAQ is functional reference content. Users want answers, not animation. |
81
+ | Q2 | Centered Accordion Stack | **None** | Same reasoning. The accordion expand/collapse is handled by `.animate-accordion-down/up` semantic utilities — that's sufficient motion. |
82
+
83
+ ---
84
+
85
+ ## Comparison / Pricing Compositions
86
+
87
+ | ID | Composition | Suggested Preset | Notes |
88
+ |---|---|---|---|
89
+ | P1 | 3-Tier Pricing Table | **P5** (Scale-In) per tier with `--i` increment | Cards "place" themselves. Middle (recommended) tier gets `--i: 0` (appears first, draws the eye). |
90
+ | P2 | Feature Comparison Matrix | **None** | Comparison tables are analytical — users scan rows. No motion. |
91
+ | P3 | Single Card Plan | **None** | One card, one CTA. Instant. |
92
+
93
+ ---
94
+
95
+ ## Gallery / Showcase Compositions
96
+
97
+ | ID | Composition | Suggested Preset | Notes |
98
+ |---|---|---|---|
99
+ | G1 | Masonry Grid | **P5** (Scale-In) per card on scroll-into-view | Cards scale in as they enter the viewport. `IntersectionObserver` + `--i` based on column position. |
100
+ | G2 | Filterable Grid | **None** on filter switch; **P5** (Scale-In) on initial load only | Filter switches are "tens of times/day" — no animation. Only initial load gets scale-in. |
101
+ | G3 | Infinite Marquee Strip | **None** | The marquee is the motion. |
102
+
103
+ ---
104
+
105
+ ## New Compositions (from external research)
106
+
107
+ These compositions are additions to the standard catalogue, informed by external motion research. They use the same `@shavin/ui` primitives and token system.
108
+
109
+ ### ST: Sticky Two-Column
110
+ **Best for:** Long-form storytelling, product deep-dives, case studies.
111
+ **Structure:** Left column has sticky positioning (text stays in view); right column scrolls through a series of visual panels.
112
+ **Primitives:** `<Grid columns={{ base: 1, lg: 2 }}>` → left `lg:sticky lg:top-24 lg:h-fit` + right scrolling `<Flex direction="column" gap="12">`.
113
+ **Motion:** P1 (Fade-Rise) on first viewport only. The scroll itself drives subsequent reveals — don't add entrance animation to every panel.
114
+
115
+ ### H5: Logo Cloud Hero
116
+ **Best for:** Trust-first landing pages where social proof leads.
117
+ **Structure:** Centered headline + CTA, with a row of partner logos directly below as the primary trust signal.
118
+ **Primitives:** `<Container size="4">` → centered `<Heading>` + `<Button>` + `<Grid columns={{ base: 3, sm: 4, md: 6 }}>` of grayscale logos.
119
+ **Motion:** P3 (Split-Stagger) on text layers, P1 (Fade-Rise) on logo row as a single block.
120
+
121
+ ### F6: Logo Marquee + Feature Grid
122
+ **Best for:** Mid-page social proof transition — logos scroll above, features below.
123
+ **Structure:** Infinite marquee strip of partner logos, followed by a standard 3-column feature grid.
124
+ **Primitives:** Marquee container + `<Grid columns={{ base: 1, sm: 2, lg: 3 }}>` of `<Card>`.
125
+ **Motion:** None on marquee (it's already animated), P1 (Fade-Rise) on the feature grid.
126
+
127
+ ### C4: Inline Sign-Up
128
+ **Best for:** Developer tools, newsletters, early-access pages where the sign-up form IS the conversion.
129
+ **Structure:** Email input + submit button integrated directly into the hero or a feature section (no separate CTA section needed).
130
+ **Primitives:** `<Flex gap="3">` → `<Input placeholder="you@company.com">` + `<Button>Get early access</Button>`.
131
+ **Motion:** None. The form must be instantly usable.
132
+
133
+ ### E: Editorial Spread
134
+ **Best for:** Blog posts, documentation, long-form articles.
135
+ **Structure:** Wide centered column for prose (max-w-3xl), with full-bleed visual interludes between text blocks.
136
+ **Primitives:** `<Container size="3">` for prose + `<figure className="full-bleed">` for images.
137
+ **Motion:** None on text. P1 (Fade-Rise) optionally on full-bleed visuals on scroll-into-view.
138
+
139
+ ### D: Dashboard Preview
140
+ **Best for:** SaaS product pages showing a live-ish UI preview.
141
+ **Structure:** A styled "fake" dashboard or app screenshot inside a browser frame, with annotated callouts pointing to key UI elements.
142
+ **Primitives:** `<Card className="overflow-hidden">` wrapping a browser frame + absolutely positioned callout `<Popover>` elements.
143
+ **Motion:** P5 (Scale-In) on the entire preview as a single unit. Callout tooltips use `.animate-rise` on hover/interaction (handled by Radix).
144
+
145
+ ### X: Expandable Showcase
146
+ **Best for:** Block catalogs, component galleries, design system docs.
147
+ **Structure:** Grid of compact preview cards; clicking one expands it into a full-width detail panel (accordion-like, but horizontal expansion).
148
+ **Primitives:** `<Grid>` of `<Card>` → click triggers `<Dialog>` or inline expansion with `grid-column: 1 / -1`.
149
+ **Motion:** P1 (Fade-Rise) on grid items. Expansion uses `.animate-accordion-down/up` or `.animate-modal-in` depending on implementation.
150
+
151
+ ---
152
+
153
+ ## Quick Reference: The "Should I Animate?" Decision
154
+
155
+ | Scenario | Answer |
156
+ |---|---|
157
+ | First viewport, hero section | Yes — P3 or P4 (one-time delight) |
158
+ | Below-the-fold content entering on scroll | Yes — P1 or P5 (subtle, per-section) |
159
+ | Tab switch, filter change, sort | No (high frequency) |
160
+ | Hover state | CSS transition only, `--dur-fast`, no keyframe |
161
+ | Button press | `active:scale-[0.97]` + `--dur-instant`, no keyframe |
162
+ | Modal/dialog open | `.animate-modal-in` (semantic utility, automatic) |
163
+ | Dropdown/menu open | `.animate-rise` (semantic utility, automatic) |
164
+ | Drawer/sidebar open | P6 (Slide-In) or `.animate-rise` with `--ease-drawer` |
165
+ | FAQ accordion | `.animate-accordion-down/up` (semantic utility, automatic) |
166
+ | Logo marquee | CSS animation only, no entrance preset |
167
+ | CTA section | None — instant visibility for conversion |
@@ -0,0 +1,147 @@
1
+ # Concentric Laws — The Mathematical Foundation
2
+
3
+ > **Load priority:** CORE: load for any nested radius or padding. These two laws govern every spatial decision.
4
+ > **Token cost:** ~1.8K tokens.
5
+
6
+ Every spatial decision in a layout must satisfy two concentric laws simultaneously. They are not optional and not overridable by aesthetic preference.
7
+
8
+ ---
9
+
10
+ ## Law 1 — Concentric Radius
11
+
12
+ > **R_inner = max(floor, R_outer − P)**, floor = min(radius-lg, radius-panel / 2)
13
+ >
14
+ > **R_outer** = container radius; **P** = padding between container wall and inner element.
15
+
16
+ Inner radius = outer minus the padding, so both arcs share one center — that is what makes nested rounding look _right_. The floor keeps padded children from going square (0 only when the theme radius is 0).
17
+
18
+ **Why it matters:** When R_inner ≥ R_outer, the inner curve bulges out from behind the outer curve. The eye perceives a "corner gap" or a visual collision. It communicates broken structure, not deliberate containment.
19
+
20
+ ### Token Mapping (@shavin/ui)
21
+
22
+ | Role | Token | Default value | Use on |
23
+ | --------------------------- | ---------------- | -------------------- | -------------------------------------------------------------------------------------------- |
24
+ | Large surfaces & containers | `--radius-panel` | 16px (medium preset) | Cards, dialogs, modals, dropdowns, section containers, accordions, accordion items, callouts |
25
+ | Controls | `--radius-lg` | 8px (medium preset) | Single-line controls: buttons, inputs, badges, chips, avatar frames, switches |
26
+ | Tiny standalone shapes | `--radius-sm` | 4px | Swatches, carets. Never a nested inner radius: the floor applies |
27
+ | Never use on panels | `rounded-full` | 9999px | Only pills (Badge), Avatar, Switch thumb — never panels or container items |
28
+
29
+ > [!CRITICAL]
30
+ > **Panel Radius vs Control Radius Role Discipline**:
31
+ >
32
+ > - Always evaluate whether an element acts as a **control** (single-line button/input) or a **container/surface** (holds multi-line content, lists, or child nodes).
33
+ > - Containers (`Card`, `Dialog`, `Popover`, `Menu`, `AccordionItem`, `Callout`, `Inset`) **MUST ALWAYS** use `--radius-panel`.
34
+ > - Never assign `--radius-lg` or `--radius-xl` to an `AccordionItem` or multi-line container surface. Doing so causes it to turn into a broken stadium capsule under the "Full" radius preset.
35
+
36
+ ### Concentric Nesting Worked Examples
37
+
38
+ ```
39
+ Section (no radius — full-bleed)
40
+ └── Container (max-w, no radius — layout only)
41
+ └── Card [--radius-panel = 16px, p-5 = 20px]
42
+ └── Button [--radius-lg = 8px] ✓ (16 - 20 = negative → floor = min(8, 16/2) = 8)
43
+ └── Input [--radius-lg = 8px] ✓
44
+
45
+ Card [--radius-panel = 16px, p-4 = 16px]
46
+ └── Inner chip/badge → 16 - 16 = 0 → floor 8px → rounded-panel-p4 (= --radius-lg) ✓
47
+
48
+ Popover [--radius-panel = 16px, p-3 = 12px]
49
+ └── List item row → 16 - 12 = 4 → floor 8px → rounded-panel-p3 ✓
50
+
51
+ Dialog [--radius-panel = 16px, p-6 = 24px]
52
+ └── Inner card → 16 - 24 < 0 → floor 8px → rounded-panel-p6 ✓
53
+ ```
54
+
55
+ ### Radius Rules
56
+
57
+ - **Never use `--radius-panel`** on a control (button, input, badge). It creates a stadium shape at "full" preset.
58
+ - **Never use `--radius-lg` / `rounded-lg` literal** — always `rounded-[var(--radius-lg)]`.
59
+ - **Never use `rounded-2xl`, `rounded-xl`, `rounded-3xl` literals** — they don't track the ThemeProvider.
60
+ - If R_outer − P is below the floor, use the floor (`rounded-panel-pN`), never `rounded-none` or a literal.
61
+
62
+ ### What `validate_code` checks (and `autofix_code` fixes)
63
+
64
+ The lint is conservative: it judges only what it can read from the source.
65
+
66
+ - Radius written as a token class (`rounded-[var(--radius-panel)]`, `rounded-panel-pN`, `rounded-[var(--radius-lg)]`, `rounded-[calc(var(--radius-panel) - Npx)]`). `rounded-full`, `rounded-none` and `rounded-panel-inner` are never flagged.
67
+ - Padding written as `p-N`, equal `px-N py-N`, `p-[Npx]` or `Card padding="md"`. A component with its own default padding and no explicit value gets no verdict.
68
+ - A transparent wrapper between outer and inner adds its padding. A wrapper with a background or border and no radius ends the check.
69
+ - A literal radius (`rounded-lg`, `rounded-xl`) is always reported. When the role or nesting makes the fix clear, the report names the exact class and `autofix_code` writes it (`rounded-panel-pN`, or an explicit `max(floor, calc(panel - X))` when N is off the scale). Otherwise both options are listed and nothing is changed.
70
+ - Elements marked `data-overlay`, `data-gradient` or `data-scope-theme` are skipped.
71
+
72
+ ---
73
+
74
+ ## Law 2 — Concentric Spacing
75
+
76
+ > **Outer containers hold more space than inner elements.**
77
+ >
78
+ > Padding decreases as you move inward through nesting levels. Space communicates containment — the outer boundary "holds" the inner content.
79
+
80
+ This is not about aesthetics. It is about perception: if an inner element has more padding than its parent, the eye reads the boundary as inverted. The container appears to be _inside_ its contents.
81
+
82
+ ### The Four Spatial Zones
83
+
84
+ Every layout exists across four nested spatial zones. Each zone has a valid padding range. Do not skip zones or invert their order.
85
+
86
+ | Zone | What it covers | Tailwind range | Notes |
87
+ | ------------- | ---------------------------------- | ------------------------------------ | ---------------------------------- |
88
+ | **Page** | Full viewport, section backgrounds | `py-16 md:py-24` to `py-24 md:py-32` | No token — raw Tailwind spacing OK |
89
+ | **Container** | Max-width wrapper, centering shell | `px-4 md:px-6 lg:px-10` | No token — layout utility |
90
+ | **Surface** | Card, panel, dialog body, sidebar | `p-4` to `p-8` | Maps to `--radius-panel` surfaces |
91
+ | **Element** | Button, input, row, badge inner | `px-2 py-1` to `px-4 py-2` | Maps to `--radius-lg` controls |
92
+
93
+ **The rule:** Page > Container > Surface > Element. If a child's padding matches or exceeds its parent's, the spatial hierarchy is broken.
94
+
95
+ ### Vertical Section Rhythm (Web Pages / Marketing)
96
+
97
+ Major page sections should follow a consistent vertical rhythm. Rhythm = trust.
98
+
99
+ ```
100
+ Page section (hero, features, FAQ, footer):
101
+ py-16 md:py-24 ← body (Section size="body")
102
+ py-24 md:py-32 ← hero / statement / CTA (size="hero")
103
+ strip/compact: see layout-compositions/references/foundations.md §3
104
+
105
+ Section internal header (heading + subtext block):
106
+ mb-10 md:mb-12 ← gap between section header and content grid
107
+
108
+ Content grid / card grid:
109
+ gap-6 ← standard card gap
110
+ gap-4 ← dense / compact grids
111
+
112
+ Card internal padding:
113
+ p-5 or p-6 ← standard card
114
+ p-4 ← compact card
115
+ p-8 ← feature/showcase card
116
+
117
+ Card internal sections (header → body → footer within a card):
118
+ space-y-3 or space-y-4 ← groups within a card
119
+ border-t + pt-3 ← footer separator within card
120
+ ```
121
+
122
+ **Never use arbitrary values** (`py-[73px]`, `mb-[22px]`). If the standard scale doesn't produce the right result, move up or down one step. Arbitrary values break rhythm.
123
+
124
+ ### Vertical Section Rhythm (Web Apps / Dashboards)
125
+
126
+ Apps have denser, more compressed rhythms than marketing pages.
127
+
128
+ ```
129
+ App shell / page wrapper:
130
+ p-4 md:p-6 ← page-level inset
131
+
132
+ Panel / sidebar:
133
+ p-4 ← standard sidebar padding
134
+ px-3 py-4 ← tighter nav sidebar
135
+
136
+ Content area sections:
137
+ space-y-4 to space-y-6 ← vertical separation between page blocks
138
+
139
+ Card / widget:
140
+ p-4 to p-5 ← standard dashboard card
141
+ p-3 ← compact metric widget
142
+
143
+ Form group (label + input + hint):
144
+ space-y-1 to space-y-1.5 ← within a single field
145
+ space-y-4 to space-y-5 ← between fields
146
+ space-y-6 to space-y-8 ← between field groups / sections
147
+ ```
@@ -0,0 +1,32 @@
1
+ # DOCS Mode — Documentation Portal Composition
2
+
3
+ Load this file ONLY when `visual-compositor`'s Activation Modes table (in `SKILL.md`) resolves to `DOCS` — e.g. `docs.shavin.cc`, API reference sites, changelog pages, knowledge bases.
4
+
5
+ ## Why DOCS is a separate mode
6
+
7
+ Before this file existed, documentation portals were force-fit into either `MARKETING` (wrong — no hero-reveal-and-convert arc, no CTA rhythm, no Tagline Reveal moment) or `STRUCTURAL` (partially right on density, wrong on navigation and content shape). Neither models a docs site's actual layout problem: a persistent sidebar table of contents, dense reference prose, code blocks as first-class content, and a reading experience optimized for scanning + search rather than conversion.
8
+
9
+ ## Core layout shape
10
+
11
+ - **Persistent left sidebar** (collapsible on mobile) for the nested page tree. Sidebar width: `w-64` to `w-72`, `border-r border-hairline`, independently scrollable from main content.
12
+ - **Right-hand "on this page" mini-TOC** for pages with 3+ headings (`w-56`, `sticky top-16`), auto-generated from `h2`/`h3` — omit on short pages.
13
+ - **Content column measure**: `max-w-2xl` to `max-w-3xl` for prose — narrower than MARKETING's hero measure, because dense reference text needs a tighter line length than a marketing headline.
14
+ - **No hero-reveal arc.** The `page-architecture.md` 12-section vertical arc and Tagline Reveal moment (from `shavin-webpage`) do NOT apply in DOCS mode — skip them entirely.
15
+
16
+ ## Typography & density
17
+
18
+ - Inherit `spacing-dense.md`'s density framework (`STRUCTURAL`/`DOCS` share this file — see Mode Rule Map) — reference prose benefits from the same compact rhythm as dashboards, not MARKETING's generous `py-24`.
19
+ - Body copy: `text-sm leading-relaxed text-fg-subtle`, same as elsewhere, but line length capped tighter (`max-w-2xl`) per above.
20
+ - Code blocks are first-class: `font-mono text-xs`, `bg-surface border border-hairline rounded-[var(--radius-panel)]`, always with a copy button and language label. Never omit syntax highlighting language hints.
21
+ - Inline `<code>` uses `bg-surface-hover border border-hairline rounded-[var(--radius-lg)] px-1 py-0.5 text-xs font-mono`.
22
+
23
+ ## Navigation & wayfinding
24
+
25
+ - Sidebar items use active-state styling matching the current route (`bg-brand-subtle text-brand-text` or `border-l-2 border-brand`), not a full-card selected state.
26
+ - Breadcrumbs above the `h1` for pages nested more than one level deep.
27
+ - Prev/Next page links at the bottom of content, `border-t border-hairline pt-6`.
28
+ - A `Cmd+K` / search trigger is expected in the header on any real docs site — flag its absence in `audit-checklist.md` review for DOCS-mode pages, even though it isn't literally part of this skill's own token rules.
29
+
30
+ ## What still applies unchanged
31
+
32
+ `cognitive-layer.md`, `concentric-laws.md`, `spacing-core.md`, `layout-restraint.md`, `typography-rules.md`, and `interface-polish.md` are ALWAYS strict in DOCS mode exactly as in every other mode — see the Mode Rule Map in `SKILL.md`. `graphics-and-assets.md`, `spacing-marketing.md`, and `editorial-mode.md` are skipped entirely: documentation portals should not carry atmospheric marketing backdrops or theatrical motion.