Communitygithub.com

laviedezidane/hyperframes-skill

將現有的 Remotion(React)組合原始碼移植到 HyperFrames HTML。僅在明確要求移植/轉換/遷移/翻譯 Remotion 原始碼時使用——單向,僅限 Remotion。若僅是提及 Remotion、作為參考的程式碼,或「製作類似我的 Remotion 影片」則視為新建構建(/general-video)。不確定時 → /hyperframes。

hyperframes-skill 是什麼?

此技能專用於將 Remotion(基於 React 的影片組合框架)的原始碼翻譯為 HyperFrames(HTML + GSAP)組合。它提供了一個結構化的、機械化的翻譯流程,能處理約 80% 的常見 Remotion 用法,同時透過原始碼檢查(linting)來拒絕轉換不支援的模式(例如 React 狀態管理或非 Remotion 來源),並建議執行時期互操作模式作為替代方案。技能內建了四層測試語料庫(T1 至 T4),並使用結構相似性(SSIM)指標來自動驗證翻譯品質,確保視覺上的一致性。它支援 Claude Code、Coder 和 Codex 等代理平台,關鍵工作流程包括:檢查原始碼是否有阻礙轉換的模式、規劃 API 映射、生成 HyperFrames HTML 輸出、透過渲染比對進行驗證,以及記錄任何翻譯差距。該技能特別強調不得用於新建 HyperFrames 組合或反向翻譯回 Remotion。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/laviedezidane/hyperframes-skill/tree/HEAD/.agents/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 基於搜尋(seek-driven)模型的模式來防範那有損耗的 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 設定是典型的警告案例:技能會丟棄匯入和 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 已經對 clockWipe() / iris() 採用了此路線,透過 npx hyperframes add sdf-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,以及每個純量 prop 一個 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 子元件將作為重複的 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 --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 報告。使用此功能在乾淨的 checkout 上驗證技能是否端到端運作 — 以及在編輯任何參考後作為回歸檢查。

經驗證的基準(截至 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 20 individual skills — each has its own dedicated page.

laviedezidane/hyperframes-skill

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.

laviedezidane/hyperframes-skill

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.

laviedezidane/hyperframes-skill

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.

laviedezidane/hyperframes-skill

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.

laviedezidane/hyperframes-skill

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.

laviedezidane/hyperframes-skill

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

laviedezidane/hyperframes-skill

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.

laviedezidane/hyperframes-skill

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.

laviedezidane/hyperframes-skill

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

laviedezidane/hyperframes-skill

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.

laviedezidane/hyperframes-skill

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

laviedezidane/hyperframes-skill

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.

laviedezidane/hyperframes-skill

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

laviedezidane/hyperframes-skill

Agent Media OS for 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. When the host app provides its own music or sound-effect tools, use those for music and sound effects; `resolve --type bgm|sfx` needs the heygen CLI. When `HEYGEN_API_BASE` is set, HeyGen calls go through that host with no CLI sign-in.

laviedezidane/hyperframes-skill

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.

laviedezidane/hyperframes-skill

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.

laviedezidane/hyperframes-skill

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.

laviedezidane/hyperframes-skill

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.

laviedezidane/hyperframes-skill

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.

laviedezidane/hyperframes-skill

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.

相關技能