Rules to know
The skills enforce these automatically, but if you hand-edit compositions or debug issues, these are the rules that matter:- Register all timelines on
window.__timelines— the renderer can’t seek animations it doesn’t know about. - Video elements must be
muted— audio goes in separate<audio>elements so the renderer can mix it. - No
Math.random()— random values produce different frames on each render, breaking determinism. Use a seeded PRNG (e.g. mulberry32) if you need pseudo-random values. And when you want a stepped, stop-motion hold, quantize it on the integer frame index, not on elapsed seconds — seek times don’t land on exact 1/fps doubles, so second-domain arithmetic drifts and the hold length stutters. See Handmade, still deterministic. - Synchronous timeline construction — no
async/awaitorfetch()during GSAP timeline setup. - Timed elements need
class="clip"— plusdata-start,data-duration, anddata-track-index. - Add entrance animations to every scene — elements appearing without animation feel broken on video.
- Add transitions between scenes — jump cuts between scenes are almost always unintentional in composed video. See What transitions do and when they trigger.
Lint rules to know
The linter added eight more rules that catch subtler seek-order and SVG-drawing mistakes — cases where a render can look right in the live preview and still render wrong on a cold, non-linear render worker. Two further hazards below carry no rule code: they surface in the render, not the linter. Phrase prompts to avoid these up front rather than debugging them after a render.Cold-seek visibility
Elements that start hidden need their visible end state stated explicitly — a render worker that seeks straight to a later frame restores the authored hidden state, not whatever the preview showed a moment ago.-
Reveal the destination, not just the source. If an element starts hidden and a
gsap.fromTo()reveals it, ask for the destination vars — not just thefromvars — to includeopacity: 1(orautoAlpha: 1). Cold render workers restore the hidden authored state, so an element can stay invisible even when sequential preview looks correct. (gsap_cold_seek_hidden_fromto_missing_reveal, PR #2503) -
Set the initial hidden state outside the timeline. Don’t rely on a
tl.set(...)at position 0 inside the timeline itself to hide an element at the start — a zero-duration set exactly at frame 0 may not have applied yet when frame 0 renders. Ask for a baregsap.set(...)outside the timeline, or author the hidden state directly in CSS/HTML. (gsap_timeline_set_initial_hide, PR #2612) -
A
fromToshows its from-state before it starts.immediateRenderback-renders thefromvars at every time earlier than the tween’s own start, so an element you authored to “appear at 3s” is already on screen at frame 0 wearing its start pose. Sequential preview hides this — you scrub past frame 0 before the tween exists. Ask forto()pluskeyframes, or a zero-durationtl.set()at the beat boundary, whenever an element must be absent before its cue. (Surfaced while validating this guide’s kinetic-quote and map-route examples.)
One caveat on “identical every time”: parallel workers are not bit-identical to each other. Building this chapter’s rule-1 demo — whose left half is deliberately frozen — a default multi-worker render produced four distinct frame hashes across those frozen frames instead of one, with the changes landing exactly on the 30-frame worker-chunk boundaries. The deltas were a handful of ±1-level pixels (109–113 dB), i.e. per-Chrome-process rasterization variance, not animation. Determinism in the sense that matters is intact: the same worker seeking the same time renders the same frame, and your composition is not the variable. But if you need a bit-exact result — hashing frames, proving a hold, diffing two renders — pass
--workers 1. Encoding adds its own noise on top, so compare lossless frames rather than the encoded MP4 when you need certainty.Seek-order safety
These four all come from the same root cause: a cold render worker seeks non-linearly, so anything whose value depends on when or in what order it runs can render differently than the live preview did.- Don’t stack a relative tween on a property another writer is still animating.
"+=50"or"-=20"captures its base at tween init — sequential playback inits mid-flight of the other writer, a cold worker landing later inits from its end state, and the same frame renders at two different positions. State absolute end values instead, or sequence the tweens so they don’t overlap on that property. (gsap_relative_value_second_writer, PR #2612) - Don’t combine
repeatRefresh: truewith a relative value on a repeating tween. The relative offset accumulates per iteration, so a worker seeking straight into iteration N never performed the earlier iterations’ accumulation and lands somewhere else. Ask for absolute endpoints (afromTo()) instead if the loop needs to render correctly from any seek position. (gsap_repeat_refresh_relative_value, PR #2611) - Function-valued tween vars receive
(index, target, targets)— the first argument is a number, not the element. Don’t ask for a function value that calls an element method on its first parameter, or that reads transform-sensitive layout (its result would depend on the worker’s own seek order). Use the second parameter for the element, index arithmetic like(i) => i * 20, or a value computed once at build time. (gsap_function_value_hazard, PR #2611) - Don’t measure DOM geometry inside a timeline callback.
getBoundingClientRect(),getTotalLength(), andgetComputedStyle()all depend on whatever DOM state the render happens to be in — and timeline callbacks re-fire on every seek, so a cold worker’s own non-linear seek order can hand the callback a different measurement than the live preview did. Ask for geometry to be computed once at build time instead. (gsap_callback_dom_measurement, PR #2611)
SVG draw-on
Two more ways an SVG “line draws itself” effect (animatedstrokeDasharray / strokeDashoffset) can render as a static, undrawn line.
- Don’t declare a multi-value CSS
stroke-dasharrayon the same element GSAP is animating. GSAP merges dash lists per component, so the CSS gap survives the animation and the draw-on hide only covers one gap’s worth — the line stays visible for the whole scene. Put decorative dashing on a separate element if you need both effects. (svg_drawon_css_dasharray_conflict, PR #2611) stroke-linecap: roundpaints a dot at zero dash length. An un-drawn stroke isn’t nothing — a round cap renders a visible dot at the path’s start from frame 0, so a “line draws itself” effect begins with a stray mark sitting on screen. Gate the group’s opacity until the draw begins, or use a butt cap. (Surfaced while validating this guide’s examples.)- Give the path a static
dattribute before anything measures it.getTotalLength()returns 0 in Chrome if the path’sdisn’t set yet — whether becausedis only assigned inside a function that hasn’t run, or never assigned as a static attribute at all — and a dash animation built on a 0-length path is silently dead. (svg_measure_before_path_d, PR #2611)
Layout waivers, and the one that bites
hyperframes check flags a text block covered by another element as text_occluded, and
two attributes waive it: data-layout-allow-overlap for intentional layering, and
data-layout-allow-occlusion for something deliberately painted over type. Both are
legitimate — a caption designed to sit behind a matted subject needs one.
Two things about them are worth knowing before you reach for either:
data-layout-allow-occlusionalso silences the WCAG contrast gate for that whole subtree. Validating this guide’s confetti example, moving the attribute onto a cluster root took contrast coverage from 73 checks to 13 — and a deliberately near-invisible numeral inside it then passed. Scope the attribute to the narrowest node that needs it, and check the contrast count afterwards; if it dropped, you have waived more than you meant to.- The occlusion audit is stricter than it looks on atomic labels. A single glyph — a
digit, a
$, a.— flags at any coverage, so one confetti particle grazing one character is a hard error.pointer-events: nonedoes not exempt an element, and a CSSmask-imagelets the audit probe through masked-away cells and attribute the occlusion to whatever paints behind them.
Anti-patterns
Each one causes friction or wrong output for a specific engine reason — with the fix. Don’t ask for React / Vue components. Compositions are plain HTML withdata-* attributes and a GSAP timeline; framework components force a translation step.
- ❌
build a React component for the intro - ✅
build the intro scene(the agent writes composition HTML directly)
- ❌
render in 4K 60fps(for a social clip) - ✅ say nothing — or
4Konly when the delivery target actually needs it
/hyperframes, the agent guesses at HTML video conventions instead of loading the framework’s actual rules.
- ❌
make me a video of... - ✅
/hyperframes make me a video of...
check localizes the problem first (lint, then a browser gate); a bare log makes the agent re-derive what the tool already knows.
- ❌ pasting 200 lines of console output
- ✅
check reports a missing asset in scene 2 — fix it
- ❌
use my logo - ✅
use assets/logo.svg
- ❌
/pr-to-video ... dark theme - ✅ let the preset carry the look, or use a freeform build when you need full style control
- ❌
a 60-second explainer from this script: ... - ✅
a ~60-second explainer from this script: ...