Communitygithub.com

Aseel1600/Edit01

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

Edit01 是什么?

该技能用于将现有 Remotion(React)视频合成作品精确地翻译为 HyperFrames(HTML + GSAP)合成作品。它建立了一套系统化的映射关系,覆盖约80%的常见 Remotion 惯用模式,并提供分级测试语料库(T1-T4)来验证翻译质量,确保 SSIM 指标满足阈值要求。技能通过内置的 linter 脚本检测无法完美翻译的阻塞模式(如 useState、useEffect、异步 calculateMetadata 等),并推荐使用运行时互操作方案(PR #214)作为替代方案,而不是进行有损翻译。翻译流程包括:源码 lint 检查、根据 API 映射计划翻译、生成包含 GSAP 时间线的 HTML、通过对比 Remotion 基线视频进行 SSIM 验证,最后生成 TRANSLATION_NOTES.md 记录差异。该技能明确支持单向转换(仅 Remotion → HyperFrames),不支持反向导出或非 Remotion 源(如 After Effects、Framer Motion)。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Aseel1600/Edit01/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:Lint 源码

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

  • 阻塞项(拒绝 + 推荐互操作):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 配置是典型的警告情况:技能会删除 import + 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

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

步骤 3:生成 HF 合成作品

生成包含以下内容的 index.html:

  • 根 <div id="stage">,携带合成作品的 data-composition-id、data-start="0"、data-duration(以秒为单位)、data-fps、data-width、data-height,以及每个标量属性一个 data-*。
  • 一组扁平的场景 div,带有 data-start / data-duration / data-track-index。
  • 内联 <style> 用于布局;CSS 设置每个动画属性的 from 状态。
  • 底部的一个 <script> 标签,包含一个暂停的 gsap.timeline({paused: true})。每个 Remotion useCurrentFrame() 派生都成为此时间线上正确偏移处的补间。
  • window.__timelines["<composition-id>"] = tl; 将时间线注册到 HF 运行时。

自定义 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 查看_哪些_帧出现了偏差,然后重新阅读相关的 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 的运行时互操作模式——一个针对未通过此技能 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
T4escape-hatch(8 个 lint 案例)8/8 通过不适用

Individual skills in this repo

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

Aseel1600/Edit01

Generate AI videos from text prompts using multiple provider gateways. Use when: (1) Generating videos from text descriptions, (2) Creating AI-generated video clips for content production, (3) Image-to-video generation with a reference image, (4) Choosing between video generation providers (VEO, Kling, Sora, Runway, Seedance, MiniMax, Gemini Omni). Supports gateways: HeyGen API, fal.ai API, Kling official direct API, and the Gemini API (Gemini Omni Flash).

Aseel1600/Edit01

Create AI avatar videos with precise control over avatars, voices, scripts, scenes, and backgrounds using HeyGen's v2 API. Use when: (1) Choosing a specific avatar and voice for a video, (2) Writing exact scripts for an avatar to speak, (3) Building multi-scene videos with different backgrounds per scene, (4) Creating transparent WebM videos for compositing, (5) Using talking photos as video presenters, (6) Integrating HeyGen avatars with Remotion, (7) Batch video generation with exact specs, (8) Brand-consistent production videos with precise control.

Aseel1600/Edit01

Use p5.js/canvas for local procedural character effects: particles, weather, squash/stretch, walk cycles, and environmental motion.

Aseel1600/Edit01

Review local character animation with schema checks, Playwright browser previews, frame sampling, and FFmpeg/ffprobe final output checks.

Aseel1600/Edit01

Create videos from a text prompt using HeyGen's Video Agent. Use when: (1) Creating a video from a description or idea, (2) Generating explainer, demo, or marketing videos from a prompt, (3) Making a video without specifying exact avatars, voices, or scenes, (4) Quick video prototyping or drafts, (5) One-shot prompt-to-video generation, (6) User says "make me a video" or "create a video about X".

Aseel1600/Edit01

Generate Mandarin and multilingual narration with Volcengine Doubao Speech 2.0. Use when creating Chinese voiceovers, when the user prefers Doubao/Volcengine/火山引擎/豆包 TTS, or when narration needs character-level timestamp metadata for subtitles.

Aseel1600/Edit01

Video and audio processing with FFmpeg. Use for format conversion, resizing, compression, audio extraction, and preparing assets for Remotion. Triggers include converting GIF to MP4, resizing video, extracting audio, compressing files, or any media transformation task.

Aseel1600/Edit01

Generate expressive, multilingual narration with fish.audio (S1 / S2-generation models) and reuse cloned voices via reference_id. Use when the user prefers fish.audio/Fish Audio TTS, wants a specific playground voice model, or needs high-emotion voice-clone narration.

Aseel1600/Edit01

Use when implementing Disney's 12 animation principles with Framer Motion in React applications

Aseel1600/Edit01

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.

Aseel1600/Edit01

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

Aseel1600/Edit01

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.

Aseel1600/Edit01

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

Aseel1600/Edit01

Audio and media assets for HyperFrames compositions, produced by one shared audio engine (`scripts/audio.mjs`) — multi-provider TTS (HeyGen / ElevenLabs / Kokoro local), background music + sound effects (HeyGen audio-library retrieval by default, with local Lyria / MusicGen BGM generation and a bundled SFX library as the no-credential fallback), Whisper transcription, background removal, and caption authoring. Use for voiceover / TTS, BGM, SFX / sound effects, transcription, captions / subtitles / lyrics / karaoke / per-word styling, voice + provider selection, and music-mood prompting.

Aseel1600/Edit01

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

Aseel1600/Edit01

Use when the user wants a short, design-led motion graphic where motion is the message: kinetic typography, stat or number count-up, chart/data-viz hit, logo sting, brand lockup, lower-third, callout, social overlay, animated headline/tweet/news item, motion poster, or quick captured-page highlight. Usually under 10s and up to ~30s, with no narration arc, voice-over, or live-action subject. Can render to MP4 or transparent overlay. Not for longer, multi-scene, narrated, or brand-reel pieces (use general-video), narrated website videos (website-to-video), topic explainers (faceless-explainer), product promos (product-launch-video), PR videos (pr-to-video), or captions on existing footage (embedded-captions). When unsure whether it's a quick motion-first piece or a longer / narrated treatment, see /hyperframes.

Aseel1600/Edit01

Use when the user has a music track (an audio file, or a video to pull audio from) and wants a beat-synced HyperFrames video, calm to hard-hitting. The music drives everything: one analyzer reads it once, the orchestrator lays out the frames and fills a per-frame plan, and one sub-agent builds each frame. Typography and templates are the floor — a complete video needs zero assets — but any images or videos the user supplies are cut into the frames on the same beat grid (beat-cut / ken-burns). The genre (lyric video, slideshow, kinetic promo) falls out of the per-frame choices; the pipeline never branches on it.

Aseel1600/Edit01

Best practices for Remotion - Video creation in React

Aseel1600/Edit01

Toolkit-specific Remotion patterns — custom transitions, shared components, and project conventions. For core Remotion framework knowledge (hooks, animations, rendering, etc.), see the `remotion-official` skill.

Aseel1600/Edit01

Animate SVG character rigs with GSAP, CSS transforms, Remotion frame control, and HyperFrames-compatible browser previews.

相关技能