Communitygithub.com

Aseel1600/Edit01

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

Edit01 是什麼?

此技能專門用於將現有的 Remotion (React) 影片組合移植為 HyperFrames (HTML + GSAP) 組合。它提供了一套機械化的翻譯流程,約 80% 的典型組合可以直接對應轉換。技能內建了分級測試語料庫 (T1–T4) 來驗證翻譯品質,確保視覺逼真度達到嚴格的 SSIM 閾值。關鍵工作流程包括:檢查原始碼以識別無法直接翻譯的模式(如 useState、useEffect 等),規劃 API 映射,生成 HF 組合(包含 timeline 和場景 div),並透過渲染比對來驗證。此技能僅支援單向翻譯(Remotion → HyperFrames),不支援逆向操作或非 Remotion 原始碼(如 After Effects 或 Framer Motion)。若偵測到無法翻譯的封鎖模式時,技能會停止並建議改用執行時期互通模式(runtime interop pattern)。此技能適用於 Claude Code、Cursor 以及任何支援 HyperFrames 工作流程的 AI 程式碼助手。

相容平台~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 基於幀搜尋(seek-driven)模型的模式,來防衛剩下那 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、自訂鉤子。
  • 資訊(翻譯時附上備註):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-*。
  • 帶有 data-start / data-duration / data-track-index 的場景 div 平面清單。
  • 用於佈局的內聯 <style>;CSS 會設定每個動畫屬性的起始狀態。
  • 底部的一個 <script> 標籤,包含一個暫停的 gsap.timeline({paused: true})。每個 Remotion useCurrentFrame() 的衍生結果,都會變成該時間軸上在正確偏移處的補間動畫。
  • window.__timelines["<composition-id>"] = tl; 將時間軸註冊到 HF 的執行時期。

自訂 React 子元件使用 props 介面作為模板,內聯為重複的 HTML(請參閱 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 --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") — 否則差異會測量編碼器差異(約 0.05 SSIM 的影響),而非翻譯保真度。

步驟 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(檢查驗證),輸出每層的通過/失敗表格,並產生彙總的 JSON 報告。使用此功能來驗證技能在乾淨的檢出環境中能端到端運作 — 並在編輯任何參考文件後作為回歸檢查。

驗證基準(截至 2026-04-27):

分層組合形狀平均 SSIM閾值
T1單一元素淡入0.9740.95
T2多場景 + spring + 音訊 + 圖片0.9850.95
T3資料驅動、自訂子元件、計數器0.9530.90
T4逃脫機制(8 個檢查案例)8/8 通過n/a

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.

相關技能