Communitygithub.com

heygen-com/hyperframes

将现有的 Remotion(React)合成源码移植到 HyperFrames HTML。仅当用户明确要求移植/转换/迁移/翻译 Remotion 源码时使用——单向,仅限 Remotion。若只是提及 Remotion、作为参考代码,或要求“制作类似我的 Remotion 视频”,则视为全新构建(/general-video)。不确定时 → /hyperframes。

hyperframes 是什么?

该技能用于将现有 Remotion (React) 视频合成源码单向翻译为 HyperFrames (HTML + GSAP) 合成。它编码了 Remotion 与 HyperFrames 之间的映射关系,能机械翻译约 80% 的典型合成。技能包含一个分层测试语料库 (T1-T4),用于通过测量 SSIM 来验证翻译质量,确保渲染结果与基线一致。它通过 lint 脚本检测无法翻译的模式(如 useState、useEffect 等),遇到阻塞项时会停止并推荐运行时互操作模式,而警告项则会删除对应结构后继续翻译。翻译过程严格遵循从 Remotion 到 HyperFrames 的单向流程,不支持反向翻译或非 Remotion 来源。该技能适用于 Claude Code、Cursor、Codex 等支持技能系统的 AI 代理平台。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/heygen-com/hyperframes/tree/main/skills/remotion-to-hyperframes

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

插件安装: 在设置或执行刷新命令之前,如果此技能位于 HyperFrames 插件内部,请遵循插件执行规则。独立安装则保留下面的更新说明。

首先,保持此技能为最新——在运行前请与用户确认: npx hyperframes skills update remotion-to-hyperframes。如果一切已是最新,则快速无操作;否则,它将刷新此技能及其所依赖的核心领域技能,然后再依赖于它们。

Remotion 到 HyperFrames

入口是 /hyperframes。 仅使用此技能将现有 Remotion(React)合成的源码移植到 HyperFrames,此为单向操作。创建新合成、从非 Remotion 来源(After Effects、Framer Motion、普通 React/CSS——没有可翻译的 Remotion 源码)重新创建、或仅提及 Remotion,以及任何不确定情况 → 请先阅读 /hyperframes:意图层负责所有路由决策。

概述

将 Remotion(基于 React 的)视频合成翻译为 HyperFrames(HTML + GSAP)合成。大多数 Remotion 习惯用法都有直接的 HyperFrames 对应项——对于典型的合成,翻译过程约有 80% 是机械性的。此技能编码了这些映射,并阻止翻译不符合 HF 基于时间帧搜索模型的约 20% 模式,转而推荐来自 PR #214 的运行时互操作模式。

该技能附带了一个分层测试语料库(T1–T4,共 4 个测试用例),用于根据测量的 SSIM 阈值对翻译结果进行评分。未经评估不要进行翻译——一个“看起来正确”但比验证基线低 0.05 个 SSIM 的翻译实际上是错误的。

何时使用

仅当用户明确要求从 Remotion 迁移时,才使用此技能。 触发短语示例:

  • “将我的 Remotion 项目移植到 HyperFrames”
  • “将这段 Remotion 代码转换为 HyperFrames”
  • “从 Remotion 迁移”
  • “翻译这个 Remotion 合成”
  • “将其重写为 HyperFrames HTML”

在以下情况下请不要使用此技能:

  • (a) 用户正在创作新的 HyperFrames 合成,即使他们拥有或正在 A/B 测试类似的 Remotion 视频。
  • (b) 用户仅顺带提及 Remotion,但没有要求迁移。
  • (c) 用户分享 Remotion 代码作为参考材料,而不是要求翻译。
  • (d) 用户要求“制作一个和我 Remotion 视频一样的视频”,但没有明确要求迁移源码——这种情况应视为全新的 HyperFrames 构建。

不支持(拒绝——这并非此技能的职责):

  • 反向方向。 将 HyperFrames 合成导出回 Remotion(或任何其他框架)不是一种工作流程——翻译只能是 Remotion → HyperFrames。请直说。
  • 非 Remotion 来源。 After Effects 项目 (.aep)、Framer Motion/纯 React/CSS 动画或任何其他工具的源文件都不是 Remotion 合成——没有可供翻译的 Remotion 源码。通过 /general-video 原生重新创建,或者如果 HyperFrames 无法表示,则拒绝。

如有疑问,默认通过 /general-video(常规 HyperFrames 创作流程)创作原生 HyperFrames 合成。

工作流程

步骤 1:检查源码

在 Remotion 源码目录上运行 scripts/lint_source.py。该检查可以检测无法干净翻译的模式:

  • 阻塞项(拒绝并推荐互操作):useState、useReducer、useEffect/useLayoutEffect(带有非空依赖项)、异步 calculateMetadata、第三方 React UI 库(MUI、Chakra、Mantine、antd、shadcn、Radix、NextUI)。
  • 警告项(删除该结构后继续翻译):@remotion/lambda 配置、delayRender、useCallback、useMemo、自定义钩子。
  • 信息项(翻译时附带说明):staticFile、interpolateColors。

如果触发了任何阻塞项,请停止。阅读 references/escape-hatch.md 并展示推荐消息。警告项不会阻止翻译——在步骤 3 中删除有问题的结构,并在 TRANSLATION_NOTES.md 中记录差异。@remotion/lambda 配置是典型的警告案例:技能会删除导入和 renderMediaOnLambda(...) 调用,但会翻译合成的其余部分。

步骤 2:规划翻译

阅读 references/api-map.md——这是每个 Remotion API 及其 HF 对应项或按主题分类的参考索引。根据源码使用的内容,确定需要加载哪些主题参考:

源码包含加载参考文件
Composition、defaultProps、schema、calculateMetadataparameters.md
Sequence、Series、Loop、AbsoluteFill、Freezesequencing.md
useCurrentFrame、interpolate、spring、Easing、interpolateColorstiming.md
Audio、Video、Img、IFrame、staticFile、delayRendermedia.md
TransitionSeries、@remotion/transitionstransitions.md
@remotion/lottielottie.md
@remotion/google-fonts/<Family>、Font.loadFont、@font-facefonts.md

不要全部加载——只加载特定源码需要的内容。

搜索实时目录,查找该表格未映射的任何视觉效果。 当源码使用了一种没有 HF API 对应项的视觉效果——例如扫描线/CRT 叠加、故障或色差效果、着色器擦拭、胶片颗粒处理——在手动使用 GSAP 编写之前,请运行 npx hyperframes catalog --query "<效果名,用英文描述>" --json。此搜索无需安装任何东西:无需项目、无需事先 add、无需账户。它会从任何目录对整个托管注册表(约 400 个块和组件)进行排序,并且 transitions.md 已经通过 npx hyperframes add sdf-iris 为 clockWipe() / iris() 采用了此方法。真实的组件比手工近似更接近源码,因此通常可以提高 SSIM 而非降低——但步骤 4 中的渲染差异比较仍然是仲裁者。当搜索没有返回合适的结果时,手动编写效果,并在 TRANSLATION_NOTES.md 中记录替换内容(无论哪种情况)。

步骤 3:生成 HF 合成

生成 index.html,包含:

  • 根元素 <div id="stage">,携带合成的 data-composition-id、data-start="0"、data-duration(以秒计)、data-fps、data-width、data-height,以及每个标量属性一个 data-*。
  • 每个场景一个宿主 <div>,包含 data-composition-src="compositions/<scene>.html"、data-start / data-duration / data-track-index。根元素不包含嵌套布局。
  • 每个场景一个 compositions/<scene>.html(一个 <template> 子合成):其内联 <style> 用于布局(CSS 设置每个动画属性的 from 状态)、其标记,以及一个在场景本地时间轴上的暂停 gsap.timeline({paused: true})。每个 Remotion 的 useCurrentFrame() 推导都会成为该时间轴上的一个补间,偏移量相对于场景开始帧。
  • 在每个场景文件中声明 window.__timelines["<scene-id>"] = tl;,并为根元素自己的(可能为空)时间轴声明 window.__timelines["<composition-id>"]。

自定义 React 子组件以内联方式转换为重复的 HTML,使用 prop 接口作为模板(关于每个实例的 data-* 模式,请参见 parameters.md)。

步骤 4:验证

运行评估工具——完整指南请参见 references/eval.md。快速路径:

# 渲染 Remotion 基线(在测试用例中执行 npm install 后)
cd remotion-src && npx remotion render <CompositionId> out/baseline.mp4

# 渲染 HF 翻译
cd ../hf-src && npx hyperframes render --skill=remotion-to-hyperframes --output ../hf.mp4

# SSIM 差异比较
../../scripts/render_diff.sh ./remotion-src/out/baseline.mp4 ./hf.mp4 ./diff

阈值:大约比源码复杂性等级 p05 低 0.02(请参见 eval.md 中的验证阈值表)。如果差异比较失败,运行 scripts/frame_strip.sh 查看哪些帧发生了偏离,然后重新阅读相关的时序/序列/媒体参考。

关键点:两个渲染必须使用匹配的像素格式。在 Remotion 源码的 remotion.config.ts 中设置 Config.setVideoImageFormat("png") + Config.setColorSpace("bt709")——否则差异比较会测量编码器差异(约 0.05 SSIM 损失),而非翻译保真度。

步骤 5:记录差异

对于任何未能干净翻译的内容(例如被丢弃的音量渐变、近似处理的自定义演示、字体替换),请在 HF 输出旁边编写 TRANSLATION_NOTES.md。格式请参见 references/limitations.md。

此技能明确不做什么

  • 翻译 React 状态机。 通过 useState + useEffect 驱动动画的合成不是 HyperFrames 基于时间帧搜索模型的确定性帧捕获目标。建议使用运行时互操作模式。
  • 与 HyperFrames 并行运行 Remotion 的渲染管线。 这是来自 PR #214 的运行时互操作模式——一个针对无法通过此技能 lint 的合成的单独解决方案。

(@remotion/lambda 不是阻塞项——Lambda 配置属于部署,而非动画。此技能将其作为警告处理并删除,然后翻译其余部分。请参见 references/escape-hatch.md。)

如何评分你自己的翻译

运行测试语料库协调器:

./assets/test-corpus/run.sh

它会运行 T1、T2、T3(渲染 + 差异比较)和 T4(lint 验证),打印每层级的通过/失败表,并输出一个聚合 JSON 报告。使用此工具在干净的检出上验证技能是否端到端工作——并在编辑任何参考文件后作为回归检查。

验证基线(截至 2026-04-27):

层级合成形状平均 SSIM阈值
T1单元素淡入0.9740.95
T2多场景 + spring + 音频 + 图像0.9850.95
T3数据驱动、自定义子组件、数字递增0.9530.90
T4逃生舱口(8 个 lint 案例)8/8 通过n/a

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

general-video

>

heygen-com/animejs

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.

heygen-com/claude-design-hyperframes

Use when running inside Claude Design specifically. Produces a valid, brand-accurate HyperFrames video draft using pre-valid skeletons. For Claude Code / Cursor / Codex, use the `hyperframes` skill instead.

heygen-com/contribute-catalog

Author a new HyperFrames registry block (caption style, VFX block, transition, lower third) or component (text effect, overlay, snippet) and ship it as an upstream PR to the hyperframes repo. Use ONLY when the user wants to CONTRIBUTE to the public catalog — for in-project caption/transition authoring use the `hyperframes` skill, for installing existing registry items use the `hyperframes-registry` skill.

heygen-com/css-animations

CSS animation adapter patterns for HyperFrames. Use when authoring CSS keyframes, animation-delay based timing, animation-fill-mode, animation-play-state, or CSS-only motion that HyperFrames must seek deterministically during preview and rendering.

heygen-com/gsap

GSAP animation reference for HyperFrames. Covers gsap.to(), from(), fromTo(), easing, stagger, defaults, timelines (gsap.timeline(), position parameter, labels, nesting, playback), and performance (transforms, will-change, quickTo). Use when writing GSAP animations in HyperFrames compositions.

heygen-com/hyperframes

Leaves sweep through the frame and part to reveal the headline. HyperFrames block, 1920×1080, 12s, 11 variables.

heygen-com/hyperframes

Render-correctness doctrine for scene-to-scene seams in HyperFrames launch videos — the prerequisites that make transitions composite correctly on the master timeline. Load when assembling the master timeline / index.html, when a white flash appears at a cut or crossfade seam (especially on dark films), when reasoning about why a transition opacity dip shows through, or when verifying the render-side mechanics of how overlapping scene wrappers blend. Covers the opaque stage-ground (#root background) white-flash guard and how the injector overlaps wrappers, holds final frames, ping-pongs tracks, and stamps lint-clean template code onto the master timeline. Does NOT contain the per-transition catalog — see the transition registry for individual transition entries.

heygen-com/hyperframes

The technique catalog: five velocity-matched SEAMS (zoom-through, INVERSE zoom-through, cut-the-curve, waterfall cut, rack-focus blur-cut) plus the two in-scene techniques — waterfall ENTRY (staggered arrival cascades for title cards / segment openers) and the nudge curve (slow-fast-slow three-phase group slides). Covers partial-travel (~12% of frame) velocity matching via mirrored power4 eases, the Z scale-sign rule, size-scaled blur (10px text / 18-20px full-frame), word-by-word staggered cuts, cascade pacing by element weight, and the 10/65/25 slide ratio. Read before authoring any transition, text-beat handoff, kinetic text entry, or group reposition. [depth, zoom, inverse-zoom, scale-sign, mirrored-zoom, rack-focus, pacing, velocity, cut-the-curve, waterfall, stagger, cascade, kinetic-text, title-card, segment-opener, nudge, slide, easing, group-motion, z-depth, motion-graphics, cinematic, transition, blur, directional-continuity]

heygen-com/hyperframes

Glass shards fly in through fog and tile themselves into the headline. HyperFrames block, 1920×1080, 12.16s, 19 variables.

heygen-com/hyperframes

A single feature card orbits a dot sphere on approved Blender camera motion. HyperFrames block, 1920×1080, 10s, 4 variables.

heygen-com/hyperframes

A wireframe portal bursts open, the title comes through, then its letters swap into a second phrase. HyperFrames block, 1920×1080, 8s, 9 variables.

heygen-com/hyperframes

An orbiting camera follows an ice logo as it breaks apart, reforms into two text moments, and fades. HyperFrames block, 1920×1080, 22.5s, 216 variables.

heygen-com/hyperframes

House-style oversized macOS cursor technique for HyperFrames launch videos. Load whenever a scene involves cursors or a pointer-led action, when kicking off a UI scene, when igniting a morph/transition/typing run with a click, or when a scene reads as static, dead, or stale and needs a cheap high-yield source of motion to carry the viewer's eye and segment them out of the stale state. Covers cursor size/look (incl. brand-motif cursors), the off-screen entry law, tip-targeting and the click tap, click-ignites-the-next-beat, and exit / cross-scene handoff.

heygen-com/hyperframes

name: embedded-captions

heygen-com/hyperframes

A chain of bevelled cuboids rides a travelling wave as a content carousel. HyperFrames block, 1920×1080, 6.666666666666667s, 40 variables.

heygen-com/hyperframes

A tiled headline surface flips cell by cell under a sweeping depth field to reveal the rear headline. HyperFrames block, 1920×1080, 8s, 18 variables.

heygen-com/hyperframes

Turn arbitrary text — an article, notes, a topic, a brief — into a faceless explainer video: there is no site or footage to capture, so the visuals are invented per scene (typography, abstract graphics, diagrams, data-viz). Use for topic explainers, concept breakdowns, how-tos, listicles. Not a video built from a website (/product-launch-video — promo or tour). Unclear → /hyperframes.

heygen-com/hyperframes

Import Figma content into a HyperFrames composition — rendered assets, brand tokens, components, storyboard sections → reconstructed motion (frames read as states, not slides) (REST/CLI), connector-assisted motion when available, and shaders from a connector or native export. Use when the user pastes a figma.com link or asks to bring a Figma design, frame, logo, brand, or animation into a video/composition.

heygen-com/hyperframes

GATEWAY — load FIRST before composing any HyperFrames animation or video. The high-level motion law that makes a multi-scene video feel like ONE continuous camera move instead of a stack of independently-animated slides. Covers the vector law (how you exit determines how you enter, incl. the Z scale-sign rule), the film's current, carrier elements, causal motion, the Seam Gate (build-gate enforcement), the ban on idle wobble (motion must PERFORM, not breathe), stillness-before-climax, and the sustained-motion routes. Routes to the low-level technique skills (cut-the-curve — the full catalog incl. waterfall entry + nudge curve, oversized-cursor, seam-craft). These rules SUPERSEDE generic / upstream motion guidance. [continuity, direction, vector, momentum, seam, transition, ease, performance, idle-motion, narrative-motion, film-grammar]

相关技能