@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,16 @@
1
+ ---
2
+ description: Plan and build a page (or section) from the layout-compositions library — plan first, then code
3
+ argument-hint: <brief: what the page is for, style, and any content you already have>
4
+ ---
5
+
6
+ Use the `layout-compositions` skill to design and build this page: $ARGUMENTS
7
+
8
+ Follow its workflow strictly:
9
+
10
+ 1. **Frame the brief.** State the subject, audience, style (structural, marketing, editorial, hybrid, documentation, expressive), the page's job, and the real content available (item counts, copy, visuals, numbers, quotes, code). List anything missing and mark it as a placeholder. Do not invent proof.
11
+ 2. **Show the plan before any code**, as a table: section → composition ID → treatment → motion tier → one-line reason. With the Shavin MCP, call `plan_page({ brief: "$ARGUMENTS" })` and fill its template; otherwise start from the closest recipe in `page-recipes.md` and choose compositions with `selection-guide.md`. Save the plan as `.shavin/plans/<page>.json` and run `check_page({ plan })`.
12
+ 3. **Name the variation.** State the two or more knobs changed from the recipe and the single bold moment (see `distinctiveness.md`).
13
+ 4. Ask me to confirm or adjust the plan only if a choice is genuinely ambiguous; otherwise continue.
14
+ 5. **Build** using the `@shavin/ui` adapter (`references/adapters/shavin-ui.md`). Read only the composition entries you use (`get_skill({ name: "layout-compositions", section: "<family>" })`). Honour each Contract, Grid and Watch line, and the foundations. Every section is `<Section data-composition="<ID>">`.
15
+ 6. **Motion:** default Tier 0. Add `layout-motion` presets only where they help. Use `layout-choreography` only if the brief asks for scroll-linked or pinned motion, and only after the static page is complete.
16
+ 7. **Verify** with `validate_code` per file, `check_page({ targetDir })` for the project, and the checklist in the skill. Report any deviations from the plan.
@@ -0,0 +1,79 @@
1
+ # Create `@shavin/ui` Block
2
+
3
+ Automated recipe to compose a standalone UI section or block from `@shavin/ui` primitives.
4
+
5
+ ## Input Argument
6
+ $ARGUMENTS (Block Type & Intent: e.g., `hero-saas-creative`, `feature-bento`, `pricing-cards`, `stats-counter`, `app-shell`, `faq-accordion`)
7
+
8
+ ## Instructions
9
+
10
+ ### 0. Read Project Context & Resolve Mode
11
+
12
+ - 💡 **If `shavin-mcp` is connected:** Call `get_project_context()` to read the project's `SHAVIN.md` — it returns the configured brand, theme mode, radius, density, and (if present) the `## 3. Site & Mode Defaults` section. Use those values as the source of truth for all theme/mode decisions in this block.
13
+ - 💡 **Otherwise (No-MCP):** Read `SHAVIN.md` directly (`view SHAVIN.md` or equivalent file read). Look for `## 2. Design System Configuration` and `## 3. Site & Mode Defaults`. If `SHAVIN.md` doesn't exist, treat `Site Type` and `Default Visual Mode` as `AUTO` (decide per request, see `SHAVIN.md` section 3).
14
+ - **Mode resolution:** Resolve the visual mode (STRUCTURAL / MARKETING / EDITORIAL / HYBRID / DOCS) using the precedence in `visual-compositor/SKILL.md` (section Mode Precedence) — do NOT hardcode a partial mode table here. The resolution order is: (1) explicit signal in `$ARGUMENTS`, (2) `SHAVIN.md`'s `Default Visual Mode`, (3) `visual-compositor/SKILL.md`'s Activation Modes table, (4) ask the user. Treat `get_skill_mode` as advisory only (it can't return DOCS or HYBRID).
15
+
16
+ ### 1. Skill Activation
17
+
18
+ Activate skill modules based on the resolved mode — see the Activation Matrix in `AGENTS.md` for the skill dispatcher table. The key mappings:
19
+ - **MARKETING / EDITORIAL / HYBRID**: Load `shavin-webpage/` (`page-architecture.md`, `editorial-craft.md`, `style-recipes.md`) + `layout-compositions/` for composition patterns + `visual-compositor/` files per the File Loading Guide.
20
+ - **STRUCTURAL / DOCS**: Load `shavin-app/SKILL.md` + `visual-compositor/spacing-dense.md` (and `docs-mode.md` for DOCS).
21
+ - **All modes**: Enforce `visual-compositor/typography-rules.md`, `interface-polish.md`, and `motion-and-physics.md`. For MARKETING/EDITORIAL/HYBRID modes, also load `page-motion-presets.md` and `composition-motion-map.md` for entrance preset recipes.
22
+
23
+ ### 2. Primitive Discovery & Selection
24
+
25
+ - 💡 **If `shavin-mcp` is connected:** Query available primitives dynamically using `get_components({ name?, density? })`.
26
+ - 💡 **Otherwise (No-MCP):** Reference `@shavin/ui`'s 138-component system — browse `packages/ui/src/primitives/` or read `components.json` at the repo root (generated via `npm run manifest:gen`).
27
+ - Do NOT restrict yourself to basic cards. Reach for rich interactive primitives:
28
+ - **Containers & Overlays**: `Card`, `Inset`, `Dialog`, `AlertDialog`, `Popover`, `Tooltip`, `Callout`, `ScrollArea`, `HoverCard`, `AspectRatio`.
29
+ - **Navigation & Hierarchy**: `Tabs`, `SegmentedControl`, `Breadcrumbs`, `Pagination`, `Menu`, `Dropdown`, `Sidebar`.
30
+ - **Controls & Data Entry**: `Button`, `IconButton`, `TextField`, `TextArea`, `Select`, `Combobox`, `Checkbox`, `Switch`, `Slider`, `RadioGroup`, `DatePicker`.
31
+ - **Data Display & Feedback**: `Table`, `Badge`, `Avatar`, `AvatarGroup`, `Progress`, `Skeleton`, `Kbd`, `Separator`, `BarChart`, `LineChart`, `Sparkline`, `StatCard`, `Accordion`.
32
+ - **Layout & Structure**: `AppFrame`, `Sidebar`, `Section`, `Container`, `Flex`, `Grid`.
33
+ - **Zero Raw HTML**: Never use raw HTML buttons, inputs, tables, or cards when a Shavin primitive exists.
34
+
35
+ ### 3. Spatial Hierarchy & Concentric Geometry
36
+
37
+ - **Section wrapper**: `Section` has no padding by default — set `size="body"` (py-16 md:py-24) or `size="hero"` (py-24 md:py-32) for marketing showcases, or an explicit `py-16 md:py-24`. Full-bleed, zero horizontal padding on `<section>` (the `Container` is the gutter).
38
+ - **Content wrapper**: `<Container size="lg" className="px-4 md:px-6">` (`xl` is for the nav and footer only; split and dense grids stay in `lg`).
39
+ - **Container Surfaces**: `rounded-[var(--radius-panel)] border border-hairline bg-surface`.
40
+ - **Controls & Chips**: `rounded-[var(--radius-lg)]` (inputs, buttons, badges).
41
+ - **Concentric Nesting Rule**: Inner radius must satisfy $R_{\text{inner}} = \max(\text{floor}, R_{\text{outer}} - P)$, floor = `min(radius-lg, radius-panel / 2)`. Use concentric utilities (`rounded-panel-p5`, `rounded-panel-p3`, `rounded-panel-inner`).
42
+
43
+ ### 4. Color & Typography Contrast
44
+
45
+ - **Section Title**: `text-fg` with `font-semibold` or `font-display` and `tracking-tight`.
46
+ - **Paired Subtitle**: `text-fg-subtle` (`color="subtle"`), never `text-fg-muted` (per `AGENTS.md` typography invariant).
47
+ - **Metadata / Minor Captions**: `text-fg-muted` (timestamps, subtle counter labels).
48
+ - **Action Buttons**: Primary `variant="solid"` (brand tone), Secondary `variant="outline"` or `variant="subtle"`.
49
+ - **Zero Raw Color Literals**: No hex codes, no `rgb()`, no `--n-*` foundation variables. Only semantic tokens (`bg-surface`, `bg-canvas`, `text-fg`, `border-hairline`, `brand`).
50
+
51
+ ### 5. Imagery & Media (Anti-Slop Invariant)
52
+
53
+ **Follow the anti-slop invariant in `visual-compositor/anti-patterns.md` and `core-rules.md` §11 (AP-03).**
54
+
55
+ - **NEVER** dump cliché literal stock (people typing on laptops, handshakes, generic office desks) or dense, tiny, unreadable UI screenshots into blocks or templates. They look cheap and break visual cohesion.
56
+ - **PREFERRED hero / main media** (content on top, behind a scrim — set via layout bg props `bgImage` / `bgVideo` + `bgPoster` / `bgOverlays`):
57
+ 1. **Curated photography** from Lummi (`assets.lummi.ai`), Unsplash, or user-supplied — usable anywhere, including as highlights for visual balance.
58
+ 2. **Mesh gradients** (`bgOverlays="mesh-lime"`, `mesh-night`, `mesh-mint`, `mesh-peach`, `mesh-brand`; append `-animated` for slow drift).
59
+ 3. **Animated backgrounds** (Pexels video via `bgVideo` with a `bgPoster` fallback).
60
+ - **3D renders**: optional decorative graphics only — never focal hero/feature media.
61
+ - **Product mockups rebuilt from Shavin primitives**: do NOT use as imagery unless highly confident of the result (rarely).
62
+ - If visual media is required, wrap it in a container with concentric radii (`rounded-panel-p5` or `rounded-[var(--radius-panel)]`), `overflow-hidden`, and `object-cover`.
63
+ - Add subtle theme-aware border (`border border-hairline`) to prevent visual bleed in dark or light mode.
64
+
65
+ ### 6. Icons
66
+
67
+ - **Strictly use `lucide-react`**: `import { Sparkles, ArrowRight, Check, Shield } from "lucide-react"`.
68
+ - Zero emojis in UI titles/badges.
69
+ - Zero standalone inline `<svg>` markup.
70
+ - Zero `@phosphor-icons/react` imports.
71
+
72
+ ### 7. Validation & Quality Gate
73
+
74
+ - 💡 **If `shavin-mcp` is connected:** Validate the block with `validate_code({ code: "<ComponentSource>" })`. Must score 100% token purity with zero lint errors and correct concentric nesting.
75
+ - 💡 **Otherwise (No-MCP):** Run `node bin/lint-tokens.mjs <file>` — it implements the same token purity regexes as `@shavin/mcp`'s `validate_code`, with `--fix` for autofixable cases (hex→token, literal radius→token).
76
+ - Also run `npm run tokens:check` and `npm run typecheck` if working inside the Shavin repository.
77
+ - Render the block at 375, 768 and 1280. No horizontal page scroll, nothing cut off by an `overflow-hidden` ancestor, button rows wrap, tables scroll inside their own region.
78
+
79
+ To propose a block for the shared Shavin catalogue, open an issue with the block code; catalogue blocks are added by maintainers.
@@ -0,0 +1,40 @@
1
+ # Create `@shavin/ui` Primitive Component
2
+
3
+ Automated recipe to create a new accessible UI primitive (tested against WCAG 2.2 AA) inside `@shavin/ui`.
4
+
5
+ ## Input Argument
6
+ $ARGUMENTS (Component Name, e.g., `Accordion`, `Rating`, `Kbd`)
7
+
8
+ ## Instructions
9
+
10
+ ### 0. Read Project Context
11
+
12
+ - 💡 **If `shavin-mcp` is connected:** Call `get_project_context()` to confirm the project's current theme configuration and token setup.
13
+ - 💡 **Otherwise (No-MCP):** Read `SHAVIN.md` directly. Also read `AGENTS.md` (its Component Addition Pipeline section is the current checklist).
14
+
15
+ Execute the primitive pipeline in order:
16
+
17
+ ### 1. Primitive Source (`packages/ui/src/primitives/{ComponentName}/{ComponentName}.tsx`)
18
+ - Import `cva` from `class-variance-authority`, `cn` from `../../lib/cn`.
19
+ - Use ONLY semantic tokens (`bg-surface`, `text-fg`, `border-hairline`, `bg-brand-solid` with `text-brand-fg` for a fill under text, `text-brand-text`, etc.). ZERO raw hex, `rgb()`, or `--n-*`.
20
+ - Controls use `--radius-lg`; floating containers use `--radius-panel` + `data-panel` attribute.
21
+ - Define `componentVariants` with `cva()` and merge `className` via `cn()`.
22
+ - Create index file: `packages/ui/src/primitives/{ComponentName}/index.ts`.
23
+
24
+ ### 2. Export Registration (`packages/ui/src/index.ts`)
25
+ - Export `{ComponentName}` and its prop types from `packages/ui/src/index.ts`.
26
+ - Run `npm run manifest:gen` to update `components.json` and `meta.ts`.
27
+
28
+ ### 3. Doc File (`packages/ui/src/primitives/{ComponentName}/{ComponentName}.doc.ts`)
29
+ - Describe the component, its guidance (do / don't) and examples. Examples define their own data and state; doc files may only `import type`.
30
+ - `npm run manifest:gen` compiles it into `components.json`, which `get_components` and the playground read.
31
+
32
+ ### 4. Preview & Tests
33
+ - `npm run playground`, open the component's page and clear its checklist; every example must render.
34
+ - Add render, axe and contract cases in `tests/unit/` (`smoke`, `a11y`, `contracts`).
35
+ - The docs site page and the Studio block registry are wired by maintainers after merge.
36
+
37
+ ### 5. Quality Verification
38
+ - 💡 **If `shavin-mcp` is connected:** Call `validate_code({ code })` to verify token purity of the new primitive.
39
+ - 💡 **Otherwise (No-MCP):** Run `node bin/lint-tokens.mjs packages/ui/src/primitives/{ComponentName}/{ComponentName}.tsx` — same regexes, no MCP required.
40
+ - Run `npm run verify` to confirm build, typecheck, token linting, and ledger pass >= 90/100.
@@ -0,0 +1,45 @@
1
+ # Create `@shavin/ui` Full-Page Screen
2
+
3
+ Automated recipe to compose a production-ready full-page layout using `@shavin/ui` primitives.
4
+
5
+ ## Input Argument
6
+ $ARGUMENTS (Screen Type: e.g., `saas-dashboard`, `analytics-overview`, `settings-profile`, `marketing-landing`, `pricing-matrix`)
7
+
8
+ ## Instructions
9
+
10
+ ### 0. Read Project Context & Resolve Mode
11
+
12
+ - 💡 **If `shavin-mcp` is connected:** Call `get_project_context()` to read the project's `SHAVIN.md` — it returns the configured brand, theme mode, radius, density, and (if present) the `## 3. Site & Mode Defaults` section. Use those values as the source of truth for all theme/mode decisions.
13
+ - 💡 **Otherwise (No-MCP):** Read `SHAVIN.md` directly (`view SHAVIN.md` or equivalent file read). Look for `## 2. Design System Configuration` and `## 3. Site & Mode Defaults`. If `SHAVIN.md` doesn't exist, treat `Site Type` and `Default Visual Mode` as `AUTO` (decide per request, see `SHAVIN.md` section 3).
14
+ - **Mode resolution:** Resolve the visual mode using the precedence in `visual-compositor/SKILL.md` (section Mode Precedence) — do NOT hardcode a partial mode table here. The resolution order is: (1) explicit signal in `$ARGUMENTS`, (2) `SHAVIN.md`'s `Default Visual Mode`, (3) `visual-compositor/SKILL.md`'s Activation Modes table, (4) ask the user. Treat `get_skill_mode` as advisory only (it can't return DOCS or HYBRID, and defaults differently than this table).
15
+
16
+ ### 1. Skill Activation (by resolved mode)
17
+
18
+ See the Activation Matrix in `AGENTS.md` for the skill dispatcher table — do not maintain a separate copy here. The key mode→skill mappings:
19
+ - **MARKETING / EDITORIAL / HYBRID**: Load `shavin-webpage/` (`page-architecture.md`, `editorial-craft.md`, `style-recipes.md`) + `layout-compositions/` (57 compositions, selection guide, treatments, page recipes). Follow the 12-section vertical reading arc, conversion copywriting formulas, mandatory Tagline Reveal moment,and 5 Design Calibration Dials. Apply `typography-rules.md` and `interface-polish.md`.
20
+ - **DOCS**: Load `shavin-webpage/SKILL.md` + `visual-compositor/docs-mode.md`. Skip the 12-section marketing arc — use persistent sidebar nav, dense reference prose (`max-w-2xl`), and first-class code blocks per `docs-mode.md`.
21
+ - **STRUCTURAL** (SaaS / Dashboard / Admin / Settings): Load `shavin-app/SKILL.md`. Use `AppFrame` / `Sidebar` layouts; offer high density (`scaling="95%"`, opt-in, default 100%), concentric surface nesting (`rounded-panel-p5`), paired metric KPI cards, rich data `Table`s with sort headers and status badges, `Skeleton` loading states. For Settings: sticky `Tabs` / `SegmentedControl`, form stacks, Radix `AlertDialog` for destructive confirms.
22
+ - **All modes**: Enforce `visual-compositor/motion-and-physics.md` (The Frequency Law, motion tokens `--dur-*`/`--dist-*`/`--stagger`, reduced-motion safety net, Rauno split & stagger enter choreography). For MARKETING/EDITORIAL/HYBRID modes, also load `page-motion-presets.md` and `composition-motion-map.md` for entrance preset recipes and per-composition motion suggestions.
23
+ - 💡 **Shortcut (MCP):** If `shavin-mcp` is connected and you want a full first-draft page rather than hand-assembling one section at a time, `synthesize_layout({ prompt: $ARGUMENTS, category })` returns complete JSX with mode, theme, and token-compliance already resolved — use it as a starting point, then apply the composition rules below to refine.
24
+
25
+ ### 2. Composition Rules
26
+ - **Primitives**: Import directly from `@shavin/ui` root. Never use raw HTML buttons, inputs, tables, or cards where Shavin primitives exist.
27
+ - **Semantic Tokens ONLY**:
28
+ - Backgrounds: `bg-canvas` (body/page), `bg-surface` (cards), `bg-surface-raised` (elevated panels).
29
+ - Text: `text-fg` (headings/titles), `text-fg-subtle` (paired descriptions), `text-fg-muted` (metadata/captions).
30
+ - Borders: `border-hairline`, `border-hairline-strong`.
31
+ - Brand: `bg-brand-solid text-brand-fg hover:bg-brand-solid-hover` for fills with text, `bg-brand` for decoration only, `text-brand-text`, `text-brand-contrast`, `border-brand-text` for a state border.
32
+ - Zero raw hex, `rgb()`, or default Tailwind colors (`slate-500`, `blue-600`).
33
+ - **Concentric Geometry**:
34
+ - Containers/Panels: `rounded-[var(--radius-panel)]` (Cards, Modals, Popovers).
35
+ - Controls: `rounded-[var(--radius-lg)]` (Buttons, TextFields, Badges).
36
+ - Concentric nesting formula: $R_{\text{inner}} = \max(\text{floor}, R_{\text{outer}} - P)$, floor = `min(radius-lg, radius-panel / 2)` (`rounded-panel-p5`, `rounded-panel-p3`).
37
+ - **Icons**:
38
+ - Use `lucide-react` exclusively (e.g. `import { LayoutDashboard, Users, Settings, Sparkles } from "lucide-react"`).
39
+ - Never use emoji characters, standalone inline `<svg>` markup, or phosphor icons.
40
+
41
+ ### 3. Verification & Quality Gate
42
+ - 💡 **If `shavin-mcp` is connected:** Validate synthesized screen code with `validate_code({ code })`.
43
+ - 💡 **Otherwise (No-MCP):** Run `node bin/lint-tokens.mjs <path> --fix` — same regexes as `@shavin/mcp`'s `validate_code`, with autofix for hex→token and literal radius→token.
44
+ - Output code directly into the target project structure (e.g. `src/app/(dashboard)/page.tsx`).
45
+ - Verify all imports and ensure zero compile or lint errors.
@@ -0,0 +1,41 @@
1
+ # Create `@shavin/ui` Custom Theme Preset
2
+
3
+ Automated recipe to add a new theme preset to the DS source (`THEME_PRESETS`).
4
+
5
+ ## Input Argument
6
+ $ARGUMENTS (Theme Name, e.g., `emerald-dark`, `cyber-violet`, `minimal-slate`)
7
+
8
+ ## Instructions
9
+
10
+ ### 0. Read Project Context
11
+
12
+ - 💡 **If `shavin-mcp` is connected:** Call `get_project_context()` to check the project's current theme configuration and confirm the new preset doesn't duplicate an existing one.
13
+ - 💡 **Otherwise (No-MCP):** Read `SHAVIN.md` directly for the project's current theme values. If working inside the Shavin repository, check `packages/ui/src/lib/theme-presets.ts` for existing preset names to avoid duplicates.
14
+
15
+ ### 1. Preset Configuration (`packages/ui/src/lib/theme-presets.ts`)
16
+ - Add new preset definition to `THEME_PRESETS`.
17
+ - Specify `brandColor` (`monochrome`, another named brand colour, or a hex).
18
+ - Specify `grayColor` (`gray` (pure neutral), `zinc` (cool tech), `slate` (slate blue), `sand` (warm earth), `olive` (earth green)).
19
+ - Specify `radius` scaling preset (`none` | `small` | `medium` | `large` | `full`).
20
+ - Specify `scaling` (`100%` (default) | `95%` (dense SaaS) | `90%` | `105%` | `110%`).
21
+ - Specify `panelBackground` (`solid` (opaque high performance) | `translucent` (glassmorphism blur)).
22
+
23
+ ### 2. Mounting via ThemeProvider
24
+
25
+ ```tsx
26
+ <ThemeProvider
27
+ brandColor="monochrome"
28
+ grayColor="zinc"
29
+ radius="large"
30
+ scaling="100%"
31
+ panelBackground="solid"
32
+ />
33
+ ```
34
+
35
+ > **For consumer projects:** Use `/apply-theme` instead — it reads `SHAVIN.md`'s `## 2. Design System Configuration` and mounts the correct `ThemeProvider` props for the project. This command is for adding presets to the DS source.
36
+
37
+ ### 3. Verification
38
+ - Check contrast ratio compliance (WCAG 2.2 AA: 4.5:1 for text such as `--fg`, 3:1 for controls and large text).
39
+ - Preview it with `npm run playground` (theme switcher) across a few primitives in light and dark.
40
+ - 💡 **If `shavin-mcp` is connected:** Call `validate_code({ code })` on any demo JSX using the new preset.
41
+ - 💡 **Otherwise (No-MCP):** Run `npm run tokens:check` and `npm run typecheck` — these are npm scripts, no MCP required.
@@ -0,0 +1,14 @@
1
+ ---
2
+ description: Build every UI task with Shavin (@shavin/ui) components, tokens and the six states
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # Shavin
7
+
8
+ This project uses `@shavin/ui`. A plain request for a page, section, screen or component means Shavin; the user does not need to say so.
9
+
10
+ - Every UI element is a `@shavin/ui` component. No raw `<button>`, `<input>`, `<select>`, `<textarea>`, `<table>` or `<dialog>`, no hand-styled `<div>` imitating a card, badge, modal, tabs or toast, and no other UI library in new code. Existing code from another library is left alone unless the user asks to migrate it.
11
+ - Every screen covers first-time, empty, loading, error, success and disabled states by default, without being asked (`EmptyState` kind first-time / empty / no-results / success; `Skeleton` for loading content, never a spinner, `Button loading` for actions; `Callout color="danger"` with retry; `TextField errorMessage`, `FormField error`, `FormErrorSummary`; `useToast()`; `Button disabledReason`; `Stepper`; `AlertDialog` for destructive actions). Every site has a not-found page and an error boundary. Never remove focus rings.
12
+ - Colours come from semantic tokens (`bg-surface`, `text-fg`, `border-hairline`); a hex is allowed only as `brandColor="#hex"` on `ThemeProvider`.
13
+ - On every turn that writes UI, including small follow-ups: read `SHAVIN.md`, look components up with the Shavin MCP (`get_components`, `get_tokens`) instead of writing props from memory, plan new pages with `plan_page`, and run `validate_code` on every changed file before answering.
14
+ - Full rules: `AGENTS.md`, `SHAVIN.md` and the skills in `.agents/skills/`.
package/package.json CHANGED
@@ -1,6 +1,68 @@
1
1
  {
2
2
  "name": "@shavin/skills",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Agent skills and slash commands for @shavin/ui, installed into a project's .agents/ folder",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "Avinash Bussa",
8
+ "url": "https://avinashbussa.com"
9
+ },
10
+ "homepage": "https://docs.shavin.cc",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/avinashbussa/shavin.git",
14
+ "directory": "packages/skills"
15
+ },
16
+ "bugs": {
17
+ "url": "https://github.com/avinashbussa/shavin/issues"
18
+ },
19
+ "keywords": [
20
+ "ai-agents",
21
+ "agent-skills",
22
+ "design-system",
23
+ "claude-code",
24
+ "cursor",
25
+ "prompting",
26
+ "ui-design",
27
+ "shavin"
28
+ ],
29
+ "type": "module",
30
+ "engines": {
31
+ "node": ">=22"
32
+ },
33
+ "bin": {
34
+ "skills": "./bin/install.mjs",
35
+ "shavin-skills": "./bin/install.mjs",
36
+ "shavin-lint-tokens": "./bin/lint-tokens.mjs"
37
+ },
38
+ "files": [
39
+ "AGENTS.md",
40
+ "bin",
41
+ "skills",
42
+ "!skills/shavin-core",
43
+ "!skills/shavin-ui-qa-linter",
44
+ "!skills/dense-compression-protocol.md",
45
+ "commands",
46
+ "cursor",
47
+ "build.mjs",
48
+ "posix-path.mjs",
49
+ "token-budget.json",
50
+ "README.md",
51
+ "CHANGELOG.md"
52
+ ],
53
+ "scripts": {
54
+ "install-skills": "node bin/install.mjs",
55
+ "build": "node build.mjs",
56
+ "check": "node build.mjs --dry-run --strict",
57
+ "tokens": "node build.mjs --tokens",
58
+ "lint": "node bin/lint-tokens.mjs"
59
+ },
60
+ "shavin": {
61
+ "compat": {
62
+ "@shavin/ui": ">=0.1.0 <0.2.0"
63
+ }
64
+ },
65
+ "publishConfig": {
66
+ "access": "public"
67
+ }
68
+ }
package/posix-path.mjs ADDED
@@ -0,0 +1,7 @@
1
+ import path from "node:path";
2
+
3
+ /** Forward-slash form of a path. Skill files are listed and compared with "/" (SKILL.md frontmatter, token-budget.json). */
4
+ export const toPosix = (p) => String(p).split("\\").join("/");
5
+
6
+ /** `path.relative(from, to)` with "/" separators on every platform. `pathImpl` is for tests (e.g. `path.win32`). */
7
+ export const relPosix = (from, to, pathImpl = path) => toPosix(pathImpl.relative(from, to));
@@ -0,0 +1,294 @@
1
+ ---
2
+ name: core-rules
3
+ description: >
4
+ Shared foundation rules for @shavin/ui — token compliance, concentric geometry,
5
+ typography hierarchy, font loading, animation, and anti-slop standards.
6
+ The shared baseline for every domain skill. Read this file; the MCP does not inject it and it is not a skill name. Never duplicate these in domain skills.
7
+ ---
8
+
9
+ # @shavin/ui Core Rules
10
+
11
+ - **Single source of truth.** Domain skills (shavin-app, shavin-webpage, visual-compositor) reference this file. Never re-explain these rules inline — link here instead.
12
+
13
+ ---
14
+
15
+ ## 1. Token Compliance (Zero Tolerance)
16
+
17
+ 1. Tier-1 foundation vars (`--n-*`) → `global.css` ONLY.
18
+ 2. Tier-2 semantic vars (`bg-surface`, `text-fg`, `border-hairline`) → EVERYWHERE ELSE.
19
+ 3. **ZERO** hex, rgb(), rgba() in component code.
20
+ 4. **ZERO** raw Tailwind color scales (`slate-500`, `blue-600`, etc.).
21
+ 5. Import primitives from `@shavin/ui` root ONLY — never deep paths (`@shavin/ui/primitives/…`).
22
+ 6. Variants: `cva()` + `cn()`. Floating surfaces: `data-panel` attribute.
23
+ 7. Brand colour as a text or icon colour: `text-brand-text`, never `text-brand` (the fill: it fails contrast for light brands). `validate_code` warns on it.
24
+
25
+ ### Semantic Token Quick Reference
26
+
27
+ | Role | Token | Use For |
28
+ |---|---|---|
29
+ | Backgrounds | `bg-canvas`, `bg-surface`, `bg-surface-hover`, `bg-surface-raised` | Page, cards, hover states, elevated panels |
30
+ | Foreground | `text-fg`, `text-fg-subtle`, `text-fg-muted`, `text-brand-text` | Titles, descriptions, meta, brand text |
31
+ | Borders | `border-hairline`, `border-hairline-strong` | Resting cards/dividers (`hairline`), hover/active/featured states (`hairline-strong`). A border, ring or bar that shows a state (selected, checked, current) is `border-brand-text` / `ring-brand-text`, never raw `border-brand` (`validate_code` warns). Raw `border-brand` is for decorative marketing moments only, never standard cards, apps, dashboards or docs. |
32
+ | Brand | `bg-brand-solid text-brand-fg hover:bg-brand-solid-hover`, `bg-brand`, `bg-brand-subtle` | Fills with text on them (CTA, solid badge): `brand-solid` + `text-brand-fg`, never `bg-brand` + `text-brand-fg` (`validate_code` warns). `bg-brand`: decoration with no text. `bg-brand-subtle`: highlight fills |
33
+
34
+ **Responsive.** A data table is always `Table`; it scrolls inside its own region with an edge fade, so never wrap it in `overflow-hidden`. A row of buttons or chips uses `flex-wrap`, never `shrink-0`. Fixed widths (`min-w-*`, `w-[Npx]`) on content need a scroll container or a breakpoint override. Check 375, 768 and 1280.
35
+
36
+ ---
37
+
38
+ ## 2. Concentric Radius — The Two-Tier Rule
39
+
40
+ ### Token Assignment (Role-Based, Not Shape-Based)
41
+
42
+ | Token | Value (medium preset) | Use On | NEVER Use On |
43
+ |---|---|---|---|
44
+ | `--radius-panel` | 16px | Cards, dialogs, modals, popovers, menus, accordions, accordion items, callouts, panels | Buttons, inputs, badges, chips, switches |
45
+ | `--radius-lg` | 8px | Buttons, inputs, badges, chips, icon buttons, switches, single-line controls | Cards, dialogs, panels, accordion items |
46
+ | `--radius-sm` | 4px | Tiny standalone shapes (swatches, carets). Never a nested inner radius: the floor applies | — |
47
+ | `rounded-full` | 9999px | Avatar, pill Badge, Switch thumb ONLY | Any panel, card, or container |
48
+
49
+ ### Concentric Formula
50
+
51
+ - **R_inner = max(floor, R_outer − P)**, floor = min(radius-lg, radius-panel / 2); P = padding between container wall and inner element.
52
+
53
+ ```
54
+ Card [--radius-panel, p-5] → inner button [--radius-lg] ✓
55
+ Card [--radius-panel, p-4] → inner chip [rounded-panel-p4] ✓
56
+ Popover [--radius-panel, p-3] → inner list item [rounded-panel-p3] ✓
57
+ ```
58
+
59
+ ### Hard Rules
60
+
61
+ - **NEVER** use literal `rounded-lg`, `rounded-xl`, `rounded-2xl` — always `rounded-[var(--radius-panel)]` for containers or `rounded-[var(--radius-lg)]` for controls.
62
+ - **NEVER** use `--radius-lg` on a container/panel (breaks at "Full" preset → stadium capsule).
63
+ - **NEVER** use `--radius-panel` on a control (breaks at "Full" preset → oversized pill).
64
+ - Nested surfaces: `rounded-panel-p3` (outer p-3), `rounded-panel-p5` (outer p-5).
65
+
66
+ ---
67
+
68
+ ## 3. Concentric Spacing
69
+
70
+ - **RULE:** outer containers hold more space than inner elements — padding decreases as nesting depth increases (Page > Container > Surface > Element). If child padding ≥ parent padding → hierarchy broken.
71
+ - Zone ranges and section rhythm: `visual-compositor/concentric-laws.md` (Law 2), via `get_skill({ name: "visual-compositor", section: "concentric-laws" })`.
72
+ - **NEVER** put `px-*` on `<section>` — section is full-bleed, Container is the gutter.
73
+ - **RULE:** page body width: every body section uses `<Container size="lg">` (72rem) so all content shares one centred column with visible margins at 1280 and 1440. `xl` (88rem) is for the nav and footer only; `full` only for media or FX that should bleed (`shavin-webpage` Rule 5).
74
+ - **NEVER** use arbitrary values (`py-[73px]`) — breaks rhythm.
75
+
76
+ ---
77
+
78
+ ## 4. Typography Color Hierarchy
79
+
80
+ | Context | Token | Class |
81
+ |---|---|---|
82
+ | **Title / Heading** | `--fg` | `text-fg`, `<Text weight="semibold">` |
83
+ | **Paired description** (immediately under title) | `--fg-subtle` | `text-fg-subtle`, `color="subtle"` |
84
+ | **Standalone text** (no adjacent title) | `--fg-muted` | `text-fg-muted`, `color="muted"` |
85
+ | **Micro labels / metadata** | `--fg-subtle` | `text-fg-subtle`, `color="subtle"` |
86
+
87
+ > **CRITICAL:** Paired descriptions MUST use `--fg-subtle`, NEVER `--fg-muted`.
88
+ > `--fg-muted` sits optically close to `--fg` → creates homogeneous grey block, no hierarchy.
89
+ > **Contrast:** `--fg-subtle` passes WCAG 2.2 AA on every dark surface (5.7:1 on the canvas, 5.1:1 on cards, 4.8:1 elevated), so paired descriptions use it in light and dark.
90
+
91
+ ---
92
+
93
+ ## 5. Font Loading Protocol
94
+
95
+ 1. **PREFERRED**: Shavin native font loader from `@shavin/ui/lib/theme-presets`:
96
+ - `applyDisplayFontPreset(name)` → sets `--font-display`
97
+ - `applyBodyFontPreset(name)` → sets `--font-body`
98
+ - `applySubheadingFont("body" | "display" | name)` → sets `--font-subheading` (h3-h6; default body)
99
+ - `loadGoogleFont(name)` → dynamic injection w/ duplicate guard
100
+ 2. **FALLBACK ONLY**: `next/font/google` in `layout.tsx` or raw `<link>` tags.
101
+ 3. **NEVER** hardcode `@import url(...)` or raw `<link rel="stylesheet">` in components.
102
+
103
+ ### Font Pairing by Mode
104
+
105
+ | Mode | Display | Body | Rule |
106
+ |---|---|---|---|
107
+ | STRUCTURAL | Inter | Inter | Same font — differentiate via size/weight only |
108
+ | MARKETING | Fraunces (default) | Inter | Serif display + neutral body |
109
+ | EDITORIAL | Fraunces italic (default) | Inter | Extreme scale contrast (6:1 min) |
110
+ | HYBRID | Marketing hero → STRUCTURAL app section | — | Switch at section boundary, never mid-section |
111
+
112
+ ---
113
+
114
+ ## 6. Animation & Transitions
115
+
116
+ - Animate **compositor-only** properties: `transform`, `opacity`.
117
+ - **NEVER** animate layout geometry: `width`, `height`, `top`, `left`.
118
+ - **NEVER** use `transition: all` — list properties explicitly.
119
+ - Overlay/drawer: `overscroll-behavior: contain` to prevent canvas scroll bleed.
120
+
121
+ ---
122
+
123
+ ## 7. Anti-Slop Copywriting
124
+
125
+ > **Governing principle:** Write domain-specific, precise microcopy — never generic tech marketing. See `visual-compositor/anti-patterns.md` AP-10 & AP-11 for the full catalogue.
126
+
127
+ - ❌ Vacuous tech clichés: *"Empower your workflow"*, *"Revolutionize your efficiency"*, *"Seamless intelligence"*
128
+ - ❌ Binary contrast tropes: *"It's not just a dashboard. It's your command center."*
129
+ - ❌ Throat-clearing openers: *"In today's fast-paced digital ecosystem..."*
130
+ - ❌ Lazy placeholders: `"Card Title"`, `"Lorem ipsum"`, `"John Doe"`, `"user@example.com"`
131
+ - ✅ Domain-specific telemetry: `p99: 42ms`, `99.98% SLA`, `14.2 GB / 20 GB allocated`
132
+ - ✅ Precise action labels: *"Generate API Key"*, *"Deploy to Production"*, *"Invite Teammate"*
133
+
134
+ ---
135
+
136
+ ## 8. Monospace Restraint
137
+
138
+ `font-mono` reserved for **code representations only**: code blocks, inline `<code>`, CLI commands, raw token keys, hashes, API endpoints.
139
+
140
+ - ❌ NOT on standard UI labels, filter popover headers, component names in galleries, metric units.
141
+ - ✅ OK on code snippets, JSX syntax, CSS variables, git SHAs, raw hex strings.
142
+ - Exception: project explicitly configured w/ monospace display/body font (Brutalist mode).
143
+
144
+ ---
145
+
146
+ ## 9. Icons — No Emojis, No Glyphs, `<Icon>`
147
+
148
+ 1. **NEVER** use emoji or Unicode glyphs (✓, ★, →, ▶, •, ✗) in UI, docs or generated output: they render inconsistently across platforms. Use `<Icon>`.
149
+ 2. **NEVER** hand-write or paste inline `<svg>` icons.
150
+ 3. **ALWAYS** use `<Icon>` from `@shavin/ui`:
151
+ ```tsx
152
+ <Icon name="Check" size="sm" color="subtle" /> // by name: PascalCase or kebab-case, case-insensitive
153
+ <Icon icon={Settings} size="md" color="muted" strokeWidth={1.5} /> // by component
154
+ ```
155
+ - Sizes: `xs` 12, `sm` 16, `md` 20, `lg` 24, `xl` 32, `2xl` 40, `3xl` 48px, or a number.
156
+ - Colors: `default`, `subtle`, `muted`, `brand`, `contrast`, `success`, `warning`, `danger`, `inherit`.
157
+ - Never the sparkles icon (any library) or sparkle emoji unless the user asks: it is AI-slop shorthand for "AI feature".
158
+ 4. Libraries registered in `<Icon>`: Lucide (default, `strokeWidth` 0.5–3.0), Phosphor, Radix Icons, Material. Others are not in the name lookup.
159
+ 5. **ALWAYS** use the SVG from the project `assets/` folder for logos and wordmarks; never recreate one as inline SVG or text.
160
+
161
+ - Mappings: ✓ → `Check`, ★ → `Star` (brand), → → `ArrowRight`, ▶ → `Play`, ✗ → `X`, list bullet → `Check` xs brand.
162
+ - Feature lists: `<Flex direction="row" align="center" gap="2">` with `<Icon name="Check" size="sm" color="brand" />` and `<Text size="sm" color="subtle">`. Never `✓ text`.
163
+ - Exceptions: `currentColor` brand-logo SVGs from `assets/`; CSS-drawn checkmarks on native checkboxes; the `IconPicker` primitive.
164
+
165
+ ---
166
+
167
+ ## 10. Live Browser Bridge (MCP-First)
168
+
169
+ - Verify token and layout compliance with `get_live_audit` before reaching for screenshots.
170
+ - Always pass the route: `get_live_audit({ path: "/foundations/colors" })`. Each browser tab is isolated; without `path` and with several tabs open, the result is a summary across all of them.
171
+ - After editing, call `wait_for_live_clean({ path })` and fix whatever it still reports before ending your turn.
172
+
173
+ ---
174
+
175
+ ## 11. Responsive Design & Breakpoint Overrides
176
+
177
+ Shavin uses a **3-tier breakpoint cascade** for responsive design. The base (desktop) value is always defined without a suffix; tablet and mobile overrides use `@tablet` / `@mobile` suffixes on the same prop key.
178
+
179
+ **Prefer layouts that adapt by themselves before reaching for overrides:** rows of cards use `<Grid columns="auto" minWidth="sm">` (wraps to the container's width), app screens use `<AppFrame>` (its `Sidebar` turns into a drawer when the frame is narrow; put `<SidebarTrigger />` in the TopBar, never a hand-written hamburger/Drawer). Use the suffix cascade below only for changes these cannot express.
180
+
181
+ ### Prop Suffix Convention
182
+
183
+ | Breakpoint | Suffix | Tailwind Prefix | Trigger |
184
+ |---|---|---|---|
185
+ | Desktop (base) | *(none)* | *(none)* | Default |
186
+ | Tablet | `@tablet` | `max-lg:` | `< 1024px` |
187
+ | Mobile | `@mobile` | `max-md:` | `< 768px` |
188
+
189
+ ### Supported Responsive Props
190
+
191
+ `columns`, `rows`, `gap`, `direction` / `flexDir`, `align` / `items`, `justify`, `wrap`, `padding`, `width`, `height`. Style props (margin, font size, text align, display) also accept the suffixes.
192
+
193
+ ### Example
194
+
195
+ ```json
196
+ {
197
+ "type": "Grid",
198
+ "props": {
199
+ "columns": "3",
200
+ "columns@tablet": "2",
201
+ "columns@mobile": "1",
202
+ "gap": "6",
203
+ "gap@mobile": "4"
204
+ }
205
+ }
206
+ ```
207
+
208
+ Renders: `grid-cols-3 max-lg:grid-cols-2 max-md:grid-cols-1 gap-6 max-md:gap-4`
209
+
210
+ ### Rules
211
+
212
+ - **Base is always desktop.** Never omit the base value — overrides only apply at narrower breakpoints.
213
+ - **Mobile wins over tablet.** The cascade emits mobile (`max-md:`) after tablet (`max-lg:`), so the narrower override takes precedence at small widths.
214
+ - **Only override what changes.** Don't duplicate the full prop set at every breakpoint. Text size, color, and most visual props rarely need breakpoint overrides.
215
+ - **Use `frame` option** in `compose_to_canvas` / `inject_blocks` to create separate mobile/tablet frames for side-by-side preview, not as a substitute for prop overrides.
216
+
217
+ ---
218
+
219
+ ## 12. Atmospheric Depth, Asset Selection & Anti-Slop Visuals
220
+
221
+ > **Governing principle:** Token purity permits rich atmospheric layering — never confuse it with flat, sterile wireframes. Prefer typographic hierarchy over decorative elements. See `visual-compositor/anti-patterns.md` (AP-01 through AP-13) for the full named catalogue with code examples and remediation.
222
+
223
+ - **NEVER** produce flat sterile wireframes (AP-01) — use layered depth: pastel mesh backdrops, gradient scrims, frosted glass panels (`bg-surface/80 backdrop-blur-md border border-hairline/70`).
224
+ - **NEVER** use `bg-brand/20 blur-3xl` glow orbs (AP-02) — use diffuse pastel meshes with mask dissolves instead.
225
+ - **NEVER** cliché stock or tiny screenshots (AP-03) — use Lummi/Unsplash photos, meshes, or video behind a scrim (`bgImage`/`bgVideo`/`bgOverlays`). 3D = decoration only.
226
+ - **NEVER** scatter `<Badge>` components for section labels (AP-04). A section label is optional: use plain overline text (`uppercase tracking-wider text-fg-subtle`) only where it adds information, at most one per page region. Badge is for stateful labels only.
227
+ - **NEVER** dump paragraph walls (AP-05), metric clutter in heroes (AP-06), or kitchen-sink bento grids (AP-07) — one clear thought per section, generous breathing room.
228
+ - **NEVER** over-contain with nested cards (AP-09) — proximity before containers.
229
+
230
+ ---
231
+
232
+ ## 13. No-MCP Fallback & MCP Dense-Mode Compatibility
233
+
234
+ - 💡 If `shavin-mcp` is connected: call `get_skill({ name, section })` / `get_tokens` / `validate_code`.
235
+ - 💡 Otherwise (No-MCP): read the skill file directly (`.agents/skills/<name>/<file>.md`) — same content — and lint with `npx -p @shavin/skills shavin-lint-tokens <file-or-glob>`, which mirrors `validate_code` exactly: hex, `rgb()`/`rgba()`, raw `--n-*`, literal radius utilities, wrong spacing literals. Node 22+.
236
+ - **RULE (skill authors):** MCP dense mode (`get_skill`, default `density: "dense"`) drops plain paragraphs and blockquotes that lack hard signal words. Write rules and MCP tips as bullets or tables, never `>` blockquotes.
237
+
238
+ ---
239
+
240
+ ## 14. Container Children Spacing — No Accidental Flush Stacking
241
+
242
+ - **Problem:** `Card`, `Container`, and raw `<div>` wrappers do NOT auto-space their children — multiple children stack flush (zero gap) unless spacing is explicit. A `Card` has `padding` (default `none`: set `sm` 16px, `md` 20px, `lg` 24px or `xl` 32px) but no `gap`. This is the #1 cause of "packed without spacing" layouts.
243
+
244
+ ### Rules
245
+
246
+ 1. **NEVER place multiple text/element children directly inside a `Card` without spacing.** A `Card` has `padding` (wall-to-content) but no `gap` (child-to-child). Children will stack flush.
247
+
248
+ 2. **ALWAYS use one of these patterns for children inside a container:**
249
+
250
+ | Pattern | When | Example |
251
+ |---------|------|---------|
252
+ | `<Flex direction="column" gap="3">` wrapper | Structured vertical groups | Card body with heading, text, button |
253
+ | `space-y-3` on the container's className | Simple text stacks | Paragraphs in a div |
254
+ | `<Flex direction="row" gap="2">` | Horizontal items | Icon + text pairs, button groups |
255
+
256
+ 3. **Card body pattern — always wrap children in a Flex.** Spacing comes from `gap`; do not add `my-*` / `mt-*` margins on children (they stack on top of the gap):
257
+ ```tsx
258
+ // ✅ Correct — Flex wrapper with gap
259
+ <Card padding="md">
260
+ <Flex direction="column" gap="3">
261
+ <Text size="md" weight="semibold">Free</Text>
262
+ <Text size="xs" color="subtle">For individuals</Text>
263
+ <Text size="md" weight="bold">$0</Text>
264
+ <Separator />
265
+ <Flex direction="column" gap="2">
266
+ <Flex direction="row" align="center" gap="2">
267
+ <Icon name="Check" size="sm" color="brand" />
268
+ <Text size="sm" color="subtle">Up to 3 projects</Text>
269
+ </Flex>
270
+ </Flex>
271
+ <Button variant="outline" className="w-full">Get Started</Button>
272
+ </Flex>
273
+ </Card>
274
+
275
+ // ❌ Wrong — children stack flush, no spacing
276
+ <Card padding="md">
277
+ <Text>Free</Text>
278
+ <Text>For individuals</Text>
279
+ <Text>$0</Text>
280
+ <Separator />
281
+ <Text>✓ Up to 3 projects</Text>
282
+ <Button>Get Started</Button>
283
+ </Card>
284
+ ```
285
+
286
+ 4. **Grid gap vs card padding:** Grid `gap` spaces the cards themselves. Inside each card, use a `Flex` wrapper with its own `gap` for card-internal spacing. These are independent — one does not substitute for the other.
287
+
288
+ 5. **Section-level spacing:** The `Section` primitive has **no padding by default** (`size="none"`) — a bare `<Section>` is a flat full-bleed band. Always give a content section its vertical breathing: set `size` (`compact` dashboards · `strip` logo/stat bars · `body` most content, py-16/24 · `hero` heroes/CTAs, py-24/32) or a `py-16`/`py-24` className. Leave it unset only for utility screens (auth, 404, app shells) or when you set custom `py-*`. The header block (heading + subtext) uses `mb-10` or `mb-12` to separate from content below. Never less than `mb-8`.
289
+
290
+ 6. **BlockNode trees (Studio):** same rule: set `gap` on `Flex` / `Grid` and wrap `Card` children in a `Flex` with `gap` (details in `shavin-studio`).
291
+
292
+ ## 15. Studio
293
+
294
+ - Connected Studio session only: prop names, BlockNode rules and what the parser drops are in the `shavin-studio` skill (`get_skill({ name: "shavin-studio" })`). AGENTS.md says when to load it.