Communitygithub.com

Army161/OpenMontage

將既有的 Remotion(React)合成專案移植到 HyperFrames HTML。僅在使用者明確要求移植/轉換/遷移/翻譯 Remotion 原始碼時使用。

OpenMontage 是什麼?

這是一個專門用於將 Remotion(React 架構)影片合成轉換為 HyperFrames(HTML + GSAP)格式的技能。它提供機械化的翻譯流程,涵蓋約 80% 的典型合成案例,並透過 lint 腳本攔截無法乾淨轉換的模式(如 useState、useEffect、異步 calculateMetadata 和第三方 React 函式庫),同時建議使用執行時期互通模式作為替代方案。該技能支援 Claude Code、Cline 等 AI 代理平台,並附帶分層測試語料庫(T1–T4),透過 SSIM 閾值驗證翻譯品質。其運作流程包括:原始碼檢查(lint)、翻譯規劃(參考 API 對照表)、生成 HF 合成(包含 index.html、GSAP 時間軸和場景 div)以及驗證與記錄差異。重要的是,這是一個單向、僅限 Remotion 的翻譯工具,不支持逆向匯出或非 Remotion 來源。

相容平台~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 基於幀尋址模型的模式,來防止那有損的 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。lint 會偵測無法乾淨翻譯的模式:

  • 阻斷項(拒絕並建議互通):useState、useReducer、帶有非空依賴項的 useEffect/useLayoutEffect、異步 calculateMetadata、第三方 React UI 函式庫(MUI、Chakra、Mantine、antd、shadcn、Radix、NextUI)。
  • 警告(移除該結構後再翻譯):@remotion/lambda 配置、delayRender、useCallback、useMemo、自訂 Hook。
  • 資訊(翻譯並附註):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,以及每個純量 prop 對應的一個 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 子元件會使用 prop 介面作為模板,內聯為重複的 HTML(有關每個實例的 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")——否則差異比對測量的是編碼器差異(約 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 通過不適用

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.

相關技能