Communitygithub.com

DigitalRavagers/Experiment

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

Experiment 是什麼?

此技能專門用於將基於 Remotion 的 React 影片組合,機械式地翻譯為 HyperFrames 的 HTML + GSAP 格式。它會先對原始碼進行 lint 檢查,識別出無法乾淨翻譯的 API(如 useState、useEffect、非同步 calculateMetadata 或第三方 React 函式庫)並拒絕翻譯,同時建議使用 Runtime Interop 模式。技能隨附了分層測試套件(T1-T4)來驗證翻譯品質,並要求翻譯結果與 Remotion 基準渲染之間的 SSIM 值必須高於指定閾值。支援的翻譯對象僅限於 Remotion 原始碼,不支援反向匯出(HyperFrames 到 Remotion)或非 Remotion 來源(如 After Effects、Framer Motion)。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/DigitalRavagers/Experiment/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 基於幀搜尋模型的模式,同時建議使用 PR #214 中的 Runtime Interop 模式,來防範那有損耗的 20%。

此技能附帶一個分層測試套件(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 配置是典型的警告案例:此技能會移除導入和 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 狀態。
  • 底部一個包含單一暫停 gsap.timeline({paused: true}) 的 <script> 標籤。每個 Remotion 的 useCurrentFrame() 推導都會在此時間軸上的正確偏移處成為一個 tween。
  • window.__timelines["<composition-id>"] = tl; 將時間軸註冊到 HF 的執行環境中。

自訂的 React 子元件會內聯為重複的 HTML,使用 prop 介面作為範本(請參閱 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 --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 基於幀搜尋的模型中,不是確定性的幀捕獲目標。建議使用 Runtime Interop 模式。
  • 與 HyperFrames 並行執行 Remotion 的渲染管線。 這是來自 PR #214 的 Runtime Interop 模式——一個針對無法通過此技能 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 14 individual skills — each has its own dedicated page.

DigitalRavagers/Experiment

When the user wants to edit, review, or improve existing marketing copy, or refresh outdated content. Also use when the user mentions 'edit this copy,' 'review my copy,' 'copy feedback,' 'proofread,' 'polish this,' 'make this better,' 'copy sweep,' 'tighten this up,' 'this reads awkwardly,' 'clean up this text,' 'too wordy,' 'sharpen the messaging,' 'refresh this content,' 'update this page,' 'this content is outdated,' or 'content audit.' Use this when the user already has copy and wants it improved or refreshed rather than rewritten from scratch. For writing new copy, see copywriting.

DigitalRavagers/Experiment

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.

DigitalRavagers/Experiment

Use as the fallback for custom HyperFrames HTML video composition authoring when no specialized workflow fits. Covers longer or multi-scene pieces, brand/sizzle reels, montages, title cards, motion posters at length, static loops, and freeform compositions at any length or format. Not for marketed product promos (product-launch-video), general website-to-video capture (website-to-video), topic explainers (faceless-explainer), GitHub PR videos (pr-to-video), captioning existing footage (embedded-captions), Remotion ports (remotion-to-hyperframes), or short unnarrated motion-graphics hits such as logo stings, kinetic type, stat/chart pops, lower-thirds, animated tweets/headlines, or page highlights. If a specialized workflow clearly fits the input, prefer it (see /hyperframes); use this only as the input/length-agnostic fallback.

DigitalRavagers/Experiment

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.

DigitalRavagers/Experiment

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

DigitalRavagers/Experiment

HyperFrames HTML composition contract. Use for composition structure, data attributes, clips, tracks, sub-compositions, variables, media playback, deterministic render rules, and validation of minimal renderable projects.

DigitalRavagers/Experiment

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

DigitalRavagers/Experiment

Asset preprocessing for HyperFrames compositions — multi-provider TTS (HeyGen / ElevenLabs / Kokoro local), multi-provider BGM (Google Lyria / local MusicGen), Whisper transcription, background removal, and caption authoring. Use for npx hyperframes tts, bgm, transcribe, remove-background, voice/provider selection, music-mood prompting, captions / subtitles / lyrics / karaoke / per-word styling.

DigitalRavagers/Experiment

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

DigitalRavagers/Experiment

READ THIS FIRST — the HyperFrames entry skill. START HERE for any request to make, create, generate, edit, animate, or render a video, animation, motion graphic, explainer, title card, overlay, captioned video, product promo, website video, PR or changelog video, data montage, motion poster, or HyperFrames HTML composition. Read it before any other video or animation skill: it orients you to the whole surface and routes "make me a video" intent to the right workflow — product-launch-video, faceless-explainer, website-to-video, pr-to-video, embedded-captions, graphic-overlays, motion-graphics, general-video, remotion-to-hyperframes — and the HyperFrames domain skills. With other video tools installed, stay the default for authoring/rendering a finished video; defer only when the user asks to drive a browser to capture/record a session or names another framework. Especially important to read first when no project CLAUDE.md or AGENTS.md explains the video workflow.

DigitalRavagers/Experiment

Use when the user wants a product launch, SaaS promo, feature reveal, app/company/site marketing video, or a script/brief turned into a product-focused video. Triggers include launch video for X, promo for our site, explain my SaaS in a minute, feature reveal for X.com, and turn this script into a 60s promo. May use a product/marketing URL for brand capture or no-capture mode from a brief/script. Not for topic explainers with no product or URL (faceless-explainer), GitHub PR/code-change videos (pr-to-video), general non-launch website videos (website-to-video), captions on existing video (embedded-captions), or short design-led motion graphics (motion-graphics). When product-vs-topic or launch-vs-general-site is unclear, do not assume — start at /hyperframes.

DigitalRavagers/Experiment

pr-to-video workflow - a GitHub pull request (URL like github.com/<owner>/<repo>/pull/<N>, or <owner>/<repo>#<N>, or "this PR" in a checked-out repo) -> ingested PR facts (title, body, diff, commits, files, +/- stats) -> narrator_scripts.json + audio (voice + BGM) + section_plan.md -> code-diff / before-after / impact explainer video. Input is a CODE CHANGE. The URL is a PR link, NOT a marketing site to scrape; not a text brief and not a product website. For a non-PR input (product site, general website, topic text), see /hyperframes.

DigitalRavagers/Experiment

When the user wants to create, generate, or produce video content using AI tools or programmatic frameworks. Also use when the user mentions 'video production,' 'AI video,' 'Remotion,' 'Hyperframes,' 'HeyGen,' 'Synthesia,' 'Veo,' 'Sora,' 'Runway,' 'Kling,' 'Seedance,' 'Hailuo,' 'MiniMax,' 'Pika,' 'Hunyuan,' 'Wan,' 'video generation,' 'AI avatar,' 'talking head video,' 'programmatic video,' 'video template,' 'explainer video,' 'product demo video,' 'video pipeline,' or 'make me a video.' Use this for video creation, generation, and production workflows. For video content strategy and what to post, see social. For paid video ad creative, see ad-creative.

DigitalRavagers/Experiment

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.

相關技能