medium.com 4 min read Original Source

A Quick Guide to Hyperframes

AGENTIC ENGINEERING

If you’ve ever needed to generate product launch videos, UI explainer reels, data visualizations, or automated social content, you’ve probably hit the same wall I hit… traditional video tools feel too alien and React-centric solutions like Remotion force an entire component architecture onto something that should just be a page.

HyperFrames takes a different approach. It treats video as a web-native problem. You author compositions as plain HTML + CSS + JavaScript (with GSAP, Lottie, CSS animations, Three.js, or any other seekable runtime). The framework then seeks frame-by-frame in headless Chrome and encodes a deterministic MP4 with FFmpeg.

I think it’s perfect for CI, agent pipelines, and batch rendering.

While creating videos with Hyperframes, HTML is the source of truth. Compositions are just files with data-* attributes. LLMs and agents already excel at generating HTML and HyperFrames leans into that. More on that later in this article.

The renderer captures each frame independently via Chrome’s beginFrame API. So, you don’t have to worry about dropped frames from slow machines.

This framework gives you adapter-based animation. GSAP is first-class. But CSS, Lottie, Anime.js, Three.js, and WAAPI are supported through the same protocol.

And core packages export solid types, so if you’re a TypeScript developer, you’ll find this framework very easy to work with.

To scaffold your first project, all you need to do is:

npx hyperframes init my-video
npx hyperframes init my-video

This starts a TUI and you’ll be asked to choose a template. If you prefer a non-interactive command, you can type in this instead:

npx hyperframes init my-video --non-interactive --example blank
npx hyperframes init my-video --non-interactive --example blank

Once your project has been initialized, you can start a live preview by running:

cd my-video
npx hyperframes preview
cd my-video
npx hyperframes preview

The Studio opens with hot reload. Edit index.html and the timeline updates instantly.

A composition is an HTML document whose root element declares its identity and canvas:

<button data-code="

” data-toggle-ms=”1200″ aria-label=”Copy code” data-nosnippet=”” class=”code-copy-btn absolute right-3 top-3 size-8 p-1.5 flex items-center justify-center bg-black/50 text-white rounded-md transition-colors duration-200 cursor-pointer hover:bg-black/70″>

<div id="root"
     data-composition-id="my-video"
     data-start="0"
     data-width="1920"
     data-height="1080">
  <!-- all your clips live here -->
</div>
<div id="root"
     data-composition-id="my-video"
     data-start="0"
     data-width="1920"
     data-height="1080">
  <!-- all your clips live here -->
</div>

Every visual element must have class = “clip”. And every timed element needs three attributes: data-start, data-duration, and data-track-index.

data-start can either be the number of absolute seconds or number of seconds relative to another clip. data-duration is, of course, the length of the clip in seconds. data-track-index helps you avoid overlap collisions.

Tracks manage time conflicts, not paint order. You can use CSS z-index for layering. But overlapping elements (crossfades, overlays) must sit on different tracks.

Here’s a minimal starting point:

<button data-code="

Hello, Medium!

const tl = gsap.timeline({ paused: true });
tl.from("#title", {
opacity: 0,
y: -50,
duration: 1,
ease: "power3.out"
}, 0);

window.__timelines = window.__timelines || {};
window.__timelines["my-video"] = tl;
” data-toggle-ms=”1200″ aria-label=”Copy code” data-nosnippet=”” class=”code-copy-btn absolute right-3 top-3 size-8 p-1.5 flex items-center justify-center bg-black/50 text-white rounded-md transition-colors duration-200 cursor-pointer hover:bg-black/70″>

<div id="root"
  data-composition-id="my-video"
  data-start="0"
  data-width="1920"
  data-height="1080">

<h1 id="title" class="clip"
    data-start="0" data-duration="5" data-track-index="0"
    style="font-size: 72px; color: white; text-align: center;
          position: absolute; top: 50%; left: 50%;
          transform: translate(-50%, -50%);">
  Hello, Medium!
</h1>

<script>
  const tl = gsap.timeline({ paused: true });
  tl.from("#title", {
    opacity: 0,
    y: -50,
    duration: 1,
    ease: "power3.out"
  }, 0);

  window.__timelines = window.__timelines || {};
  window.__timelines["my-video"] = tl;
</script>
<div id="root"
  data-composition-id="my-video"
  data-start="0"
  data-width="1920"
  data-height="1080">

<h1 id="title" class="clip"
    data-start="0" data-duration="5" data-track-index="0"
    style="font-size: 72px; color: white; text-align: center;
          position: absolute; top: 50%; left: 50%;
          transform: translate(-50%, -50%);">
  Hello, Medium!
</h1>

<script>
  const tl = gsap.timeline({ paused: true });
  tl.from("#title", {
    opacity: 0,
    y: -50,
    duration: 1,
    ease: "power3.out"
  }, 0);

  window.__timelines = window.__timelines || {};
  window.__timelines["my-video"] = tl;
</script>

You need to remember that a composition is not a scrolling document. It is a fixed-size stage. So, absolute positioning is ideal for HyperFrames. Layout behaves more like After Effects or a motion-graphics timeline than like a responsive website.

And you always create the timeline paused. The runtime owns playback. You never control media playback or clip visibility from scripts (the framework owns those).

Also, videos must be muted. Audio lives in separate elements so the framework can mix tracks cleanly.

Large language models have become exceptionally good at generating, editing, and reasoning about HTML. They are far less reliable when forced to emit proprietary timeline JSON, React component trees with complex prop drilling, or custom DSLs.

HyperFrames wasn’t really built for humans. The entire architecture was designed around the strengths and constraints of coding agents (Claude Code, Codex, Antigravity, etc).

Hyperframes allows an agent to scaffold an entire multi-scene video from a natural-language prompt. It also allows agents to iterate by editing the same files a human would open. There is no “compile the agent’s output into the real format” step. The agent’s output is the real format.

Every command of the Hyperframes CLI accepts explicit flags, emits plain text (or structured JSON), and fails fast with clear error messages.

But generic web knowledge is usually not enough. So, HyperFrames ships a set of skills that register as slash commands and inject the precise conventions agents otherwise miss. To get the skills, you need to run:

npx skills add heygen-com/hyperframes  --full-depth
npx skills add heygen-com/hyperframes  --full-depth

Wall-clock animation systems are much harder for agents to reason about and debug, which is why the framework seeks every frame independently. So, an agent can treat a video as a mutable document. It can inspect, plan a change, apply it, validate, and re-render in a tight loop.

Once the skills are installed, you can write a simple prompt like this one:

Using /hyperframes, create a 12-second product intro with
a background video, animated title, lower-third caption,
and subtle music.
Using /hyperframes, create a 12-second product intro with
a background video, animated title, lower-third caption,
and subtle music.

… and the agent will use the framework correctly. It will also do static validation and headless runtime checks.

Finally you (or the agent) can run the following command to render the MP4 video:

npx hyperframes render -o result.mp4
npx hyperframes render -o result.mp4

Note that the skills are explicit about not silently inventing media or leaving broken remote URLs in the composition. Everything that ends up in the final HTML should be a local, frozen file under the project (usually assets/) with a ledger entry from /media-use when it was resolved. Yes, music and visual assets are obtained through the formal /media-use skill.

For music/sounds, if HeyGen authentication credentials are present (or the HEYGEN_API_KEY environment variable is set), the agent will try to fetch an appropriate sample from HeyGen’s music catalog.

But you usually download files from Pixabay (or Pexels, Unsplash, etc.), and drop the files into assets/. I like to generate audio using tools like Suno or Google’s Lyria 3.

Thanks for reading. Please consider following me here on Medium or on X.