Skip to content

xinetzone/SpecWeave / .agents/skills/hyperframes

hyperframes

Verified

Create video compositions, animations, title cards, overlays, captions, voiceovers, audio-reactive visuals, and scene transitions in HyperFrames HTML. Use when asked to build any HTML-based video content, add captions or subtitles synced to audio, generate text-to-speech narration, create audio-reactive animation (beat sync, glow, pulse driven by music), add animated text highlighting (marker sweeps, hand-drawn circles, burst lines, scribble, sketchout), or add transitions between scenes (crossfades, wipes, reveals, shader transitions). Covers composition authoring, timing, media, and the full video production workflow. For dev-loop CLI commands (init, lint, inspect, preview, render) see the hyperframes-cli skill; for asset preprocessing commands (tts, transcribe, remove-background) see the hyperframes-media skill.

FileKindSize
SKILL.mdskill md32.3 KB
data-in-motion.mdmarkdown1.3 KB
house-style.mdmarkdown4.9 KB
palettes/bold-energetic.mdmarkdown417 B
palettes/clean-corporate.mdmarkdown410 B
palettes/dark-premium.mdmarkdown389 B
palettes/jewel-rich.mdmarkdown394 B
palettes/monochrome.mdmarkdown454 B
palettes/nature-earth.mdmarkdown399 B
palettes/neon-electric.mdmarkdown380 B
palettes/pastel-soft.mdmarkdown392 B
palettes/warm-editorial.mdmarkdown411 B
patterns.mdmarkdown5.4 KB
references/animejs-adapter.mdmarkdown3.2 KB
references/audio-reactive.mdmarkdown3.0 KB
references/beat-direction.mdmarkdown13.5 KB
references/captions.mdmarkdown7.7 KB
references/css-animations-adapter.mdmarkdown3.8 KB
references/css-patterns.mdmarkdown8.1 KB
references/design-picker.mdmarkdown11.9 KB
references/dynamic-techniques.mdmarkdown7.6 KB
references/html-in-canvas-patterns.mdmarkdown16.8 KB
references/lottie-adapter.mdmarkdown3.3 KB
references/motion-principles.mdmarkdown11.3 KB
references/narration.mdmarkdown3.4 KB
references/prompt-expansion.mdmarkdown5.5 KB
references/techniques.mdmarkdown20.6 KB
references/text-effects.mdmarkdown4.0 KB
references/three-adapter.mdmarkdown3.5 KB
references/transcript-guide.mdmarkdown5.7 KB
references/transitions.mdmarkdown12.5 KB
references/transitions/catalog.mdmarkdown6.1 KB
references/transitions/css-3d.mdmarkdown421 B
references/transitions/css-blur.mdmarkdown1.7 KB
references/transitions/css-cover.mdmarkdown1.4 KB
references/transitions/css-destruction.mdmarkdown4.4 KB
references/transitions/css-dissolve.mdmarkdown2.4 KB
references/transitions/css-distortion.mdmarkdown1.8 KB
references/transitions/css-grid.mdmarkdown370 B
references/transitions/css-light.mdmarkdown2.3 KB
references/transitions/css-mechanical.mdmarkdown1.6 KB
references/transitions/css-other.mdmarkdown838 B
references/transitions/css-push.mdmarkdown1.2 KB
references/transitions/css-radial.mdmarkdown1.0 KB
references/transitions/css-scale.mdmarkdown715 B
references/typegpu-adapter.mdmarkdown6.5 KB
references/typography.mdmarkdown9.1 KB
references/video-composition.mdmarkdown3.6 KB
references/waapi-adapter.mdmarkdown3.1 KB
scripts/animation-map.mjsscript19.0 KB
scripts/contrast-report.mjsscript12.3 KB
scripts/package-loader.mjsscript8.1 KB
templates/design-picker.htmlother43.1 KB
visual-styles.mdmarkdown11.5 KB

references/dynamic-techniques.md

View on GitHub
# Dynamic Caption Techniques

You are here because SKILL.md told you to read this file before writing animation code. Pick your technique combination from the table below based on the energy level you detected from the transcript, then implement using standard GSAP patterns.

## Technique Selection by Energy

Captions are a constrained surface — the highlight and exit technique is closely tied to how much intensity the spoken content carries. The table below is a calibration reference. If DESIGN.md or the storyboard specifies a caption style, that overrides anything here.

The core principle: **all energy levels use karaoke highlight as the baseline.** The difference is intensity — not the technique type.

**What changes with energy:**

- **Highlight intensity:** high energy gets accent color + glow + 15% scale pop on active words. Low energy gets a gentle white shift with 3% scale. The karaoke behavior is the same; the amplitude is different.
- **Exit style:** high energy exits scatter or drop (the word leaves with motion). Low energy exits collapse (the word simply fades or shrinks). The exit should express the same energy as the content.
- **Cycle variation:** high energy alternates highlight styles every 2 groups for variety. Low energy uses a single consistent style, varying only the ease. Variation itself creates energy; consistency creates calm.

Calibration reference (starting points, not rules):

| Energy level | Highlight amplitude                 | Exit                | Cycle variation |
| ------------ | ----------------------------------- | ------------------- | --------------- |
| High         | Accent color + glow + 15% scale pop | Scatter or drop     | Every 2 groups  |
| Medium-high  | Color pop, no glow                  | Scatter or collapse | Every 3 groups  |
| Medium       | White shift only                    | Fade + slide        | Every 3 groups  |
| Medium-low   | Minimal scale change                | Fade                | Single style    |
| Low          | Warm tones, slow transition         | Collapse            | Single style    |

**All energy levels use karaoke highlight as the baseline.** The difference is intensity — high energy gets accent color + glow + 15% scale pop on active words, low energy gets a gentle white shift with 3% scale.

**Emphasis words always break the pattern.** When a word is flagged as emphasis (emotional keyword, ALL CAPS, brand name), give it a stronger animation than surrounding words (larger scale, accent color, overshoot ease). This creates contrast.

**Marker highlight modes add a visual layer on top of karaoke.** For emphasis words that need more than color/scale, add a marker-style effect — highlight sweep, circle, burst, or scribble — using the `/marker-highlight` skill. Match mode to energy: burst for hype, circle for key terms, highlight for standard, scribble for subtle.

## Audio-Reactive Captions (Mandatory for Music)

**If the source audio is music (vocals over instrumentation, beats, any musical content), you MUST extract audio data and add audio-reactive animations.** This is not optional — music without audio reactivity looks disconnected. Even low-energy ballads get subtle bass pulse and treble glow.

No special wiring is needed. The group loop already iterates over every caption group to build entrance, karaoke, and exit tweens. At that point, read the audio data for each group's time range and use it to modulate the group's animation intensity with regular GSAP tweens.

```js
// Load audio data inline (same pattern as TRANSCRIPT)
var AUDIO = JSON.parse(audioDataJson); // { fps, totalFrames, frames: [{ bands: [...] }] }

GROUPS.forEach(function (group, gi) {
  var groupEl = document.getElementById("cg-" + gi);
  if (!groupEl) return;

  // Read peak energy for this group's time range
  var startFrame = Math.floor(group.start * AUDIO.fps);
  var endFrame = Math.min(Math.floor(group.end * AUDIO.fps), AUDIO.totalFrames - 1);
  var peakBass = 0;
  var peakTreble = 0;
  for (var f = startFrame; f <= endFrame; f++) {
    var frame = AUDIO.frames[f];
    if (!frame) continue;
    peakBass = Math.max(peakBass, frame.bands[0] || 0, frame.bands[1] || 0);
    peakTreble = Math.max(peakTreble, frame.bands[6] || 0, frame.bands[7] || 0);
  }

  // Modulate entrance — louder groups enter bigger and glowier
  tl.to(
    groupEl,
    {
      scale: 1 + peakBass * 0.06,
      textShadow:
        "0 0 " + Math.round(peakTreble * 12) + "px rgba(255,255,255," + peakTreble * 0.4 + ")",
      duration: 0.3,
      ease: "power2.out",
    },
    group.start,
  );

  // Reset at exit so audio-driven values don't persist
  tl.set(groupEl, { scale: 1, textShadow: "none" }, group.end - 0.15);
});
```

This shapes the animation at build time, not playback time — no per-frame callbacks, no `tl.call()` loops, no async fetch timing issues. Loud groups come in with more weight and glow; quiet groups come in soft. The audio data modulates _how much_, the content determines _what_.

Keep audio reactivity subtle — 3-6% scale variation and soft glow. Heavy pulsing makes text unreadable.

To generate the audio data file:

```bash
python3 skills/gsap-effects/scripts/extract-audio-data.py audio.mp3 --fps 30 --bands 8 -o audio-data.json
```

## Combining Techniques

Don't use the same highlight animation on every group — cycle through styles using the group index. Don't combine multiple competing animations on the same word at the same timestamp. Vary techniques across groups to match the content's pace changes.

**Marker highlight effects** (from the `/marker-highlight` skill) layer well with karaoke — use karaoke for the word-by-word reveal, then add a marker effect on emphasis words only. For example: karaoke highlights each word in white, but brand names get a yellow highlight sweep and stats get a red circle. Cycle marker modes across groups for visual variety (see the mode-to-energy mapping in the marker-highlight skill).

## Available Tools

These tools are available in the HyperFrames runtime. Use them when they solve a real problem — not every composition needs all of them.

| Tool                | What it does                                                              | Access                                                                                         | When it's useful                                                             |
| ------------------- | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| **pretext**         | Pure-arithmetic text measurement without DOM reflow. 0.0002ms per call.   | `window.__hyperframes.pretext.prepare(text, font)` / `.layout(prepared, maxWidth, lineHeight)` | Per-frame text reflow, shrinkwrap containers, computing layout before render |
| **fitTextFontSize** | Finds the largest font size that fits text on one line. Built on pretext. | `window.__hyperframes.fitTextFontSize(text, { maxWidth, fontFamily, fontWeight })`             | Overflow prevention for long phrases, portrait mode, large base sizes        |
| **audio data**      | Pre-extracted per-frame RMS energy and frequency bands.                   | Extract with `extract-audio-data.py`, load inline or via `fetch("audio-data.json")`            | Audio-reactive visuals — modulate intensity based on the music               |
| **GSAP**            | Animation timeline with tweens and callbacks.                             | `gsap.to()`, `gsap.set()`, `tl.to()`, `tl.set()`                                               | All caption animation                                                        |
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 466kUpdated Claude CodeCodexVerifiedInstall
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 466kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 319kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 319kUpdated Claude CodeCodexVerifiedInstall