dreative 0.5.0 → 0.5.2

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 (48) hide show
  1. package/README.md +49 -27
  2. package/dist/cli/audit.js +206 -0
  3. package/dist/cli/audit.test.js +79 -0
  4. package/dist/cli/docsCheck.js +163 -0
  5. package/dist/cli/docsCheck.test.js +8 -0
  6. package/dist/cli/index.js +81 -8
  7. package/dist/server/preview.js +73 -73
  8. package/dist/server/store.js +11 -0
  9. package/dist/shared/artifacts.js +162 -0
  10. package/dist/shared/design.js +42 -22
  11. package/dist/shared/ruleSystem.js +130 -0
  12. package/dist/shared/ruleSystem.test.js +187 -0
  13. package/dist/shared/skillSystem.js +173 -0
  14. package/dist/shared/skillSystem.test.js +110 -0
  15. package/dist/ui/assets/{index--vztc_MR.js → index-CKwmbx2j.js} +13 -13
  16. package/dist/ui/index.html +12 -12
  17. package/package.json +5 -3
  18. package/skill/dreative/DESIGN.md +290 -95
  19. package/skill/dreative/PLAN.md +462 -71
  20. package/skill/dreative/SKILL.md +230 -126
  21. package/skill/dreative/frameworks/nextjs.md +13 -0
  22. package/skill/dreative/frameworks/react-vite.md +12 -0
  23. package/skill/dreative/frameworks/styling.md +14 -0
  24. package/skill/dreative/frameworks/sveltekit.md +10 -0
  25. package/skill/dreative/frameworks/vue-nuxt.md +12 -0
  26. package/skill/dreative/recipes/3d-recipes.md +44 -0
  27. package/skill/dreative/recipes/cinematic-recipes.md +19 -0
  28. package/skill/dreative/recipes/immersive-recipes.md +18 -0
  29. package/skill/dreative/recipes/media-recipes.md +60 -0
  30. package/skill/dreative/recipes/motion-recipes.md +44 -0
  31. package/skill/dreative/references/ARTIFACTS.md +180 -0
  32. package/skill/dreative/references/REFLEX_FONTS.json +44 -0
  33. package/skill/dreative/references/RULES.json +186 -0
  34. package/skill/dreative/references/SKILL_CONTRACT.md +30 -0
  35. package/skill/dreative/references/TIERS.md +42 -0
  36. package/skill/dreative/schemas/plan.schema.json +241 -0
  37. package/skill/dreative/schemas/verify.schema.json +61 -0
  38. package/skill/dreative/skills/3d.md +94 -157
  39. package/skill/dreative/skills/cinematic.md +56 -232
  40. package/skill/dreative/skills/experimental.md +111 -0
  41. package/skill/dreative/skills/immersive.md +61 -223
  42. package/skill/dreative/skills/interaction.md +9 -1
  43. package/skill/dreative/skills/media.md +135 -216
  44. package/skill/dreative/skills/mobile.md +128 -117
  45. package/skill/dreative/skills/motion.md +89 -229
  46. package/skill/dreative/skills/refined.md +116 -102
  47. package/skill/dreative/skills/ux.md +155 -144
  48. package/dist/server/ai.js +0 -177
@@ -1,117 +1,128 @@
1
- # Dreative Specialist Skill — Mobile Excellence
2
-
3
- Load this file when `plan.skills` includes `mobile`, when the brief says
4
- mobile-first / most users are on phones / "make the mobile version great", or
5
- when an app-register product is primarily used on mobile. It EXTENDS DESIGN.md
6
- §13 (which governs how desktop effects DEGRADE); this file is about designing
7
- mobile as a first-class surface in its own right — clean, tidy, and still
8
- genuinely animated and premium, just calibrated to a 390px viewport, a thumb,
9
- and a battery. It STACKS with whatever treatments were chosen: motion/3d/
10
- immersive briefs get their mobile-native expression here, never a cropped
11
- desktop.
12
-
13
- ## 0. The register: calm confidence, not shrunken desktop
14
-
15
- Mobile premium reads differently from desktop premium: less simultaneous
16
- motion, more focus per viewport, perfect ergonomics. The dial translation:
17
- desktop ambition N mobile ambition N−2. A desktop dial-8 site ships a
18
- dial-6 phone experience that feels JUST as craftedone hero moment, silky
19
- scroll reveals, tactile presses rather than a stuttering copy of the desktop
20
- choreography.
21
-
22
- - **One idea per viewport.** The phone viewport is a frame; compose each
23
- screenful like one (hero = one headline + one visual + one CTA, nothing
24
- else). If a desktop section held three things, the mobile version stacks
25
- them as three clean beats or cuts to the strongest one.
26
- - **Tidy is the aesthetic.** Consistent gutters (20-24px), one column
27
- discipline, generous vertical rhythm (56-80px between sections), no element
28
- closer than 8px to another. Clutter reads twice as loud at 390px.
29
- - **Type recalibrated, not just clamped**: hero 2-3rem (2 lines max with the
30
- REAL copy), body stays ≥16px, line-length falls out of the gutters — check
31
- headlines don't orphan single words (`text-wrap: balance`).
32
-
33
- ## 1. Layout patterns that are mobile-native
34
-
35
- - Asymmetric desktop grids collapse to intentional single-column ORDER
36
- (decide what comes first usually visual headline support → CTA), not
37
- DOM-order accidents. Check the collapsed order reads as a story.
38
- - Horizontal scroll is mobile's extra axis: card shelves, galleries, and
39
- chip rows as swipeable strips (`overflow-x-auto` + `scroll-snap-type: x
40
- mandatory` on short strips, edge inset, visible peek of the next card
41
- the peek IS the affordance; no scrollbars, no arrows).
42
- - Sticky bottom bar for the primary action on conversion/product pages
43
- (add-to-cart, main CTA): thumb-reach beats footer CTA; respect
44
- `env(safe-area-inset-bottom)`.
45
- - Accordions/tabs for secondary density (specs, FAQs) instead of long walls;
46
- tables become stacked cards or a scrollable container with sticky first
47
- columnnever squeezed 6-column tables.
48
- - Nav: the fullscreen menu is mobile's one theatrical moment — staggered
49
- link entrance (line-mask, 60ms stagger), big touch-sized links (≥ 48px
50
- rows), contact/socials in the footer of the overlay. Wired per ux.md §1
51
- (focus trap, scroll lock, Esc/back closes).
52
-
53
- ## 2. Motion on mobile (still premium, never crazy)
54
-
55
- The motion inventory scaled to touch (extends motion.md §9):
56
-
57
- - **Keep**: one composed hero entrance (≤ 600ms total), line-mask headline
58
- reveals, in-view section reveals (2-3, `once: true`), press states on
59
- EVERYTHING tappable (`active:scale-[0.98]` on mobile this is the main
60
- interaction feedback, since hover doesn't exist), marquees (pause
61
- off-screen), counters, accordion springs.
62
- - **Translate**: parallax halves or dies (§13); pinned sequences → short
63
- sticky sections (≤ 1.5 viewports) or plain stacked beats; hover-woken media
64
- in-view-woken (loop plays while 60% visible, pauses off-screen) or
65
- tap-to-play; magnetic/cursor effects → gone entirely, replaced by press
66
- feedback; drag-to-explore swipe carousel or index list as PRIMARY
67
- (DESIGN.md §13).
68
- - **Ban on mobile**: smooth-scroll libraries at full strength (Lenis: disable
69
- or `syncTouch` carefully fighting native momentum feels broken), more than
70
- one scrubbed sequence, simultaneous animation of > 4 elements, any effect
71
- that drops the scroll below 60fps on a mid-range phone.
72
- - Scroll reveals trigger earlier (`margin: "-10% 0px"` not -20%) — mobile
73
- viewports are short and users scroll fast; late reveals = users see blank.
74
-
75
- ## 3. 3D and heavy media on mobile
76
-
77
- - Default: replace live 3D with the poster or a pre-rendered loop (3d.md §7,
78
- media.md). A generated video loop IS the mobile 3D strategy in most cases —
79
- visually near-identical, thermally free.
80
- - If live 3D ships: dpr capped at 2, sim/particle counts halved, post-FX off,
81
- `frameloop="demand"` where possible, pause on scroll-out and
82
- `document.hidden`. Test the thermal story: 30s of idling must not heat the
83
- phone (no full-rate rAF on static scenes).
84
- - Video: one playing loop per viewport, 2MB mobile variants
85
- (`<source media>` or renditions), `playsinline` mandatory, poster always.
86
- - Images: serve mobile-sized renditions (`srcset/sizes`) — a 2400px hero on a
87
- 390px screen is a failed budget even when it looks fine.
88
-
89
- ## 4. Ergonomics (the thumb is the cursor)
90
-
91
- - Tap targets 44px (48px preferred) with 8px gaps; small text links get
92
- padded hit areas. Primary actions in the bottom half on app-register
93
- screens; destructive actions OUT of easy thumb reach.
94
- - Respect the gesture map: horizontal edge swipes (back), bottom edge (home)
95
- don't hang custom gestures on them; carousels stop 16px short of edges.
96
- - Inputs: correct `type/inputmode/autocomplete` (ux.md §2), font-size ≥ 16px
97
- (iOS zoom), the focused field scrolls above the keyboard, forms in one
98
- column, no fixed elements covering inputs while the keyboard is up.
99
- - Safe areas: `viewport-fit=cover` + `env(safe-area-inset-*)` padding on
100
- fixed bars/corners; nothing under the notch or home indicator.
101
- - No hover-dependent anything: whatever desktop hover revealed is visible by
102
- default, in-view-triggered, or behind an explicit tap (DESIGN.md §13).
103
-
104
- ## 5. Mobile verification (part of the runtime pass)
105
-
106
- At 390×844 (plus one small check at 320px):
107
-
108
- 1. Walk every section: no horizontal body scroll, no clipped text/controls,
109
- no element under fixed bars (DESIGN.md §15 at mobile widths).
110
- 2. Run ux.md §7's audit at this width (menu, forms, taps, console).
111
- 3. Scroll the full page fast: reveals keep up, nothing janks, sticky elements
112
- behave through the URL-bar resize.
113
- 4. Confirm the motion translation shipped2): press states everywhere, hero
114
- ≤ 600ms, heavy effects swapped for their mobile strategy — name what runs
115
- on mobile vs desktop in the final report.
116
- 5. If media/3D shipped: posters load, loops play inline (not fullscreen),
117
- pause off-screen.
1
+ # Dreative Specialist Skill — Mobile Excellence
2
+
3
+ ## Contract
4
+
5
+ Universal foundation: ux and baseline mobile apply to every web page.
6
+
7
+ Follow `../references/SKILL_CONTRACT.md`. Dependency: `ux`. This skill is
8
+ universal for web work. Deliver a section-by-section mobile translation, touch
9
+ targets, responsive media/effect budgets, and approximately 390px verification.
10
+ It is never satisfied by shrinking desktop. Done means navigation, content,
11
+ forms, orientation/viewport behavior, performance, and reduced motion pass on a
12
+ coarse pointer.
13
+
14
+ Load this file when `plan.skills` includes `mobile`, when the brief says
15
+ mobile-first / most users are on phones / "make the mobile version great", or
16
+ when an app-register product is primarily used on mobile. It EXTENDS DESIGN.md
17
+ §13 (which governs how desktop effects DEGRADE); this file is about designing
18
+ mobile as a first-class surface in its own right clean, tidy, and still
19
+ genuinely animated and premium, just calibrated to a 390px viewport, a thumb,
20
+ and a battery. It STACKS with whatever treatments were chosen: motion/3d/
21
+ immersive briefs get their mobile-native expression here, never a cropped
22
+ desktop.
23
+
24
+ ## 0. The register: calm confidence, not shrunken desktop
25
+
26
+ Mobile premium reads differently from desktop premium: less simultaneous
27
+ motion, more focus per viewport, perfect ergonomics. The dial translation:
28
+ desktop ambition N mobile ambition N−2. A desktop dial-8 site ships a
29
+ dial-6 phone experience that feels JUST as crafted one hero moment, silky
30
+ scroll reveals, tactile presses rather than a stuttering copy of the desktop
31
+ choreography.
32
+
33
+ - **One idea per viewport.** The phone viewport is a frame; compose each
34
+ screenful like one (hero = one headline + one visual + one CTA, nothing
35
+ else). If a desktop section held three things, the mobile version stacks
36
+ them as three clean beats or cuts to the strongest one.
37
+ - **Tidy is the aesthetic.** Consistent gutters (20-24px), one column
38
+ discipline, generous vertical rhythm (56-80px between sections), no element
39
+ closer than 8px to another. Clutter reads twice as loud at 390px.
40
+ - **Type recalibrated, not just clamped**: hero 2-3rem (2 lines max with the
41
+ REAL copy), body stays ≥16px, line-length falls out of the gutters — check
42
+ headlines don't orphan single words (`text-wrap: balance`).
43
+
44
+ ## 1. Layout patterns that are mobile-native
45
+
46
+ - Asymmetric desktop grids collapse to intentional single-column ORDER
47
+ (decide what comes first usually visual headline → support → CTA), not
48
+ DOM-order accidents. Check the collapsed order reads as a story.
49
+ - Horizontal scroll is mobile's extra axis: card shelves, galleries, and
50
+ chip rows as swipeable strips (`overflow-x-auto` + `scroll-snap-type: x
51
+ mandatory` on short strips, edge inset, visible peek of the next card —
52
+ the peek IS the affordance; no scrollbars, no arrows).
53
+ - Sticky bottom bar for the primary action on conversion/product pages
54
+ (add-to-cart, main CTA): thumb-reach beats footer CTA; respect
55
+ `env(safe-area-inset-bottom)`.
56
+ - Accordions/tabs for secondary density (specs, FAQs) instead of long walls;
57
+ tables become stacked cards or a scrollable container with sticky first
58
+ column never squeezed 6-column tables.
59
+ - Nav: the fullscreen menu is mobile's one theatrical moment — staggered
60
+ link entrance (line-mask, 60ms stagger), big touch-sized links (≥ 48px
61
+ rows), contact/socials in the footer of the overlay. Wired per ux.md §1
62
+ (focus trap, scroll lock, Esc/back closes).
63
+
64
+ ## 2. Motion on mobile (still premium, never crazy)
65
+
66
+ The motion inventory scaled to touch (extends motion.md §5):
67
+
68
+ - **Keep**: one composed hero entrance (≤ 600ms total), line-mask headline
69
+ reveals, in-view section reveals (2-3, `once: true`), press states on
70
+ EVERYTHING tappable (`active:scale-[0.98]` on mobile this is the main
71
+ interaction feedback, since hover doesn't exist), marquees (pause
72
+ off-screen), counters, accordion springs.
73
+ - **Translate**: parallax halves or dies (§13); pinned sequences short
74
+ sticky sections (≤ 1.5 viewports) or plain stacked beats; hover-woken media
75
+ in-view-woken (loop plays while 60% visible, pauses off-screen) or
76
+ tap-to-play; magnetic/cursor effects → gone entirely, replaced by press
77
+ feedback; drag-to-explore swipe carousel or index list as PRIMARY
78
+ (DESIGN.md §13).
79
+ - **Ban on mobile**: smooth-scroll libraries at full strength (Lenis: disable
80
+ or `syncTouch` carefully fighting native momentum feels broken), more than
81
+ one scrubbed sequence, simultaneous animation of > 4 elements, any effect
82
+ that drops the scroll below 60fps on a mid-range phone.
83
+ - Scroll reveals trigger earlier (`margin: "-10% 0px"` not -20%) — mobile
84
+ viewports are short and users scroll fast; late reveals = users see blank.
85
+
86
+ ## 3. 3D and heavy media on mobile
87
+
88
+ - Default: replace live 3D with the poster or a pre-rendered loop (3d.md §5,
89
+ media.md). A generated video loop IS the mobile 3D strategy in most cases —
90
+ visually near-identical, thermally free.
91
+ - If live 3D ships: dpr capped at 2, sim/particle counts halved, post-FX off,
92
+ `frameloop="demand"` where possible, pause on scroll-out and
93
+ `document.hidden`. Test the thermal story: 30s of idling must not heat the
94
+ phone (no full-rate rAF on static scenes).
95
+ - Video: one playing loop per viewport, 2MB mobile variants
96
+ (`<source media>` or renditions), `playsinline` mandatory, poster always.
97
+ - Images: serve mobile-sized renditions (`srcset/sizes`) a 2400px hero on a
98
+ 390px screen is a failed budget even when it looks fine.
99
+
100
+ ## 4. Ergonomics (the thumb is the cursor)
101
+
102
+ - Tap targets 44px (48px preferred) with ≥ 8px gaps; small text links get
103
+ padded hit areas. Primary actions in the bottom half on app-register
104
+ screens; destructive actions OUT of easy thumb reach.
105
+ - Respect the gesture map: horizontal edge swipes (back), bottom edge (home)
106
+ don't hang custom gestures on them; carousels stop 16px short of edges.
107
+ - Inputs: correct `type/inputmode/autocomplete` (ux.md §2), font-size ≥ 16px
108
+ (iOS zoom), the focused field scrolls above the keyboard, forms in one
109
+ column, no fixed elements covering inputs while the keyboard is up.
110
+ - Safe areas: `viewport-fit=cover` + `env(safe-area-inset-*)` padding on
111
+ fixed bars/corners; nothing under the notch or home indicator.
112
+ - No hover-dependent anything: whatever desktop hover revealed is visible by
113
+ default, in-view-triggered, or behind an explicit tap (DESIGN.md §13).
114
+
115
+ ## 5. Mobile verification (part of the runtime pass)
116
+
117
+ At 390×844 (plus one small check at 320px):
118
+
119
+ 1. Walk every section: no horizontal body scroll, no clipped text/controls,
120
+ no element under fixed bars (DESIGN.md §15 at mobile widths).
121
+ 2. Run ux.md §7's audit at this width (menu, forms, taps, console).
122
+ 3. Scroll the full page fast: reveals keep up, nothing janks, sticky elements
123
+ behave through the URL-bar resize.
124
+ 4. Confirm the motion translation shipped (§2): press states everywhere, hero
125
+ ≤ 600ms, heavy effects swapped for their mobile strategy — name what runs
126
+ on mobile vs desktop in the final report.
127
+ 5. If media/3D shipped: posters load, loops play inline (not fullscreen),
128
+ pause off-screen.
@@ -1,229 +1,89 @@
1
- # Dreative Specialist Skill — Motion & Scroll Choreography
2
-
3
- Load this file when `plan.skills` includes `motion`, or the brief/prompt asks for
4
- animation, parallax, scroll storytelling, kinetic type, or "cinematic" feel.
5
- It EXTENDS DESIGN.md §6 (which still applies: 100/300/500 durations, ease-out
6
- exponential curves, reduced-motion fallbacks, no scroll listeners, no bounce).
7
- This file is about doing ambitious motion WELL, not about adding more of it.
8
- Every effect here needs a mobile strategy per DESIGN.md §13 (shorter pins,
9
- halved parallax, 600ms mobile entrance budget) decide it at design time.
10
- If the requested motion needs structure the current markup can't express (pinned
11
- sections, split text, persistent stages), use DESIGN.md §11's transformation-depth
12
- ladder: offer restructure as an option and, once confirmed, rebuild the markup —
13
- don't fake choreography onto the old skeleton. When the page's imagery or video
14
- participates in the choreography (reveals, scrubbed sequences, distortion,
15
- hover-woken loops), read `media.md` media is motion material there, with the
16
- DOM-tier and WebGL treatment vocabularies and the generation pipeline.
17
- On phones the whole inventory recalibrates: `mobile.md` §2 is the translation
18
- table (what keeps, what halves, what dies) decide it at design time.
19
-
20
- ## 0. Pick the tool by the job, not by habit
21
-
22
- - **CSS only** — hover/focus/press states, one-shot entrances, marquees, simple
23
- scroll reveals via `animation-timeline: view()`. Zero JS cost; always first choice.
24
- - **Motion (`motion/react`, formerly Framer Motion)** React apps: presence
25
- (`AnimatePresence`), layout animation (`layout` prop = free FLIP), springs,
26
- `whileInView`, gesture props. The default for React product+brand pages.
27
- - **GSAP + ScrollTrigger** timeline choreography: multiple elements coordinated
28
- over one scroll range, scrubbed sequences, pinned sections, kinetic type.
29
- Use when a Motion version would need 4+ manually-synced `useScroll` hooks.
30
- - **Lenis** — smooth scroll wrapper for scroll-driven brand pages. Only on brand
31
- register with motion dial ≥7; never in product UI. Sync ScrollTrigger with
32
- `lenis.on('scroll', ScrollTrigger.update)`.
33
-
34
- One animation system per page. Motion AND GSAP on the same page = two spring
35
- vocabularies fighting; pick one and commit.
36
-
37
- ## 1. Springs beat durations for anything interactive
38
-
39
- Duration+easing is for one-shot choreography (entrances, exits). Anything that
40
- tracks input or can be interrupted (drag, hover follow, toggles, layout shifts)
41
- uses springs they redirect mid-flight without a visible restart.
42
-
43
- - Motion defaults: `{ type: "spring", stiffness: 300, damping: 30 }` = snappy UI;
44
- `stiffness: 120, damping: 20` = soft brand movement. Overshoot (`damping < 15`)
45
- only on playful briefs, and only on small elements — never on layout.
46
- - `visualDuration` (Motion ≥11.13) sets spring feel by time: easier to reason about.
47
- - Never spring opacity or color; springs are for transform. Crossfade those.
48
-
49
- ## 2. Orchestration: one timeline, one story
50
-
51
- The scattered-reveals look (every section fades up independently) is the #1 motion
52
- tell. Instead:
53
-
54
- - **Hero entrance** = ONE composed sequence: parent `staggerChildren: 0.08`,
55
- `delayChildren` after nav settles; elements enter in reading order; total ≤ 900ms.
56
- Nothing else on the page gets entrance choreography.
57
- - **Below the fold**: at most 2-3 sections get `whileInView` reveals (`once: true`,
58
- `margin: "-20% 0px"`), and they should differ (a clip reveal here, a stagger
59
- there) not the same fade-and-rise stamped on everything.
60
- - Stagger direction carries meaning: top-down for lists, center-out for grids
61
- (`delay: Math.abs(i - mid) * 0.05`), left-right only for horizontal sequences.
62
- - Exits are faster than entrances (~75%) and simpler (fade + small offset; never
63
- reverse the full entrance).
64
-
65
- ## 3. Scroll choreography (motion dial ≥ 7)
66
-
67
- - **Scrub vs trigger**: scrub (`scrub: 0.5–1` or Motion `useScroll`+`useTransform`)
68
- for progress-bound narrative (a product rotating, a number counting, a diagram
69
- assembling). Triggered one-shots for everything else. Scrubbed text reveals are
70
- worn out; scrub things that MOVE, trigger things that APPEAR.
71
- - **Pinning**: max ONE pinned sequence per page (`ScrollTrigger pin: true`, or
72
- `position: sticky` + a tall parent — prefer sticky, it's free and un-janks).
73
- Pin length 2.5 viewport heights; past that users feel trapped.
74
- - **Parallax**: subtle = 8-15% differential (`useTransform(scrollYProgress, [0,1],
75
- ["-8%","8%"])`); apply to media/decoration, never body text. 2-3 layers max.
76
- - **CSS scroll-driven animations** (`animation-timeline: view(); animation-range:
77
- entry 0% cover 40%`) handle simple reveals/parallax with zero JS — use for
78
- progressive enhancement, gate with `@supports (animation-timeline: view())`.
79
- - Progress-linked values snap to keyframes users can feel: use eased ranges
80
- (`useTransform` with cubic arrays), not raw linear mapping.
81
- - Never scroll-jack (hijacking wheel delta into slide-snapping). `scroll-snap` on
82
- a horizontal strip is fine; taking over vertical page scroll is not.
83
-
84
- ## 4. Kinetic type and text reveal
85
-
86
- - Split text with `SplitText` (GSAP, now free) or manual word-`<span>` wrapping;
87
- animate **words or lines, not characters** for readability (chars only for short
88
- display words ≤ 12 chars). Wrap split parents in `overflow-hidden` line masks and
89
- slide lines up `y: "110%" → 0` — the line-mask reveal reads as premium; per-char
90
- fade reads as 2021 template.
91
- - `aria-label` the original string on the split container; split spans get
92
- `aria-hidden`. Re-splitting on resize: debounce, or use `SplitText`'s autoSplit.
93
- - Counters: animate with `useSpring`/gsap `snap: 1`, `tabular-nums` mandatory,
94
- duration ≤ 1.2s, trigger once in view.
95
-
96
- ## 5. Layout & presence
97
-
98
- - Motion `layout` prop for reflow (filtering grids, expanding cards, reordering) —
99
- it's FLIP under the hood, transform-only. `layoutId` for shared-element morphs
100
- (card → modal). Wrap conditional trees in `AnimatePresence mode="popLayout"`.
101
- - Accordion/height: `grid-template-rows: 0fr → 1fr` (CSS, cheap) or Motion
102
- `height: "auto"` (it measures for you). Never `max-height: 9999px`.
103
- - **View Transitions API** for page-level transitions (`document.startViewTransition`,
104
- or the framework wrapper e.g. Next `<ViewTransition>`): name persistent elements
105
- with `view-transition-name` so they morph across routes. Feature-gate; fall back
106
- to instant navigation, not a JS fade.
107
-
108
- ## 6. Performance and accessibility (non-negotiable)
109
-
110
- - Transform/opacity only in hot paths; promote animating layers sparingly
111
- (`will-change` set just-in-time, removed after). > 6 simultaneously-animating
112
- elements = re-choreograph.
113
- - All scroll work driven by IntersectionObserver / ScrollTrigger / `useScroll`
114
- (rAF-batched) — a raw `scroll` listener is a hard ban (DESIGN.md).
115
- - Test the tab hidden→visible case: loops must not accumulate; `whileInView` must
116
- not re-fire (`once: true`).
117
- - `prefers-reduced-motion`: scrubbed narratives get a static end-state, entrances
118
- become plain fades ≤ 200ms, marquees stop. In Motion use `useReducedMotion()`
119
- and branch the variants — don't just shorten durations.
120
- - Content exists without JS: initial styles are the VISIBLE state; animation
121
- libraries then hide/offset from JS before first paint (`gsap.set`, Motion
122
- `initial`). An SSR'd page must never flash-then-hide.
123
-
124
- ## 7. Recipes (copy the shape, restyle the skin)
125
-
126
- - **Hero sequence**: nav fades in (150ms) → headline lines mask-slide up, 80ms
127
- stagger → subtext + CTA fade-rise together → hero media scales 1.04→1 with 6px
128
- blur→0. Total 900ms, expo-out.
129
- - **Sticky product walkthrough**: `sticky` media column + scrolling step copy;
130
- step index from IntersectionObserver on copy blocks; media crossfades/transforms
131
- per step (springy, 300ms).
132
- - **Marquee**: duplicated track, `animation: scroll Xs linear infinite`,
133
- `width: max-content`, pause on hover, speed from content width (px/s constant,
134
- ~60-90px/s), masked edges with `mask-image: linear-gradient`.
135
- - **Scrub showcase**: sticky canvas/image sequence, `useScroll` on the wrapper,
136
- map progress to frame index / rotation; preload frames; ≤ 2.5 viewports tall.
137
- - **Canvas product story** (capsul-in-pro.com's form): a single-product launch
138
- page as one scroll-scrubbed narrative — the product renders on a full-page
139
- canvas (image-sequence or WebGL) and scroll drives its assembly/rotation
140
- while short copy beats fade in at fixed progress stops; the site ships as
141
- one bundled app with explicit portrait/landscape variants (it gates on
142
- orientation rather than half-working in both). Copy the shape: one subject,
143
- one scrubbed timeline, copy anchored to progress ranges, per-orientation
144
- choreography decided up front.
145
- - **Text on a path** (verified on epic.net): a manifesto paragraph flows along a
146
- curved SVG path (`<textPath>` or per-word transforms sampled from a curve) and
147
- relaxes toward straight lines as scroll progress advances — the curve
148
- amplitude is the scrubbed value. One per site; body text elsewhere stays flat.
149
- - **Orbiting cursor label** (epic.net's video CTA): a circular text ring
150
- ("PLAY VIDEO ⟲") slowly rotates around the pointer while it's over the media
151
- region — SVG `<textPath>` on a circle, damped position follow, constant
152
- rotation. Replaces the play button; fine pointers only, real button fallback.
153
-
154
- ## 8. Setup blueprints — install and WIRE the stack (do not skip)
155
-
156
- Doctrine without dependencies ships a static page. When this skill is active,
157
- actually add the libraries to the project and wire them before designing
158
- sections. Pick the stack per §0, then:
159
-
160
- **GSAP + ScrollTrigger + Lenis (brand pages, the unseen.co-family stack):**
161
-
162
- ```
163
- npm i gsap lenis
164
- ```
165
-
166
- ```js
167
- // one module, imported once at app root (e.g. src/lib/motion.ts)
168
- import gsap from "gsap";
169
- import { ScrollTrigger } from "gsap/ScrollTrigger";
170
- import Lenis from "lenis";
171
-
172
- gsap.registerPlugin(ScrollTrigger);
173
- export const lenis = new Lenis({ lerp: 0.1, smoothWheel: true });
174
- lenis.on("scroll", ScrollTrigger.update);
175
- gsap.ticker.add((t) => lenis.raf(t * 1000));
176
- gsap.ticker.lagSmoothing(0);
177
- ```
178
-
179
- React: run that inside a `useEffect` in a `<SmoothScroll>` provider mounted in
180
- the root layout (destroy on unmount); Next.js needs `"use client"` on it.
181
- ONE Lenis instance, ONE gsap ticker — never per-component.
182
-
183
- **motion/react (React product+brand):** `npm i motion` — import from
184
- `"motion/react"`. Shared transition vocabulary in one exported object
185
- (`export const spring = { type: "spring", stiffness: 300, damping: 30 }`), used
186
- everywhere; `MotionConfig reducedMotion="user"` at the root.
187
-
188
- **Easing tokens (either stack):** commit page-wide —
189
- `expo.out` / `cubic-bezier(0.16, 1, 0.3, 1)` for entrances/reveals,
190
- `power2.inOut` for scrubbed/camera moves, springs for interactive. Define once
191
- (gsap defaults via `gsap.defaults({ ease: "expo.out" })` or CSS custom
192
- property `--ease-out-expo`), reference everywhere.
193
-
194
- **Line-mask headline reveal (the canonical premium move, copy this shape):**
195
-
196
- ```jsx
197
- // each line: <div class="overflow-hidden"><div class="line">…</div></div>
198
- gsap.set(".line", { yPercent: 110 });
199
- gsap.to(".line", {
200
- yPercent: 0, duration: 0.9, ease: "expo.out", stagger: 0.08,
201
- scrollTrigger: { trigger: el, start: "top 80%", once: true },
202
- });
203
- ```
204
-
205
- Use GSAP `SplitText` (free) with `type: "lines", mask: "lines"` instead of
206
- hand-wrapping when available; `aria-label` the original string per §4.
207
-
208
- ## 9. Definition of done — the shipped-motion inventory
209
-
210
- A motion request is fulfilled only if the final code contains, verifiably
211
- (grep the imports, name the elements):
212
-
213
- - **Dial 4–6 (product/calm brand):** composed hero entrance timeline (§2), the
214
- three global feel constants (interaction.md §0), 1–2 `whileInView`/triggered
215
- section reveals, animated states (loading/success). No smooth scroll.
216
- - **Dial 7–8 (expressive brand):** all of the above PLUS Lenis smooth scroll,
217
- line-mask headline reveals on hero + section headings, one scrubbed scroll
218
- sequence (pin, parallax system, or progress-bound narrative), one signature
219
- pointer effect (interaction.md §1), and a page/route transition treatment.
220
- - **Dial 9–10 (award-site):** all of the above PLUS the immersive.md or
221
- cinematic.md architecture actually built (persistent stage/canvas, preloader
222
- choreography, spatial or sim-driven route transitions, custom cursor).
223
-
224
- Before reporting done, list which inventory items shipped and where (element +
225
- trigger). "The page has hover states" does not clear dial 7+. If a listed item
226
- was deliberately cut, say so and why. This inventory is what the SKILL.md
227
- verification pass checks against — and its runtime stage must PROVE the items
228
- run (transforms changing, triggers firing, console clean), not just find them
229
- in the source.
1
+ # Dreative Specialist Skill — Motion & Scroll Choreography
2
+
3
+ ## Contract
4
+
5
+ Follow `../references/SKILL_CONTRACT.md`. Dependencies: `ux`, `mobile`. Deliver a
6
+ named motion system, trigger/timing/easing inventory, cleanup strategy, mobile
7
+ translation, reduced-motion fallback, and sampled runtime evidence.
8
+
9
+ Load for animation, parallax, scroll stories, kinetic type, spatial transitions,
10
+ or a motion dial that requires more than state feedback.
11
+
12
+ ## 0. Explore before recipes
13
+
14
+ Understand the content sequence, brand physics, inputs, and still layout first.
15
+ Record three original choreography concepts before reading
16
+ `../recipes/motion-recipes.md`. A recipe supplies wiring—not the story.
17
+
18
+ Name the motion signature in physical terms such as precise mechanical settle,
19
+ soft editorial drift, elastic play, or heavy cinematic inertia. One system owns
20
+ the page; independent default animations do not.
21
+
22
+ ## 1. Hard gates
23
+
24
+ - Content is visible before enhancement and never depends on a JS callback to
25
+ appear (`content.visible`).
26
+ - Reduced motion removes nonessential travel, pinning, auto-looping, and
27
+ vestibular effects while preserving state and hierarchy
28
+ (`motion.reducedMotion`).
29
+ - Navigation, forms, keyboard, pointer targets, and focus remain functional
30
+ (`ux.functional`, `spatial.noOcclusion`).
31
+ - Timelines/listeners/observers/render loops clean up; hidden tabs and route
32
+ transitions do not multiply work.
33
+ - Heavy choreography has measured runtime and a concrete low-power/mobile/static
34
+ fallback (`effects.runtimeFallback`).
35
+
36
+ ## 2. Motion architecture
37
+
38
+ Choose by job:
39
+
40
+ - CSS transitions/animations for local states and simple decorative loops.
41
+ - `motion/react` for component presence, layout, gestures, and springs.
42
+ - GSAP + ScrollTrigger for coordinated timelines and pinned scroll chapters.
43
+ - Lenis only when the concept needs a shared smooth-scroll clock.
44
+ - R3F/three.js render state for scene motion; synchronize with the page clock.
45
+
46
+ Use one provider/ticker/scroll owner. Define tokens for duration, spring, easing,
47
+ distance, stagger, and reduced-motion behavior. Interactive motion uses springs
48
+ or velocity-aware settling; narrative motion uses deliberate timelines.
49
+
50
+ ## 3. Evidence-backed creative structure
51
+
52
+ At expressive/award, satisfy `motion.expressive.diversityOrDevelopment` through
53
+ one plan path:
54
+
55
+ - **Diversity:** at least four distinct mechanisms across three input drivers.
56
+ Reusing one mechanism more than twice is a warning that the system is shallow.
57
+ - **Development:** one coherent signature mechanism develops through at least
58
+ three materially different roles/states, supported by two quieter secondary
59
+ mechanisms and at least two drivers.
60
+
61
+ Development is not the same reveal with different distances. A line becoming
62
+ navigation, data plot, and scene boundary qualifies; fade-up repeated across
63
+ three sections does not.
64
+
65
+ ## 4. Choreography principles
66
+
67
+ - Build a timeline for the whole journey: setup, anticipation, peak, rest,
68
+ transformation, resolution.
69
+ - Entrances orient; they are not the design. Key media and signatures respond to
70
+ input or develop state.
71
+ - Scroll links progress to meaning. Clamp/damp velocity and avoid raw scroll
72
+ listeners or layout work in every frame.
73
+ - Kinetic type remains readable DOM text; splits restore cleanly and preserve
74
+ accessibility.
75
+ - Presence/exits preserve focus, scroll position, and input continuity.
76
+ - Mobile shortens travel, removes long pins, lowers parallax, and preserves the
77
+ concept through a calmer translation rather than a cropped desktop effect.
78
+
79
+ ## 5. Planning and verification
80
+
81
+ For each moment record element, trigger/driver, purpose, state range, duration or
82
+ spring, mobile translation, reduced-motion behavior, fallback, and evidence.
83
+
84
+ Runtime proof includes changing transforms/uniforms/state at two timestamps,
85
+ trigger positions, tested scroll-back, hidden-tab recovery, cleanup after route
86
+ changes, mobile viewport, reduced motion, console count, and frame-time sampling
87
+ for heavy work. A static screenshot cannot prove choreography.
88
+
89
+ Recipe reference: `../recipes/motion-recipes.md`, after concept exploration only.