Communitygithub.com

1345AbhishekKumar/starter-nextjs

將現有 Remotion (React) 動畫腳本移植到 HyperFrames HTML。僅在用戶明確要求移植/轉換/遷移/翻譯 Remotion 原始碼時使用。

starter-nextjs 是什麼?

此 AI 助手技能專門用於將基於 Remotion (React) 的影片腳本轉換為 HyperFrames (HTML + GSAP) 格式。它提供了一套完整的機械化翻譯流程,涵蓋了從原始碼檢查、API 映射、腳本生成到視覺驗證(SSIM)的完整步驟。此技能僅支援單向(Remotion → HyperFrames)移植,不支援反向匯出或非 Remotion 來源(如 After Effects、Framer Motion)。當偵測到無法翻譯的模式(如 useState、useEffect、非同步 calculateMetadata 或第三方 React 庫)時,它會明確拒絕翻譯並建議使用運行時互操作模式。此外,該技能還附帶一個分層測試語料庫(T1-T4),用於驗證翻譯的視覺保真度,確保輸出的 HyperFrames 腳本在幀級別上與原始 Remotion 腳本高度相似。它主要用於 Claude Code、Cursor 或 Codex 等 AI 編碼代理,幫助開發者無縫遷移現有 Remotion 專案。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/1345AbhishekKumar/starter-nextjs/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 基於圖框驅動的模式的模式來防範那損失性的 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 無法表示,則拒絕。

如有疑問,預設使用 /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-*。
  • 一個扁平清單的場景 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 子組件使用 prop 介面作為模板內聯為重複的 HTML(有關每個實例的 data-* 模式,請參閱 parameters.md)。

步驟 4:驗證

執行評估工具——完整指南請參閱 references/eval.md。快速路徑:

# 渲染 Remotion 基準(在測試案例中執行 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 13 individual skills — each has its own dedicated page.

1345AbhishekKumar/starter-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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-nextjs

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.

相關技能