@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,114 @@
1
+ # Typography Rules & Type Scale Hierarchy
2
+
3
+ > **Load priority:** ALL MODES.
4
+ > **Token cost:** ~2.5K tokens.
5
+ > **Synthesized from:** Vercel Web Interface Guidelines, Meng To Design Systems, and Interface Polish standards.
6
+
7
+ Typography is the backbone of UI design. In high-end digital products, typography communicates 90% of the hierarchy, mood, and perceived quality.
8
+
9
+ ---
10
+
11
+ ## 1. Type Scale & Paired Line Heights
12
+
13
+ Every font size in @shavin interfaces must snap to the strict geometric type scale with its paired line height. Never use arbitrary values like `text-[19px]`, `font-size: 22px`, or `leading-[38px]`.
14
+
15
+ | Class | Font Size | Line Height | Tracking | Primary Role |
16
+ |---|---|---|---|---|
17
+ | `text-xs` | 12px (0.75rem) | 16px (1rem) | `tracking-normal` / `tracking-wider` (caps) | Microcopy, badges, timestamps, tags |
18
+ | `text-sm` | 14px (0.875rem) | 20px (1.25rem) | `tracking-normal` | Controls, secondary buttons, tooltips, list labels |
19
+ | `text-base` | 16px (1rem) | 24px (1.5rem) | `tracking-normal` | Body copy, primary inputs, standard buttons |
20
+ | `text-lg` | 18px (1.125rem) | 28px (1.75rem) | `tracking-normal` | Lead paragraph, card titles, subheadings |
21
+ | `text-xl` | 20px (1.25rem) | 28px (1.75rem) | `tracking-tight` | Section headers, modal titles, bento headlines |
22
+ | `text-2xl` | 24px (1.5rem) | 32px (2rem) | `tracking-tight` | Major card headings, small hero titles |
23
+ | `text-3xl` | 30px (1.875rem) | 36px (2.25rem) | `tracking-tight` | Feature section titles, stat numbers |
24
+ | `text-4xl` | 36px (2.25rem) | 40px (2.5rem) | `tracking-tight` | Hero headlines (mobile), large display stats |
25
+ | `text-5xl` | 48px (3rem) | 1.1 (tight) | `tracking-tight` | Hero headlines (tablet/desktop) |
26
+ | `text-6xl` | 60px (3.75rem) | 1.08 (tight) | `tracking-tight` | Flagship marketing hero headlines |
27
+ | `text-7xl` | 72px (4.5rem) | 1.05 (tight) | `tracking-tighter` | Editorial impact statements, high-impact numbers |
28
+
29
+ > Heading `xl` and up are fluid (follow their container): section `2xl` 30→36px / `3xl` 36→48px, hero `4xl` 36→60px / `5xl` 36→72px. No `md:text-*` steps; a plain `text-*` class pins a fixed size. All Headings apply `text-balance`.
30
+
31
+ ---
32
+
33
+ ## 2. Text Wrapping & Orphan Prevention
34
+
35
+ Single orphaned words at the end of a sentence destroy visual balance and make layouts feel machine-assembled.
36
+
37
+ ```tsx
38
+ // ✅ Headings MUST use text-wrap: balance
39
+ <Heading as="h1" size="5xl" weight="bold">
40
+ The Intelligent Design System for High-Velocity Teams
41
+ </Heading>
42
+
43
+ // ✅ Body copy and descriptions MUST use text-wrap: pretty
44
+ <Text color="subtle" className="leading-relaxed text-pretty max-w-2xl">
45
+ Ship accessible, token-strict React applications with zero design drift across light and dark themes.
46
+ </Text>
47
+ ```
48
+
49
+ - **`text-balance` (`text-wrap: balance`)**: Required on all display headings, hero titles, card titles, and modal headers ($\le 4$ lines).
50
+ - **`text-pretty` (`text-wrap: pretty`)**: Required on multi-line body copy, descriptions, and list prose to prevent single trailing words on the last line.
51
+
52
+ ---
53
+
54
+ ## 3. Tabular Numbers (`tabular-nums`)
55
+
56
+ Proportional digits have varying character widths (e.g. `1` is much narrower than `8`). Whenever numbers update, change, or sit in grids/telemetry, proportional digits cause distracting jitter and layout shift.
57
+
58
+ ```tsx
59
+ // ✅ ALWAYS use tabular-nums on numbers, counters, timestamps, latency, and telemetry
60
+ <Text as="span" weight="semibold" className="tabular-nums">&lt;3.2ms</Text>
61
+ <Heading as="p" size="3xl" weight="bold" className="tabular-nums">1,423,690</Heading>
62
+ ```
63
+
64
+ **Where tabular numbers are mandatory:**
65
+ - Telemetry & performance metrics (`<3.2ms`, `99.9%`, `100.0%`).
66
+ - Currency & pricing numbers (`$24`, `$99.00`).
67
+ - Timers, dates, and version indicators (`v2.4.0`, `14:02:45`).
68
+ - Table numeric columns and data grid values.
69
+
70
+ ---
71
+
72
+ ## 4. Reading Line Length (Max-Width Bounds)
73
+
74
+ Never let body text or hero headlines span full-width across a widescreen monitor. Lines longer than 75 characters exhaust the eye and reduce comprehension.
75
+
76
+ - **Hero Headings**: `max-w-3xl` or `max-w-[680px]` centered or left-aligned.
77
+ - **Subheadings & Lead Copy**: `max-w-2xl` or `max-w-[600px]`.
78
+ - **Prose & Article Body**: `max-w-prose` (65ch–75ch).
79
+
80
+ ---
81
+
82
+ ## 5. Optical Contrast & Semantic Color Hierarchy
83
+
84
+ Never rely on grey washes that blend together. Establish crisp optical contrast:
85
+
86
+ ```
87
+ Level 1: Primary Title → text-fg (High contrast, bold, tracking-tight)
88
+ Level 2: Paired Description → text-fg-subtle (Readable neutral, leading-relaxed, text-pretty)
89
+ Level 3: Standalone Metadata → text-fg-muted (Desaturated secondary metadata, timestamps)
90
+ Level 4: Brand colour → text-brand-text (semantic emphasis, active indicators)
91
+ ```
92
+
93
+ > [!CRITICAL]
94
+ > Paired descriptions immediately underneath a title MUST use `text-fg-subtle`, NEVER `text-fg-muted`. `text-fg-muted` sits too close to dark backgrounds in light mode and causes eye fatigue.
95
+ >
96
+ > **Exception — on dark media** (`surface="dark-always"`): subtitles/overlines use `text-fg-muted`; `text-fg-subtle` is too faint.
97
+
98
+ ---
99
+
100
+ ## 6. Subtle Optical Text Gradients (Display Hero Headlines)
101
+
102
+ On flagship marketing heroes, a very subtle directional text gradient adds a luxurious, sculpted feel:
103
+
104
+ ```tsx
105
+ // ✅ High-end subtle text gradient (Light: fg -> fg/80, Dark: white -> muted)
106
+ <Heading as="h1" size="5xl" weight="bold" className="bg-gradient-to-r from-fg via-fg to-fg/75 bg-clip-text text-transparent">
107
+ The Intelligent Design System for High-Velocity Teams
108
+ </Heading>
109
+ ```
110
+
111
+ **Rules:**
112
+ - Apply ONLY to large display titles (`text-4xl` and above).
113
+ - Never use rainbow or high-saturation electric neon gradients on text.
114
+ - Gradients must stay tonal (`from-fg via-fg to-fg/75`), keeping every stop at 4.5:1 or better (WCAG 2.2 AA).
@@ -0,0 +1,86 @@
1
+ {
2
+ "description": "Token budget configuration for Shavin skills. build.mjs measures actuals against these limits and now enforces them (see build.mjs warn() calls) instead of only printing them.",
3
+ "alwaysLoadedBudget": 22000,
4
+ "perSkillBudget": 12000,
5
+ "perFileBudget": 6000,
6
+ "perSkillBudgetOverrides": {
7
+ "visual-compositor": {
8
+ "budget": 45000,
9
+ "reason": "Bundles multiple mutually-exclusive mode variants (STRUCTURAL/MARKETING/EDITORIAL/DOCS spacing, font-pairings, audit-checklist, anti-patterns). No single task loads the whole folder — see 'Activation Modes' in visual-compositor/SKILL.md for the subset actually loaded per mode. Includes docs-mode.md and anti-patterns.md (consolidated AI-slop catalogue, AP-01–AP-11) added in this rebuild."
10
+ },
11
+ "shavin-webpage": {
12
+ "budget": 12000,
13
+ "reason": "Bundles modular on-demand files (page-architecture.md, editorial-craft.md, style-recipes.md). Layout compositions moved to standalone layout-compositions skill. Loaded modularly on-demand per section."
14
+ },
15
+ "layout-compositions": {
16
+ "budget": 41000,
17
+ "reason": "57 compositions across 9 family files, plus selection-guide, treatments, foundations, page-recipes, metadata-schema, and shavin-ui adapter. No single task loads all family files — the workflow explicitly says to load only the family files for the IDs you use. SKILL.md itself is lightweight; the weight is in the reference files loaded on-demand."
18
+ },
19
+ "layout-motion": {
20
+ "budget": 6000,
21
+ "reason": "3 reference files (tokens, presets, composition-motion-map) plus SKILL.md. Small, focused skill — loaded when motion is needed on top of a composition."
22
+ },
23
+ "layout-choreography": {
24
+ "budget": 10000,
25
+ "reason": "4 reference files (scenes, tech-and-performance, fallbacks-and-accessibility, shavin-timelines) plus SKILL.md. Loaded only for cinematic/awwwards-tier motion requests."
26
+ }
27
+ },
28
+ "alwaysLoadedFiles": {
29
+ "core-rules.md": { "always": true, "note": "baseline rules file, read from .agents/skills (not injected by the MCP, not a skill name); also the No-MCP static fallback — see core-rules.md §13 'No-MCP Fallback'" },
30
+ "visual-compositor/cognitive-layer.md": { "always": true },
31
+ "visual-compositor/concentric-laws.md": { "always": true },
32
+ "visual-compositor/spacing-core.md": { "always": true },
33
+ "visual-compositor/layout-restraint.md": { "always": true, "note": "was documented as ALWAYS in visual-compositor/SKILL.md body but missing from this config — fixed; see rebuild notes" },
34
+ "visual-compositor/typography-rules.md": { "always": true, "note": "same fix as above" },
35
+ "visual-compositor/interface-polish.md": { "always": true, "note": "same fix as above" },
36
+ "visual-compositor/motion-and-physics.md": { "always": true, "note": "same fix as above" }
37
+ },
38
+ "onDemandFiles": {
39
+ "visual-compositor/spacing-marketing.md": { "modes": ["MARKETING", "EDITORIAL"] },
40
+ "visual-compositor/spacing-dense.md": { "modes": ["STRUCTURAL", "DOCS"] },
41
+ "visual-compositor/font-pairings.md": { "trigger": "font decisions" },
42
+ "visual-compositor/editorial-mode.md": { "modes": ["EDITORIAL", "HYBRID"] },
43
+ "visual-compositor/docs-mode.md": { "modes": ["DOCS"] },
44
+ "visual-compositor/audit-checklist.md": { "trigger": "end of layout tasks" },
45
+ "visual-compositor/anti-patterns.md": { "trigger": "composing or reviewing blocks/screens; when output looks AI-generated" },
46
+ "visual-compositor/graphics-and-assets.md": { "modes": ["MARKETING", "EDITORIAL", "HYBRID"] },
47
+ "visual-compositor/page-motion-presets.md": { "modes": ["MARKETING", "EDITORIAL", "HYBRID"], "note": "entrance preset recipes using motion tokens; loaded alongside composition-motion-map" },
48
+ "visual-compositor/composition-motion-map.md": { "modes": ["MARKETING", "EDITORIAL", "HYBRID"], "note": "which preset per composition + new compositions (ST, H5, F6, C4, E, D, X)" },
49
+ "visual-compositor/references/EDITORIAL_EXPRESSIVE.md": { "modes": ["EDITORIAL"] },
50
+ "shavin-webpage/page-architecture.md": { "modes": ["MARKETING", "EDITORIAL"] },
51
+ "shavin-webpage/editorial-craft.md": { "modes": ["MARKETING", "EDITORIAL"] },
52
+ "shavin-webpage/style-recipes.md": { "modes": ["MARKETING", "EDITORIAL", "HYBRID"] },
53
+ "layout-compositions/references/selection-guide.md": { "trigger": "choosing compositions" },
54
+ "layout-compositions/references/page-recipes.md": { "trigger": "page section sequencing" },
55
+ "layout-compositions/references/treatments.md": { "trigger": "treatment selection" },
56
+ "layout-compositions/references/distinctiveness.md": { "trigger": "avoiding generic results" },
57
+ "layout-compositions/references/foundations.md": { "trigger": "layout foundations" },
58
+ "layout-compositions/references/visual-review.md": { "trigger": "end of any page task: visual review of the rendered page" },
59
+ "layout-compositions/references/metadata-schema.md": { "trigger": "adding compositions" },
60
+ "layout-compositions/references/compositions/structural.md": { "trigger": "structural compositions (ST*)" },
61
+ "layout-compositions/references/compositions/hero.md": { "trigger": "hero compositions (H*)" },
62
+ "layout-compositions/references/compositions/features.md": { "trigger": "feature compositions (F*)" },
63
+ "layout-compositions/references/compositions/proof.md": { "trigger": "proof compositions (P*, S*, T*)" },
64
+ "layout-compositions/references/compositions/conversion.md": { "trigger": "conversion compositions (C*, Q*)" },
65
+ "layout-compositions/references/compositions/gallery.md": { "trigger": "gallery compositions (G*)" },
66
+ "layout-compositions/references/compositions/editorial.md": { "trigger": "editorial compositions (E*)" },
67
+ "layout-compositions/references/compositions/documentation.md": { "trigger": "documentation compositions (D*)" },
68
+ "layout-compositions/references/compositions/expressive.md": { "trigger": "expressive compositions (X*)" },
69
+ "layout-compositions/references/adapters/shavin-ui.md": { "trigger": "@shavin/ui code patterns" },
70
+ "layout-motion/references/tokens.md": { "trigger": "motion tokens" },
71
+ "layout-motion/references/presets.md": { "trigger": "tier-1 motion presets" },
72
+ "layout-motion/references/composition-motion-map.md": { "trigger": "which preset per composition" },
73
+ "layout-choreography/references/scenes.md": { "trigger": "cinematic scene recipes" },
74
+ "layout-choreography/references/tech-and-performance.md": { "trigger": "choreography tech and budgets" },
75
+ "layout-choreography/references/fallbacks-and-accessibility.md": { "trigger": "choreography accessibility" },
76
+ "layout-choreography/references/shavin-timelines.md": { "trigger": "shavin timelines reference" }
77
+ },
78
+ "notes": [
79
+ "alwaysLoadedBudget covers core-rules.md + the 8 files visual-compositor/SKILL.md's own body table marks CORE (measured: ~19K tokens as of this rebuild; 20000 leaves ~1K headroom). Motion-and-physics.md grew with duration/distance/stagger token documentation.",
80
+ "perSkillBudget is the default max tokens a single skill folder should contribute when fully loaded. Skills that legitimately bundle mutually-exclusive mode variants should add an entry to perSkillBudgetOverrides with a documented reason, rather than being silently over budget or inflating the global default for everyone else.",
81
+ "perFileBudget flags any single file that's too heavy to load frequently.",
82
+ "As of this rebuild these are enforced by build.mjs's warn() calls (visible in npm run check), not just printed. Run with --strict to treat them as hard failures.",
83
+ "DOCS mode was added for documentation-portal projects (e.g. docs.shavin.cc) that don't fit STRUCTURAL, MARKETING, or EDITORIAL well — see visual-compositor/SKILL.md Activation Modes and skills/shavin-core/SKILL.md dispatch section.",
84
+ "layout-compositions, layout-motion, and layout-choreography are standalone skills extracted from the old shavin-webpage/layout-compositions.md flat file. The 2-tier motion architecture (Tier 1 restrained = layout-motion, Tier 2 cinematic = layout-choreography) is deliberately separate from standard composition guidelines. layout-compositions has a high budget override because it contains 9 family files loaded on-demand — no single task loads all of them."
85
+ ]
86
+ }