dsh-hyperframes 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 (66) hide show
  1. package/README.en.md +35 -0
  2. package/README.md +35 -0
  3. package/cordis.patch.yml +7 -0
  4. package/lib/index.d.ts +35 -0
  5. package/lib/index.js +74 -0
  6. package/package.json +63 -0
  7. package/skills/gsap/SKILL.md +213 -0
  8. package/skills/gsap/references/effects.md +297 -0
  9. package/skills/gsap/scripts/extract-audio-data.py +188 -0
  10. package/skills/hyperframes/SKILL.md +366 -0
  11. package/skills/hyperframes/data-in-motion.md +19 -0
  12. package/skills/hyperframes/house-style.md +71 -0
  13. package/skills/hyperframes/palettes/bold-energetic.md +14 -0
  14. package/skills/hyperframes/palettes/clean-corporate.md +14 -0
  15. package/skills/hyperframes/palettes/dark-premium.md +14 -0
  16. package/skills/hyperframes/palettes/jewel-rich.md +14 -0
  17. package/skills/hyperframes/palettes/monochrome.md +14 -0
  18. package/skills/hyperframes/palettes/nature-earth.md +14 -0
  19. package/skills/hyperframes/palettes/neon-electric.md +14 -0
  20. package/skills/hyperframes/palettes/pastel-soft.md +14 -0
  21. package/skills/hyperframes/palettes/warm-editorial.md +14 -0
  22. package/skills/hyperframes/patterns.md +118 -0
  23. package/skills/hyperframes/references/audio-reactive.md +76 -0
  24. package/skills/hyperframes/references/captions.md +132 -0
  25. package/skills/hyperframes/references/css-patterns.md +373 -0
  26. package/skills/hyperframes/references/dynamic-techniques.md +90 -0
  27. package/skills/hyperframes/references/motion-principles.md +69 -0
  28. package/skills/hyperframes/references/transcript-guide.md +151 -0
  29. package/skills/hyperframes/references/transitions/catalog.md +117 -0
  30. package/skills/hyperframes/references/transitions/css-3d.md +12 -0
  31. package/skills/hyperframes/references/transitions/css-blur.md +51 -0
  32. package/skills/hyperframes/references/transitions/css-cover.md +43 -0
  33. package/skills/hyperframes/references/transitions/css-destruction.md +95 -0
  34. package/skills/hyperframes/references/transitions/css-dissolve.md +66 -0
  35. package/skills/hyperframes/references/transitions/css-distortion.md +45 -0
  36. package/skills/hyperframes/references/transitions/css-grid.md +10 -0
  37. package/skills/hyperframes/references/transitions/css-light.md +49 -0
  38. package/skills/hyperframes/references/transitions/css-mechanical.md +30 -0
  39. package/skills/hyperframes/references/transitions/css-other.md +25 -0
  40. package/skills/hyperframes/references/transitions/css-push.md +41 -0
  41. package/skills/hyperframes/references/transitions/css-radial.md +37 -0
  42. package/skills/hyperframes/references/transitions/css-scale.md +24 -0
  43. package/skills/hyperframes/references/transitions.md +112 -0
  44. package/skills/hyperframes/references/tts.md +75 -0
  45. package/skills/hyperframes/references/typography.md +175 -0
  46. package/skills/hyperframes/scripts/animation-map.mjs +596 -0
  47. package/skills/hyperframes/scripts/contrast-report.mjs +335 -0
  48. package/skills/hyperframes/visual-styles.md +211 -0
  49. package/skills/hyperframes-cli/SKILL.md +152 -0
  50. package/skills/hyperframes-registry/SKILL.md +106 -0
  51. package/skills/hyperframes-registry/examples/add-block.md +51 -0
  52. package/skills/hyperframes-registry/examples/add-component.md +73 -0
  53. package/skills/hyperframes-registry/references/demo-html-pattern.md +54 -0
  54. package/skills/hyperframes-registry/references/discovery.md +53 -0
  55. package/skills/hyperframes-registry/references/install-locations.md +45 -0
  56. package/skills/hyperframes-registry/references/wiring-blocks.md +91 -0
  57. package/skills/hyperframes-registry/references/wiring-components.md +77 -0
  58. package/skills/website-to-hyperframes/SKILL.md +125 -0
  59. package/skills/website-to-hyperframes/references/step-1-capture.md +74 -0
  60. package/skills/website-to-hyperframes/references/step-2-design.md +178 -0
  61. package/skills/website-to-hyperframes/references/step-3-script.md +96 -0
  62. package/skills/website-to-hyperframes/references/step-4-storyboard.md +246 -0
  63. package/skills/website-to-hyperframes/references/step-5-vo.md +42 -0
  64. package/skills/website-to-hyperframes/references/step-6-build.md +229 -0
  65. package/skills/website-to-hyperframes/references/step-7-validate.md +114 -0
  66. package/skills/website-to-hyperframes/references/techniques.md +387 -0
@@ -0,0 +1,246 @@
1
+ # Step 4: Write the Storyboard
2
+
3
+ **Before writing anything, fully re-read these files:**
4
+
5
+ - **DESIGN.md** — your color palette, font rules, components, Do's/Don'ts. Every creative decision must be grounded in this brand identity. If it says "white backgrounds with purple accent" — plan light scenes, not dark moody ones.
6
+ - **`capture/extracted/asset-descriptions.md`** — read EVERY line. This is your menu of available visuals. Each line describes what the image actually shows (e.g., "translucent ribbons in orange, pink, and purple on white background" or "a high-speed train under a dark starry sky"). Use these descriptions to decide which assets belong in which beat. Assets you don't understand from the description — view them directly before assigning.
7
+ - **[techniques.md](techniques.md)** — 11 visual techniques (SVG path drawing, Canvas 2D art, CSS 3D, per-word typography, Lottie, video compositing, typing effect, variable fonts, MotionPath, velocity transitions, audio-reactive). Pick 2-3 per beat and specify them in the storyboard.
8
+
9
+ The storyboard is the creative north star. It tells the engineer exactly what to build for each beat — mood, camera, animations, transitions, assets, sound. Write it as if you're briefing a motion designer who's never seen the website.
10
+
11
+ Save as `STORYBOARD.md` in the project directory.
12
+
13
+ ---
14
+
15
+ ## Global Direction
16
+
17
+ Every STORYBOARD.md starts with global settings:
18
+
19
+ ```markdown
20
+ **Format:** 1920×1080
21
+ **Audio:** [TTS provider] voiceover + underscore + SFX
22
+ **VO direction:** [voice character — e.g., "mid-age male, calm confident delivery,
23
+ Apple keynote register — economy of words, silence between sentences is a feature"]
24
+ **Style basis:** DESIGN.md (brand colors, fonts, components from the captured site)
25
+ ```
26
+
27
+ **Global guardrails** (adapt to the brand):
28
+
29
+ - Push color presence. Muted is fine, flat is not. Every beat should have at least one color that pulls your eye.
30
+ - Motion should be visible and intentional. Err toward more movement than feels safe — subtle reads as static at 30fps.
31
+ - Use as many captured assets as the creative vision allows. Scatter framework icons around a dashboard. Layer enterprise photos behind stats. Use product screenshots as floating cards. The assets exist — use them generously.
32
+ - Aim for 8-10 visual elements per beat, not 2-3. A great beat has: background texture, midground content, foreground accents, floating decorative elements, animated icons, SVG path drawings, particle effects, typographic details. It should feel DENSE and alive.
33
+ - Use at least 2-3 different techniques from techniques.md per beat — not across the whole video, per beat. Don't default to basic fade/scale/opacity — mix in SVG path drawing, CSS 3D transforms, typing effects, counter animations, canvas procedural art. Each beat should feel like its own visual world.
34
+
35
+ **Underscore/music direction** (if applicable):
36
+
37
+ - Describe the mood, reference artists, when it swells or drops
38
+ - Example: "Minimal electronic. Warm sustained pad already playing when the video starts. Sits underneath everything, never competing with VO. Swells gently during the flex section, drops to near-nothing for the comparison, resolves on a final chord."
39
+
40
+ ---
41
+
42
+ ## Asset Audit
43
+
44
+ Before writing any beats, audit every captured asset. Print this table:
45
+
46
+ | Asset | Type | Assign to Beat | Role |
47
+ | ------------------------------ | ---------- | -------------- | ------------------------------------- |
48
+ | wave-fallback-desktop.png | Hero image | Beat 1 | Full-bleed animated background |
49
+ | enterprise-accordion-hertz.png | Photo | Beat 3 | Enterprise credibility, Ken Burns pan |
50
+ | stripe-logo.svg | SVG | Beat 1, Beat 5 | Brand mark opener + closer |
51
+ | datavizstatic3x.png | Data viz | Beat 3 | Supporting visual behind stats |
52
+ | icon-3.svg | Icon | SKIP | Decorative, too small |
53
+
54
+ **Minimum utilization:**
55
+
56
+ - At least 50% of product screenshots and hero images must appear
57
+ - Brand logo appears in the first AND last beat
58
+ - The site's signature visual (gradient wave, hero illustration, key product UI) must appear — it's the most recognizable brand element
59
+ - Maximum 2 consecutive text-only beats. The 3rd must contain a visual asset
60
+ - Opening beat must contain a visual asset, not text-only
61
+
62
+ ---
63
+
64
+ ## Per-Beat Direction
65
+
66
+ Each beat is a WORLD, not a layout. Before writing CSS specs and GSAP instructions, describe what the viewer EXPERIENCES. The difference between a great storyboard and a mediocre one:
67
+
68
+ **Mediocre:** "Dark navy background. '$1.9T' in white, 280px. Logo top-left. Wave image bottom-right."
69
+ **Great:** "Camera is already mid-flight over a vast dark canvas. The gradient wave sweeps across the frame like aurora borealis — alive, shifting. '$1.9T' SLAMS into existence with such force the wave ripples in response. This isn't a slide — it's a moment."
70
+
71
+ The first describes pixels. The second describes an experience. Write the second, then figure out the pixels.
72
+
73
+ Each beat should have:
74
+
75
+ ### Concept
76
+
77
+ The big idea for this beat in 2-3 sentences. What visual WORLD are we in? What metaphor drives it? What should the viewer FEEL? This is the most important part — everything else flows from it.
78
+
79
+ ### VO cue
80
+
81
+ Which narration line plays over this beat.
82
+
83
+ ### Visual description
84
+
85
+ What the viewer sees — described cinematically, not as CSS specs. Use camera language (pan, zoom, drift, settle). Describe at least 5 visual elements, not just text + background. Think in layers — what's moving in the foreground, midground, background simultaneously?
86
+
87
+ ### Mood direction
88
+
89
+ Cultural and design references, not hex codes:
90
+
91
+ - "Geometric, rhythmic, precise. Think Josef Albers or Bauhaus color studies."
92
+ - "Warm workspace. Nice notebook energy, not technical blueprint."
93
+ - "Cinematic title sequence. The kind of opening where you lean forward."
94
+
95
+ ### Assets
96
+
97
+ Which captured files to use, referenced by filename:
98
+
99
+ - "Background: `capture/assets/wave-fallback-desktop.png` — full-bleed, slow zoom 1→1.04 over beat duration"
100
+ - "Logo: `capture/assets/svgs/stripe-logo.svg` — centered, fades in at 0.5s"
101
+ - "Enterprise photo: `capture/assets/enterprise-accordion-hertz.png` — Ken Burns pan, 70% opacity overlay"
102
+
103
+ ### Animation choreography
104
+
105
+ Specific motion verbs per element — not "it animates in" but HOW:
106
+
107
+ | Energy | Verbs | Example |
108
+ | ------------- | --------------------------------------------- | ------------------------------------- |
109
+ | High impact | SLAMS, CRASHES, PUNCHES, STAMPS, SHATTERS | "$1.9T" SLAMS in from left at -5° |
110
+ | Medium energy | CASCADE, SLIDES, DROPS, FILLS, DRAWS | Three cards CASCADE in staggered 0.3s |
111
+ | Low energy | types on, FLOATS, morphs, COUNTS UP, fades in | Counter COUNTS UP from 0 to 135K |
112
+
113
+ Every element gets a verb. If you can't name the verb, the element is not yet designed.
114
+
115
+ ### Transition
116
+
117
+ How this beat hands off to the next. Specify the type and parameters.
118
+
119
+ **When to pick which:**
120
+
121
+ | Choose shader transition for | Choose CSS transition for | Choose hard cut for |
122
+ | ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------- |
123
+ | Reveals, big reaction shots, product/logo unveils, energy shifts, "wow" moments | Continuous camera-motion beats where the scene feels like one move broken into cuts | Rapid-fire lists, percussive edits on the beat, comedic timing |
124
+ | Any moment the music/VO punctuates with a downbeat or SFX hit | Beats that ease from one composition into the next with shared motion vocabulary | Sequences of 3+ quick tempo-matched switches |
125
+ | Brand moments where the transition itself _is_ the visual | Minimal/editorial pacing | Anytime a 0.3-0.8s transition would feel too slow |
126
+
127
+ Rule of thumb: if the beat is the _centerpiece_ of the video, shader-transition into it. If the beat is connective tissue, CSS-transition. A brand reel of 5-7 beats usually wants 1-2 shader transitions (the hero reveal + the CTA) and the rest CSS or hard cuts — too many shader transitions flatten their impact.
128
+
129
+ **CSS transitions** (choose from `skills/hyperframes/references/transitions/catalog.md`):
130
+
131
+ - Velocity-matched upward: exit `y:-150, blur:30px, 0.33s power2.in` → entry `y:150→0, blur:30px→0, 1.0s power2.out`
132
+ - Whip pan: exit `x:-400, blur:24px, 0.3s power3.in` → entry `x:400→0, blur:24px→0, 0.3s power3.out`
133
+ - Blur through: exit `blur:20px, 0.3s` → entry `blur:20px→0, 0.25s power3.out`
134
+ - Zoom through: exit `scale:1→1.2, blur:20px, 0.2s power3.in` → entry `scale:0.75→1, blur:20px→0, 0.5s expo.out`
135
+ - Hard cut / smash cut (for rapid-fire sequences)
136
+
137
+ **Shader transitions** (choose from `packages/shader-transitions/README.md`):
138
+
139
+ - Cross-Warp Morph (organic, versatile) — 0.5-0.8s, power2.inOut
140
+ - Cinematic Zoom (professional momentum) — 0.4-0.6s, power2.inOut
141
+ - Gravitational Lens (otherworldly) — 0.6-1.0s, power2.inOut
142
+ - Glitch (aggressive, high energy) — 0.3-0.5s
143
+ - See `packages/shader-transitions/README.md` for the full API, available shaders, and setup
144
+
145
+ **How velocity-matched CSS transitions work:**
146
+ Exit the outgoing beat with an accelerating ease (power2.in or power3.in) plus a blur ramp. Enter the incoming beat with a decelerating ease (power2.out or power3.out) plus blur clear. The fastest point of both easing curves meets at the cut — the viewer perceives continuous camera motion, not two discrete animations. Match exit velocity to entry velocity within ~5% tolerance.
147
+
148
+ ### Depth layers
149
+
150
+ What's in foreground, midground, and background. Every beat should have at least 2 layers:
151
+
152
+ - "BG: dark navy fill + subtle radial glow. MG: stat cards with drop shadow. FG: brand logo bottom-right."
153
+
154
+ ### SFX cues
155
+
156
+ What sounds at what moment:
157
+
158
+ - "On the capture pulse — a soft, warm analog shutter click."
159
+ - "Left side carries a faint low drone. On fold: drone cuts. Silence. Then a single clean chime."
160
+
161
+ ---
162
+
163
+ ## Production Architecture
164
+
165
+ Include this file tree at the bottom of the storyboard:
166
+
167
+ ```
168
+ project/
169
+ ├── index.html root — VO + underscore + beat orchestration
170
+ ├── DESIGN.md brand reference (from Step 2)
171
+ ├── SCRIPT.md narration text (from Step 3)
172
+ ├── STORYBOARD.md THIS FILE — creative north star
173
+ ├── transcript.json word-level timestamps (from Step 5)
174
+ ├── narration.wav TTS audio (from Step 5)
175
+ ├── capture/ captured website data (from Step 1)
176
+ │ ├── screenshots/
177
+ │ ├── assets/
178
+ │ │ ├── svgs/
179
+ │ │ ├── fonts/
180
+ │ │ ├── lottie/
181
+ │ │ └── videos/
182
+ │ ├── extracted/
183
+ │ │ ├── tokens.json
184
+ │ │ ├── visible-text.txt
185
+ │ │ ├── asset-descriptions.md
186
+ │ │ ├── animations.json
187
+ │ │ ├── assets-catalog.json
188
+ │ │ └── detected-libraries.json
189
+ │ └── AGENTS.md
190
+ └── compositions/
191
+ ├── beat-1-hook.html
192
+ ├── beat-2-features.html
193
+ ├── ...
194
+ └── captions.html
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Example: Beat-by-Beat Format
200
+
201
+ Here are three beats from a production storyboard showing the level of detail expected.
202
+
203
+ ### BEAT 1 — COLD OPEN (0:00–0:05)
204
+
205
+ **VO:** "Your AI agent already knows how to make videos."
206
+
207
+ **Concept:** We're already in motion when the video starts. No title card, no fade from black. We're mid-flight over an infinite creative workspace — dozens of living compositions scattered below us like a city seen from a drone. Each one is alive, running a different animation. The message is clear before any words: this tool makes videos. Lots of them.
208
+
209
+ **Visual:** Slow smooth diagonal drift over a vast canvas (3600×2200px plane). Scattered across it: 25 composition cards at organic angles (±5-15° rotation), soft shadows, thin borders. Each card contains a DIFFERENT running animation — kinetic type, gradient morph, data viz, particle system, logo assembly, SVG drawing, shader noise, 3D rotating object. Depth-of-field: close cards slightly blurred, focal sweet-spot in mid-distance, far cards smaller and desaturated.
210
+
211
+ **Camera:** Diagonal drift top-left to bottom-right, slight 2-3° rotation over 5s. power1.inOut ease. Zoom accelerates in final second as we approach one specific card.
212
+
213
+ **Assets:** Product screenshots and logo on cards. Each card is a mini-composition with its own animation.
214
+
215
+ **SFX:** Ambient warmth pad already playing. Faint textured hum — overhearing creative activity from a distance.
216
+
217
+ ---
218
+
219
+ ### BEAT 5 — THE THESIS (0:20–0:24)
220
+
221
+ **VO:** "Anything a browser can render can be a frame in your video."
222
+
223
+ **Mood:** Big statement. This sentence gets its own canvas. Clean, spacious, typographic.
224
+
225
+ **Visual:** Words appear as staggered kinetic typography. "Anything a browser can render" — distinctive serif, gentle fade + rise (y: 24px → 0, opacity 0 → 1, 0.4s, power2.out). Held beat — one second of stillness. "can be a frame in your video." appears below. As the final word lands, the entire text pulses once — a brief warm flash, subtle scale bump to 101%.
226
+
227
+ **Transition OUT:** Whip pan left — x:-400, blur:24px, opacity:0.4, 0.3s power3.in
228
+
229
+ **SFX:** Silence under the first line. On the capture pulse — a soft analog shutter click.
230
+
231
+ ---
232
+
233
+ ### BEAT 7 — THE CONTRAST (0:38–0:44)
234
+
235
+ **VO:** "No new framework for the agent to learn. Just HTML."
236
+
237
+ **Mood:** Clean comparison. Light base. Two worlds side by side.
238
+
239
+ **Visual:** Left half: dense code, small, compressed, overwhelming. Scrolls slowly upward. Slightly desaturated. Right half: spacious HTML, syntax-highlighted, generous line spacing, inviting. On "Just HTML." — the left side folds inward along its center line, like a book closing. The right side expands to fill the frame. Warm glow rises behind it.
240
+
241
+ **Transition IN:** Zoom through — scale 0.75→1, blur 20px→0, 0.5s expo.out
242
+ **Transition OUT:** Velocity-matched upward — y:-150, blur:30px, 0.33s power2.in
243
+
244
+ **Assets:** Real framework code on the left (actual content, not lorem ipsum). Real HyperFrames HTML on the right.
245
+
246
+ **SFX:** Left side carries a faint low drone. On fold: drone cuts. Silence. Then a single clean chime as the right side expands.
@@ -0,0 +1,42 @@
1
+ # Step 5: Generate VO + Map Timing
2
+
3
+ ## Audition voices
4
+
5
+ Never use the first voice you find. Audition 2-3 voices with the first sentence of SCRIPT.md:
6
+
7
+ - **Kokoro** (try first — free, no API key) — `npx hyperframes tts SCRIPT.md --voice af_nova --output narration.wav`. Runs locally on CPU. Requires Python 3.10+ (macOS system Python 3.9 won't work — if it fails with an onnxruntime error, move to the next option).
8
+ - **ElevenLabs** (best voice quality, widest selection) — `mcp__elevenlabs__search_voices` to browse, `mcp__elevenlabs__text_to_speech` to generate. Does not return timestamps — transcribe separately after.
9
+ - **HeyGen TTS** (returns word timestamps automatically — saves a transcribe step) — `mcp__claude_ai_HeyGen__text_to_speech`. Use when you want timestamps without a separate transcription pass.
10
+
11
+ Pick the voice that sounds most natural and conversational. Listen for pacing — does it breathe between sentences? Does it sound like a person or a robot?
12
+
13
+ ## Generate full narration
14
+
15
+ Generate the full script as `narration.wav` (or `.mp3`) in the project directory.
16
+
17
+ **Also save the exact spoken text** — with pronunciation substitutions applied (e.g., `API` → `A P I`, `$2T` → `two trillion`) — as `narration.txt` in the same directory. This is the string passed to TTS, distinct from `SCRIPT.md` which is the human-readable creative doc. Having `narration.txt` makes it trivial to regenerate the audio later with a different voice without re-deriving the substitutions. Name it exactly `narration.txt`.
18
+
19
+ ## Transcribe for word-level timestamps
20
+
21
+ ```bash
22
+ npx hyperframes transcribe narration.wav
23
+ ```
24
+
25
+ Produces `transcript.json` with `[{ text, start, end }]` for every word. These timestamps are the source of truth for all beat durations.
26
+
27
+ ## Map timestamps to beats
28
+
29
+ Go through STORYBOARD.md beat by beat. For each beat:
30
+
31
+ 1. Find the first word of that beat's VO cue in `transcript.json`
32
+ 2. Find the last word of that beat's VO cue
33
+ 3. Set `beat.start = firstWord.start`, `beat.end = lastWord.end`
34
+ 4. Add 0.3-0.5s padding at the end for visual breathing room
35
+
36
+ Update STORYBOARD.md with real durations. Replace estimated times (e.g., "0:00-0:05") with actual timestamps (e.g., "0.00-3.21s").
37
+
38
+ Beat boundaries land on word onsets — hard cuts to the VO.
39
+
40
+ ## Update index.html
41
+
42
+ Update each scene slot's `data-start` and `data-duration` to match the real beat timings from the transcript. Also update the total composition duration and audio element duration.
@@ -0,0 +1,229 @@
1
+ # Step 6: Build Compositions
2
+
3
+ **Before building, fully re-read these files:**
4
+
5
+ - **DESIGN.md** — your color palette, fonts, components, and Do's/Don'ts. Every composition must use EXACT hex colors and font families from this file. If it says "white backgrounds" — use white, not dark.
6
+ - **STORYBOARD.md** — the beat-by-beat plan you're executing. Each beat specifies assets, animations, transitions, and which techniques to use.
7
+ - **`capture/extracted/asset-descriptions.md`** — when the storyboard assigns an asset to a beat, re-read the description to understand what it shows and how to position/style it correctly.
8
+ - **[techniques.md](techniques.md)** — code patterns for the 10 visual techniques. When the storyboard says "SVG path drawing" or "per-word kinetic typography" — read the code pattern from this file and adapt it.
9
+ - **transcript.json** — word-level timestamps that drive scene durations.
10
+
11
+ **Split the work: spawn a sub-agent for each beat.** By this step your context is full of captured data, DESIGN.md, SCRIPT, STORYBOARD, and transcript. Building compositions on top of all that means the detailed rules below compete with thousands of tokens of prior work. Each sub-agent gets a fresh context focused on one beat — dramatically better output.
12
+
13
+ **How to dispatch each sub-agent:**
14
+
15
+ Pass file PATHS, not file contents. The #1 failure mode is reading an asset file and pasting its SVG/image data into the sub-agent prompt. The sub-agent then uses inline content instead of referencing the file on disk. Same with fonts — pass the local woff2 path, don't substitute Google Fonts.
16
+
17
+ ```
18
+ Build the composition for beat 1. Save to compositions/beat-1-hook.html.
19
+
20
+ STORYBOARD for this beat:
21
+ [paste the beat section from STORYBOARD.md]
22
+
23
+ ASSETS — reference by path, do NOT read/inline the file contents:
24
+ - Logo: <img src="../capture/assets/favicon.svg"> (top-left, 40x40px)
25
+ - Hero image: <img src="../capture/assets/hero-bg.png"> (full-bleed background)
26
+ - Noise texture: ../capture/assets/noise.png (full-frame overlay, 3% opacity)
27
+
28
+ FONTS — use @font-face with the captured font files, NOT Google Fonts:
29
+ @font-face { font-family: 'BrandFont'; src: url('../capture/assets/fonts/BrandFont-Regular.woff2'); }
30
+
31
+ Read DESIGN.md for exact colors and Do's/Don'ts.
32
+ Read techniques.md for animation code patterns.
33
+ Load the `hyperframes` skill for composition structure rules.
34
+ ```
35
+
36
+ After each sub-agent finishes, verify the composition references `../capture/assets/` — if it used inline SVGs or Google Fonts instead of the captured files, fix it before moving on.
37
+
38
+ Load the `hyperframes` skill first — it has the rules for data attributes, timeline contracts, deterministic rendering, and layout. Everything below supplements those rules, not replaces them.
39
+
40
+ ---
41
+
42
+ ## Per-Composition Process
43
+
44
+ For each beat in the storyboard:
45
+
46
+ ### 1. Read the beat's storyboard section
47
+
48
+ Know the mood, visual description, assets, animation choreography, transition, and SFX before writing any HTML.
49
+
50
+ ### 2. Build the static end-state first
51
+
52
+ Position every element where it should be at its **most visible moment** — the frame where everything is fully entered and correctly placed. Write this as static HTML+CSS. No GSAP yet.
53
+
54
+ This is the "Layout Before Animation" principle from the compose skill. The CSS position is the ground truth. Animations describe the journey to and from it.
55
+
56
+ ### 3. Verify the static layout
57
+
58
+ Look at it. Check:
59
+
60
+ - Are elements where the storyboard says they should be?
61
+ - Are depth layers present (foreground / midground / background)?
62
+ - Do any elements overlap unintentionally?
63
+ - Are assets sized correctly? (hero images should fill 50-70% of frame, not sit at 100x100px)
64
+
65
+ ### 4. Add entrance animations
66
+
67
+ Use `gsap.from()` — animate FROM offscreen/invisible TO the CSS position. The CSS position is where the element ends up.
68
+
69
+ ### 5. Add mid-scene activity
70
+
71
+ Every visible element must have continuous motion. A still image on a still background is a JPEG with a progress bar.
72
+
73
+ | Element type | Mid-scene activity |
74
+ | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
75
+ | Image / screenshot | Slow zoom (scale 1→1.03), slow pan, or Ken Burns |
76
+ | Stat / number | Counter animates from 0 to target |
77
+ | Logo grid | Subtle shimmer sweep, or gentle scale pulse |
78
+ | Any persistent element | Subtle float (y ±4-6px, sine.inOut, yoyo) |
79
+ | Logo / CTA (with music or dramatic VO) | Audio-reactive scale/glow — bass pulses the logo (3–4%), treble glows the CTA. See technique #11 in `techniques.md` for the sampling pattern |
80
+
81
+ ### 6. Add exit / transition
82
+
83
+ Check the storyboard's transition specification for this beat:
84
+
85
+ - **CSS transition**: implement the exit animation (e.g., `y:-150, blur:30px, 0.33s power2.in`). The next composition handles its own entry.
86
+ - **Shader transition**: no exit animation needed — the shader handles the blend. Read `packages/shader-transitions/README.md` for the API, available shaders, and setup. The package handles WebGL init, capture, and GSAP integration — do not copy raw GLSL manually.
87
+ - **Hard cut**: no exit animation. The scene simply ends.
88
+
89
+ For all CSS transition types and their GSAP implementations, read `skills/hyperframes/references/transitions/catalog.md`.
90
+
91
+ ### 7. Asset cross-reference
92
+
93
+ Before self-review, verify you actually used the assets you planned to:
94
+
95
+ 1. Open STORYBOARD.md and find this beat's asset assignments
96
+ 2. List every asset that was assigned to this beat
97
+ 3. Search the composition HTML for each filename (e.g., grep for "wave-fallback-desktop")
98
+ 4. If any assigned asset is missing from the HTML, add it now
99
+ 5. Check for the inline anti-pattern: if the HTML contains `<svg xmlns=` or `data:image/` but no `../capture/assets/` references, the assets were inlined instead of referenced. Replace inline content with `<img src="../capture/assets/filename.svg">`
100
+ 6. Check fonts: if the HTML uses `fonts.googleapis.com` but there are captured fonts in `capture/assets/fonts/`, replace with `@font-face` pointing to the local files (e.g., `src: url('../capture/assets/fonts/BrandFont-Regular.woff2')`)
101
+
102
+ This step catches the two most common failures: compositions ending up text-only, and assets being inlined instead of file-referenced.
103
+
104
+ ### 8. Self-review
105
+
106
+ After building the composition, check WITH ACTUAL CODE:
107
+
108
+ - [ ] Asset cross-reference passed (step 7 above — every assigned asset is in the HTML)
109
+ - [ ] Elements are where the storyboard says they should be (no misplacement)
110
+ - [ ] No overlapping text (text covering text is always ugly)
111
+ - [ ] Depth layers present (2+ layers minimum)
112
+ - [ ] Every visible element has mid-scene activity (not just entrance + exit)
113
+ - [ ] Font sizes above minimum (20px body text, 16px labels — sub-14px is unreadable after encoding)
114
+ - [ ] No full-screen dark linear gradients (H.264 creates visible banding — use solid + localized radial glows)
115
+ - [ ] Timeline registered: `window.__timelines["comp-id"] = tl`
116
+ - [ ] Colors match DESIGN.md exactly (paste the HEX value, don't approximate)
117
+ - [ ] **Every `<template>` root element** — not just `index.html`, but every sub-composition's root — has `data-start="0"`. The linter warns `root_composition_missing_data_start` when missing. Authoring `data-duration="<beat_seconds>"` on the root is also recommended for compositions whose GSAP timeline uses repeating animations (`repeat: -1` or large `repeat: N`); without it the runtime may infer `Infinity` and stall playback. The linter flags those repeating shapes directly via `gsap_infinite_repeat` and `gsap_repeat_ceil_overshoot`.
118
+ - [ ] **Caption exits have a hard kill.** If you animate captions out with `tl.to(groupEl, { opacity: 0 }, group.end)`, follow it with `tl.set(groupEl, { opacity: 0, visibility: "hidden" }, group.end)` as a deterministic kill — per-word karaoke tweens can override the exit tween and leave captions stuck on screen. Linter: `caption_exit_missing_hard_kill`.
119
+ - [ ] **No duplicate media nodes.** If the same image/video source is referenced twice with identical `data-start` + `data-duration`, the compiler discovers it twice and can double-render. Dedupe by using a single `<img>` with appropriate z-layering, or stagger the `data-start` values. Linter: `duplicate_media_discovery_risk`.
120
+
121
+ **If `skills/hyperframes-animation-map/` is installed**, run it:
122
+
123
+ ```bash
124
+ node skills/hyperframes-animation-map/scripts/animation-map.mjs <composition-dir>
125
+ ```
126
+
127
+ Read the summaries. Fix every flag: offscreen, collision, invisible, pacing issues.
128
+
129
+ ### 9. Move to the next composition
130
+
131
+ ---
132
+
133
+ ## Asset Presentation
134
+
135
+ Never embed a raw flat image. Every image must have motion treatment:
136
+
137
+ - **Perspective tilt**: use `gsap.set(el, { transformPerspective: 1200, rotationY: -8 })` + `box-shadow` — creates depth. Do NOT use CSS `transform: perspective(...)` as GSAP will overwrite it.
138
+ - **Slow zoom (Ken Burns)**: GSAP `scale: 1` → `1.04` over beat duration — makes photos cinematic
139
+ - **Device frame**: Wrap in a laptop/phone shape using CSS `border-radius` and `box-shadow`
140
+ - **Floating UI**: Extract a key element and animate it at a different z-depth for parallax
141
+ - **Scroll reveal**: Clip the image to a viewport window and animate `y` position
142
+
143
+ ---
144
+
145
+ ## Audio Wiring
146
+
147
+ In the root `index.html`:
148
+
149
+ - **Narration**: `<audio id="narration" src="narration.wav" data-start="0" data-duration="..." data-track-index="0" data-volume="1">`
150
+ - **Underscore/music** (if storyboard specifies): `<audio id="underscore" src="underscore.mp3" data-start="0" data-duration="..." data-track-index="3" data-volume="0.15">`
151
+ - **SFX** (if storyboard specifies): individual `<audio>` elements at specific `data-start` timestamps
152
+ - **Captions** (optional — only if user requests): sub-composition on a parallel track. Skip unless explicitly asked for.
153
+
154
+ ---
155
+
156
+ ## Critical Rules
157
+
158
+ These exist because the capture engine is deterministic. Violations produce broken output.
159
+
160
+ - **No `repeat: -1`** — calculate exact repeats from beat duration
161
+ - **No `Math.random()`** — use a seeded PRNG (mulberry32)
162
+ - **Register every timeline**: `window.__timelines["comp-id"] = tl`
163
+ - **Synchronous timeline construction** — no async/await wrapping timeline code
164
+ - **Never use ANY CSS `transform` for centering** — not `translate(-50%, -50%)`, not `translateX(-50%)`, not `translateY(-50%)`. GSAP animates the `transform` property, which overwrites ALL CSS transforms including centering. The element flies offscreen. Use flexbox centering instead: `display:flex; align-items:center; justify-content:center` on a wrapper div. The linter catches this (`gsap_css_transform_conflict`) but only if you run it.
165
+ - **Minimum font sizes**: 20px body, 16px labels
166
+ - **No full-screen dark linear gradients** — H.264 banding
167
+
168
+ ---
169
+
170
+ ## Load-bearing rules for animation authoring
171
+
172
+ Rules below came out of two independent website-to-hyperframes builds (2026-04-20) where compositions lint-clean and still ship broken — elements that never appear, ambient motion that doesn't scrub, entrance tweens that silently kill their target. The linter cannot catch these; the rules must be followed by the author.
173
+
174
+ - **No iframes for captured content.** Iframes do not seek deterministically with the timeline — the capture engine cannot scrub inside them, so they appear frozen (or blank) in the rendered output. If the source you're stylizing is a live web app, use the screenshots from `capture/` as stacked panels or layered images, not live embeds.
175
+
176
+ - **Never stack two transform tweens on the same element.** A common failure: a `y` entrance plus a `scale` Ken Burns on the same `<img>`. The second tween's `immediateRender: true` writes the element's initial state at construction time, overwriting whatever the first tween set — leaving the element invisible or offscreen with no lint warning. A secondary mechanism: `tl.from()` resets to its declared "from" state when the playhead is seeked past the timeline's end, so an element that looked correct in linear playback vanishes in the capture engine's non-linear seek. Fix one of two ways:
177
+
178
+ ```html
179
+ <!-- BAD: two transforms on one element -->
180
+ <img class="hero" src="..." />
181
+ <script>
182
+ tl.from(".hero", { y: 50, opacity: 0, duration: 0.6 }, 0);
183
+ tl.to(".hero", { scale: 1.04, duration: beat }, 0); // kills the entrance
184
+ </script>
185
+
186
+ <!-- GOOD option A: combine into one tween -->
187
+ <script>
188
+ tl.fromTo(
189
+ ".hero",
190
+ { y: 50, opacity: 0, scale: 1.0 },
191
+ { y: 0, opacity: 1, scale: 1.04, duration: beat, ease: "none" },
192
+ 0,
193
+ );
194
+ </script>
195
+
196
+ <!-- GOOD option B: split across parent + child -->
197
+ <div class="hero-wrap"><img class="hero" src="..." /></div>
198
+ <script>
199
+ tl.from(".hero-wrap", { y: 50, opacity: 0, duration: 0.6 }, 0); // entrance on parent
200
+ tl.to(".hero", { scale: 1.04, duration: beat }, 0); // Ken Burns on child
201
+ </script>
202
+ ```
203
+
204
+ - **Prefer `tl.fromTo()` over `tl.from()` inside `.clip` scenes.** `gsap.from()` sets `immediateRender: true` by default, which writes the "from" state at timeline construction — before the `.clip` scene's `data-start` is active. Elements can flash visible, start from the wrong position, or skip their entrance entirely when the scene is seeked non-linearly (which the capture engine does). Explicit `fromTo` makes the state at every timeline position deterministic:
205
+
206
+ ```js
207
+ // BRITTLE: immediateRender interacts badly with scene boundaries
208
+ tl.from(el, { opacity: 0, y: 50, duration: 0.6 }, t);
209
+
210
+ // DETERMINISTIC: state is defined at both ends, no immediateRender surprise
211
+ tl.fromTo(el, { opacity: 0, y: 50 }, { opacity: 1, y: 0, duration: 0.6 }, t);
212
+ ```
213
+
214
+ - **Ambient pulses must attach to the seekable `tl`, never bare `gsap.to()`.** Auras, shimmers, gentle float loops, logo breathing — all of these must be added to the scene's timeline, not fired standalone. Standalone tweens run on wallclock time and do not scrub with the capture engine, so the effect is absent in the rendered video even though it looks correct in the studio preview:
215
+
216
+ ```js
217
+ // BAD: lives outside the timeline, never renders in capture
218
+ gsap.to(".aura", { scale: 1.08, yoyo: true, repeat: 5, duration: 1.2 });
219
+
220
+ // GOOD: seekable, deterministic, renders
221
+ tl.to(".aura", { scale: 1.08, yoyo: true, repeat: 5, duration: 1.2 }, 0);
222
+ ```
223
+
224
+ - **Hard-kill every scene boundary, not just captions.** The caption hard-kill rule above generalizes: any element whose visibility changes at a beat boundary needs a deterministic `tl.set()` kill after its fade, because later tweens on the same element (or `immediateRender` from a sibling tween) can resurrect it. Apply to every element with an exit animation:
225
+
226
+ ```js
227
+ tl.to(el, { opacity: 0, duration: 0.3 }, beatEnd);
228
+ tl.set(el, { opacity: 0, visibility: "hidden" }, beatEnd + 0.3); // deterministic kill
229
+ ```
@@ -0,0 +1,114 @@
1
+ # Step 7: Validate & Deliver
2
+
3
+ ## Lint + Validate
4
+
5
+ Run in sequence. Fix all errors before proceeding to the next command.
6
+
7
+ ```bash
8
+ npx hyperframes lint
9
+ npx hyperframes validate
10
+ ```
11
+
12
+ `lint` checks HTML structure statically — missing attributes, timeline registration, tween conflicts, CSS transform + GSAP conflicts (including inline styles).
13
+ `validate` loads the composition in headless Chrome and catches runtime JS errors, missing assets, and failed network requests.
14
+
15
+ ## Visual Verification (snapshot)
16
+
17
+ After lint and validate pass, capture snapshot frames to SEE your own output. **Always use `hyperframes snapshot`** — do not roll your own ffmpeg/headless Chrome script; the default naming (`frame-XX-at-Ys.png`) is expected by later tooling.
18
+
19
+ ```bash
20
+ npx hyperframes snapshot <project-dir> --at <beat-midpoints>
21
+ ```
22
+
23
+ If the snapshot command isn't available, fall back to:
24
+
25
+ ```bash
26
+ npx tsx packages/cli/src/cli.ts snapshot <project-dir> --at <beat-midpoints>
27
+ ```
28
+
29
+ Calculate the midpoint of each beat from your STORYBOARD.md timings. For a 4-beat video with beats at 0-5.8s, 5.8-15.0s, 15.0-22.5s, 22.5-25.3s:
30
+
31
+ ```bash
32
+ npx hyperframes snapshot <project-dir> --at 2.9,10.4,18.7,23.9
33
+ ```
34
+
35
+ This renders one frame per beat at the moment when content is most visible. Use timestamps where the most content is on screen — usually 60-70% into each beat, after entrances finish but before exits start. Output lands in `<project-dir>/snapshots/` with filenames like `frame-00-at-2.9s.png`.
36
+
37
+ **View every snapshot image carefully.** Don't glance and move on. For each frame, check:
38
+
39
+ **Visibility:**
40
+
41
+ - Is there visible content? All-white or all-black frames mean compositions aren't rendering.
42
+ - Can you read ALL text? White text on white/light background is invisible. Dark text on dark background is invisible. Every text element needs contrast against what's directly behind it.
43
+ - Are images and assets showing? Empty space where an image should be means a path issue or missing file.
44
+
45
+ **Positioning and layout:**
46
+
47
+ - Do background images fill the entire frame? If an image only covers half the screen, the `object-fit`, `width`, `height`, or position values are wrong.
48
+ - Are elements where the storyboard says they should be? Compare the snapshot to the beat description.
49
+ - Is there too much empty/dead space? If more than 40% of the frame is a flat solid color with nothing on it, the composition is sparse.
50
+ - Are elements overlapping incorrectly? Text over text, or content bleeding off the edges?
51
+
52
+ **Visual quality:**
53
+
54
+ - Are overlays too heavy? If a background image is barely visible through a dark overlay, reduce the overlay opacity.
55
+ - Is the visual hierarchy clear? One dominant element per frame, supporting elements secondary.
56
+ - Do the colors match DESIGN.md? Check actual rendered colors against what was planned.
57
+
58
+ **Code vs. rendered verification:**
59
+
60
+ - For each beat, check: does the snapshot show the assets you referenced in the HTML? If a composition has `<img src="...wave.png">` but the snapshot shows no wave — the image isn't loading, the path is wrong, or it's hidden behind another element.
61
+ - If a snapshot shows nothing at a timestamp, try a slightly different time (1-2 seconds later). Compositions may still be in entrance animations.
62
+ - The snapshot command is fast — run it multiple times at different timestamps if needed.
63
+
64
+ If any frame has issues, go back to Step 6 and fix that composition before proceeding.
65
+
66
+ ## Preview
67
+
68
+ ```bash
69
+ npx hyperframes preview
70
+ ```
71
+
72
+ Open the studio in a browser. Scrub through every beat.
73
+
74
+ ### Handoff URL
75
+
76
+ The Studio URL is the project handoff surface. In the final response, report the
77
+ active preview URL with the project hash:
78
+
79
+ ```text
80
+ http://localhost:<port>/#project/<project-name>
81
+ ```
82
+
83
+ Use the actual port selected by `hyperframes preview` and the project name shown
84
+ by the preview command. If you run `hyperframes preview --port 3017` for a
85
+ project directory named `hyperframes-video`, the project URL is:
86
+
87
+ ```text
88
+ http://localhost:3017/#project/hyperframes-video
89
+ ```
90
+
91
+ Do **not** present `index.html` as the project link. `index.html` is the source
92
+ file for agents and editors; the user-facing project is the running HyperFrames
93
+ Studio preview. You may include source file links as secondary context, but the
94
+ primary "Project" or "Preview" line must be the localhost Studio URL.
95
+
96
+ If a render was also requested, still include the Studio URL first so the user
97
+ can scrub and inspect the project. Include the MP4 path as the rendered output,
98
+ not as a replacement for the project URL.
99
+
100
+ ## Render (on-demand only)
101
+
102
+ **Do NOT render automatically as part of the pipeline.** Preview is the delivery — the user scrubs, spots anything they want tweaked, and you iterate. Rendering to MP4 takes minutes of wall-clock time per pass and is wasted work if the user wants changes.
103
+
104
+ Only run `hyperframes render` when the user **explicitly asks** — e.g. "render it", "make the final", "export the MP4", "I'm happy, produce the file". Until then, stop at preview + snapshots.
105
+
106
+ When the user does ask to render, always pass `--output renders/<project-name>.mp4` so the final file has a predictable, human-readable name. The CLI default is timestamped (`<project>_YYYY-MM-DD_HH-MM-SS.mp4`) which is hard to reference from docs or later iterations.
107
+
108
+ ```bash
109
+ npx hyperframes render --output renders/<project-name>.mp4
110
+ ```
111
+
112
+ Example: `npx hyperframes render --output renders/stripe-launch.mp4`
113
+
114
+ For social-media vertical output, check `npx hyperframes render --help` for viewport/format flags.