cinematic-scroll-skill 2.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.
- package/COMPATIBILITY.md +244 -0
- package/LICENSE +21 -0
- package/MODELS.md +92 -0
- package/README.md +250 -0
- package/SKILL.md +1003 -0
- package/audit-mode.md +497 -0
- package/bin/install.mjs +91 -0
- package/compile-choreography.mjs +296 -0
- package/decision-log.md +241 -0
- package/examples/GETTING_STARTED.md +279 -0
- package/examples/KNOWN_ISSUES.md +50 -0
- package/examples/PROMPTS.md +166 -0
- package/examples/luxe/README.md +88 -0
- package/examples/luxe/index.html +662 -0
- package/examples/noir/README.md +72 -0
- package/examples/noir/index.html +634 -0
- package/examples/pop/README.md +81 -0
- package/examples/pop/index.html +711 -0
- package/examples/renaissance/README.md +39 -0
- package/examples/renaissance/index.html +648 -0
- package/examples/studio/README.md +77 -0
- package/examples/studio/chapters.js +105 -0
- package/examples/studio/index.html +520 -0
- package/manifest.json +92 -0
- package/manifest.md +136 -0
- package/package.json +56 -0
- package/references/film-archetypes.md +211 -0
- package/references/performance-budget.md +499 -0
- package/references/scroll-patterns.md +693 -0
- package/scroll-choreography-compilation.md +543 -0
- package/scroll-choreography.json +1512 -0
- package/taste-guardrails.md +164 -0
- package/templates/nextjs/.env.example +41 -0
- package/templates/nextjs/app/api/fal/proxy/route.ts +33 -0
- package/templates/nextjs/app/api/fal/webhook/route.ts +132 -0
- package/templates/nextjs/app/api/generate-edition-asset/route.ts +66 -0
- package/templates/nextjs/app/globals.css +80 -0
- package/templates/nextjs/app/layout.tsx +21 -0
- package/templates/nextjs/app/page.tsx +10 -0
- package/templates/nextjs/components/ChapterDemoVisual.tsx +212 -0
- package/templates/nextjs/components/ChapterScene.tsx +373 -0
- package/templates/nextjs/components/EditionsPage.tsx +116 -0
- package/templates/nextjs/components/SmoothScrollProvider.tsx +8 -0
- package/templates/nextjs/lib/api-guard.ts +110 -0
- package/templates/nextjs/lib/editions-manifest.ts +224 -0
- package/templates/nextjs/lib/fal-client.ts +12 -0
- package/templates/nextjs/lib/fal-generate.ts +86 -0
- package/templates/nextjs/lib/fal-models.ts +213 -0
- package/templates/nextjs/lib/prompt-contract.ts +97 -0
- package/templates/nextjs/lib/use-device.ts +42 -0
- package/templates/nextjs/lib/use-lenis.ts +35 -0
- package/templates/nextjs/next.config.ts +29 -0
- package/templates/nextjs/package-lock.json +6455 -0
- package/templates/nextjs/package.json +41 -0
- package/templates/nextjs/package.patch.json +28 -0
- package/templates/nextjs/postcss.config.js +6 -0
- package/templates/nextjs/scripts/generate-chapter-assets.mjs +243 -0
- package/templates/nextjs/scripts/setup.mjs +170 -0
- package/templates/nextjs/tailwind.config.ts +37 -0
- package/templates/nextjs/tsconfig.json +23 -0
- package/troubleshooting.md +1284 -0
package/SKILL.md
ADDED
|
@@ -0,0 +1,1003 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cinematic-scroll
|
|
3
|
+
description: Build cinematic scroll-driven, 3D-tilt, parallax, and environment-morphing websites — pinned chapter reveals, hero parallax, depth-image figures, hover-tilt cards, background-morphing layouts, release/launch pages, product story pages, or editorial commerce microsites. From a single self-contained scroll section (Mode A) to a full Shopify-Editions-style Next.js release site with AI-generated visuals (Mode B). Works through an optional 5-phase pipeline (cinematic audit → motion storyboard → technical spec → build → polish) with taste guardrails, 12 proven scroll patterns, 7 visual systems, and a transform/opacity performance budget as built-in craft constraints.
|
|
4
|
+
version: 2.1.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<!--
|
|
8
|
+
=============================================================================
|
|
9
|
+
HUMAN READING THIS BY ACCIDENT? You don't need to. This file is for Claude.
|
|
10
|
+
|
|
11
|
+
Open README.md instead — it's the human quickstart.
|
|
12
|
+
|
|
13
|
+
This file (SKILL.md) is the machine-readable contract the agent reads when the
|
|
14
|
+
skill is invoked. It's long and technical by design.
|
|
15
|
+
=============================================================================
|
|
16
|
+
-->
|
|
17
|
+
|
|
18
|
+
# Cinematic Scroll
|
|
19
|
+
|
|
20
|
+
Reusable patterns + production templates for building cinematic, scroll-driven
|
|
21
|
+
React pages: pinned chapters, multi-depth parallax, 3D mouse tilt,
|
|
22
|
+
environment-morphing backgrounds, reduced-motion-safe degradation, and
|
|
23
|
+
(optionally) a full Next.js release site with fal.ai-generated visuals.
|
|
24
|
+
|
|
25
|
+
This is v2.0 — built on a **5-phase gated pipeline**. Every phase produces a
|
|
26
|
+
reviewable artifact. The user approves each phase before the next begins.
|
|
27
|
+
This replaces the v1.0 one-shot generation model with a process that
|
|
28
|
+
consistently produces production-quality output.
|
|
29
|
+
|
|
30
|
+
## The aesthetic is the user's — the motion is yours
|
|
31
|
+
|
|
32
|
+
**This skill supplies the *motion grammar*, never a fixed look.** The pinned
|
|
33
|
+
chapters, parallax, tilt, title choreography, and morphing backgrounds are the
|
|
34
|
+
constant; the visual world — palette, typography, imagery, mood — comes entirely
|
|
35
|
+
from the user's brief. Derive the aesthetic from what they ask for (brand,
|
|
36
|
+
references, palette, vibe, or a visual system from `references/film-archetypes.md`).
|
|
37
|
+
If they haven't said, **ask** or offer 2–3 distinct directions — never default to
|
|
38
|
+
any one style. The same machinery must produce a brutalist black-on-white drop, a
|
|
39
|
+
quiet-luxury launch, a neon Gen-Z page, a sci-fi noir reveal, an organic wellness
|
|
40
|
+
story, or a Renaissance editorial. None is "the" style. The five public examples
|
|
41
|
+
(`examples/renaissance`, `examples/studio`, `examples/noir`, `examples/luxe`, `examples/pop`)
|
|
42
|
+
are *different* worlds from the same engine — proof the look is a variable, not a default.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
# Philosophy
|
|
47
|
+
|
|
48
|
+
## 1. Taste is non-negotiable
|
|
49
|
+
|
|
50
|
+
The difference between slop and craft is anti-convergence. This skill ships
|
|
51
|
+
with `taste-guardrails.md` — 11 banned patterns, a cinematic vocabulary,
|
|
52
|
+
pacing rules, and anti-convergence principles. These are **hard constraints**,
|
|
53
|
+
not suggestions. An agent that does not enforce taste produces tasteless
|
|
54
|
+
output regardless of prompt quality. Every generated file is checked against
|
|
55
|
+
the banned patterns list before delivery.
|
|
56
|
+
|
|
57
|
+
## 2. Process over prompt
|
|
58
|
+
|
|
59
|
+
A great prompt is not enough. The 5-phase gated pipeline ensures that
|
|
60
|
+
**auditing**, **planning**, **specifying**, **building**, and **polishing**
|
|
61
|
+
happen as discrete, reviewable steps. The user sees a `cinematic-audit.md`
|
|
62
|
+
before any code is written. They approve a `motion-storyboard.md` before
|
|
63
|
+
any animation is implemented. Process de-risks the output.
|
|
64
|
+
|
|
65
|
+
## 3. Film grammar over web patterns
|
|
66
|
+
|
|
67
|
+
Scroll is not "web design." It is **digital cinematography**. The cinematic
|
|
68
|
+
vocabulary in `taste-guardrails.md` (Section 2) maps 12 film techniques to
|
|
69
|
+
scroll equivalents — dolly zooms, whip pans, rack focus, tracking shots,
|
|
70
|
+
crane shots. Every scroll behavior names the film technique it implements.
|
|
71
|
+
This is how we produce cinema, not PowerPoint transitions.
|
|
72
|
+
|
|
73
|
+
## 4. Measurable quality
|
|
74
|
+
|
|
75
|
+
Every output has reviewable artifacts. Every phase has a decision gate.
|
|
76
|
+
Every build is checked against `performance-budget.md` (Section 6, 11-point
|
|
77
|
+
pre-launch checklist). Quality is not a feeling — it is a checklist.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
# The 5-Phase Pipeline
|
|
82
|
+
|
|
83
|
+
Each phase produces a reviewable `.md` artifact. The user reviews and
|
|
84
|
+
approves each phase before proceeding. The agent never skips a phase
|
|
85
|
+
without explicit user consent.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Phase 1: Cinematic Audit
|
|
90
|
+
|
|
91
|
+
**Purpose:** Analyze the brand/content, define the emotional arc, select
|
|
92
|
+
the visual system, and establish the motion personality.
|
|
93
|
+
|
|
94
|
+
| | |
|
|
95
|
+
|---|---|
|
|
96
|
+
| **Input** | User's brief, brand materials (palette, logo, copy), reference sites, target audience, device context |
|
|
97
|
+
| **Output** | `cinematic-audit.md` |
|
|
98
|
+
| **Decision gate** | User approves the emotional arc and visual system before proceeding |
|
|
99
|
+
|
|
100
|
+
### Agent instructions
|
|
101
|
+
|
|
102
|
+
1. Ask the user about their brand's motion personality if not provided:
|
|
103
|
+
- "What emotion should the first 3 seconds produce?"
|
|
104
|
+
- "Is your brand closer to a Symmetric Monument (meticulous, formal) or a Warm Scrapbook (intimate, playful)?"
|
|
105
|
+
- "Who is scrolling this — a curious visitor or a decision-maker?"
|
|
106
|
+
|
|
107
|
+
2. Select a **visual system** from `references/film-archetypes.md`.
|
|
108
|
+
Read the archetypes file (Section 1-7) and match the brief to ONE primary
|
|
109
|
+
visual system. Document the choice in the audit with rationale. Never mix more
|
|
110
|
+
than 2 visual systems; if hybridity is needed, choose one primary and one accent.
|
|
111
|
+
|
|
112
|
+
3. Define the **emotional arc** across the full scroll journey:
|
|
113
|
+
- Opening emotion (what the user feels at scroll position 0)
|
|
114
|
+
- Mid-journey turning point (where the narrative shifts)
|
|
115
|
+
- Closing emotion (what the user carries away)
|
|
116
|
+
- Pacing rhythm: glacial / medium / energetic / variable
|
|
117
|
+
|
|
118
|
+
4. Document:
|
|
119
|
+
- Brand motion personality (3-5 adjectives)
|
|
120
|
+
- Emotional arc definition (opening → midpoint → closing)
|
|
121
|
+
- Audience analysis (device split, technical sophistication, attention span)
|
|
122
|
+
- Device context (primary viewport, performance tier expectation)
|
|
123
|
+
- Accessibility requirements (reduced-motion needs, WCAG target)
|
|
124
|
+
- Visual system selection (primary + optional accent, with rationale)
|
|
125
|
+
- Color temperature progression across chapters (warm → cool → neutral)
|
|
126
|
+
- Typography strategy (display font + body font, from archetype)
|
|
127
|
+
|
|
128
|
+
### Output: `cinematic-audit.md`
|
|
129
|
+
|
|
130
|
+
```markdown
|
|
131
|
+
# Cinematic Audit — [Project Name]
|
|
132
|
+
|
|
133
|
+
## Brand Motion Personality
|
|
134
|
+
[3-5 adjectives, e.g., "precise, clinical, data-driven, restrained"]
|
|
135
|
+
|
|
136
|
+
## Emotional Arc
|
|
137
|
+
- **Opening (0-20%):** [emotion, e.g., "awe at scale"]
|
|
138
|
+
- **Discovery (20-50%):** [emotion, e.g., "curiosity, information hunger"]
|
|
139
|
+
- **Turning Point (50%):** [emotion, e.g., "realization of complexity"]
|
|
140
|
+
- **Climax (50-80%):** [emotion, e.g., "confidence, trust"]
|
|
141
|
+
- **Resolution (80-100%):** [emotion, e.g., "clarity, call to action"]
|
|
142
|
+
|
|
143
|
+
## Audience Analysis
|
|
144
|
+
- Primary device: [desktop/mobile/tablet split]
|
|
145
|
+
- Technical sophistication: [low/medium/high]
|
|
146
|
+
- Expected attention span: [short <2min / medium 2-5min / long >5min]
|
|
147
|
+
|
|
148
|
+
## Device Context
|
|
149
|
+
- Primary viewport: [e.g., 1440px desktop, 390px mobile]
|
|
150
|
+
- Performance tier: [flagship/mid-range/budget/mixed]
|
|
151
|
+
|
|
152
|
+
## Accessibility Requirements
|
|
153
|
+
- WCAG target: [AA/AAA]
|
|
154
|
+
- Reduced-motion support: [required/preferred]
|
|
155
|
+
|
|
156
|
+
## Visual System
|
|
157
|
+
- **Primary:** [e.g., Clinical Noir — clinical precision, data-driven]
|
|
158
|
+
- **Accent (optional):** [e.g., Symmetric Monument for the authority moment]
|
|
159
|
+
- **Rationale:** [why this system matches the brand]
|
|
160
|
+
|
|
161
|
+
## Color Temperature Progression
|
|
162
|
+
[Chapter-by-chapter temperature plan: warm → cool → neutral → warm]
|
|
163
|
+
|
|
164
|
+
## Typography Strategy
|
|
165
|
+
- Display: [font family, sizing approach]
|
|
166
|
+
- Body: [font family, sizing approach]
|
|
167
|
+
- Source: [from film-archetypes.md Section X]
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Phase 2: Motion Storyboard
|
|
173
|
+
|
|
174
|
+
**Purpose:** Plan the scroll sequence — chapters, patterns, transitions,
|
|
175
|
+
depth layers, timing, and mobile degradation.
|
|
176
|
+
|
|
177
|
+
| | |
|
|
178
|
+
|---|---|
|
|
179
|
+
| **Input** | `cinematic-audit.md` |
|
|
180
|
+
| **Output** | `motion-storyboard.md` |
|
|
181
|
+
| **Decision gate** | User approves the chapter structure and pattern choices before proceeding |
|
|
182
|
+
|
|
183
|
+
### Agent instructions
|
|
184
|
+
|
|
185
|
+
1. Design a **chapter breakdown** of 5-8 chapters. Each chapter is one
|
|
186
|
+
pinned section with a distinct visual world. The total scroll distance
|
|
187
|
+
should be 1500-3000vh for the full experience.
|
|
188
|
+
|
|
189
|
+
2. Select **ONE pattern from `references/scroll-patterns.md` per chapter**.
|
|
190
|
+
The 12 available patterns (Section 1-12) are:
|
|
191
|
+
- Pinned Hero, Scrubbed Timeline, Velocity-Reactive, Sticky Narrative,
|
|
192
|
+
Chaptered Release, Parallax Gallery, 3D Product Orbit, Editorial Longread,
|
|
193
|
+
Data Story, Landing Sequence, Portfolio Reveal, Archive Explorer.
|
|
194
|
+
Document the pattern choice and rationale for each chapter.
|
|
195
|
+
|
|
196
|
+
3. Ensure **no adjacent chapters use the same pattern or transition type**.
|
|
197
|
+
This is a hard rule from `taste-guardrails.md` Section 4.4. Alternate:
|
|
198
|
+
fade → slide → scale → rotate → crossfade → wipe.
|
|
199
|
+
|
|
200
|
+
4. Configure **depth layers per chapter** following the selected pattern's
|
|
201
|
+
depth configuration. Reference `taste-guardrails.md` Section 4.3: never
|
|
202
|
+
repeat a depth multiplier between adjacent chapters. Maximum 7 layers per
|
|
203
|
+
chapter (`taste-guardrails.md` Section 1.7).
|
|
204
|
+
|
|
205
|
+
5. Verify **all pinned sections respect the 150-400vh rule** from
|
|
206
|
+
`taste-guardrails.md` Section 3.2 and 3.3. No pin shorter than 150vh,
|
|
207
|
+
no pin longer than 400vh.
|
|
208
|
+
|
|
209
|
+
6. Ensure **breathing room between chapters**: minimum 80vh of free-scroll
|
|
210
|
+
space between pinned chapters (`taste-guardrails.md` Section 3.4).
|
|
211
|
+
|
|
212
|
+
7. Specify the **title reveal style per chapter**, rotating through the
|
|
213
|
+
vocabulary in `taste-guardrails.md` Section 4.5. Never use the same
|
|
214
|
+
treatment twice in a row.
|
|
215
|
+
|
|
216
|
+
8. Document the **mobile degradation plan** per chapter using the tier
|
|
217
|
+
system from `performance-budget.md` Section 3.
|
|
218
|
+
|
|
219
|
+
### Output: `motion-storyboard.md`
|
|
220
|
+
|
|
221
|
+
```markdown
|
|
222
|
+
# Motion Storyboard — [Project Name]
|
|
223
|
+
|
|
224
|
+
## Chapter Map
|
|
225
|
+
|
|
226
|
+
| # | ID | Pattern | Pin Duration | Transition | Title Reveal |
|
|
227
|
+
|---|---|---|---|---|---|
|
|
228
|
+
| 1 | hero | Pinned Hero | 250vh | Crane shot down | Mask reveal |
|
|
229
|
+
| 2 | problem | Sticky Narrative | 200vh | Fade through black | Word stagger |
|
|
230
|
+
| 3 | solution | Chaptered Release | 300vh | Whip pan right | Letter-spacing scrub |
|
|
231
|
+
| 4 | ... | ... | ... | ... | ... |
|
|
232
|
+
|
|
233
|
+
## Chapter Details
|
|
234
|
+
|
|
235
|
+
### Chapter 1: [ID] — [Pattern from scroll-patterns.md Section X]
|
|
236
|
+
**Pin duration:** [X]vh
|
|
237
|
+
**Pattern reference:** `references/scroll-patterns.md` Section [X]
|
|
238
|
+
**Depth layers:**
|
|
239
|
+
| Layer | Depth | Role | Content |
|
|
240
|
+
|---|---|---|---|
|
|
241
|
+
| 0 | 0.15 | Atmospheric far | [description] |
|
|
242
|
+
| 1 | 0.30 | Mid-far | [description] |
|
|
243
|
+
| ... | ... | ... | ... |
|
|
244
|
+
**Title reveal:** [technique from taste-guardrails.md Section 4.5]
|
|
245
|
+
**Transition to next:** [film technique from taste-guardrails.md Section 2]
|
|
246
|
+
**Mobile degradation:** [plan from performance-budget.md Section 3]
|
|
247
|
+
**Color temperature:** [warm/cool/neutral]
|
|
248
|
+
|
|
249
|
+
[Repeat for each chapter]
|
|
250
|
+
|
|
251
|
+
## Transition Map
|
|
252
|
+
|
|
253
|
+
| From | To | Type | Film Technique | Duration (scroll) |
|
|
254
|
+
|---|---|---|---|---|
|
|
255
|
+
| ch1 | ch2 | [type] | [e.g., Crane shot] | [X]vh |
|
|
256
|
+
| ... | ... | ... | ... | ... |
|
|
257
|
+
|
|
258
|
+
## Timing / Pacing Spec
|
|
259
|
+
|
|
260
|
+
- Default rhythm: 1.2s scroll per 100vh (`taste-guardrails.md` Section 3.1)
|
|
261
|
+
- Total experience scroll distance: [X]vh
|
|
262
|
+
- Estimated scroll time at normal speed: [X] seconds
|
|
263
|
+
- Title reveal duration per chapter: 30-40% of pin range (Section 3.5)
|
|
264
|
+
- Stagger offset: 5-8% per element, max 5 elements before overlap (Section 3.6)
|
|
265
|
+
- Snap dead zone: never within 10vh of pin start/end (Section 3.7)
|
|
266
|
+
- Motion density limit: max 3 simultaneous motion types per 50vh window (Section 3.8)
|
|
267
|
+
|
|
268
|
+
## Mobile Degradation Plan
|
|
269
|
+
|
|
270
|
+
[Per-chapter summary of mobile strategy, referencing performance-budget.md
|
|
271
|
+
Section 3 tier degradation]
|
|
272
|
+
|
|
273
|
+
## Anti-Convergence Checklist
|
|
274
|
+
|
|
275
|
+
- [ ] No adjacent chapters share the same pattern
|
|
276
|
+
- [ ] No adjacent chapters share the same transition type
|
|
277
|
+
- [ ] No adjacent chapters share the same title reveal style
|
|
278
|
+
- [ ] No depth multiplier is repeated between adjacent chapters
|
|
279
|
+
- [ ] Color temperature alternates between chapters
|
|
280
|
+
- [ ] All pins are 150-400vh
|
|
281
|
+
- [ ] All pins have 80vh breathing room between them
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## Phase 3: Technical Spec
|
|
287
|
+
|
|
288
|
+
**Purpose:** Output the Lenis/GSAP/ScrollTrigger implementation plan with
|
|
289
|
+
exact configs, performance budget allocation, and asset requirements.
|
|
290
|
+
|
|
291
|
+
| | |
|
|
292
|
+
|---|---|
|
|
293
|
+
| **Input** | `motion-storyboard.md` + `references/performance-budget.md` |
|
|
294
|
+
| **Output** | `technical-spec.md` |
|
|
295
|
+
| **Decision gate** | User confirms the tech stack and approves performance budget before proceeding |
|
|
296
|
+
|
|
297
|
+
### Agent instructions
|
|
298
|
+
|
|
299
|
+
1. **Select packages:**
|
|
300
|
+
- Smooth scroll: Lenis (`lenis` npm package — NOT `@studio-freight/lenis`)
|
|
301
|
+
OR GSAP ScrollSmoother (preferred when GSAP is already in the build)
|
|
302
|
+
- Animation: GSAP + ScrollTrigger + SplitText (all now free)
|
|
303
|
+
- Motion primitives: `choreo-3d` for pinning orchestration
|
|
304
|
+
- Framework: React 19 + Next.js App Router (Mode B) or vanilla (Mode A)
|
|
305
|
+
|
|
306
|
+
2. **Specify exact GSAP ScrollTrigger configs** for every pinned chapter:
|
|
307
|
+
- `scrub` value (0.3-0.8 range per `performance-budget.md` Section 7)
|
|
308
|
+
- `start` and `end` positions
|
|
309
|
+
- `pin` configuration
|
|
310
|
+
- `snap` behavior if applicable
|
|
311
|
+
- Easing functions per role (hero entrance, exit, micro-interaction,
|
|
312
|
+
chapter transition — from `taste-guardrails.md` Section 4.1)
|
|
313
|
+
|
|
314
|
+
3. **Allocate performance budget** from `performance-budget.md`:
|
|
315
|
+
- Layer count per viewport (max 10 desktop, 4 mobile — Section 2)
|
|
316
|
+
- will-change strategy (Section 2)
|
|
317
|
+
- Image budget per chapter (Section 5)
|
|
318
|
+
- Font budget (Section 5)
|
|
319
|
+
- JS budget (Section 5)
|
|
320
|
+
|
|
321
|
+
4. **Flag any performance risks:** If the storyboard requests more than
|
|
322
|
+
7 layers per chapter, more than 3 simultaneous motion types in a 50vh
|
|
323
|
+
window, or pins approaching the 400vh limit, flag it here with mitigation.
|
|
324
|
+
|
|
325
|
+
5. **Document asset requirements:** Images, videos, fonts, with specifications
|
|
326
|
+
for each (format, dimensions, generation prompts if using fal.ai).
|
|
327
|
+
|
|
328
|
+
6. **Specify mobile degradation implementation** per chapter, referencing
|
|
329
|
+
`performance-budget.md` Section 3 (Mobile Degradation Matrix).
|
|
330
|
+
|
|
331
|
+
### Output: `technical-spec.md`
|
|
332
|
+
|
|
333
|
+
```markdown
|
|
334
|
+
# Technical Spec — [Project Name]
|
|
335
|
+
|
|
336
|
+
## Package Selection
|
|
337
|
+
|
|
338
|
+
| Package | Version | Purpose |
|
|
339
|
+
|---|---|---|
|
|
340
|
+
| gsap | ^3.13 | Core animation engine |
|
|
341
|
+
| lenis | ^1.3.23 | Smooth scroll (alternative: GSAP ScrollSmoother) |
|
|
342
|
+
| choreo-3d | latest | Pinning orchestration, ScrollLayer, ScrollChoreography |
|
|
343
|
+
| @gsap/react | latest | useGSAP hook for React integration |
|
|
344
|
+
| next | ^15 | Framework (Mode B only) |
|
|
345
|
+
|
|
346
|
+
## Component Architecture
|
|
347
|
+
|
|
348
|
+
[Diagram or list of components and their responsibilities]
|
|
349
|
+
|
|
350
|
+
## Animation Timeline Specs
|
|
351
|
+
|
|
352
|
+
### Chapter 1: [ID]
|
|
353
|
+
```javascript
|
|
354
|
+
// GSAP ScrollTrigger configuration
|
|
355
|
+
ScrollTrigger.create({
|
|
356
|
+
trigger: '#ch1',
|
|
357
|
+
start: 'top top',
|
|
358
|
+
end: '+=250vh',
|
|
359
|
+
pin: true,
|
|
360
|
+
scrub: 0.5,
|
|
361
|
+
snap: { /* ... */ },
|
|
362
|
+
});
|
|
363
|
+
```
|
|
364
|
+
**Scroll-scrub values:** [list]
|
|
365
|
+
**Easing functions:** [per-role assignment]
|
|
366
|
+
**Layer animation details:** [per-layer transform specs]
|
|
367
|
+
|
|
368
|
+
[Repeat for each chapter]
|
|
369
|
+
|
|
370
|
+
## Performance Budget Allocation
|
|
371
|
+
|
|
372
|
+
| Resource | Budget | Actual | Status |
|
|
373
|
+
|---|---|---|---|
|
|
374
|
+
| Compositor layers (desktop) | 10 max | [X] | OK/RISK |
|
|
375
|
+
| Compositor layers (mobile) | 4 max | [X] | OK/RISK |
|
|
376
|
+
| Images per chapter | 3 max | [X] | OK/RISK |
|
|
377
|
+
| Total image weight | 500KB/ch | [X] | OK/RISK |
|
|
378
|
+
| Font families | 2 max | [X] | OK/RISK |
|
|
379
|
+
| Animation JS | 100KB gz | [X] | OK/RISK |
|
|
380
|
+
|
|
381
|
+
## Asset Requirements
|
|
382
|
+
|
|
383
|
+
| Chapter | Asset | Type | Spec | Prompt/Source |
|
|
384
|
+
|---|---|---|---|---|
|
|
385
|
+
| 1 | hero-bg | image | 1920x1080 WebP | [prompt or URL] |
|
|
386
|
+
| ... | ... | ... | ... | ... |
|
|
387
|
+
|
|
388
|
+
## Mobile Degradation Implementation
|
|
389
|
+
|
|
390
|
+
[Per-chapter mobile strategy with specific code approach]
|
|
391
|
+
|
|
392
|
+
## Performance Risks & Mitigations
|
|
393
|
+
|
|
394
|
+
| Risk | Severity | Mitigation |
|
|
395
|
+
|---|---|---|
|
|
396
|
+
| [e.g., 8 layers in ch3] | High | Reduce to 5, use opacity faking |
|
|
397
|
+
| ... | ... | ... |
|
|
398
|
+
|
|
399
|
+
## GSAP Defaults
|
|
400
|
+
|
|
401
|
+
```javascript
|
|
402
|
+
ScrollTrigger.defaults({
|
|
403
|
+
markers: false,
|
|
404
|
+
scrub: 0.5,
|
|
405
|
+
invalidateOnRefresh: true,
|
|
406
|
+
fastScrollEnd: true,
|
|
407
|
+
preventOverlaps: true,
|
|
408
|
+
});
|
|
409
|
+
```
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
414
|
+
## Phase 4: Build
|
|
415
|
+
|
|
416
|
+
**Purpose:** Generate the code.
|
|
417
|
+
|
|
418
|
+
| | |
|
|
419
|
+
|---|---|
|
|
420
|
+
| **Input** | `technical-spec.md` |
|
|
421
|
+
| **Output** | Mode A (self-contained HTML) or Mode B (Next.js project) |
|
|
422
|
+
| **Decision gate** | Implicit — the code IS the deliverable |
|
|
423
|
+
|
|
424
|
+
### Agent instructions
|
|
425
|
+
|
|
426
|
+
1. **Apply ALL taste guardrails as hard constraints.** Before delivering,
|
|
427
|
+
check every output against the banned patterns list in
|
|
428
|
+
`taste-guardrails.md` Section 1. Violating these rules is a bug, not a
|
|
429
|
+
style choice.
|
|
430
|
+
|
|
431
|
+
2. **Ensure reduced-motion fallback** for every scroll-driven effect.
|
|
432
|
+
When `prefers-reduced-motion: reduce` is active: disable pinning, disable
|
|
433
|
+
parallax, show static compositions, set all transitions to instant.
|
|
434
|
+
Reference `performance-budget.md` Section 3, Tier 4.
|
|
435
|
+
|
|
436
|
+
3. **Verify mobile degradation is implemented.** Every pinned section must
|
|
437
|
+
have a mobile fallback below 768px. Use IntersectionObserver fade-up,
|
|
438
|
+
no pinning, stacked layout. Reference `performance-budget.md` Section 3.
|
|
439
|
+
|
|
440
|
+
4. **Name the cinematic technique in code comments.** Every scroll-driven
|
|
441
|
+
animation must have a comment naming the film technique it implements
|
|
442
|
+
(from `taste-guardrails.md` Section 2).
|
|
443
|
+
|
|
444
|
+
5. **Only animate `transform` and `opacity` in hot scroll paths.** Never
|
|
445
|
+
`width`, `height`, `top`, `left`, `filter`, `box-shadow`.
|
|
446
|
+
Reference `performance-budget.md` Section 1 (Permitted Properties).
|
|
447
|
+
|
|
448
|
+
6. **Use `will-change` strategically** — 200ms before animation starts,
|
|
449
|
+
200ms after it ends, max 3 simultaneous elements. Never globally.
|
|
450
|
+
Reference `performance-budget.md` Section 2.
|
|
451
|
+
|
|
452
|
+
7. **Optional accelerator — compile from a choreography document.** If the
|
|
453
|
+
technical spec is expressed as a `scroll-choreography.json`, run the bundled
|
|
454
|
+
compiler to emit the GSAP ScrollTrigger + Lenis code instead of hand-writing it:
|
|
455
|
+
`node compile-choreography.mjs my-scene.json --out scene.js`. The compiler maps
|
|
456
|
+
the schema's CSS property names to GSAP shorthand (`translateX`→`x`,
|
|
457
|
+
`rotateZ`→`rotation`, …) — a mapping that is easy to get wrong by hand and
|
|
458
|
+
silently no-ops in GSAP if you do. See `scroll-choreography-compilation.md`.
|
|
459
|
+
|
|
460
|
+
7. **Follow the `technical-spec.md` exactly.** Do not improvise animation
|
|
461
|
+
configs that differ from the approved spec.
|
|
462
|
+
|
|
463
|
+
8. **If using fal.ai assets**, follow the server-side generation pattern,
|
|
464
|
+
never expose `FAL_KEY` in client code. Reference `MODELS.md` for model
|
|
465
|
+
selection and cost.
|
|
466
|
+
|
|
467
|
+
### Mode A vs Mode B
|
|
468
|
+
|
|
469
|
+
This phase operates in two modes. Follow the mode specified in the
|
|
470
|
+
`technical-spec.md`.
|
|
471
|
+
|
|
472
|
+
| | **Mode A — Scroll artifact** | **Mode B — Full release site** |
|
|
473
|
+
|---|---|---|
|
|
474
|
+
| Use when | Single section / hero / pinned chapter / parallax demo | Full release / launch / product-story website |
|
|
475
|
+
| Output | One self-contained `.html` (inline CSS + JS) or `.tsx` component | Next.js App Router project from `templates/nextjs/` |
|
|
476
|
+
| Build step | None | `npm install && npm run dev` |
|
|
477
|
+
| AI assets | None (CSS/SVG/static only) | Optional fal.ai pipeline (bring your own key) |
|
|
478
|
+
| GSAP | Not included (zero-dependency by design) | Full GSAP + plugins (now free) |
|
|
479
|
+
| Smooth scroll | rAF-throttled handlers | Lenis or ScrollSmoother |
|
|
480
|
+
|
|
481
|
+
If the request is ambiguous, default to **Mode A** for a single section
|
|
482
|
+
and **Mode B** when the user says "site", "page", "release", "launch",
|
|
483
|
+
or "landing".
|
|
484
|
+
|
|
485
|
+
### Mode A build rules
|
|
486
|
+
|
|
487
|
+
- Single self-contained HTML file: `<!DOCTYPE html>` ... `</html>`, inline
|
|
488
|
+
CSS + JS, renders immediately with no build step.
|
|
489
|
+
- No GSAP, no Lenis, no npm packages. `requestAnimationFrame`-throttled
|
|
490
|
+
scroll handlers only.
|
|
491
|
+
- `perspective: 1200px` on chapter wrapper. 3D transforms on at least one
|
|
492
|
+
layer (`rotateX` ±4deg max, `rotateY` ±2deg max).
|
|
493
|
+
- Minimum 5 depth layers per chapter.
|
|
494
|
+
- Type reveal: use one of mask reveal, word stagger, letter stagger,
|
|
495
|
+
vertical mask, or scrub letter-spacing.
|
|
496
|
+
- `clamp()` for all typography. No fixed `px` for `font-size`.
|
|
497
|
+
- Progress HUD in top-right for sandbox/iframe environments.
|
|
498
|
+
- Reduced-motion check: `prefers-reduced-motion: reduce` → static
|
|
499
|
+
composition, no scroll binding.
|
|
500
|
+
|
|
501
|
+
### Mode B build rules
|
|
502
|
+
|
|
503
|
+
- Scaffold from `templates/nextjs/` — copy bundled files **verbatim**.
|
|
504
|
+
Do NOT regenerate `package.json`, `ChapterScene.tsx`, `fal-models.ts`,
|
|
505
|
+
`fal-generate.ts`, or API routes from memory. The templates contain
|
|
506
|
+
tested, production-safe code.
|
|
507
|
+
- `choreo-3d` for motion primitives: `ScrollChoreography`, `ScrollLayer`,
|
|
508
|
+
`ScrollDepthImage`, `ScrollBackgroundMorph`, `useTilt3D`, `useMouseSpring`.
|
|
509
|
+
- GSAP plugins (all free): `ScrollTrigger`, `SplitText`, `ScrollSmoother`.
|
|
510
|
+
Register once: `gsap.registerPlugin(ScrollTrigger, SplitText, ScrollSmoother)`.
|
|
511
|
+
- `@gsap/react`'s `useGSAP()` hook with a `scope` for cleanup.
|
|
512
|
+
- Lenis (`lenis` package — NOT `@studio-freight/lenis`) for smooth scroll.
|
|
513
|
+
Forward Lenis RAF tick to `ScrollTrigger.update`.
|
|
514
|
+
- `lib/editions-manifest.ts` — 6-12 chapters, each with: `id`, `eyebrow`,
|
|
515
|
+
`title`, `summary`, `features`, `accent`, `background`, `foreground`,
|
|
516
|
+
`poster`, `video`.
|
|
517
|
+
- `ChapterScene.tsx` — the 7-layer cinematic scene. Do NOT downgrade it:
|
|
518
|
+
never collapse to 2 layers, never remove `perspective: 1200px`, never
|
|
519
|
+
replace word-stagger with plain opacity fade, never drop mobile fallback.
|
|
520
|
+
- `lib/fal-models.ts` adapter for all image generation — never inline
|
|
521
|
+
`image_size`, `aspect_ratio`, or `negative_prompt`.
|
|
522
|
+
- fal.ai key stays server-side only. Never in client components or `.env`.
|
|
523
|
+
|
|
524
|
+
### Output: Mode A (single file) or Mode B (project directory)
|
|
525
|
+
|
|
526
|
+
---
|
|
527
|
+
|
|
528
|
+
## Phase 5: Polish
|
|
529
|
+
|
|
530
|
+
**Purpose:** Performance audit, accessibility check, mobile verification,
|
|
531
|
+
and final quality gate.
|
|
532
|
+
|
|
533
|
+
| | |
|
|
534
|
+
|---|---|
|
|
535
|
+
| **Input** | The built code (Mode A HTML or Mode B project) |
|
|
536
|
+
| **Output** | `polish-report.md` |
|
|
537
|
+
| **Decision gate** | All 11 pre-launch checks must pass. User reviews the polish report. |
|
|
538
|
+
|
|
539
|
+
### Agent instructions
|
|
540
|
+
|
|
541
|
+
1. **Run the performance-budget.md monitoring checklist** (Section 6).
|
|
542
|
+
All 11 pre-launch checks must be verified:
|
|
543
|
+
- [ ] Chrome DevTools Performance: 10s scroll recording, < 5% red frames
|
|
544
|
+
- [ ] Lighthouse Performance score > 90
|
|
545
|
+
- [ ] WebPageTest filmstrip: smooth visual progression during scroll
|
|
546
|
+
- [ ] iPhone 12 Safari: no visible stutter during fast scroll
|
|
547
|
+
- [ ] iPhone SE: content accessible, no broken layout on budget tier
|
|
548
|
+
- [ ] Reduced-motion test: all content visible, no broken layout
|
|
549
|
+
- [ ] Battery test: 5min continuous scrolling drains < 3% battery
|
|
550
|
+
- [ ] Memory test: tab memory does not grow > 50MB after 5min scrolling
|
|
551
|
+
- [ ] Layer count: < 10 layers desktop, < 4 on mobile
|
|
552
|
+
- [ ] No layout thrashing: no purple "Layout" bars during scroll
|
|
553
|
+
- [ ] Network: no images load during scroll animation
|
|
554
|
+
|
|
555
|
+
2. **Verify no banned patterns survived.** Re-check the code against
|
|
556
|
+
`taste-guardrails.md` Section 1 (Banned Patterns).
|
|
557
|
+
|
|
558
|
+
3. **Confirm emotional arc matches Phase 1 audit.** Scroll through the
|
|
559
|
+
entire experience and verify the emotional progression matches the
|
|
560
|
+
`cinematic-audit.md` definition.
|
|
561
|
+
|
|
562
|
+
4. **Verify all reduced-motion fallbacks.** Test with macOS → Accessibility
|
|
563
|
+
→ Reduce Motion ON. All content must be visible and usable.
|
|
564
|
+
|
|
565
|
+
5. **Verify mobile degradation.** Test at 375px viewport. All pinned
|
|
566
|
+
sections must be converted to stacked layout. No broken tap targets.
|
|
567
|
+
|
|
568
|
+
6. **Verify accessibility:** All images have meaningful `alt` text (or
|
|
569
|
+
`alt=""` if decorative). All interactive elements have focus states.
|
|
570
|
+
`aria-label` on visual navigation controls. Keyboard navigation works.
|
|
571
|
+
|
|
572
|
+
7. **Measure scroll jank** using the protocol from `performance-budget.md`
|
|
573
|
+
Section 4 (Scroll Jank Measurement Protocol).
|
|
574
|
+
|
|
575
|
+
### Output: `polish-report.md`
|
|
576
|
+
|
|
577
|
+
```markdown
|
|
578
|
+
# Polish Report — [Project Name]
|
|
579
|
+
|
|
580
|
+
## Performance Audit
|
|
581
|
+
|
|
582
|
+
### Scroll Jank Measurement
|
|
583
|
+
- Test device: [e.g., MacBook Pro M3]
|
|
584
|
+
- Recording duration: 10 seconds
|
|
585
|
+
- Frames dropped: [X] / [total] ([X]%)
|
|
586
|
+
- Status: [PASS / FAIL] (target: < 5%)
|
|
587
|
+
|
|
588
|
+
### Lighthouse Scores
|
|
589
|
+
| Metric | Score | Target | Status |
|
|
590
|
+
|---|---|---|---|
|
|
591
|
+
| Performance | [X] | > 90 | OK/FAIL |
|
|
592
|
+
| Accessibility | [X] | > 95 | OK/FAIL |
|
|
593
|
+
| Best Practices | [X] | > 90 | OK/FAIL |
|
|
594
|
+
| SEO | [X] | > 90 | OK/FAIL |
|
|
595
|
+
|
|
596
|
+
### Layer Count
|
|
597
|
+
- Desktop: [X] layers (budget: 10) — OK/FAIL
|
|
598
|
+
- Mobile: [X] layers (budget: 4) — OK/FAIL
|
|
599
|
+
|
|
600
|
+
## Accessibility Checklist
|
|
601
|
+
|
|
602
|
+
- [ ] All images have alt text
|
|
603
|
+
- [ ] Focus states on all interactive elements
|
|
604
|
+
- [ ] Keyboard navigation works
|
|
605
|
+
- [ ] aria-label on visual nav controls
|
|
606
|
+
- [ ] Color contrast ≥ 4.5:1 for body text
|
|
607
|
+
- [ ] Reduced-motion: content visible and usable
|
|
608
|
+
- [ ] Screen reader compatible
|
|
609
|
+
|
|
610
|
+
## Mobile Test Results
|
|
611
|
+
|
|
612
|
+
| Device | OS | Browser | Result |
|
|
613
|
+
|---|---|---|---|
|
|
614
|
+
| iPhone 15 Pro | iOS 17 | Safari | PASS/FAIL |
|
|
615
|
+
| iPhone 12 | iOS 17 | Safari | PASS/FAIL |
|
|
616
|
+
| iPhone SE | iOS 17 | Safari | PASS/FAIL |
|
|
617
|
+
| Samsung S24 | Android 14 | Chrome | PASS/FAIL |
|
|
618
|
+
| Pixel 6 | Android 14 | Chrome | PASS/FAIL |
|
|
619
|
+
|
|
620
|
+
## Banned Patterns Check
|
|
621
|
+
|
|
622
|
+
- [ ] No filter animation during scroll
|
|
623
|
+
- [ ] No layout property animation (width/height/top/left)
|
|
624
|
+
- [ ] No setState in scroll handlers
|
|
625
|
+
- [ ] No >7 layers per chapter
|
|
626
|
+
- [ ] No same easing for every animation
|
|
627
|
+
- [ ] No same transition type between adjacent chapters
|
|
628
|
+
|
|
629
|
+
## Emotional Arc Verification
|
|
630
|
+
|
|
631
|
+
| Scroll Position | Expected Emotion | Actual | Match |
|
|
632
|
+
|---|---|---|---|
|
|
633
|
+
| 0-20% | [from audit] | [observed] | Y/N |
|
|
634
|
+
| 20-50% | [from audit] | [observed] | Y/N |
|
|
635
|
+
| 50% | [from audit] | [observed] | Y/N |
|
|
636
|
+
| 50-80% | [from audit] | [observed] | Y/N |
|
|
637
|
+
| 80-100% | [from audit] | [observed] | Y/N |
|
|
638
|
+
|
|
639
|
+
## Final Fixes Applied
|
|
640
|
+
|
|
641
|
+
[List any fixes applied during the polish phase]
|
|
642
|
+
|
|
643
|
+
## Ship Recommendation
|
|
644
|
+
|
|
645
|
+
[GO / NO-GO with reasoning]
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
---
|
|
649
|
+
|
|
650
|
+
# Mandatory Motion + Craft Requirements
|
|
651
|
+
|
|
652
|
+
Every artifact MUST satisfy ALL of these. No exceptions for "demo simplicity"
|
|
653
|
+
— the demo IS the product.
|
|
654
|
+
|
|
655
|
+
## 1. Multi-depth field — minimum 5 layers
|
|
656
|
+
|
|
657
|
+
Two-layer parallax is amateur. A real depth field uses 5-7 layers at
|
|
658
|
+
distinct depth multipliers. Pick at least 5 of these 7 slots:
|
|
659
|
+
|
|
660
|
+
| Depth | Role | Examples |
|
|
661
|
+
|---|---|---|
|
|
662
|
+
| 0.15 | Atmospheric far | Sky gradient, distant fog, soft glow |
|
|
663
|
+
| 0.30 | Mid-far | Distant props, blurred shapes, horizon |
|
|
664
|
+
| 0.50 | Mid | Subject background, atmospheric texture |
|
|
665
|
+
| 0.75 | Subject | Main figure / image / 3D object |
|
|
666
|
+
| 1.00 | UI text | Title, body copy, eyebrow label |
|
|
667
|
+
| 1.20 | Foreground accents | Floating numbers, edge labels, brackets |
|
|
668
|
+
| 1.40 | Closest overlays | Cursor highlights, badges, scroll cue |
|
|
669
|
+
|
|
670
|
+
## 2. 3D perspective camera
|
|
671
|
+
|
|
672
|
+
Set `perspective: 1200px` on the chapter wrapper. Use scroll-driven 3D
|
|
673
|
+
transforms on at least one layer: `rotateX(±4deg max)`, `rotateY(±2deg max)`,
|
|
674
|
+
`translateZ(0px → -80px)`. Disable all 3D rotation on touch devices AND
|
|
675
|
+
when `prefers-reduced-motion: reduce`.
|
|
676
|
+
|
|
677
|
+
## 3. Type reveal patterns
|
|
678
|
+
|
|
679
|
+
Plain `opacity: 0 → 1` on oversized titles is lazy. Use one of:
|
|
680
|
+
word stagger, letter stagger, mask reveal (`clip-path: inset`), vertical mask,
|
|
681
|
+
scrub letter-spacing. Combine with `translateY()` and `opacity`.
|
|
682
|
+
|
|
683
|
+
## 4. Smooth scrolling — mandatory in production
|
|
684
|
+
|
|
685
|
+
- **Mode A:** `requestAnimationFrame`-throttled scroll handlers (not raw
|
|
686
|
+
`scroll` events). No packages — dependency-free by design.
|
|
687
|
+
- **Mode B:** Lenis (`lenis` npm — NOT `@studio-freight/lenis`) OR GSAP
|
|
688
|
+
`ScrollSmoother` (preferred when GSAP is already in the build). Forward
|
|
689
|
+
Lenis RAF tick to `ScrollTrigger.update` if using both.
|
|
690
|
+
|
|
691
|
+
## 5. GSAP is now free — use the premium plugins in Mode B
|
|
692
|
+
|
|
693
|
+
As of the Webflow acquisition (2025), GSAP is 100% free including every
|
|
694
|
+
former Club plugin. In Mode B, prefer:
|
|
695
|
+
|
|
696
|
+
| Want | Use the free plugin | Instead of |
|
|
697
|
+
|---|---|---|
|
|
698
|
+
| Per-word/per-char reveals | **SplitText** (`gsap/SplitText`) | Manual word `<span>` wrapping |
|
|
699
|
+
| Pinned chapters + scroll-scrub | **ScrollTrigger** (`gsap/ScrollTrigger`) | Custom IntersectionObserver pinning |
|
|
700
|
+
| Smooth scroll | **ScrollSmoother** (`gsap/ScrollSmoother`) | Lenis + RAF forwarding |
|
|
701
|
+
| Layout transitions | **Flip** (`gsap/Flip`) | Manual FLIP math |
|
|
702
|
+
|
|
703
|
+
Register once: `gsap.registerPlugin(ScrollTrigger, SplitText, ScrollSmoother)`.
|
|
704
|
+
|
|
705
|
+
## 6. Mobile-responsive — mandatory
|
|
706
|
+
|
|
707
|
+
- `<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">`
|
|
708
|
+
- Typography in `clamp(min, fluid, max)` — never fixed `px` for `font-size`
|
|
709
|
+
- Disable pinned scroll below 768px — IntersectionObserver fade-up
|
|
710
|
+
- `env(safe-area-inset-*)` padding on fixed nav / overlays
|
|
711
|
+
- Tap targets ≥ 44px square
|
|
712
|
+
- Mobile-first: design at 375px viewport FIRST, then scale up
|
|
713
|
+
|
|
714
|
+
## 7. Loading sequence
|
|
715
|
+
|
|
716
|
+
- Preload critical backgrounds with `<link rel="preload" as="image">`
|
|
717
|
+
- Show poster / blurred LQIP placeholder during decode
|
|
718
|
+
- First paint readable within ~1.5s on simulated 4G
|
|
719
|
+
- In Next.js, `<Image>` with `priority` on above-the-fold imagery
|
|
720
|
+
|
|
721
|
+
## 8. Performance — compositor-only paths, designed for 60fps (benchmark your targets)
|
|
722
|
+
|
|
723
|
+
- Only `transform` and `opacity` mutate per scroll frame
|
|
724
|
+
- `will-change: transform` on animated layers ONLY (never globally)
|
|
725
|
+
- `translate3d(0,0,0)` to force GPU compositing where needed
|
|
726
|
+
- Cache `getBoundingClientRect()` once on init + resize, never per frame
|
|
727
|
+
- No layout reads in scroll handlers
|
|
728
|
+
- Chrome DevTools Performance flame chart = all green (composite only)
|
|
729
|
+
- Lighthouse Performance ≥ 90
|
|
730
|
+
|
|
731
|
+
## 9. Component rules
|
|
732
|
+
|
|
733
|
+
- Every full-screen chapter: `id` + single `<section>` wrapper + `eyebrow`,
|
|
734
|
+
`title`, `summary`, `features`, `asset`, `accent`
|
|
735
|
+
- All text overlays = **selectable HTML**, never baked into images
|
|
736
|
+
- `aria-label` on visual navigation controls
|
|
737
|
+
- Avoid scroll hijacking — pin per chapter, not the whole page
|
|
738
|
+
- On mobile: collapse pinned scenes into stacked vertical cards
|
|
739
|
+
- Prefer 16:9 backgrounds, 4:5 foreground figures
|
|
740
|
+
|
|
741
|
+
---
|
|
742
|
+
|
|
743
|
+
# Core Principles
|
|
744
|
+
|
|
745
|
+
1. **Reduced motion first.** Every effect degrades gracefully when
|
|
746
|
+
`prefers-reduced-motion: reduce` is set. Pin hooks skip GSAP, layers snap
|
|
747
|
+
to stable mid-keyframe, tilt returns zeros.
|
|
748
|
+
|
|
749
|
+
2. **iOS WebKit video safety.** Safari freezes `<video>` frames inside a
|
|
750
|
+
`transform-style: preserve-3d` ancestor that updates. Detect touch and
|
|
751
|
+
bypass the 3D wrapper for video.
|
|
752
|
+
|
|
753
|
+
3. **Animate transform + opacity only** in hot scroll paths.
|
|
754
|
+
|
|
755
|
+
4. **Pin chapters, not the page.** Each cinematic block opts into pinning.
|
|
756
|
+
The rest of the document scrolls normally.
|
|
757
|
+
|
|
758
|
+
5. **Deterministic motion.** Any procedural value must be stable across
|
|
759
|
+
re-renders so SSR and resize don't shift layout.
|
|
760
|
+
|
|
761
|
+
---
|
|
762
|
+
|
|
763
|
+
# Quality Bar
|
|
764
|
+
|
|
765
|
+
Output must compete with:
|
|
766
|
+
|
|
767
|
+
- **Shopify Editions** (Winter/Summer drops) — multi-chapter release worlds
|
|
768
|
+
- **Apple product launch pages** — pinned cinematic sequences
|
|
769
|
+
- **Linear release notes** — editorial typography + restraint
|
|
770
|
+
- **Stripe Sessions** — depth-of-field + atmospheric morphing
|
|
771
|
+
- **Awwwards SOTD nominees** in Editorial + Product Launch categories
|
|
772
|
+
|
|
773
|
+
"Looks like a Bootstrap landing page" or "looks like a Tailwind UI template"
|
|
774
|
+
= failure. Output should look studio-crafted. If constraints prevent this tier,
|
|
775
|
+
**say so explicitly** and deliver the highest-quality fallback the constraints
|
|
776
|
+
allow — never ship mid-tier silently.
|
|
777
|
+
|
|
778
|
+
---
|
|
779
|
+
|
|
780
|
+
# fal.ai Integration (Mode B)
|
|
781
|
+
|
|
782
|
+
This skill includes NO keys or credits. Every user creates their own fal.ai
|
|
783
|
+
account. The page works **without fal.ai** — `ChapterDemoVisual` renders
|
|
784
|
+
stunning CSS-only chapter visuals at $0.
|
|
785
|
+
|
|
786
|
+
## Setup
|
|
787
|
+
|
|
788
|
+
1. Walk new users through `examples/GETTING_STARTED.md`
|
|
789
|
+
2. Sign up at [fal.ai](https://fal.ai), create API key, add `FAL_KEY` to `.env.local`
|
|
790
|
+
3. Restart dev server after adding env vars
|
|
791
|
+
4. Never put `FAL_KEY` in client components or committed `.env` files
|
|
792
|
+
5. Mention they can skip fal.ai and use static images
|
|
793
|
+
|
|
794
|
+
## Technical rules
|
|
795
|
+
|
|
796
|
+
1. Never expose `FAL_KEY` in browser code
|
|
797
|
+
2. Use `@fal-ai/server-proxy/nextjs` — export `GET`, `POST`, **and `PUT`**
|
|
798
|
+
3. Always go through `lib/fal-models.ts` — never inline `image_size` or `negative_prompt`
|
|
799
|
+
4. Use server routes for production asset generation
|
|
800
|
+
5. Use `fal.subscribe` for ≤5 chapters; `fal.queue.submit` + webhook for >5
|
|
801
|
+
6. Set `allowedEndpoints` on the proxy + `allowUnauthorizedRequests: false`
|
|
802
|
+
7. Model IDs configurable via environment variables
|
|
803
|
+
|
|
804
|
+
See `MODELS.md` for the full model menu, cost table, and per-model parameter
|
|
805
|
+
differences. Default: `fal-ai/flux-2-pro` (~$0.06/img, ~4s).
|
|
806
|
+
|
|
807
|
+
---
|
|
808
|
+
|
|
809
|
+
# Quick-Start (For Expert Users)
|
|
810
|
+
|
|
811
|
+
Experienced users can skip the full pipeline by providing a complete brief
|
|
812
|
+
upfront. The agent runs all 5 phases internally and delivers the final output
|
|
813
|
+
in one shot. Use these prompts as templates.
|
|
814
|
+
|
|
815
|
+
## Quick-Start A: Single scroll section (Mode A)
|
|
816
|
+
|
|
817
|
+
> Build a cinematic-scroll pinned hero chapter for my [brand/product].
|
|
818
|
+
> Director grammar: [Kubrick/Fincher/Anderson/Nolan/Villeneuve/Gerwig/Zhao].
|
|
819
|
+
> [N] chapters, [color palette], [typography feel].
|
|
820
|
+
> Pin duration [X]vh. Output: single self-contained HTML file.
|
|
821
|
+
|
|
822
|
+
The agent internally runs Phase 1-3 assumptions, builds (Phase 4), and
|
|
823
|
+
delivers a performance-annotated file with inline polish notes (Phase 5
|
|
824
|
+
lightweight).
|
|
825
|
+
|
|
826
|
+
## Quick-Start B: Full release site (Mode B)
|
|
827
|
+
|
|
828
|
+
> Scaffold a complete Shopify-Editions-tier cinematic release page for
|
|
829
|
+
> [product]. Director: [name]. [N] chapters. Demo mode first — no fal.ai
|
|
830
|
+
> key required. Copy templates verbatim from `templates/nextjs/`.
|
|
831
|
+
|
|
832
|
+
The agent runs the full pipeline internally: cinematic audit (assumed),
|
|
833
|
+
storyboard (assumed), technical spec (assumed), build (Mode B), and delivers
|
|
834
|
+
with a lightweight polish checklist.
|
|
835
|
+
|
|
836
|
+
## Quick-Start C: Existing project upgrade
|
|
837
|
+
|
|
838
|
+
> Add a cinematic-scroll pinned chapter to my existing [React/Next.js] project.
|
|
839
|
+
> Use choreo-3d primitives. Pattern: [Pinned Hero/Chaptered Release/etc from
|
|
840
|
+
> scroll-patterns.md]. Pin [X]vh, [N] layers. Match my existing [palette/typography].
|
|
841
|
+
|
|
842
|
+
The agent runs Phase 2-4 only, integrating with the existing codebase.
|
|
843
|
+
|
|
844
|
+
---
|
|
845
|
+
|
|
846
|
+
# Example Prompts — Full Pipeline (5-Phase)
|
|
847
|
+
|
|
848
|
+
These examples show how the complete gated pipeline works end-to-end.
|
|
849
|
+
|
|
850
|
+
## Example 1: Fintech Trust Page (Fincher Grammar)
|
|
851
|
+
|
|
852
|
+
> **Phase 1:** We're a fintech app that needs to communicate trust and
|
|
853
|
+
> precision. Our brand is clinical, data-driven, restrained. Audience:
|
|
854
|
+
> decision-makers on desktop. Build a cinematic-scroll experience using
|
|
855
|
+
> the David Fincher visual system from `references/film-archetypes.md`
|
|
856
|
+
> Section 2. Output: `cinematic-audit.md`.
|
|
857
|
+
>
|
|
858
|
+
> **Phase 2:** Based on the audit, design a 6-chapter motion storyboard.
|
|
859
|
+
> Chapters: Authority, Problem, Solution, Product, Proof, CTA. Use
|
|
860
|
+
> Chaptered Release pattern for chapters 1 and 5, Sticky Narrative for
|
|
861
|
+
> chapter 2, Data Story for chapter 4. Reference `references/scroll-patterns.md`
|
|
862
|
+
> Sections 5, 4, and 9. Output: `motion-storyboard.md`.
|
|
863
|
+
>
|
|
864
|
+
> **Phase 3:** Produce the technical spec. Use GSAP ScrollTrigger + Lenis +
|
|
865
|
+
> choreo-3d. Scrub 0.5, pin spacing true. Reference `performance-budget.md`
|
|
866
|
+
> Sections 1, 2, and 7 for all constraints. Output: `technical-spec.md`.
|
|
867
|
+
>
|
|
868
|
+
> **Phase 4:** Build Mode B — Next.js project from templates. 6 chapters,
|
|
869
|
+
> Fincher palette (ash grey, steel blue, sickly yellow-green, black).
|
|
870
|
+
> CSS-only demo mode for first run. Output: project directory.
|
|
871
|
+
>
|
|
872
|
+
> **Phase 5:** Run the full polish checklist. Verify all 11 pre-launch
|
|
873
|
+
> checks from `performance-budget.md` Section 6. Confirm no banned patterns
|
|
874
|
+
> from `taste-guardrails.md` Section 1 survived. Output: `polish-report.md`.
|
|
875
|
+
|
|
876
|
+
## Example 2: Wellness Brand (Gerwig + Zhao Hybrid)
|
|
877
|
+
|
|
878
|
+
> **Phase 1:** We're a longevity science company. We want warmth,
|
|
879
|
+
> approachability, and land-connection. Primary grammar: Greta Gerwig
|
|
880
|
+
> (`references/film-archetypes.md` Section 6). Accent grammar: Chloé Zhao
|
|
881
|
+
> (Section 7) for the landscape chapters. Output: `cinematic-audit.md`.
|
|
882
|
+
>
|
|
883
|
+
> **Phase 2:** Design a 5-chapter storyboard. Chapters: Welcome, Science,
|
|
884
|
+
> Nature, Product, Community. Use Pinned Hero for ch1, Editorial Longread
|
|
885
|
+
> for ch2, Parallax Gallery for ch3, Chaptered Release for ch4, Landing
|
|
886
|
+
> Sequence for ch5. Reference `references/scroll-patterns.md` Sections 1,
|
|
887
|
+
> 8, 6, 5, and 10. Output: `motion-storyboard.md`.
|
|
888
|
+
>
|
|
889
|
+
> **Phase 3:** Technical spec with warm palette progression (rose → peach →
|
|
890
|
+
> amber → sage → cream). GSAP + Lenis. Mobile: disable parallax below 768px,
|
|
891
|
+
> convert to stacked IntersectionObserver fades. Reference `performance-budget.md`
|
|
892
|
+
> Section 3 (Mobile Degradation Matrix). Output: `technical-spec.md`.
|
|
893
|
+
>
|
|
894
|
+
> **Phase 4:** Build Mode B. 5 chapters, organic editorial aesthetic.
|
|
895
|
+
> fal.ai for chapter images: `historicalLayer: 'atelier'`, painterly botanical
|
|
896
|
+
> subjects. Demo mode for first run. Output: project directory.
|
|
897
|
+
>
|
|
898
|
+
> **Phase 5:** Polish. Verify emotional arc matches Phase 1: welcome (warmth)
|
|
899
|
+
> → science (curiosity) → nature (awe) → product (trust) → community
|
|
900
|
+
> (belonging). Run 11-point checklist. Output: `polish-report.md`.
|
|
901
|
+
|
|
902
|
+
## Example 3: Sci-Fi Game Reveal (Nolan Grammar, Mode A)
|
|
903
|
+
|
|
904
|
+
> **Phase 1:** We're launching a sci-fi game expansion. We want cosmic scale,
|
|
905
|
+
> event-level drama, layered realities. Director: Christopher Nolan
|
|
906
|
+
> (`references/film-archetypes.md` Section 4). Audience: gamers, 70% desktop.
|
|
907
|
+
> Output: `cinematic-audit.md`.
|
|
908
|
+
>
|
|
909
|
+
> **Phase 2:** Design a 7-chapter storyboard. Chapters: Teaser, World, Lore,
|
|
910
|
+
> Characters, Gameplay, Release, CTA. Use Pinned Hero for ch1, Chaptered
|
|
911
|
+
> Release for ch2 and ch3, 3D Product Orbit for ch5, Landing Sequence for
|
|
912
|
+
> ch7. Reference `references/scroll-patterns.md` Sections 1, 5, 5, 7, and 10.
|
|
913
|
+
> Max 7 layers in ch2 (the deepest chapter). Output: `motion-storyboard.md`.
|
|
914
|
+
>
|
|
915
|
+
> **Phase 3:** Technical spec. Mode A output (single HTML). rAF-throttled
|
|
916
|
+
> scroll, no packages. 5-7 depth layers per chapter. 3D camera:
|
|
917
|
+
> `rotateX(±4deg)`, `translateZ(0 → -80px)`. Performance budget: all
|
|
918
|
+
> `transform` + `opacity` only, `will-change` on 3 elements max. Reference
|
|
919
|
+
> `performance-budget.md` Sections 1 and 2. Output: `technical-spec.md`.
|
|
920
|
+
>
|
|
921
|
+
> **Phase 4:** Build Mode A. Single self-contained HTML. Near-black backgrounds,
|
|
922
|
+
> deep teal and crimson accents, heavy grain overlay. 7 chapters, each pinned
|
|
923
|
+
> 200-300vh. Title reveals: mask wipe, word stagger, letter-spacing scrub,
|
|
924
|
+
> scale-down entrance — varied per chapter per `taste-guardrails.md` Section 4.5.
|
|
925
|
+
> Reduced-motion fallback: static compositions. Progress HUD included.
|
|
926
|
+
> Output: `index.html`.
|
|
927
|
+
>
|
|
928
|
+
> **Phase 5:** Polish the HTML. Verify: compositor-only scroll paths, < 5%
|
|
929
|
+
> dropped frames on 10s recording, reduced-motion shows all content, mobile
|
|
930
|
+
> <768px stacks with no pinning. No banned patterns from `taste-guardrails.md`
|
|
931
|
+
> Section 1. Output: `polish-report.md`.
|
|
932
|
+
|
|
933
|
+
---
|
|
934
|
+
|
|
935
|
+
# What's in the Box
|
|
936
|
+
|
|
937
|
+
```
|
|
938
|
+
cinematic-scroll-skill/
|
|
939
|
+
├── SKILL.md # Agent contract (5-phase pipeline) [this file]
|
|
940
|
+
├── taste-guardrails.md # Quality enforcement system (11 banned patterns,
|
|
941
|
+
│ # cinematic vocabulary, pacing rules,
|
|
942
|
+
│ # anti-convergence principles)
|
|
943
|
+
├── manifest.json # Skill manifest (v2.0.0)
|
|
944
|
+
├── MODELS.md # fal.ai model menu and cost table
|
|
945
|
+
├── README.md # Human-facing overview
|
|
946
|
+
├── LICENSE # MIT
|
|
947
|
+
├── references/
|
|
948
|
+
│ ├── scroll-patterns.md # 12 proven scroll patterns (Sections 1-12),
|
|
949
|
+
│ │ # each with use case, depth config, transition,
|
|
950
|
+
│ │ # mobile strategy, performance budget
|
|
951
|
+
│ ├── film-archetypes.md # 7 visual systems (Sections 1-7):
|
|
952
|
+
│ │ # Kubrick, Fincher, Anderson, Nolan,
|
|
953
|
+
│ │ # Villeneuve, Gerwig, Zhao — each with scroll
|
|
954
|
+
│ │ # behavior, color, pacing, type, depth, transitions
|
|
955
|
+
│ └── performance-budget.md # 60fps production contract:
|
|
956
|
+
│ # frame budget, permitted/forbidden properties,
|
|
957
|
+
│ # will-change strategy, mobile degradation matrix
|
|
958
|
+
│ # (4 tiers), benchmark targets, asset budgets,
|
|
959
|
+
│ # 11-point pre-launch monitoring checklist,
|
|
960
|
+
│ # GSAP-specific rules, failure modes
|
|
961
|
+
├── examples/
|
|
962
|
+
│ ├── PROMPTS.md # 20+ trigger prompts (Mode A and B)
|
|
963
|
+
│ ├── GETTING_STARTED.md # fal.ai setup walkthrough
|
|
964
|
+
│ └── KNOWN_ISSUES.md # QA log of known issues and fixes
|
|
965
|
+
├── templates/nextjs/ # Next.js App Router template:
|
|
966
|
+
│ # package.json, ChapterScene.tsx (7-layer scene),
|
|
967
|
+
│ # ChapterDemoVisual.tsx (CSS-only fallback),
|
|
968
|
+
│ # EditionsPage.tsx (orchestrator),
|
|
969
|
+
│ # fal proxy routes, fal client/lib/scripts,
|
|
970
|
+
│ # SmoothScrollProvider, use-device hooks,
|
|
971
|
+
│ # globals.css with fluid type scale,
|
|
972
|
+
│ # tailwind.config.ts, tsconfig.json
|
|
973
|
+
└── assets/ # Shared static assets
|
|
974
|
+
```
|
|
975
|
+
|
|
976
|
+
---
|
|
977
|
+
|
|
978
|
+
# Legal and Originality Rules
|
|
979
|
+
|
|
980
|
+
- Do not reproduce the Shopify logo, screenshots, copy, proprietary
|
|
981
|
+
illustrations, exact section design, or exact visual scene.
|
|
982
|
+
- Do not generate images that imitate a living artist by name.
|
|
983
|
+
- Do not bake readable UI copy into generated images unless the user
|
|
984
|
+
specifically asks and the target model supports reliable text.
|
|
985
|
+
- Build UI text, labels, nav, cards, numbers, and feature lists as HTML/CSS
|
|
986
|
+
so they remain editable, accessible, and crisp.
|
|
987
|
+
- Use references only as art-direction benchmarks — chaptered release
|
|
988
|
+
storytelling, not clone targets.
|
|
989
|
+
- If the user asks to clone a proprietary site exactly, respond by making
|
|
990
|
+
an original system that uses the reference as inspiration.
|
|
991
|
+
|
|
992
|
+
---
|
|
993
|
+
|
|
994
|
+
# Anti-Patterns
|
|
995
|
+
|
|
996
|
+
Do NOT use this skill for:
|
|
997
|
+
|
|
998
|
+
- "Build a basic hero + features + pricing landing page."
|
|
999
|
+
- "Generate a WordPress theme."
|
|
1000
|
+
- Ordinary SaaS landing pages, CRUD dashboards, or simple brochure sites
|
|
1001
|
+
— unless the user explicitly asks for a cinematic / editorial treatment.
|
|
1002
|
+
- "Regenerate all templates from scratch without reading bundled files."
|
|
1003
|
+
- "Give me motion ideas only, no code." (The skill must output runnable artifacts.)
|