Communitygithub.com

Remotion 轉換為 HyperFrames

僅在用戶明確要求將現有的 Remotion(React)合成專案移植/轉換/遷移/翻譯為 HyperFrames 時使用。不要用於新創作、僅提及 Remotion 或將其作為參考的情況。

Remotion 轉換為 HyperFrames 是什麼?

此技能提供一條將 Remotion(React 為基礎)影片合成專案轉換為 HyperFrames(HTML + GSAP)合成專案的自動化路徑。對於大約 80% 的典型合成專案,轉換幾乎是機械式的,因為大多數 Remotion 慣用語在 HyperFrames 中都有直接對應。該技能會對無法乾淨轉換的剩餘 20% 進行防護,它會封鎖使用 `useState`、`useEffect` 或第三方 React 庫等模式的 API,並建議採用運行時互操作模式(如 PR #214 所述)來處理這類有損轉換。該技能只支援單向、僅限 Remotion 的路徑;不支援反向匯出(HyperFrames 轉為 Remotion 或任何其他框架),也不支援非 Remotion 來源(例如 After Effects 或 Framer Motion)。它包含一個分級測試語料庫(T1–T4),用於根據 SSIM 指標驗證轉換品質,確保結果不僅外觀正確,而且在像素層面具有高保真度。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/1345AbhishekKumar/starter-supabase/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)模型的模式,並建議改用 PR #214 中的執行時期互操作模式,來防護那有損的 20%。

此技能附帶一個分級測試語料庫(T1–T4,共 4 個固定樣本),根據測量到的 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 合成專案。

工作流程

第一步:檢查原始碼

在 Remotion 原始碼目錄上執行 scripts/lint_source.py。此檢查會偵測無法乾淨翻譯的模式:

  • 封鎖項目(拒絕並建議互操作):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(...) 呼叫,但會翻譯合成專案的其餘部分。

第二步:規劃翻譯

閱讀 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

不要全部載入 — 只載入特定來源所需的內容。

第三步:生成 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 子元件內聯為重複的 HTML,使用 prop 介面作為範本(有關每個實例的 data-* 模式,請參閱 parameters.md)。

第四步:驗證

執行評估測試套件 — 完整指南請參閱 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 來查看哪些_幀_發生了分歧,然後重新閱讀相關的 timing/sequencing/media 參考。

關鍵:兩個渲染必須使用匹配的像素格式。在 Remotion 原始碼的 remotion.config.ts 中設定 Config.setVideoImageFormat("png") + Config.setColorSpace("bt709") — 否則差異比較測量的是編碼器差異(約 0.05 SSIM 影響),而不是翻譯保真度。

第五步:記錄差距

任何未能乾淨翻譯的內容(音量曲線被丟棄、自訂呈現被近似、字型被替代)都將在 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 通過不適用

Individual skills in this repo

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

1345AbhishekKumar/starter-supabase

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.

1345AbhishekKumar/starter-supabase

The fallback workflow for authoring custom HyperFrames video compositions at any length or format — longer or multi-scene pieces, brand / sizzle reels, montages, title cards, static loops, and freeform compositions. Input- and length-agnostic. If a specialized workflow clearly fits the input — a marketed product, a website, a topic explainer, a GitHub PR, existing footage, a short motion graphic, or a Remotion port — prefer it (see /hyperframes); use this only as the general fallback when none fit.

1345AbhishekKumar/starter-supabase

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.

1345AbhishekKumar/starter-supabase

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

1345AbhishekKumar/starter-supabase

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.

1345AbhishekKumar/starter-supabase

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

1345AbhishekKumar/starter-supabase

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.

1345AbhishekKumar/starter-supabase

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

1345AbhishekKumar/starter-supabase

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.

1345AbhishekKumar/starter-supabase

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.

1345AbhishekKumar/starter-supabase

turn a product or marketing URL, pasted script, or brief into a product launch video, including SaaS promos, feature reveals, app launches, company promos, and product marketing videos. Use this skill when the user wants to market, launch, promote, or reveal a product. Do not use it for general non-launch website tours, non-product topic explainers, GitHub pull requests, captioning existing footage, or short unnarrated motion graphics. If the intent is unclear, route through /hyperframes first. This is the new shot-sequence architecture: every visual frame is authored as a time-coded shot sequence picked from a menu of golden blueprints, so frames develop over their full duration instead of freezing after entrance.

1345AbhishekKumar/starter-supabase

turn a GitHub pull request (a PR URL like github.com/<owner>/<repo>/pull/<N>, an <owner>/<repo>#<N> ref, or 'this PR' in a checked-out repo) into a code-change explainer video, up to ~3 min (sweet spot 30-90s) — changelog, feature reveal, fix, or refactor walkthrough, rendered from the diff / commits / files. The input is a CODE CHANGE read via the gh CLI; there is no website capture. Use this skill for a GitHub PR. Do not use it for a product launch/promo (use /product-launch-video), a tour of a real website (use /website-to-video), a topic explainer with no PR (use /faceless-explainer), captions on existing footage (use /embedded-captions), or a short unnarrated motion graphic (use /motion-graphics). If the intent is unclear, route through /hyperframes first.

1345AbhishekKumar/starter-supabase

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.

相關技能