Communitygithub.com

Remotion 轉換至 HyperFrames

僅在明確要求移植/轉換/遷移/翻譯 Remotion 來源時使用:將現有的 Remotion (React) 組件原始碼移植到 HyperFrames HTML。單向、僅限 Remotion。

Remotion 轉換至 HyperFrames 是什麼?

此技能提供一條明確且受控的路徑,將現有的 Remotion (React 影片框架) 組件轉換為 HyperFrames (HTML + GSAP) 創作。它主要用於使用者明確請求遷移現有 Remotion 專案的情況,並嚴格與其他情境(如建立新組件或處理非 Remotion 原始碼)區分開來。工作流程包括分析原始 Remotion 程式碼以識別潛在障礙(例如 React 鉤子 `useState` 或第三方 UI 函式庫),計劃與 HyperFrames API 的對應映射,產生 HyperFrames 的 `index.html` 和場景檔案,並透過結構化測試套件(包含四個等級的測試案例)對輸出進行 SSIM 為基礎的品質評估,以驗證轉換是否忠實於原始面貌。對於無法乾淨翻譯的複雜互動模式,它會建議「執行時期互通」模式,作為單向轉換的替代方案。此技能作為 HyperFrames 外掛程式提供,支援用於更新和互動式開發流程的 CLI 命令。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/samyakiasonline-ctrl/hyperframe/tree/HEAD/.claude/skills/remotion-to-hyperframes

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

外掛程式安裝: 在執行設定或更新命令前,若此技能位於 HyperFrames 外掛程式內,請遵循外掛程式執行規則。獨立安裝則保留下方的更新說明。

首先,保持此技能為最新版本 — 請在使用前向使用者確認: npx hyperframes skills update remotion-to-hyperframes。若所有內容皆為最新,此操作快速且無副作用;否則,它將在您依賴此技能之前,更新此技能及其依賴的核心領域技能。

Remotion 轉換至 HyperFrames 是做什麼的?

入口為 /hyperframes。僅使用此技能將現有的 Remotion (React) 組件原始碼移植到 HyperFrames,此為單向轉換。若要創作新組件、從非 Remotion 來源(After Effects、Framer Motion、純 React / CSS — 沒有可翻譯的 Remotion 原始碼)重新創建、僅是提及 Remotion,或任何不確定的情況 → 請先閱讀 /hyperframes:意圖層負責所有路徑決策。

總覽

將 Remotion (基於 React 的影片) 組件轉換為 HyperFrames (HTML + GSAP) 組件。大多數 Remotion 慣用語法在 HyperFrames 中都有直接對應 — 對於約 80% 的典型組件,轉換是機械性的。此技能編碼了這些映射關係,並透過拒絕轉換不適合 HF 基於影格搜尋模型的模式來保護其餘 20% 會造成資訊遺失的部分,改為推薦來自 PR #214 的執行時期互通模式。

此技能附帶一個分層測試語料庫(T1–T4,共 4 個測試案例),根據設定的 SSIM 閾值對翻譯品質進行評分。在未執行評估前請勿進行翻譯 — 一個「看起來正確」但渲染結果比驗證基準線低 0.05 SSIM 的翻譯,實際上是錯誤的。

使用時機

僅在使用者明確要求從 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 無法呈現,則拒絕。

若有疑問,請返回 /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

請勿全部載入 — 僅載入特定原始碼所需的參考文獻。

針對表格未映射的任何視覺效果,搜尋即用目錄。 當原始碼繪製的外觀沒有等效的 HF API 時 —— 例如掃描線/CRT 疊層、故障或色差效果、著色器轉場、底片顆粒效果 —— 請在用手寫 GSAP 之前執行 npx hyperframes catalog --query "<效果,以純英文描述>" --json。此搜尋無需安裝任何東西:無需專案、無需事先 add、無需帳號。它會從任何目錄對整個託管註冊表(約 400 個區塊和組件)進行排名,而 transitions.md 已經透過 npx hyperframes add sdf-iris 採用此方式處理 clockWipe() / iris()。真實的組件通常比手動近似更接近原始碼,因此通常會提高 SSIM 而非降低 — 但步驟 4 的渲染差異圖仍然是最終裁決者。當搜尋結果中沒有合適的項目時,請手寫效果,並在 TRANSLATION_NOTES.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-composition-src="compositions/<scene>.html"、data-start、data-duration 和 data-track-index。根元素不包含嵌套佈局。
  • 每個場景有一個 compositions/<scene>.html(一個 <template> 子組件):其內聯 <style> 用於佈局(CSS 設置每個動畫屬性的初始狀態 from)、其標記,以及在場景本地時間軸上的一個暫停的 gsap.timeline({paused: true})。每個 Remotion 的 useCurrentFrame() 推導都會變成該時間軸上的一個補間動畫,在場景內的偏移位置執行。
  • 每個場景檔案中設定 window.__timelines["<scene-id>"] = tl;,以及根元素自身(可能為空)時間軸的 window.__timelines["<composition-id>"]。

自訂 React 子組件可使用屬性介面作為模板(請參閱 parameters.md 以了解每個實例的 data-* 模式)內聯為重複的 HTML。

步驟 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多場景 + 彈簧 + 音訊 + 圖片0.9850.95
T3資料驅動、自訂子組件、數字動畫計數0.9530.90
T4排除方案(8 個語法檢查案例)8/8 通過不適用

Individual skills in this repo

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

samyakiasonline-ctrl/hyperframe

Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet `anchor` rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.

samyakiasonline-ctrl/hyperframe

Turn arbitrary text — an article, notes, a topic, a brief — into a faceless explainer video: there is no site or footage to capture, so the visuals are invented per scene (typography, abstract graphics, diagrams, data-viz). Use for topic explainers, concept breakdowns, how-tos, listicles. Not a video built from a website (/product-launch-video — promo or tour). Unclear → /hyperframes.

samyakiasonline-ctrl/hyperframe

Import Figma content into a HyperFrames composition — rendered assets, brand tokens, components, storyboard sections → reconstructed motion (frames read as states, not slides) (REST/CLI), connector-assisted motion when available, and shaders from a connector or native export. Use when the user pastes a figma.com link or asks to bring a Figma design, frame, logo, brand, or animation into a video/composition.

samyakiasonline-ctrl/hyperframe

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated motion-first unit, including an animated title. Route fresh creation through hyperframes before using this skill.

samyakiasonline-ctrl/hyperframe

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). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.

samyakiasonline-ctrl/hyperframe

Use when audio already placed in a HyperFrames composition needs to be mixed: fade-in/fade-out, crossfade, track gain or volume, volume automation, ducking, a music bed that fights a voiceover (voiceover carve), effects on a track (EQ, compressor, limiter, gate, saturation, delay, reverb, chorus, phaser, bitcrush), automation envelopes drawn on a track's volume or any effect parameter, or one submix bus carrying a chain, a fader and an automation clock for several tracks at once (`<hf-audio-group>`). Don't use for sourcing or generating audio — finding BGM, SFX, or making a voiceover is `/media-use`. Don't use for clip timing or track layout, which is `/hyperframes-core`.

samyakiasonline-ctrl/hyperframe

Use the HyperFrames CLI development loop: init, add, catalog, capture, lint, check, snapshot, compare, grade-compare, preview, play, present, beats, keyframes, single or batch render, publish, cloud, cloudrun, feedback, lambda, doctor, browser, info, upgrade, skills, compositions, timeline, history, clean, docs, benchmark, telemetry, transcribe, auth, tts, and remove-background. Also use when diagnosing build or render failures. validate, inspect, and layout are deprecated aliases; use check. Covers local, HeyGen-hosted cloud, AWS Lambda, and Google Cloud Run rendering.

samyakiasonline-ctrl/hyperframe

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.

samyakiasonline-ctrl/hyperframe

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

samyakiasonline-ctrl/hyperframe

Use when a HyperFrames composition needs a punch-in, punch-out, zoom, reframe, Ken Burns treatment, camera move, visual match/whip handoff, or other seek-safe 2D/3D keyframes; also for GSAP, CSS keyframes, Anime.js, WAAPI, FLIP, paths, masks, SVG morph/draw, text trails, 3D depth, or `hyperframes keyframes` diagnostics. Don't use for broad scene strategy, brand design, media sourcing, captions, or general video planning.

samyakiasonline-ctrl/hyperframe

Search, install, and wire registry blocks and components into HyperFrames compositions. Use BEFORE hand-building any named visual — whenever a brief, a user, or a storyboard names a look, effect, treatment, or transition such as CRT scanlines, glitch, chromatic aberration, film grain, a shimmer sweep, a chart, a code or terminal window, a map, or a confetti burst — because roughly 400 hosted items already cover many of them and the search ranks all of them with nothing installed, no project, and no account. Also use when running hyperframes add or hyperframes catalog, installing one item or every block matching a tag, wiring an installed item into index.html, or working with hyperframes.json. Covers discovery, install locations, block sub-composition wiring, component snippet merging, and authoring a new block or component to contribute upstream (idea → scaffold → validate → PR).

samyakiasonline-ctrl/hyperframe

Mandatory entry point: read this first for any request to make, create, edit, animate, or render a video, animation, or motion graphic, including a promo, explainer, captioned clip, title card, overlay, slideshow or interactive deck, Remotion port, or any HyperFrames HTML composition. Also use it to inspect, diagnose, validate, preview, publish, or batch-render an existing HyperFrames project. Inputs may be a website URL, GitHub PR, Figma design or URL, text or brief, existing footage, or music. It resumes project state, captures intent when applicable, selects and installs the owning workflow, and routes domain capabilities. HyperFrames is the default output framework unless the user explicitly chooses another framework for the deliverable or asks only to record a browser session.

samyakiasonline-ctrl/hyperframe

Use when working with a person on a HyperFrames project in Studio: first, whether their message asks for a change at all (questions, loose ideas and "don't change anything" get an answer and a plan, not an edit); for a new film, the plan, storyboard and build order that the HyperFrames launch films follow; and how the timeline should be laid out so it reads well (one caption track, one element kind per track, every scene a sub-composition) and where captions and key content may sit (safe zones). Don't use for how to perform an individual edit (split, trim, retime, volume, copy, swap): that is `creator-editing-recipes.md` in `/hyperframes-core`.

samyakiasonline-ctrl/hyperframe

Agent Media OS, the single skill for every media need in a HyperFrames project. Resolve BGM, SFX, image, icon, brand logo, voice, color grade, or LUT into a frozen local file or paste-ready block + ledger record (one verb, `resolve`); generate via TTS / music / image models when the catalog misses; produce voiceover, transcription, captions, and background removal through one shared audio engine; operate on media (cut / reframe / transform); and reuse assets across projects. Also use for vague feedback that real footage looks dark, flat, boring, should feel retro/camcorder/print/ASCII, needs privacy, or needs a media reveal.

samyakiasonline-ctrl/hyperframe

A short, design-led motion graphic where motion is the message — kinetic typography, stat count-up, chart/data-viz hit, logo sting / brand lockup, lower-third / callout / social overlay, animated map (highlight regions, connect places, zoom to a location), animated tweet / news-article / headline, webpage / UI animation (scroll, cursor, callouts), or fusing a real image's geometry into a chart. Usually under 10s (up to ~30s), no narration or live-action subject; renders to MP4 or transparent overlay. Longer / narrated / multi-scene → /general-video. Unclear → /hyperframes.

samyakiasonline-ctrl/hyperframe

Turn a music track (an audio file, a video to pull audio from, or a track generated from a mood brief) into a beat-synced video — lyric video, slideshow, or kinetic promo. The music drives all pacing; any user-supplied images/videos are cut onto the same beat grid, and a complete video needs zero assets. Narrated pieces → the input-matched workflow (see /hyperframes). Unclear → /hyperframes.

samyakiasonline-ctrl/hyperframe

Turn a product or marketing URL, pasted script, or brief into a product launch / promo video — SaaS promos, feature reveals, product demos, app and company launches. Use when the user wants to market, launch, promote, or reveal a product; the default for any commercial URL. Site tours / showcases of a website route here too — the brief carries the show-it-as-is intent. Unclear → /hyperframes.

samyakiasonline-ctrl/hyperframe

Turn a GitHub pull request (a PR URL, owner/repo#N, or 'this PR' in a checked-out repo) into a code-change explainer video — changelog, feature reveal, fix, or refactor walkthrough built from the diff, commits, and files: the input is a code change, not a website. Not a product promo (/product-launch-video) or a no-PR topic explainer (/faceless-explainer). Unclear → /hyperframes.

samyakiasonline-ctrl/hyperframe

Author a HyperFrames slideshow — a presentation, pitch deck, or interactive deck with discrete slides, fragment reveals, branching, hotspot navigation, and built-in presenter mode with speaker notes; also converts an existing page into a deck. Output is a navigable deck, not a rendered MP4. If the user didn't explicitly ask for a slideshow, confirm before authoring. Unclear → /hyperframes.

samyakiasonline-ctrl/hyperframe

Package an existing talking-head / interview / podcast video with timed, designed GRAPHIC OVERLAY cards — kinetic titles, lower-thirds, data callouts, quotes, side panels, picture-in-picture — synced to the transcript, on a 16:9 / 9:16 / 4:5 canvas of your choice; the clip plays untouched underneath. Trigger on "graphic overlays", "on-screen graphics", "package / dress up my video". Not plain subtitles (/embedded-captions). Unclear → /hyperframes.

相關技能