Communitygithub.com

Army161/OpenMontage

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

OpenMontage 是什么?

该技能专门用于将 Remotion(基于 React)的视频合成作品翻译为 HyperFrames(HTML + GSAP)格式。它通过一套机械化的映射规则处理约 80% 的常见 Remotion 习语,并严格拒绝翻译那些不适用于 HyperFrames 基于时间轴的可seek模型的模式(如 useState、useEffect、异步 calculateMetadata 等),同时推荐运行时互操作模式作为替代方案。该技能包含一个分层测试语料库(T1–T4),使用 SSIM 阈值分级评估翻译保真度,并要求在翻译前运行 lint 检查以检测阻塞模式和警告。它明确限定为单向流程(仅 Remotion → HyperFrames),不支持反向导出、非 Remotion 源码(如 After Effects、Framer Motion)或新的作品创作。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Army161/OpenMontage/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 基于时间轴的可 seek 模型的模式来防范有损失的 20%,并建议改用 PR #214 中的运行时互操作模式。

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

何时使用

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

  • “将我的 Remotion 项目移植到 HyperFrames”
  • “将此 Remotion 代码转换为 HyperFrames”
  • “从 Remotion 迁移”
  • “翻译此 Remotion comp”
  • “将其重写为 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。lint 检测无法干净翻译的模式:

  • 阻塞项(拒绝 + 推荐互操作):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 及其 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,以及每个标量 prop 对应的 data-* 属性。
  • 一组扁平的场景 div,带有 data-start / data-duration / data-track-index。
  • 用于布局的内联 <style>;CSS 设置每个动画属性的 from 状态。
  • 底部一个包含一个暂停的 gsap.timeline({paused: true}) 的 <script> 标签。每个基于 useCurrentFrame() 的推导都变成一个位于正确偏移量上的该时间线的动画。
  • window.__timelines["<composition-id>"] = tl; 将时间线注册到 HF 的运行时。

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

步骤 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")——否则差异会测量编码器差异(SSIM 下降约 0.05),而不是翻译保真度。

步骤 5:记录差距

任何未干净翻译的内容(丢弃的音量渐变、近似的自定义演示、替换的字体)都会在 HF 输出旁生成 TRANSLATION_NOTES.md。格式参见 references/limitations.md。

此技能明确不做什么

  • 翻译 React 状态机。 通过 useState + useEffect 驱动动画的合成作品在 HyperFrames 基于时间轴的可 seek 模型下不是确定性的帧捕获目标。建议使用运行时互操作模式。
  • 与 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 通过不适用

Individual skills in this repo

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

Army161/OpenMontage

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). Supports two gateways: HeyGen API and fal.ai API.

Army161/OpenMontage

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.

Army161/OpenMontage

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

Army161/OpenMontage

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

Army161/OpenMontage

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

Army161/OpenMontage

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.

Army161/OpenMontage

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.

Army161/OpenMontage

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

Army161/OpenMontage

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.

Army161/OpenMontage

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

Army161/OpenMontage

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.

Army161/OpenMontage

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

Army161/OpenMontage

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.

Army161/OpenMontage

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

Army161/OpenMontage

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.

Army161/OpenMontage

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.

Army161/OpenMontage

Best practices for Remotion - Video creation in React

Army161/OpenMontage

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.

Army161/OpenMontage

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

Army161/OpenMontage

Three.js animation - keyframe animation, skeletal animation, morph targets, animation mixing. Use when animating objects, playing GLTF animations, creating procedural motion, or blending animations.

相关技能