The HyperFrames composition contract as the linter actually enforces it - the root file and the scene files, the `window.__timelines` registration that fails a project when it is missing, the clip attributes, what may and may not be animated, the determinism bans, variables and variants, fonts, and the asset and size limits. Read before writing or editing a composition by hand.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Hyperframes Composition?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vecnode-hyperframes-composition)
---
name: hyperframes-composition
description: The HyperFrames composition contract as the linter actually enforces it - the root file and the scene files, the `window.__timelines` registration that fails a project when it is missing, the clip attributes, what may and may not be animated, the determinism bans, variables and variants, fonts, and the asset and size limits. Read before writing or editing a composition by hand.
whenToUse: Use when writing or editing a HyperFrames project's HTML (`index.html`, `compositions/*.html`), when `anim_check` reports a lint error or a browser finding, when an animation must be frame-exact, or when one composition has to render several variants from variables.
---
# The composition contract
HyperFrames does not record a screen. It **seeks** a paused timeline to each frame and
captures it. Everything below follows from that one fact: if a value on screen is not a
function of timeline time, the render is a coin toss.
## A project is a folder
```
index.html the ROOT composition: size, length, fps, the scene hosts
compositions/<id>.html one scene per file, each a <template>
assets/ media, styles, fonts - referenced as `assets/...`
caption.md the poster's alt text and the transcript (this row's file)
```
`index.html` is a complete document. Each scene is a `<template>` holding its own
`<style>`, markup and `<script>`, because the renderer mounts it into the root page.
## The two registrations that fail a project
Measured against hyperframes 0.9.106: a composition with no timeline registration is a
lint **error**, `missing_timeline_registry`, and the check exits 1.
```html
<!DOCTYPE html>
<html lang="en" data-composition-variables='[{"id":"title","type":"string","label":"Title","default":"Untitled"}]'>
<head>
<meta charset="utf-8">
<title>Untitled</title>
<link rel="stylesheet" href="assets/theme.css">
</head>
<body>
<div id="root" data-composition-id="root" data-start="0" data-width="1920" data-height="1080" data-duration="12" data-fps="30">
<div id="scene-title" class="clip" data-composition-id="title" data-composition-src="./compositions/title.html" data-start="0" data-duration="12" data-track-index="0" data-width="1920" data-height="1080" data-track-kind="graphics"></div>
</div>
<script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/gsap.min.js"></script>
<script>
const rootTimeline = gsap.timeline({ paused: true });
window.__timelines = window.__timelines || {};
window.__timelines["root"] = rootTimeline;
</script>
</body>
</html>
```
The ROOT registers its own paused timeline even though it holds no tweens. A scene
registers its own, keyed by its `data-composition-id`, **after** its last tween:
```js
const tl = gsap.timeline({ paused: true });
tl.from("#headline", { opacity: 0, y: 28, duration: 0.9, ease: "power3.out" }, 0);
window.__timelines = window.__timelines || {};
window.__timelines["title"] = tl;
```
A scene's root is `<div id="root" data-composition-id="<id>" data-width data-height>`
and it is styled with the **`#root` selector** - styling it with a class is
`subcomposition_root_styled_by_class`.
## Clip attributes
| Attribute | Meaning |
|---|---|
| `data-composition-id` | the composition's own id; the timeline's key |
| `data-start`, `data-duration` | when it shows, in seconds - it shows over `[start, start + duration)` |
| `data-track-index` | a Studio lane, **display only**; the render never reads it. Clips that never overlap may share one |
| `data-track-kind` | `"graphics"` on a scene host, `"captions"` on the one host that holds captions |
| `class="clip"` | the shared rule that gives the element the full-frame box |
The root's `data-duration` **is** the film's length: an overrun is cut, an early end holds
the last frame. Paint order is `z-index`, never track order.
## What may be animated, and what may not
Animate `opacity`, `x`, `y`, `scale`, `scaleY`, `rotation`, and — for SVG geometry —
`attr: { ... }`. Those are composited, seekable, and cannot reflow the page.
**Never** animate `left`, `top`, `width`, `height`, `font-size`, `letter-spacing`. The
linter rejects them because a layout property re-runs layout at every seek, which is both
slow and a source of one-frame differences. The same picture is a transform: a bar that
"grows" is `scaleY` from `transform-origin: bottom`, not a `height` tween.
Never tween `display`, `visibility` or `autoAlpha` **on a `.clip` element** - the
framework owns a clip's visibility. Animate a child instead.
CSS `transition` is banned (`css_transition_used`): it runs on the browser's clock, and
the browser's clock is not the timeline.
## Determinism: the banned list, and why
| Banned | Code | Why |
|---|---|---|
| `Date.now()`, `performance.now()` | `non_deterministic_code` | the frame would depend on when it was rendered |
| `requestAnimationFrame` | `requestanimationframe_in_composition` | the browser clock again; the host owns the frame |
| `setTimeout` / `setInterval` | `non_deterministic_code` | same |
| unseeded `Math.random()` | `non_deterministic_code` | two renders differ |
| `repeat: -1` | `gsap_infinite_repeat` | a seek past the loop's end has no defined state |
| network `fetch` mid-render | - | the frame would depend on the network |
Once per project, seed a generator if randomness is genuinely wanted:
`gsap.utils.random(1, 10, 1)` with a seed, or a small hash function of the index. A
finite `repeat: 1` is fine - it is a defined number of cycles.
## Variables: one composition, many renders
Declare on the root `<html>`:
```html
<html data-composition-variables='[{"id":"title","type":"string","label":"Title","default":"Untitled"}]'>
```
Bind with `data-var-text="title"` (replaces the element's own text) or
`data-var-src="shot"` (replaces an image/video/audio source). A colour or a number is
read as `var(--title)` in CSS or `window.__hyperframes.getVariables()` in a script.
Kinds: `string`, `number`, `color`, `boolean`, `enum`, `font`, `image`.
`anim_render` with `variables: { "title": "Q3 revenue" }` renders one variant without
touching the HTML; the same flag takes `--variables-file` and `--batch` at the CLI for a
set of variants with identical timing.
## Fonts
Only the bundled families resolve by name: Inter, Montserrat, Outfit, Nunito, Oswald,
League Gothic, Archivo Black, Space Mono, IBM Plex Mono, JetBrains Mono, EB Garamond,
Playfair Display, Source Code Pro, Noto Sans JP, Roboto, Open Sans, Lato, Poppins.
Anything else needs `@font-face` pointing at a file in `assets/fonts/`, or the lint error
`font_family_without_font_face` and text that falls back to a default face. The compiler
fetches a missing weight of a bundled family from Google Fonts on first use and caches it
in `~/.cache/hyperframes/fonts` - that is the one network request a render may make, and
it is why a machine with no network should name only weights it already has.
## Assets and size
- Paths are `assets/...`, relative, **no leading slash** - in sub-compositions too.
- A composition HTML file over **16 MB** is refused with `COMPOSITION_TOO_LARGE`, and the
sub-composition mounts add up to 64 MB, 10,000 mounts and 100,000 copied elements. Keep
images, fonts and data in files and reference them; never inline base64 media.
- `check`, `snapshot` and `validate` clamp at a 4096 px inspection viewport. A composition
wider than that still renders; it just cannot be inspected at full size.
## The shapes worth memorising
**A count-up** is a tween on a plain object, writing text in `onUpdate`:
```js
const box = { v: 0 };
tl.to(box, { v: 482910, duration: 1.1, ease: "power2.out",
onUpdate: () => { node.textContent = "$" + Math.round(box.v).toLocaleString("en-US"); } }, 0.8);
```
**A stagger** is one tween with `stagger`, not N tweens at hand-computed offsets:
`tl.from(".card", { opacity: 0, y: 18, duration: 0.55, stagger: 0.1 }, 0.65)`.
**A draw-on** is SVG geometry through `attr`, never a CSS class toggle:
`tl.fromTo("#arc", { attr: { "stroke-dashoffset": 251 } }, { attr: { "stroke-dashoffset": 35 }, duration: 1.1 }, 4.2)`.
**A tooltip that lands on the right bar** is positioned from the layout once, at build
time (`bar.offsetLeft`, `bar.offsetTop` inside a positioned parent), not guessed from a
percentage.