Skip to content

Commit 8662598

Browse files
docs: add runtime adapter skills (#572)
* docs: add runtime adapter skills * docs: address adapter skill review comments
1 parent 2045e21 commit 8662598

15 files changed

Lines changed: 626 additions & 28 deletions

File tree

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hyperframes",
3-
"description": "HyperFrames by HeyGen. Write HTML, render video. Compositions, GSAP animations, captions, voiceovers, audio-reactive visuals, and website-to-video capture for HyperFrames.",
3+
"description": "HyperFrames by HeyGen. Write HTML, render video. Compositions, GSAP and runtime adapter animations, captions, voiceovers, audio-reactive visuals, and website-to-video capture for HyperFrames.",
44
"version": "0.1.0",
55
"author": {
66
"name": "HeyGen",

.codex-plugin/plugin.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "hyperframes",
33
"version": "0.1.0",
4-
"description": "Write HTML, render video. Compositions, GSAP animations, captions, voiceovers, audio-reactive visuals, and website-to-video capture for HyperFrames.",
4+
"description": "Write HTML, render video. Compositions, GSAP and runtime adapter animations, captions, voiceovers, audio-reactive visuals, and website-to-video capture for HyperFrames.",
55
"author": {
66
"name": "HeyGen",
77
"email": "hyperframes@heygen.com",
@@ -15,6 +15,10 @@
1515
"video",
1616
"html",
1717
"gsap",
18+
"lottie",
19+
"three",
20+
"waapi",
21+
"animejs",
1822
"animation",
1923
"composition",
2024
"rendering",
@@ -26,7 +30,7 @@
2630
"interface": {
2731
"displayName": "HyperFrames by HeyGen",
2832
"shortDescription": "Write HTML, render video",
29-
"longDescription": "Build videos from HTML with HyperFrames. Author compositions with HTML + CSS + GSAP, use the CLI for init/preview/render/transcribe/tts, install reusable registry blocks and components, follow the GSAP animation reference, and turn any website into a video with the 7-step capture-to-video pipeline.",
33+
"longDescription": "Build videos from HTML with HyperFrames. Author compositions with HTML, CSS, GSAP, Anime.js, Lottie, Three.js, and WAAPI adapter patterns, use the CLI for init/preview/render/transcribe/tts, install reusable registry blocks and components, and turn any website into a video with the 7-step capture-to-video pipeline.",
3034
"developerName": "HeyGen",
3135
"category": "Design",
3236
"capabilities": ["Read", "Write"],

.cursor-plugin/plugin.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "hyperframes",
44
"displayName": "HyperFrames by HeyGen",
55
"version": "0.1.0",
6-
"description": "Write HTML, render video. Compositions, GSAP animations, captions, voiceovers, audio-reactive visuals, and website-to-video capture for HyperFrames.",
6+
"description": "Write HTML, render video. Compositions, GSAP and runtime adapter animations, captions, voiceovers, audio-reactive visuals, and website-to-video capture for HyperFrames.",
77
"author": {
88
"name": "HeyGen",
99
"email": "hyperframes@heygen.com"
@@ -19,6 +19,10 @@
1919
"video",
2020
"html",
2121
"gsap",
22+
"lottie",
23+
"three",
24+
"waapi",
25+
"animejs",
2226
"animation",
2327
"composition",
2428
"rendering",

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ will not match CI. Use it only for local-only experimentation.
6767

6868
## Skills
6969

70-
Composition authoring (not repo development) is guided by skills installed via `npx skills add heygen-com/hyperframes`. See `skills/` for source. Invoke `/hyperframes`, `/hyperframes-cli`, `/hyperframes-registry`, or `/gsap` when authoring compositions. When a user provides a website URL and wants a video, invoke `/website-to-hyperframes` — it runs the full 7-step capture-to-video pipeline.
70+
Composition authoring (not repo development) is guided by skills installed via `npx skills add heygen-com/hyperframes`. See `skills/` for source. Invoke `/hyperframes`, `/hyperframes-cli`, `/hyperframes-registry`, or `/gsap` when authoring compositions. Use `/animejs`, `/css-animations`, `/lottie`, `/three`, or `/waapi` when a composition uses those first-party runtime adapters. When a user provides a website URL and wants a video, invoke `/website-to-hyperframes` — it runs the full 7-step capture-to-video pipeline.

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Install the HyperFrames skills, then describe the video you want:
3232
npx skills add heygen-com/hyperframes
3333
```
3434

35-
This teaches your agent (Claude Code, Cursor, Gemini CLI, Codex) how to write correct compositions and GSAP animations. In Claude Code, the skills register as slash commands — invoke `/hyperframes` to author compositions, `/hyperframes-cli` for CLI commands, and `/gsap` for animation help.
35+
This teaches your agent (Claude Code, Cursor, Gemini CLI, Codex) how to write correct compositions, GSAP timelines, and first-party adapter animations. In Claude Code, the skills register as slash commands — invoke `/hyperframes` to author compositions, `/hyperframes-cli` for CLI commands, `/gsap` for timeline animation help, or the adapter skills (`/animejs`, `/css-animations`, `/lottie`, `/three`, `/waapi`) when a composition uses those runtimes.
3636

3737
For Claude Design, open [`docs/guides/claude-design-hyperframes.md`](https://github.com/heygen-com/hyperframes/blob/main/docs/guides/claude-design-hyperframes.md) on GitHub and click the download button (↓) to save it, then attach the file to your Claude Design chat. It produces a valid first draft; refine in any AI coding agent. See the [Claude Design guide](https://hyperframes.heygen.com/guides/claude-design).
3838

@@ -185,14 +185,19 @@ HyperFrames ships [skills](https://github.com/vercel-labs/skills) that teach AI
185185
npx skills add heygen-com/hyperframes
186186
```
187187

188-
| Skill | What it teaches |
189-
| ------------------------- | -------------------------------------------------------------------------------------------- |
190-
| `hyperframes` | HTML composition authoring, captions, TTS, audio-reactive animation, transitions |
191-
| `hyperframes-cli` | CLI commands: init, lint, preview, render, transcribe, tts, doctor |
192-
| `hyperframes-registry` | Block and component installation via `hyperframes add` |
193-
| `website-to-hyperframes` | Capture a URL and turn it into a video — full website-to-video pipeline |
194-
| `remotion-to-hyperframes` | Translate a Remotion (React) composition into a HyperFrames HTML composition |
195-
| `gsap` | GSAP animation API, timelines, easing, ScrollTrigger, plugins, React/Vue/Svelte, performance |
188+
| Skill | What it teaches |
189+
| ------------------------- | ------------------------------------------------------------------------------------------------------------------- |
190+
| `hyperframes` | HTML composition authoring, captions, TTS, audio-reactive animation, transitions |
191+
| `hyperframes-cli` | CLI commands: init, lint, preview, render, transcribe, tts, doctor |
192+
| `hyperframes-registry` | Block and component installation via `hyperframes add` |
193+
| `website-to-hyperframes` | Capture a URL and turn it into a video — full website-to-video pipeline |
194+
| `remotion-to-hyperframes` | Translate a Remotion (React) composition into a HyperFrames HTML composition |
195+
| `gsap` | GSAP timelines for HyperFrames: paused registration, deterministic seeking, easing, sequencing, performance |
196+
| `animejs` | Anime.js animations and timelines registered on `window.__hfAnime` for deterministic HyperFrames seeking |
197+
| `css-animations` | CSS keyframe animation patterns that HyperFrames can discover, pause, and seek |
198+
| `lottie` | `lottie-web` and dotLottie players registered on `window.__hfLottie` with local assets and paused playback |
199+
| `three` | Three.js scenes that render from HyperFrames `hf-seek` events and `window.__hfThreeTime` instead of wall-clock time |
200+
| `waapi` | Web Animations API `element.animate()` patterns seeked through `document.getAnimations()` |
196201

197202
## Contributing
198203

docs/concepts/frame-adapters.mdx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,16 @@ These rules are non-negotiable for any adapter. They are the foundation of Hyper
104104

105105
## Supported Runtimes
106106

107-
First-party adapters:
108-
109-
| Runtime | Seek Method | Status |
110-
|---------|------------|--------|
111-
| [GSAP](/guides/gsap-animation) | `timeline.seek(frame / fps)` | Available |
112-
| CSS/WAAPI | `animation.currentTime` | Planned |
113-
| Lottie | Set animation frame/progress | Planned |
114-
| Three.js/WebGL | Compute deterministic scene state | Planned |
115-
| SVG/Anime | Implement seek + duration contract | Planned |
107+
First-party runtime adapters:
108+
109+
| Runtime | Seek Method | Skill |
110+
|---------|-------------|-------|
111+
| [GSAP](/guides/gsap-animation) | `timeline.totalTime(timeSeconds)` or `timeline.seek(timeSeconds)` | `/gsap` |
112+
| Anime.js | `instance.seek(timeMs)` for animations registered on `window.__hfAnime` | `/animejs` |
113+
| CSS keyframes | Browser `Animation.currentTime`, with paused negative-delay fallback | `/css-animations` |
114+
| Lottie / dotLottie | `goToAndStop(timeMs, false)`, raw-frame setters, or player seek APIs | `/lottie` |
115+
| Three.js / WebGL | `hf-seek` events plus `window.__hfThreeTime` for deterministic scene rendering | `/three` |
116+
| Web Animations API | `document.getAnimations()` and `animation.currentTime` | `/waapi` |
116117

117118
Community adapters are welcome -- if it can seek by frame, it belongs in Hyperframes.
118119

docs/packages/cli.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ This is suppressed in CI environments, non-TTY shells, and when `HYPERFRAMES_NO_
697697

698698
### `skills`
699699

700-
Install HyperFrames and GSAP skills for AI coding tools:
700+
Install HyperFrames skills for AI coding tools, including first-party runtime adapter skills:
701701

702702
```bash
703703
# Install to all default targets (Claude Code, Gemini CLI, Codex CLI)
@@ -716,7 +716,7 @@ This is suppressed in CI environments, non-TTY shells, and when `HYPERFRAMES_NO_
716716
| `--codex` | Install to Codex CLI (`~/.codex/skills/`) |
717717
| `--cursor` | Install to Cursor (`.cursor/skills/` in current project) |
718718

719-
Skills are fetched from GitHub and include composition authoring, GSAP animation patterns, registry block/component wiring, and other domain-specific knowledge. The `init` command also offers to install skills automatically after scaffolding a project.
719+
Skills are fetched from GitHub and include composition authoring, GSAP animation patterns, Anime.js, CSS animation, Lottie, Three.js, and WAAPI adapter patterns, registry block/component wiring, and other domain-specific knowledge. The `init` command also offers to install skills automatically after scaffolding a project.
720720

721721
#### Troubleshooting: `fatal: active post-checkout hook found during git clone`
722722

docs/quickstart.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Install the HyperFrames skills, then describe the video you want:
1313
npx skills add heygen-com/hyperframes
1414
```
1515

16-
This teaches your agent (Claude Code, Cursor, Gemini CLI, Codex) how to write correct compositions and GSAP animations. In Claude Code the skills register as slash commands — `/hyperframes` for composition authoring, `/hyperframes-cli` for CLI commands, and `/gsap` for animation help. Invoking the slash command loads the skill context explicitly, which produces correct output the first time.
16+
This teaches your agent (Claude Code, Cursor, Gemini CLI, Codex) how to write correct compositions, GSAP timelines, and first-party adapter animations. In Claude Code the skills register as slash commands — `/hyperframes` for composition authoring, `/hyperframes-cli` for CLI commands, `/gsap` for timeline animation help, and `/animejs`, `/css-animations`, `/lottie`, `/three`, or `/waapi` when a composition uses those runtimes. Invoking the slash command loads the skill context explicitly, which produces correct output the first time.
1717

1818
<Note>
1919
Claude Design uses a different entry path. Open [`docs/guides/claude-design-hyperframes.md`](https://github.com/heygen-com/hyperframes/blob/main/docs/guides/claude-design-hyperframes.md) on GitHub, click the download button (↓) to save it, then attach to your Claude Design chat. It produces a valid first draft you can refine in any AI coding agent. See the [Claude Design guide](/guides/claude-design).
@@ -47,7 +47,7 @@ Copy any of these into your agent to get started.
4747
The agent handles scaffolding, animation, and rendering. See the [prompting guide](/guides/prompting) for more patterns.
4848

4949
<Tip>
50-
Skills encode HyperFrames-specific patterns — like required `class="clip"` on timed elements, GSAP timeline registration, and `data-*` attribute semantics — that are not in generic web docs. Using skills produces correct compositions from the start.
50+
Skills encode HyperFrames-specific patterns — like required `class="clip"` on timed elements, GSAP timeline registration, adapter registries such as `window.__hfLottie`, and `data-*` attribute semantics — that are not in generic web docs. Using skills produces correct compositions from the start.
5151
</Tip>
5252

5353
## Option 2: Start a project manually

packages/cli/src/templates/_shared/CLAUDE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
| **hyperframes-registry** | `/hyperframes-registry` | Installing blocks and components via `hyperframes add` |
1212
| **website-to-hyperframes** | `/website-to-hyperframes` | Capturing a URL and turning it into a video — full website-to-video pipeline |
1313
| **gsap** | `/gsap` | GSAP animations for HyperFrames — tweens, timelines, easing, performance |
14+
| **animejs** | `/animejs` | Anime.js animations registered on `window.__hfAnime` |
15+
| **css-animations** | `/css-animations` | CSS keyframes that HyperFrames can pause and seek |
16+
| **lottie** | `/lottie` | `lottie-web` and dotLottie players registered on `window.__hfLottie` |
17+
| **three** | `/three` | Three.js scenes rendered from HyperFrames `hf-seek` events |
18+
| **waapi** | `/waapi` | Web Animations API motion driven through `document.getAnimations()` |
1419

1520
> **Skills not available?** Ask the user to run `npx hyperframes skills` and restart their
1621
> agent session, or install manually: `npx skills add heygen-com/hyperframes`.

skills/animejs/SKILL.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
name: animejs
3+
description: Anime.js adapter patterns for HyperFrames. Use when writing Anime.js animations or timelines inside HyperFrames compositions, registering animations on window.__hfAnime, making Anime.js seek-driven and deterministic, or translating Anime.js examples into render-safe HyperFrames HTML.
4+
---
5+
6+
# Anime.js for HyperFrames
7+
8+
HyperFrames can seek Anime.js instances through its `animejs` runtime adapter. The composition owns the animation objects; HyperFrames owns the clock.
9+
10+
## Contract
11+
12+
- Create animations or timelines synchronously during composition initialization.
13+
- Set `autoplay: false` so Anime.js does not advance on its own clock.
14+
- Register every returned animation or timeline on `window.__hfAnime`.
15+
- Use finite durations and loop counts.
16+
- Avoid callbacks that mutate DOM based on wall-clock time, network state, or unseeded randomness.
17+
18+
The adapter seeks every registered instance with `instance.seek(timeMs)`, where `timeMs` is HyperFrames time in milliseconds.
19+
20+
## Basic Pattern
21+
22+
```html
23+
<script src="https://cdn.jsdelivr.net/npm/animejs@4.0.2/lib/anime.iife.min.js"></script>
24+
<script>
25+
const anim = anime({
26+
targets: ".mark",
27+
translateX: 280,
28+
rotate: "1turn",
29+
opacity: [0, 1],
30+
duration: 1200,
31+
easing: "easeOutExpo",
32+
autoplay: false,
33+
});
34+
35+
window.__hfAnime = window.__hfAnime || [];
36+
window.__hfAnime.push(anim);
37+
</script>
38+
```
39+
40+
## Timeline Pattern
41+
42+
```html
43+
<script>
44+
const tl = anime.timeline({
45+
autoplay: false,
46+
easing: "easeOutCubic",
47+
});
48+
49+
tl.add({
50+
targets: ".title",
51+
translateY: [40, 0],
52+
opacity: [0, 1],
53+
duration: 650,
54+
}).add(
55+
{
56+
targets: ".accent",
57+
scaleX: [0, 1],
58+
duration: 450,
59+
},
60+
250,
61+
);
62+
63+
window.__hfAnime = window.__hfAnime || [];
64+
window.__hfAnime.push(tl);
65+
</script>
66+
```
67+
68+
## Module Builds
69+
70+
If you use an ES module build, the adapter does not care how the instance was created. It only needs the returned object to expose `seek()`, `pause()`, and preferably `play()`:
71+
72+
```html
73+
<script type="module">
74+
import { animate } from "https://cdn.jsdelivr.net/npm/animejs/+esm";
75+
76+
const anim = animate(".chip", {
77+
x: "18rem",
78+
duration: 900,
79+
autoplay: false,
80+
});
81+
82+
window.__hfAnime = window.__hfAnime || [];
83+
window.__hfAnime.push(anim);
84+
</script>
85+
```
86+
87+
## Good Uses
88+
89+
- Small SVG and DOM flourishes where Anime.js syntax is compact.
90+
- Imported Anime.js examples that can be made seek-driven.
91+
- Multiple independent micro-animations pushed into the same registry.
92+
93+
Use GSAP for complex scene sequencing unless the user specifically asks for Anime.js. GSAP is still the primary HyperFrames authoring path.
94+
95+
## Avoid
96+
97+
- Leaving `autoplay` at the Anime.js default.
98+
- Depending on `anime.running` auto-discovery instead of explicit `window.__hfAnime.push(...)`.
99+
- Infinite loops. Compute a finite repeat count from the composition duration.
100+
- Building animations in timers, promises, event handlers, or after async asset loads.
101+
102+
## Validation
103+
104+
After editing a composition that uses Anime.js:
105+
106+
```bash
107+
npx hyperframes lint
108+
npx hyperframes validate
109+
```
110+
111+
## Credits And References
112+
113+
- HyperFrames adapter source: `packages/core/src/runtime/adapters/animejs.ts`.
114+
- Anime.js documentation for `autoplay`, `pause()`, and `seek()`: https://animejs.com/documentation/

0 commit comments

Comments
 (0)