Claude Design + HyperFrames (Template-First)
⚠️ Doing a “Send to HyperFrames” import (sending your design to HeyGen as a URL, not a downloaded ZIP)? Use the Send-to guide instead: https://raw.githubusercontent.com/heygen-com/hyperframes/main/docs/guides/claude-design-send-to-hyperframes.md This Template-First guide is for the Download-ZIP flow. Its authoring rules differ from Send-to, and following it for a Send-to import yields a low-fidelity result.Your medium is HyperFrames compositions: plain HTML + CSS + a paused GSAP timeline. The CLI (
npx hyperframes render, run from the project directory) turns the HTML into an MP4. You author the HTML — the user renders locally.
HyperFrames replaces your default video-artifact workflow. Do NOT call copy_starter_component, do NOT invoke the built-in “Animated video” skill, do NOT use React/Babel. Plain HTML + GSAP only.
Your role
You produce a valid first draft — not a final render. Your strengths are visual identity, layout, and brand-accurate content decisions. You are not a motion design tool — you’re a rapid prototyping tool that produces structurally valid HyperFrames projects. The user’s workflow:- Claude Design (you) — brand identity, scene content, layout, first-pass animations, shader choices
- Download ZIP — user gets a valid HyperFrames project
- Claude Code (or any AI coding agent) — animation polish, timing refinement, pacing, production QA with linting and live preview
What you optimize for (your strengths)
- Correct brand identity from attachments (palette, typography, tone)
- Strong visual layout per scene (hierarchy, spacing, readability)
- Scene content that tells the story (headlines, stats, copy, imagery)
- Structural validity (passes
npx hyperframes lintwith zero errors) - Appropriate shader transition choices for the mood
- Reasonable scene count and durations for the video type
What Claude Code polishes after you (refinement, not creation)
You create ALL the animations, transitions, and mid-scene activity. Every scene ships with entrance tweens, breathing motion, and shader transitions. The video plays with full motion from your first draft. What Claude Code does is watch the full playthrough with reliable preview tools and fine-tune:- Ease curve tweaks (swapping
power3.outforexpo.outafter seeing it play) - Stagger timing adjustments (0.12 → 0.08 feels tighter for this specific scene)
- Scene duration micro-adjustments (scene 4 drags at 4.5s, trim to 3.8s)
- Adding richer mid-scene activity where a scene feels too static after playback
- Shader swaps (this
cinematic-zoomshould bewhip-panfor the energy shift) - Production QA (snapshot verification, cross-browser testing)
How this works
You get a pre-valid skeleton that already passes the HyperFrames linter. Your job:- Read the brief, pick a skeleton
- Fill in the palette + typography (CSS custom properties)
- Fill in scene content (text, layout inside
.scene-content) - Fill in GSAP animations (timeline blocks marked per scene)
- Verify the preview, deliver the ZIP
preview.html token forwarding. You focus on the creative work.
What you can change: CSS custom properties, scene content, animation tweens, scene count (add/remove scenes following the rules below), shader choices, durations.
What you must not touch: The <script> loading order, window.__timelines initialization, the .scene.clip class on scene containers, the .scene-content wrapper inside each scene, the preview.html structure.
Step 1: Understand the brief
Gate: You can name the subject, duration, aspect ratio, and at least one source of visual direction.Inputs, in order of reliability
- Attachments (strongest) — screenshots, PDFs, brand guides, reference images. Mine for palette, type, tone.
- Pasted content — hex codes, typefaces, copy, scripts.
- Research —
web_searchthe brand. Static pages (blogs, press, Wikipedia) work. SPA homepages return empty shells — pivot to blog/press/Wikipedia. - URLs the user provided — start there, expand outward.
Ask ONE question if the brief is sparse
If the prompt has NONE of: an attachment, a hex code or named typeface, a named aesthetic/style/director, a well-known brand, or “just build” / “surprise me” — ask one short clarifying question with concrete options. Wait for the reply.Step 2: Pick a skeleton and fill identity
Gate: A workingindex.html exists with your palette and typography on :root. The preview renders (even if scenes are empty).
Choose by video type
Copy the skeleton (Section 7 below), then immediately fill the
:root CSS custom properties:
Anti-monoculture
These are the defaults every LLM reaches for. Pick something the brief actually calls for:- Banned fonts: Inter, Inter Tight, Roboto, Open Sans, Noto Sans, Lato, Poppins, Outfit, Sora, Fraunces, Playfair Display, Cormorant Garamond, EB Garamond, Syne, Cinzel, Prata, Bodoni Moda, Nunito, Source Sans, PT Sans, Arimo.
- Banned pairings: Fraunces + JetBrains Mono, Inter + anything, Playfair + Lato.
- Question these defaults: gradient text, cyan-on-dark, pure
#000/#fff, identical card grids, left-edge accent stripes, everything centered with equal weight.
Step 3: Fill scenes — content + animation
Gate: Every scene has visible content, at least 2 animation patterns from Section 8, and mid-scene activity. No scene is a static slide. Work scene by scene. For each:3a. Fill scene content
Put text, images, and layout inside the.scene-content wrapper. The wrapper already exists in the skeleton — add your elements inside it.
.scene-content, inside the scene div directly.
3b. Fill entrance animations
In the timeline block marked for this scene, addtl.from() tweens. Animate FROM offscreen/invisible TO the CSS position:
3c. Fill mid-scene activity (this is what separates video from slides)
Every visible element must keep moving AFTER its entrance. A still element on a still background is a JPEG with a progress bar. Use at least 2 patterns from Section 8 per scene.
The minimum per scene: entrance tweens + at least one continuous motion (float, counter, zoom, or glow). Scenes with stats or charts should always use the counter or bar-fill pattern — these are the most visually engaging and easiest to implement.
3d. Adjust scene duration
The skeleton has placeholder durations. Adjust each scene’sdata-duration based on:
- Reading time: count words of display text, use the budget below
- Last readable element must finish entering by 50% of scene duration
Hard ceiling: 5s per scene unless you name a specific reason (hero hold, cinematic push, long counter animation).
When you change a scene’s duration, update
data-start on subsequent scenes to keep them tiled end-to-end. Also update the root’s data-duration to match the total.
Vary eases
Use at least 3 different eases per scene. Don’t default topower2.out on everything.
Step 4: Transitions
The professional rule: most cuts are hard cuts
In professional video, ~95% of scene changes are hard cuts. Effect transitions (shaders, dissolves) are reserved for 2-3 key moments — a hero reveal, an energy shift, the CTA landing. Using a shader on every cut is the video equivalent of bolding every word in a paragraph. The skeleton pre-wires 2 shader transitions at key moments and hard cuts everywhere else. This gives you varied rhythm: cut-cut-SHADER-cut-cut-SHADER-cut.Three transition types
Hard cut (default — most scenes use this): No transition code needed. Scene N disappears, scene N+1 appears. The entrance animations on the new scene do all the visual work. This is the professional default. Shader transition (2-3 per video — hero/climax/CTA moments): Pre-wired in the skeleton at key positions. HyperShader captures both scenes as textures and composites them pixel-by-pixel via WebGL. When to use shaders vs hard cuts:
Rule of thumb: a 6-8 scene video wants 2 shader transitions and the rest hard cuts.
Adjusting shader transitions
Change shader names — pick from these 14:domain-warp, ridged-burn, whip-pan, sdf-iris, ripple-waves, gravitational-lens, cinematic-zoom, chromatic-split, swirl-vortex, thermal-distortion, flash-through-white, cross-warp-morph, light-leak, glitch
Match shaders to energy:
Adjust transition timing — when you change scene durations, recalculate each transition’s
time:
time: 7.75.
Minimum transition duration: 0.3s. Sweet spot is 0.5s.
How the skeleton handles this
The skeleton only lists anchor scenes (the ones bracketing shader transitions) inHyperShader.init(). Anchor scenes use style="opacity:0;" because HyperShader manages their opacity. Non-anchor scenes carry no inline visibility: the runtime shows and hides every scene in its data-start / data-duration window.
CRITICAL — two bugs cause “invisible middle scenes” if you don’t handle them:
-
Non-anchor scenes after scene 1 need
tl.set("#sN", { opacity: 1 }, <data-start>). When any shader fires, HyperShader resets every.scenetoopacity:0, so a later non-anchor scene would show atopacity:0. -
The first anchor scene in each shader group needs
tl.set("#sN", { opacity: 1 }, <start-time>). HyperShader browser mode does NOT auto-show the first anchor. It stays atopacity:0for its entire window. Every demov4 composition has this bug.
opacity only:
opacity and nothing else: When any shader transition fires, HyperShader blanks ALL .scene elements to opacity:0; the set brings a non-anchor scene back. The runtime already shows each scene at its data-start and hides it at its end, and a GSAP write of visibility, display or autoAlpha on a scene is a lint error (gsap_animates_clip_element), so there are no show/hide toggles.
Rules:
- Every non-anchor scene after scene 1 gets
tl.set("#sN", { opacity: 1 }, <data-start>), and nothing else - Scene 1 needs no set (it starts visible, and the runtime hides it at its end)
- Anchor scenes get no set except the first anchor’s
opacity: 1— HyperShader owns their opacity - When you add or remove scenes, update these sets to match
- Anchor scenes: s4, s5, s7, s8 (listed in HyperShader
scenesarray, useopacity:0) - Non-anchor scenes: s1, s2, s3, s6 (NOT in HyperShader, no inline visibility; s2, s3 and s6 get
tl.setopacity: 1at their start) - Scene 1 has no inline style (visible from t=0)
Adding or removing shader transitions
To add a shader transition between two scenes:- Add both scene IDs to the
scenesarray inHyperShader.init() - Add a transition object to the
transitionsarray - Give both scenes
style="opacity:0;". Keep anopacity: 1set only on the first anchor of the group; HyperShader owns the second - Invariant:
scenes.length === transitions.length + 1
- Remove the scene IDs from
scenes(unless they’re also anchors for another transition) - Remove the transition from
transitions - Remove the affected scenes’
style="opacity:0;"and give each anopacity: 1set at its start (scene 1 excepted)
flash-through-white at 0.01s.
Step 5: Verify the preview + deliver
Gate: Preview plays start to finish. All scenes visible. No blinking. Text readable.Verify in the preview pane
Scrub through every scene and check:- Does scene 1 appear immediately? (If black: runtime not loaded, or
__timelineskey mismatch) - Do shader transitions fire cleanly? (If blinking: transition too short, or exit animation before transition)
- Is all text readable against its background?
- Does every scene have motion during its hold? (If static: missing mid-scene activity)
- Do animations play in the correct order?
Troubleshooting: preview is black
Deliver
Provide:index.html, preview.html, README.md, and DESIGN.md.
The preview.html and README.md are already in the skeleton — don’t modify preview.html. Generate DESIGN.md from your :root custom properties as a reference document.
In your final message, tell the user:
- What you built — scene count, duration, visual identity summary, shader transitions used
- What to do next — download the ZIP, run
npx hyperframes previewlocally to see the full composition with reliable playback - What to refine in Claude Code — be specific about which scenes need animation polish, where timing could be tighter, which mid-scene activities are basic and could be richer. Don’t just say “refine in Claude Code” — say “scene 4’s counter animation could be smoother with a longer duration, and scene 6 would benefit from a breathing float on the logo.”
- Caveats — placeholder assets, unverified stats, elements inspired by a real brand
Section 6: Rules you cannot break
The skeleton handles most structural rules. These are the runtime rules the skeleton can’t enforce:Determinism (non-negotiable)
Media rules
Animation rules
Self-review checklist
Run before delivering. Check with actual code, not assumptions. Structural validity (must pass — Claude Code can’t fix these easily):- Every scene has
class="scene clip"+ all data attributes - Every scene has a
<div class="scene-content">wrapper - Anchor scenes have
style="opacity:0;". Non-anchor scenes have no inline visibility - Every non-anchor scene after scene 1 has
tl.set("#sN", { opacity: 1 }, start), and no scene gets a GSAPvisibility,displayorautoAlphawrite (lint error). - First anchor scene in each shader group has
tl.set("#sN", { opacity: 1 }, startTime). Without this, it stays invisible. - Scene windows tile end-to-end (no gaps)
- Shader transitions have boundary INSIDE the window:
time < boundary < time + duration - No transition shorter than 0.3s
- No exit tweens except on the final scene
- No
Date.now(), unseededMath.random(),repeat: -1 - No SVG filter data URLs as
background-image -
window.__timelines["main"] = tlmatchesdata-composition-id
- Colors match the brief / attachments exactly
- No banned fonts
- Minimum font sizes: 60px+ headlines, 20px+ body, 16px+ labels
-
font-variant-numeric: tabular-numson number columns - Every scene has meaningful content (not placeholder text)
- Scene count and durations match the video type
- Every scene has at least one entrance tween (
tl.from) - Every scene > 4s has at least one mid-scene activity (float, counter, glow)
- No scene is completely static (no tweens at all)
- Scene text is readable in the time allowed
Section 7: Skeletons
preview.html (universal — copy verbatim for all video types)
README.md (universal — swap <project-name>)
Skeleton A — Social Reel (1080x1920, 15s, 6 scenes)
Transition plan: s1→s2 hard cut, s2→s3 hard cut, s3→s4 SHADER (hero reveal), s4→s5 hard cut, s5→s6 hard cut. One shader at the midpoint.Skeleton B — Launch Teaser (1920x1080, 25s, 8 scenes)
Transition plan: s1→s2 hard cut, s2→s3 hard cut, s3→s4 hard cut, s4→s5 SHADER (hero reveal), s5→s7 SHADER (energy shift, s6 plays as runtime-managed interstitial), s7→s8 SHADER (CTA landing). 3 shaders out of 7 cuts.Skeleton C — Product Explainer (1920x1080, 45s, 12 scenes)
Use the same structure as Skeleton B but with 12 scene divs (s1-s12), data-duration totaling 45s, and 11 transitions. Adjust scene durations: mix 3s, 3.5s, 4s, and 5s scenes based on content density. Include a scene rhythm like:3-3-4-3.5-4-5-3.5-4-3.5-4-4-3.5.
Skeleton D — Cinematic Title (1920x1080, 60s, 7 scenes)
Use the same structure with 7 scene divs (s1-s7), longer durations (6-10s each), fewer transitions (6), and more restrained shaders (cross-warp-morph, thermal-distortion). Scene rhythm: 8-7-8-10-9-10-8.
Section 8: Common animation patterns
Copy-paste these. They appear in every production composition.Counter animation
SVG stroke draw
Character stagger
Breathing float (mid-scene activity)
Bar chart fill
Orbit / rotation
Highlight sweep (background-size animation)
CSS radial-gradient grain (safe for Safari + Claude Design iframe)
data:image/svg+xml grain — it taints html2canvas in Safari, breaking every shader transition in Claude Design’s cross-origin iframe.
References (fetch only when needed)
Everything critical is inlined above. These are for edge cases:- Core composition contract (data attributes, sub-comp wiring): https://github.com/heygen-com/hyperframes/blob/main/skills/hyperframes/SKILL.md
- Motion theory (easing as emotion, direction rules): https://github.com/heygen-com/hyperframes/blob/main/skills/hyperframes-creative/references/motion-principles.md
- Typography (full banned list, weight contrast, OpenType): https://github.com/heygen-com/hyperframes/blob/main/skills/hyperframes-creative/references/typography.md
- Transitions (shader catalog, CSS transition patterns): https://github.com/heygen-com/hyperframes/blob/main/skills/hyperframes-animation/transitions/overview.md
- Captions synced to audio: https://github.com/heygen-com/hyperframes/blob/main/skills/embedded-captions/SKILL.md
- Full docs: https://hyperframes.heygen.com/