Communitygithub.com

Remotion 轉 HyperFrames

將現有的 Remotion (React 基礎) 影片合成內容轉換為 HyperFrames HTML 合成內容。僅在使用者明確要求移植、轉換、遷移、翻譯或改寫 Remotion 合成內容為 HyperFrames 時使用。

Remotion 轉 HyperFrames 是什麼?

此技能專為將基於 React 的 Remotion 影片合成內容精準轉換為 HyperFrames (HTML + GSAP) 格式而設計。它能處理約 80% 的典型合成內容,透過 API 映射機制將常見的 Remotion 慣用語法(如 `useCurrentFrame`、`interpolate`、`Sequence`)轉譯為等效的 GSAP timeline 時間軸操作。但技能也內建了智慧偵測機制,能識別無法直接轉換的「高損耗」模式(如 `useState`、`useEffect` 副作用、`async calculateMetadata` 或第三方 React 元件庫),當遇到這些情況時會自動停止轉換,並建議採用執行時期互操作(runtime interop)模式作為替代方案。支援的平台包括 HyperFrames 專案的開發工作流程,並附帶分層驗證測試語料庫(T1-T4),透過結構相似性指標(SSIM)確保轉換後的視覺保真度。此技能的設計前提是所有驗證測試都必須通過,才能確認轉換是正確的。

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

在你喜歡的 AI 中提問

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

說明文件

Remotion 轉 HyperFrames 是做什麼的?

總覽

將 Remotion (React 基礎) 影片合成內容轉換為 HyperFrames (HTML + GSAP) 合成內容。大多數 Remotion 慣用語法都有直接的 HyperFrames 等效方式——對於約 80% 的典型合成內容,這項轉換是機械性的。此技能包含了轉換映射,並透過拒絕轉換不符合 HF 搜尋驅動模型的模式,來防範那 20% 的高損耗情況,同時建議改採 PR #214 中的執行時期互操作模式。

此技能附帶一個分層測試語料庫(T1–T4,共 4 個測試實例),用於根據測量的 SSIM 閾值來評分轉換結果。請務必執行評估後再進行轉換——一個「看起來正確」但比驗證基準線低 0.05 SSIM 的轉換結果,實際上是有問題的。

使用時機

僅在使用者明確要求從 Remotion 遷移時使用此技能。 範例觸發詞句:

  • "port my Remotion project to HyperFrames"
  • "convert this Remotion code to HyperFrames"
  • "migrate from Remotion"
  • "translate this Remotion comp"
  • "rewrite this as HyperFrames HTML"

請勿在下列情況下使用此技能:

  • (a) 使用者正在建立一個全新的 HyperFrames 合成內容,即使他們擁有或正在 A/B 測試一個類似的 Remotion 影片。
  • (b) 使用者只是順帶提及 Remotion,但並未要求遷移。
  • (c) 使用者分享 Remotion 程式碼僅作為參考材料,而非要求進行轉譯。
  • (d) 使用者要求「和我 Remotion 影片一樣的內容」,但未明確要求遷移原始碼——請將其視為全新的 HyperFrames 建置。

若有疑慮,預設改為使用 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、自訂 hooks。
  • 資訊項(轉譯並附上註記):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 的扁平列表,每個 div 帶有 data-start / data-duration / data-track-index。
  • 用於版面配置的內聯 <style>;CSS 設定每個動畫屬性的起始狀態 (from)。
  • 頁面底部的單一 <script> 標籤,包含一個暫停的 gsap.timeline({paused: true})。每個 Remotion 的 useCurrentFrame() 推導都會變成在此時間軸上適當偏移的 tween 動畫。
  • window.__timelines["<composition-id>"] = tl; 將時間軸註冊到 HF 的執行時期。

自訂的 React 子元件會內聯為重複的 HTML,使用 prop 介面作為範本(有關每個實例的 data-* 模式,請參閱 parameters.md)。

步驟 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 --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 的搜尋驅動模型中並非確定性的影格擷取目標。請建議採用執行時期互操作模式。
  • 同時執行 Remotion 的渲染管線與 HyperFrames。 這是 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 通過n/a

Individual skills in this repo

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

Biznomad/agent-skills

Landing page quality assessment for paid advertising campaigns. Evaluates message match, page speed, mobile experience, trust signals, form optimization, and conversion rate potential. Use when user says "landing page", "post-click experience", "landing page audit", "conversion rate", or "landing page optimization".

Biznomad/agent-skills

TikTok Ads deep analysis covering creative quality, tracking, bidding, campaign structure, and TikTok Shop. Evaluates 25 checks with emphasis on creative-first strategy, safe zone compliance, and Smart+ campaigns. Use when user says "TikTok Ads", "TikTok marketing", "TikTok Shop", "Spark Ads", "Smart+", or "TikTok campaign".

Biznomad/agent-skills

YouTube Ads specific analysis covering campaign types, creative quality, audience targeting, and measurement. Evaluates video ad performance across skippable, non-skippable, bumper, Shorts, and Demand Gen formats. Use when user says "YouTube Ads", "video ads", "pre-roll", "bumper ads", "YouTube campaign", or "Shorts ads".

Biznomad/agent-skills

Help users get promoted at work. Use when someone is preparing for a promotion conversation, building their case for advancement, trying to understand what's blocking their promotion, or figuring out how to get to the next level in their career.

Biznomad/agent-skills

CSS animation adapter patterns for HyperFrames. Use when authoring CSS keyframes, animation-delay based timing, animation-fill-mode, animation-play-state, or CSS-only motion that HyperFrames must seek deterministically during preview and rendering.

Biznomad/agent-skills

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.

Biznomad/agent-skills

Read-only queue dashboard for workspace-aware ship. Shows which VERSION slots are currently claimed by open PRs, which sibling Conductor workspaces have WIP work likely to ship soon, and what slot /ship would pick next. No mutations — just a snapshot. Use when asked to "landing report", "what's in the queue", "show me open PRs", or "which version do I claim next". (gstack)

Biznomad/agent-skills

HyperFrames CLI dev loop — `npx hyperframes` for scaffolding (init), validation (lint, inspect), preview, render, and environment troubleshooting (doctor, browser, info, upgrade). Use when running any of these commands or troubleshooting the HyperFrames build/render environment. For asset preprocessing commands (`tts`, `transcribe`, `remove-background`), invoke the `hyperframes-media` skill instead.

Biznomad/agent-skills

Asset preprocessing for HyperFrames compositions — text-to-speech narration (Kokoro), audio/video transcription (Whisper), and background removal for transparent overlays (u2net). Use when generating voiceover from text, transcribing speech for captions, removing the background from a video or image to use as a transparent overlay, choosing a TTS voice or whisper model, or chaining these (TTS → transcribe → captions). Each command downloads its own model on first run.

Biznomad/agent-skills

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, and registry discovery.

Biznomad/agent-skills

Create video compositions, animations, title cards, overlays, captions, voiceovers, audio-reactive visuals, and scene transitions in HyperFrames HTML. Use when asked to build any HTML-based video content, add captions or subtitles synced to audio, generate text-to-speech narration, create audio-reactive animation (beat sync, glow, pulse driven by music), add animated text highlighting (marker sweeps, hand-drawn circles, burst lines, scribble, sketchout), or add transitions between scenes (crossfades, wipes, reveals, shader transitions). Covers composition authoring, timing, media, and the full video production workflow. For dev-loop CLI commands (init, lint, inspect, preview, render) see the hyperframes-cli skill; for asset preprocessing commands (tts, transcribe, remove-background) see the hyperframes-media skill.

Biznomad/agent-skills

Still-to-video conversion guide: model selection, motion prompting, and camera movement. Covers Wan 2.5 i2v, Seedance, Fabric, Grok Video with when to use each. Use for: animating images, creating video from stills, adding motion, product animations. Triggers: image to video, i2v, animate image, still to video, add motion to image, image animation, photo to video, animate still, wan i2v, image2video, bring image to life, animate photo, motion from image

Biznomad/agent-skills

>- The Landing Page Audit skill performs comprehensive evaluations of post-click experiences, combining technical performance analysis with conversion rate optimization (CRO) assessment.

Biznomad/agent-skills

Write high-converting landing page copy using proven frameworks like PAS (Problem-Agitate-Solution), AIDA, and StoryBrand. Creates headlines, value propositions, CTAs, and full page sections optimized for conversion. Use when users need landing page copy, sales page content, or marketing website text.

Biznomad/agent-skills

Optimize landing pages for higher conversion rates using proven frameworks and design patterns. Use when designing, reviewing, or improving landing pages, hero sections, pricing pages, CTAs, or when the user asks about conversion optimization.

Biznomad/agent-skills

Read-only queue dashboard for workspace-aware ship. (gstack)

Biznomad/agent-skills

Building promotion cases, brag documents, tracking wins, and self-advocacy for career advancement. Use when preparing for promotions, documenting accomplishments, or building your case for advancement.

Biznomad/agent-skills

Best practices for Remotion - Video creation in React

Biznomad/agent-skills

Produce programmable videos with Remotion using scene planning, asset orchestration, and validation gates for automated, brand-consistent video content.

Biznomad/agent-skills

Reviews animation and motion code against a high craft bar derived from Emil Kowalski's design engineering philosophy. Default to flagging; approval is earned.

相關技能