Communitygithub.com

Remotion to HyperFrames

既存のRemotion(Reactベース)動画構成をHyperFrames(HTML + GSAP)構成に変換します。ユーザーが明示的にRemotion構成の移植、変換、移行、翻訳、またはHyperFramesへの書き換えを依頼した場合にのみ使用します。

Remotion to HyperFrames とは?

このスキルは、Remotion(Reactベース)の動画構成をHyperFrames(HTML + GSAP)に機械的に翻訳するためのツールです。RemotionのAPIの約80%はHyperFramesに直接対応しており、翻訳はほぼ機械的に行われます。しかし、useStateやuseEffectなどの状態管理パターンや非同期calculateMetadataなど、一部の非対応パターン(約20%)はブロックされ、代わりにランタイム相互運用パターン(PR #214)を推奨します。このスキルは、ソースコードのリンティング、計画立案、HTML生成、評価、そしてギャップ文書化の5ステップワークフローを備えています。評価ではT1〜T4の階層化テストコーパスを使用し、SSIM(構造的類似性)しきい値に基づいて翻訳品質を測定します。対応プラットフォームはClaude Code、Coder、Cursor、CodexなどのAIエージェント向けに設計されており、主にRemotionからHyperFramesへのマイグレーションシナリオで活用します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/libz-renlab-ai/TeamBrain/tree/HEAD/.agents/skills/remotion-to-hyperframes

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Remotion → HyperFrames

概要

Remotion(Reactベース)の動画構成をHyperFrames(HTML + GSAP)構成に翻訳します。ほとんどのRemotionイディオムにはHyperFramesに直接対応するものがあり、典型的な構成の約80%は機械的に翻訳可能です。このスキルは対応マッピングをエンコードし、損失の発生する20%については、HFのシーク駆動モデルに適合しないパターンを翻訳せず、代わりにPR #214のランタイム相互運用パターンを推奨することで保護します。

このスキルには段階的テストコーパス(T1~T4、計4つのフィクスチャ)が付属しており、測定されたSSIMしきい値に対して翻訳を評価します。評価を実行せずに翻訳してはいけません。「見た目が正しい」翻訳でも、検証済みベースラインよりSSIMが0.05低い場合は、暗黙的に誤っています。

ワークフロー

ステップ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。

ブロッカーが1つでも発火したら、停止します。references/escape-hatch.mdを読み、推奨メッセージを提示してください。警告の場合、翻訳は停止しません。ステップ3で該当構造を削除し、そのギャップをTRANSLATION_NOTES.mdに記録します。@remotion/lambda設定は標準的な警告のケースです。スキルはimport文とrenderMediaOnLambda(...)呼び出しを削除しつつ、構成の残り部分は翻訳します。

ステップ2: 翻訳計画の立案

references/api-map.mdを読んでください。これはすべてのRemotion APIとそのHF相当品、またはトピック別リファレンスの索引です。ソースで使用されているAPIに基づいて、必要なトピックリファレンスを特定します。

ソースに含まれるものロードするリファレンス
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ごとに1つのdata-*を含めます。
  • data-start / data-duration / data-track-indexを持つシーンdivのフラットリスト。
  • レイアウト用のインライン<style>。CSSはすべてのアニメーションプロパティのfrom状態を設定します。
  • 末尾の単一の<script>タグ。これには1つの一時停止された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 --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")を設定してください。設定しない場合、差分は翻訳の忠実度ではなくエンコーダの差異(SSIM約0.05の低下)を測定することになります。

ステップ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複数シーン + spring + オーディオ + 画像0.9850.95
T3データ駆動、カスタムサブコンポーネント、カウントアップ0.9530.90
T4エスケープハッチ(8リントケース)8/8合格n/a

Individual skills in this repo

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

libz-renlab-ai/TeamBrain

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.

libz-renlab-ai/TeamBrain

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.

libz-renlab-ai/TeamBrain

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 CLI commands (init, lint, preview, render, transcribe, tts) see the hyperframes-cli skill.

libz-renlab-ai/TeamBrain

Capture a website and create a HyperFrames video from it. Use when: (1) a user provides a URL and wants a video, (2) someone says "capture this site", "turn this into a video", "make a promo from my site", (3) the user wants a social ad, product tour, or any video based on an existing website, (4) the user shares a link and asks for any kind of video content. Even if the user just pastes a URL — this is the skill to use.

libz-renlab-ai/TeamBrain

HyperFrames CLI tool — hyperframes init, lint, inspect, preview, render, transcribe, tts, doctor, browser, info, upgrade, compositions, docs, benchmark. Use when scaffolding a project, linting, validating, inspecting visual layout in compositions, previewing in the studio, rendering to video, transcribing audio, generating TTS, or troubleshooting the HyperFrames environment.

関連スキル