Communitygithub.com

DigitalRavagers/Experiment

将现有的 Remotion (React) 合成作品移植到 HyperFrames HTML。仅在用户明确要求移植/转换/迁移/翻译 Remotion 源代码时使用。

Experiment 是什么?

该技能旨在将基于 Remotion(React)的视频合成作品翻译成 HyperFrames(HTML + GSAP)格式。它主要将 Remotion 中的常见模式(如 useCurrentFrame、Sequence、Audio 等)机械地映射到 HyperFrames 中对应的 Seek-Driven 模型(如 GSAP 时间线和数据属性),覆盖约 80% 的典型需求。然而,它明确拒绝翻译 Remotion 中与 HyperFrames 不兼容的模式,例如基于状态(useState/useEffect)的动画或异步计算,并建议使用运行时互操作模式。该技能包含一个分层测试语料库(T1-T4),通过 SSIM 指标验证翻译准确性,确保视觉输出与原始 Remotion 基线高度一致。它同时提供严格的导入前检查,使用 lint 工具识别阻塞模式,并引导用户生成 TRANSLATION_NOTES.md 记录已知差距。请务必注意,该技能是单向的(仅从 Remotion 到 HyperFrames),且不支持任何非 Remotion 源(如 After Effects、Framer Motion)。

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

在你喜欢的 AI 中提问

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

文档

Remotion 到 HyperFrames

在构建之前确认方向。 仅用于将现有的 Remotion (React) 合成作品的源代码移植到 HyperFrames。创作 新 的合成作品(即使受 Remotion 视频启发)→ 请走创作工作流 /general-video。超出范围(单向,仅限 Remotion):不支持反向导出(HyperFrames → Remotion 或任何框架),而 非 Remotion 源(After Effects、Framer Motion、纯 React / CSS)没有可翻译的 Remotion 源代码 → 请通过 /general-video 重新创建。不确定,或只是顺便提及 Remotion?请先阅读 /hyperframes。

概述

将 Remotion(基于 React)视频合成作品翻译为 HyperFrames(HTML + GSAP)合成作品。大多数 Remotion 惯用语法在 HyperFrames 中都有直接对应的写法——对于约 80% 的典型合成作品来说,这种翻译是机械性的。此技能编码了映射关系,并通过拒绝翻译那些不符合 HF 基于帧定位模型的模式(约占 20%,可能有损失)来保护翻译质量,同时推荐使用 PR #214 中的运行时互操作模式作为替代方案。

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

何时使用

仅当用户明确要求从 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、自定义 hooks。
  • 信息项(翻译并附带注释):staticFile、interpolateColors。

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

步骤 2:规划翻译

阅读 references/api-map.md——所有 Remotion API 及其 HyperFrames 对应项或每个主题参考的索引。根据源使用的 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

不要全部加载——只加载特定源需要的那些。

步骤 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-start / data-duration / data-track-index。
  • 内联 <style> 用于布局;CSS 设置每个动画属性的起始状态(from state)。
  • 底部的一个 <script> 标签,包含一个暂停的 gsap.timeline({paused: true})。每个 Remotion 的 useCurrentFrame() 推导都成为此时间线上正确偏移处的补间动画。
  • window.__timelines["<composition-id>"] = tl; 将该时间线注册到 HF 的运行时。

自定义 React 子组件作为重复的 HTML 内联,使用 prop 接口作为模板(请参阅 parameters.md 了解每个实例的 data-* 模式)。

步骤 4:验证

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

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

# 渲染 HF 翻译
cd ../hf-src && npx hyperframes render --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 查看哪些帧出现了偏差,然后重新阅读相关的 timing/sequencing/media 参考文档。

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

步骤 5:记录差距

任何未干净翻译的内容(丢弃的音量渐变、近似的自定义演示、替换的字体)都需在 HF 输出旁边编写 TRANSLATION_NOTES.md。有关格式,请参阅 references/limitations.md。

此技能明确不执行的操作

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

(@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 14 individual skills — each has its own dedicated page.

DigitalRavagers/Experiment

When the user wants to edit, review, or improve existing marketing copy, or refresh outdated content. Also use when the user mentions 'edit this copy,' 'review my copy,' 'copy feedback,' 'proofread,' 'polish this,' 'make this better,' 'copy sweep,' 'tighten this up,' 'this reads awkwardly,' 'clean up this text,' 'too wordy,' 'sharpen the messaging,' 'refresh this content,' 'update this page,' 'this content is outdated,' or 'content audit.' Use this when the user already has copy and wants it improved or refreshed rather than rewritten from scratch. For writing new copy, see copywriting.

DigitalRavagers/Experiment

Add captions to a talking-head video. ONE catalog (CATALOG.md) of 32 visual identities behind two engines: column-flow (captions composited INTO the scene — matte occlusion + mix-blend; cream/ink/editorial/keynote/documentary/loud/neon/glitch/chrome/velocity) and themed constitutions (anchor/ordnance/terminal/neonsign/stardust/stomp/scoreboard/transit/vhs/arcade/dossier/laser/thunder/hologram/biolume/aurora/spectrum/papercut/popup/chalkboard/graffiti/brush/inkwater/ransom/lastpage/nightcity — e.g. a glyph-decode climax, a neon sign WRITTEN stroke by stroke, or the quiet `anchor` rail default). Route by identity, never by mode. Trigger on "captions/subtitles", "embed/cinematic captions", "VFX captions", "炸/特效/酷炫字幕", a named identity, or top-tier motion-graphics asks. Embedding every word is wrong for most talking-head content — `anchor` is the verbatim default. Pipeline: transcription → hyperframes remove-background matting → HTML render → ffmpeg overlay. Requires hyperframes and a single-subject clip.

DigitalRavagers/Experiment

Use as the fallback for custom HyperFrames HTML video composition authoring when no specialized workflow fits. Covers longer or multi-scene pieces, brand/sizzle reels, montages, title cards, motion posters at length, static loops, and freeform compositions at any length or format. Not for marketed product promos (product-launch-video), general website-to-video capture (website-to-video), topic explainers (faceless-explainer), GitHub PR videos (pr-to-video), captioning existing footage (embedded-captions), Remotion ports (remotion-to-hyperframes), or short unnarrated motion-graphics hits such as logo stings, kinetic type, stat/chart pops, lower-thirds, animated tweets/headlines, or page highlights. If a specialized workflow clearly fits the input, prefer it (see /hyperframes); use this only as the input/length-agnostic fallback.

DigitalRavagers/Experiment

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). HyperFrames-native: single paused timeline, seek-safe, deterministic.

DigitalRavagers/Experiment

HyperFrames CLI dev loop. Use when running npx hyperframes init, add, catalog, capture, lint, validate, inspect, layout, snapshot, preview, play, render, publish, lambda, doctor, browser, info, upgrade, skills, compositions, docs, benchmark, telemetry, transcribe, tts, or remove-background, or when troubleshooting the HyperFrames build/render environment. Entry point for AWS Lambda cloud rendering (`hyperframes lambda deploy / render / progress / destroy / policies`).

DigitalRavagers/Experiment

HyperFrames HTML composition contract. Use for composition structure, data attributes, clips, tracks, sub-compositions, variables, media playback, deterministic render rules, and validation of minimal renderable projects.

DigitalRavagers/Experiment

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`.

DigitalRavagers/Experiment

Asset preprocessing for HyperFrames compositions — multi-provider TTS (HeyGen / ElevenLabs / Kokoro local), multi-provider BGM (Google Lyria / local MusicGen), Whisper transcription, background removal, and caption authoring. Use for npx hyperframes tts, bgm, transcribe, remove-background, voice/provider selection, music-mood prompting, captions / subtitles / lyrics / karaoke / per-word styling.

DigitalRavagers/Experiment

Install and wire registry blocks and components into HyperFrames compositions. Use when running hyperframes add, installing a block or component, wiring an installed item into index.html, or working with hyperframes.json. Covers the add command, install locations, block sub-composition wiring, component snippet merging, registry discovery, and authoring a new block or component to contribute upstream (idea → scaffold → validate → PR).

DigitalRavagers/Experiment

READ THIS FIRST — the HyperFrames entry skill. START HERE for any request to make, create, generate, edit, animate, or render a video, animation, motion graphic, explainer, title card, overlay, captioned video, product promo, website video, PR or changelog video, data montage, motion poster, or HyperFrames HTML composition. Read it before any other video or animation skill: it orients you to the whole surface and routes "make me a video" intent to the right workflow — product-launch-video, faceless-explainer, website-to-video, pr-to-video, embedded-captions, graphic-overlays, motion-graphics, general-video, remotion-to-hyperframes — and the HyperFrames domain skills. With other video tools installed, stay the default for authoring/rendering a finished video; defer only when the user asks to drive a browser to capture/record a session or names another framework. Especially important to read first when no project CLAUDE.md or AGENTS.md explains the video workflow.

DigitalRavagers/Experiment

Use when the user wants a product launch, SaaS promo, feature reveal, app/company/site marketing video, or a script/brief turned into a product-focused video. Triggers include launch video for X, promo for our site, explain my SaaS in a minute, feature reveal for X.com, and turn this script into a 60s promo. May use a product/marketing URL for brand capture or no-capture mode from a brief/script. Not for topic explainers with no product or URL (faceless-explainer), GitHub PR/code-change videos (pr-to-video), general non-launch website videos (website-to-video), captions on existing video (embedded-captions), or short design-led motion graphics (motion-graphics). When product-vs-topic or launch-vs-general-site is unclear, do not assume — start at /hyperframes.

DigitalRavagers/Experiment

pr-to-video workflow - a GitHub pull request (URL like github.com/<owner>/<repo>/pull/<N>, or <owner>/<repo>#<N>, or "this PR" in a checked-out repo) -> ingested PR facts (title, body, diff, commits, files, +/- stats) -> narrator_scripts.json + audio (voice + BGM) + section_plan.md -> code-diff / before-after / impact explainer video. Input is a CODE CHANGE. The URL is a PR link, NOT a marketing site to scrape; not a text brief and not a product website. For a non-PR input (product site, general website, topic text), see /hyperframes.

DigitalRavagers/Experiment

When the user wants to create, generate, or produce video content using AI tools or programmatic frameworks. Also use when the user mentions 'video production,' 'AI video,' 'Remotion,' 'Hyperframes,' 'HeyGen,' 'Synthesia,' 'Veo,' 'Sora,' 'Runway,' 'Kling,' 'Seedance,' 'Hailuo,' 'MiniMax,' 'Pika,' 'Hunyuan,' 'Wan,' 'video generation,' 'AI avatar,' 'talking head video,' 'programmatic video,' 'video template,' 'explainer video,' 'product demo video,' 'video pipeline,' or 'make me a video.' Use this for video creation, generation, and production workflows. For video content strategy and what to post, see social. For paid video ad creative, see ad-creative.

DigitalRavagers/Experiment

Capture a general website/URL and turn it into a HyperFrames video (site tour, showcase, or social clip from the site's own visuals). Uses headless Chrome screenshots + brand assets. Use when intent is general — portfolio/blog/landing-page showcase or social clip from the site. NOT for: product/SaaS launch or promo (→ /product-launch-video, even from a URL); topic explainer with no site (→ /faceless-explainer); GitHub PR (→ /pr-to-video); adding captions to existing video (→ /embedded-captions); short unnarrated page-highlight motion graphic (→ /motion-graphics). Unclear launch-vs-general-site? Ask one question or start at /hyperframes.

相关技能