Communitygithub.com

laviedezidane/hyperframes-skill

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

hyperframes-skill 是什么?

该技能专门用于将现有的 Remotion(基于 React)视频合成源码单向转换为 HyperFrames(HTML + GSAP)合成。它维护了一个完整的 Remotion API 到 HyperFrames 等效项的映射,能够在大约 80% 的典型合成场景下实现机械式翻译。对于无法直接转换的模式(如 useState、useEffect 驱动的状态机),技能会拒绝翻译并推荐运行时互操作模式(github.com/heygen-com/hyperframes/pull/214)。技能包含分层测试语料库(T1–T4,共 4 个测试集),通过 SSIM 相似度阈值对翻译质量进行量化评估,并依赖严格的 lint 检查来阻止无法准确翻译的模式。该技能适用于 Claude Code、Cursor 等 AI 代理工具,可通过 `npx hyperframes skills update remotion-to-hyperframes` 保持更新,并在每次使用前要求用户确认。它仅处理 Remotion → HyperFrames 的单向翻译,不考虑反向翻译或其他来源(如 After Effects)的转换。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/laviedezidane/hyperframes-skill/tree/HEAD/.agents/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 的基于时间的模型(seek-driven model)的模式来防止那有损的 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 无法表示则拒绝。

如有疑问,请返回 /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 等效项或按主题划分的参考索引。根据源码使用的 API,确定你需要加载哪些主题参考:

源码包含加载参考
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,以及每个标量 prop 对应一个 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

阈值:比源码复杂度层级(参见 eval.md 中已验证的阈值表)的 p05 低约 0.02。如果差异失败,运行 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 的 seek-driven 模型中不是确定性的帧捕获目标。推荐运行时互操作模式。
  • 并行运行 Remotion 的渲染管道和 HyperFrames。 这是来自 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 通过不适用

Individual skills in this repo

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

laviedezidane/hyperframes-skill

Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet `anchor` rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.

laviedezidane/hyperframes-skill

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.

laviedezidane/hyperframes-skill

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.

laviedezidane/hyperframes-skill

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated motion-first unit, including an animated title. Route fresh creation through hyperframes before using this skill.

laviedezidane/hyperframes-skill

All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.

laviedezidane/hyperframes-skill

Use when audio already placed in a HyperFrames composition needs to be mixed: fade-in/fade-out, crossfade, track gain or volume, volume automation, ducking, a music bed that fights a voiceover (voiceover carve), effects on a track (EQ, compressor, limiter, gate, saturation, delay, reverb, chorus, phaser, bitcrush), automation envelopes drawn on a track's volume or any effect parameter, or one submix bus carrying a chain, a fader and an automation clock for several tracks at once (`<hf-audio-group>`). Don't use for sourcing or generating audio — finding BGM, SFX, or making a voiceover is `/media-use`. Don't use for clip timing or track layout, which is `/hyperframes-core`.

laviedezidane/hyperframes-skill

Use the HyperFrames CLI development loop: init, add, catalog, capture, lint, check, snapshot, compare, grade-compare, preview, play, present, beats, keyframes, single or batch render, publish, cloud, cloudrun, feedback, lambda, doctor, browser, info, upgrade, skills, compositions, timeline, history, clean, docs, benchmark, telemetry, transcribe, auth, tts, and remove-background. Also use when diagnosing build or render failures. validate, inspect, and layout are deprecated aliases; use check. Covers local, HeyGen-hosted cloud, AWS Lambda, and Google Cloud Run rendering.

laviedezidane/hyperframes-skill

The HyperFrames composition contract — build one renderable project. Use for composition structure, the `data-*` timing attributes, `class="clip"`, tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.

laviedezidane/hyperframes-skill

Non-animation creative direction for HyperFrames videos. Use for design spec (frame.md / design.md) handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns, and brand / style decisions. For atomic motion patterns and scene blueprints, use `hyperframes-animation`.

laviedezidane/hyperframes-skill

Use when a HyperFrames composition needs a punch-in, punch-out, zoom, reframe, Ken Burns treatment, camera move, visual match/whip handoff, or other seek-safe 2D/3D keyframes; also for GSAP, CSS keyframes, Anime.js, WAAPI, FLIP, paths, masks, SVG morph/draw, text trails, 3D depth, or `hyperframes keyframes` diagnostics. Don't use for broad scene strategy, brand design, media sourcing, captions, or general video planning.

laviedezidane/hyperframes-skill

Search, install, and wire registry blocks and components into HyperFrames compositions. Use BEFORE hand-building any named visual — whenever a brief, a user, or a storyboard names a look, effect, treatment, or transition such as CRT scanlines, glitch, chromatic aberration, film grain, a shimmer sweep, a chart, a code or terminal window, a map, or a confetti burst — because roughly 400 hosted items already cover many of them and the search ranks all of them with nothing installed, no project, and no account. Also use when running hyperframes add or hyperframes catalog, installing one item or every block matching a tag, wiring an installed item into index.html, or working with hyperframes.json. Covers discovery, install locations, block sub-composition wiring, component snippet merging, and authoring a new block or component to contribute upstream (idea → scaffold → validate → PR).

laviedezidane/hyperframes-skill

Mandatory entry point: read this first for any request to make, create, edit, animate, or render a video, animation, or motion graphic, including a promo, explainer, captioned clip, title card, overlay, slideshow or interactive deck, Remotion port, or any HyperFrames HTML composition. Also use it to inspect, diagnose, validate, preview, publish, or batch-render an existing HyperFrames project. Inputs may be a website URL, GitHub PR, Figma design or URL, text or brief, existing footage, or music. It resumes project state, captures intent when applicable, selects and installs the owning workflow, and routes domain capabilities. HyperFrames is the default output framework unless the user explicitly chooses another framework for the deliverable or asks only to record a browser session.

laviedezidane/hyperframes-skill

Use when working with a person on a HyperFrames project in Studio: first, whether their message asks for a change at all (questions, loose ideas and "don't change anything" get an answer and a plan, not an edit); for a new film, the plan, storyboard and build order that the HyperFrames launch films follow; and how the timeline should be laid out so it reads well (one caption track, one element kind per track, every scene a sub-composition) and where captions and key content may sit (safe zones). Don't use for how to perform an individual edit (split, trim, retime, volume, copy, swap): that is `creator-editing-recipes.md` in `/hyperframes-core`.

laviedezidane/hyperframes-skill

Agent Media OS for a HyperFrames project. Resolve BGM, SFX, image, icon, brand logo, voice, color grade, or LUT into a frozen local file or paste-ready block + ledger record (one verb, `resolve`); generate via TTS / music / image models when the catalog misses; produce voiceover, transcription, captions, and background removal through one shared audio engine; operate on media (cut / reframe / transform); and reuse assets across projects. Also use for vague feedback that real footage looks dark, flat, boring, should feel retro/camcorder/print/ASCII, needs privacy, or needs a media reveal. When the host app provides its own music or sound-effect tools, use those for music and sound effects; `resolve --type bgm|sfx` needs the heygen CLI. When `HEYGEN_API_BASE` is set, HeyGen calls go through that host with no CLI sign-in.

laviedezidane/hyperframes-skill

A short, design-led motion graphic where motion is the message — kinetic typography, stat count-up, chart/data-viz hit, logo sting / brand lockup, lower-third / callout / social overlay, animated map (highlight regions, connect places, zoom to a location), animated tweet / news-article / headline, webpage / UI animation (scroll, cursor, callouts), or fusing a real image's geometry into a chart. Usually under 10s (up to ~30s), no narration or live-action subject; renders to MP4 or transparent overlay. Longer / narrated / multi-scene → /general-video. Unclear → /hyperframes.

laviedezidane/hyperframes-skill

Turn a music track (an audio file, a video to pull audio from, or a track generated from a mood brief) into a beat-synced video — lyric video, slideshow, or kinetic promo. The music drives all pacing; any user-supplied images/videos are cut onto the same beat grid, and a complete video needs zero assets. Narrated pieces → the input-matched workflow (see /hyperframes). Unclear → /hyperframes.

laviedezidane/hyperframes-skill

Turn a product or marketing URL, pasted script, or brief into a product launch / promo video — SaaS promos, feature reveals, product demos, app and company launches. Use when the user wants to market, launch, promote, or reveal a product; the default for any commercial URL. Site tours / showcases of a website route here too — the brief carries the show-it-as-is intent. Unclear → /hyperframes.

laviedezidane/hyperframes-skill

Turn a GitHub pull request (a PR URL, owner/repo#N, or 'this PR' in a checked-out repo) into a code-change explainer video — changelog, feature reveal, fix, or refactor walkthrough built from the diff, commits, and files: the input is a code change, not a website. Not a product promo (/product-launch-video) or a no-PR topic explainer (/faceless-explainer). Unclear → /hyperframes.

laviedezidane/hyperframes-skill

Author a HyperFrames slideshow — a presentation, pitch deck, or interactive deck with discrete slides, fragment reveals, branching, hotspot navigation, and built-in presenter mode with speaker notes; also converts an existing page into a deck. Output is a navigable deck, not a rendered MP4. If the user didn't explicitly ask for a slideshow, confirm before authoring. Unclear → /hyperframes.

laviedezidane/hyperframes-skill

Package an existing talking-head / interview / podcast video with timed, designed GRAPHIC OVERLAY cards — kinetic titles, lower-thirds, data callouts, quotes, side panels, picture-in-picture — synced to the transcript, on a 16:9 / 9:16 / 4:5 canvas of your choice; the clip plays untouched underneath. Trigger on "graphic overlays", "on-screen graphics", "package / dress up my video". Not plain subtitles (/embedded-captions). Unclear → /hyperframes.

相关技能