Communitygithub.com

MattiaIppoliti/tia-skills

Compositionコントラクトは、1つのレンダリング可能なRemotionプロジェクトを構築するためのものです。プロジェクト構造、<Composition>登録、<Sequence>タイミング、レイヤー/トラックの順序、シーンコンポーネント、Propsとスキーマ、フレームワークが管理するメディア再生、決定論的レンダリングルール、検証をカバーします。また、TailwindプロジェクトとSTORYBOARD.md / SCRIPT.md計画形式についても扱います。Compositionのコードを書く前にお読みください。

tia-skills とは?

このスキルは、Remotionフレームワークを使用した動画プロジェクトの「テクニカルコントラクト」を提供します。プロジェクトの基本的な構造(package.json、src/ディレクトリ構成)から、<Composition>コンポーネントの登録方法、<Sequence>を使用したタイムラインの管理、レイヤーの重ね順、メディア(ビデオ、オーディオ、画像)の正しい配置方法、ZodスキーマによるPropsの型安全な定義、そして決定論的レンダリングを実現するためのルール(壁時計の禁止、CSSアニメーションの禁止、delayRenderの使用など)までを包括的にカバーします。主にClaude Code、Cursor、CodexなどのAIエージェントがRemotionプロジェクトの構築や編集を支援するために設計されており、効率的でバグの少ないコード生成を促進します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/MattiaIppoliti/tia-skills/tree/HEAD/skills/video/hyperframes-core

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

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

ドキュメント

HyperFrames Core

出力フレームワークはRemotionです。 Compositionは<Composition>に登録されたReactコンポーネントツリーです。現在のフレームが唯一のクロックであり、メディアの再生はDOMではなくRemotionの<Video> / <Audio>コンポーネントに属します。

このスキルはテクニカルコントラクトです。1つのプロジェクトを構築する方法について説明します。以下の本文が構築ガイドです。トピックごとの詳細はreferences/にあり、必要に応じて参照してください。その他の懸念事項は、関連するドメインスキールであるhyperframes-animation、hyperframes-creative、media-use、hyperframes-cli、hyperframes-registryにあります。/hyperframesの機能マップに、各スキルがカバーする内容が記載されています。

移植に関する注意。 このコントラクトは、HTML + data-* + 一時停止GSAPタイムラインコントラクトを置き換えるものです。data-composition-id / data-start / data-durationを持つindex.htmlや、window.__timelinesを説明するリファレンスファイルを含むプロジェクトを見つけた場合、それは古いコントラクトです。触る前にreferences/legacy-html-contract.mdをお読みください。

リファレンス

ファイル目的
references/minimal-composition.md最小のレンダリング可能なプロジェクトスケルトンから始める
references/project-structure.mdsrc/のレイアウト、シーンをコンポーネントに分割、モノリシックかモジュールかの決定
references/timing.md秒をフレームに変換、<Sequence>の配置、<Series> / <TransitionSeries>の使用、シーン間の相対時間設定
references/layers-and-order.mdレイヤーのスタック、zオーダーの制御、同じ時間軸上で2つのシーンを重ねる
references/props-and-schemas.mdPropsの宣言、Zodスキーマの作成、defaultPropsとcalculateMetadataの配線
references/media.md<Video> / <OffthreadVideo> / <Audio> / <Img>の配置、トリミング、ボリューム設定、staticFileの使用
references/determinism-rules.mdレンダリングのシーク可能性と再現性の維持、禁止事項、delayRenderによる非同期アセット読み込み
references/editing-recipes.mdカット/トリム/並べ替え/リタイム/フリーズ/カメラ/マスク/クロスフェード/オーディオのレシピとその制限
references/legacy-html-contract.md古いHTML + data-*コントラクトを使用しているプロジェクトの認識と移行
references/tailwind.mdTailwind v4プロジェクトでの作業方法
references/storyboard-format.mdSTORYBOARD.md計画(+解析されたマニフェスト)の作成
references/review-loop.mdライブボード上で計画→スケッチ→構築のレビューパスを実行
references/production-loop.md承認された計画から配信動画への変換
references/brief-contract.mdブリーフの基本ルール:モードの導出、共有フィールドレジストリ、質問の不変条件
references/brief-format.mdBRIEF.mdの作成
references/script-format.mdオプションのSCRIPT.md(固定されたナレーション)の作成
references/subagent-dispatch.mdサブエージェントディスパッチ動詞をハーネスにマッピング
references/frame-worker-core.md共有フレームワーカーの役割コントラクト

アニメーションの詳細(スプリング設定、イージング、ランタイムアダプター)についてはhyperframes-animationを参照してください。

Compositionの構築

プロジェクトの構造

package.json          # remotion, react, react-dom; studio/render用のスクリプト
remotion.config.ts    # レンダリング時設定(コーデック、画像フォーマット、Tailwind/webpackオーバーライド)
tsconfig.json
public/               # staticFile()が解決するすべてのファイル
src/
  index.ts            # registerRoot(Root)
  Root.tsx            # すべての<Composition>はここに配置
  <Name>/
    index.tsx         # compositionのトップレベルコンポーネント
    scenes/*.tsx      # シーンごとに1つのコンポーネント
    schema.ts         # Zodスキーマ + 推論されたProps型

src/index.tsはエントリーポイントであり、次の1つのことだけを行います:

import { registerRoot } from "remotion";
import { Root } from "./Root";

registerRoot(Root);

Compositionの登録

レンダリング可能なものはすべてRoot.tsx内の<Composition>です。idはCLIが名前でレンダリングするものです。

import { Composition } from "remotion";
import { LaunchVideo } from "./LaunchVideo";
import { launchSchema } from "./LaunchVideo/schema";

const FPS = 30;

export const Root: React.FC = () => (
  <>
    <Composition
      id="launch"
      component={LaunchVideo}
      durationInFrames={45 * FPS}
      fps={FPS}
      width={1920}
      height={1080}
      schema={launchSchema}
      defaultProps={{ productName: "Acme", accent: "#5B8CFF" }}
    />
  </>
);

durationInFramesはレンダリング長です。秒ではなくフレームであり、これを間違えることは最も一般的な作成ミスです。1350のような生の数値ではなく、名前付きのFPS定数から導出してください。

フレームが唯一のクロック

すべてのアニメーション値はuseCurrentFrame()の純粋関数です。これによりレンダリングがシーク可能になります。レンダラーはフレーム812にコールドスタートし、そのまま再生した場合と同じピクセルを取得する必要があります。

import { AbsoluteFill, useCurrentFrame, useVideoConfig, interpolate, spring } from "remotion";

export const Title: React.FC<{ text: string }> = ({ text }) => {
  const frame = useCurrentFrame();
  const { fps } = useVideoConfig();

  const enter = spring({ frame, fps, config: { damping: 18 } });
  const y = interpolate(enter, [0, 1], [40, 0]);

  return (
    <AbsoluteFill style={{ justifyContent: "center", alignItems: "center" }}>
      <h1 style={{ opacity: enter, transform: `translateY(${y}px)` }}>{text}</h1>
    </AbsoluteFill>
  );
};

フレーム範囲をマッピングするinterpolateは常にクランプしてください。そうしないと値が範囲を超えて補外され、フェードインが不透明度4になってしまいます:

const opacity = interpolate(frame, [0, 15], [0, 1], {
  extrapolateLeft: "clamp",
  extrapolateRight: "clamp",
});

タイミングは<Sequence>

<Sequence>はその子をタイムシフトします。内部では、useCurrentFrame()はシーケンス自体の開始時に0を返します。このローカルリベーシングこそがポイントであり、シーンコンポーネントはマスタータイムライン上の自身の位置を知る必要がありません。

<AbsoluteFill>
  <Sequence durationInFrames={90}>
    <Hook />
  </Sequence>
  <Sequence from={90} durationInFrames={150}>
    <Feature />
  </Sequence>
  <Sequence from={240} durationInFrames={120}>
    <Close />
  </Sequence>
</AbsoluteFill>

連続するシーンの場合、<Series>がオフセットを計算するため、期間を編集しても後続のすべてのfromを手動で修正する必要はありません:

<Series>
  <Series.Sequence durationInFrames={90}><Hook /></Series.Sequence>
  <Series.Sequence durationInFrames={150}><Feature /></Series.Sequence>
  <Series.Sequence durationInFrames={120}><Close /></Series.Sequence>
</Series>

<Series.Sequence offset={-15}>は、シーンを前倒しして前のシーンと重ねます。これにより計算なしでクロスフェード区間を実現できます。詳細と、プレゼンテーションベースのトランジションのための<TransitionSeries>については、references/timing.mdを参照してください。

レイヤーはトラックを置き換える

トラックインデックスはありません。重ね順は<AbsoluteFill>内のDOM順序です。後ろの兄弟が上に描画されます。ナレーショントラック、BGM、3つのビジュアルシーンは5つの兄弟として配置されます。

<AbsoluteFill>
  <Audio src={staticFile("music.mp3")} volume={0.18} />
  <Audio src={staticFile("vo.mp3")} />
  <Sequence durationInFrames={90}><Hook /></Sequence>
  <Sequence from={90}><Feature /></Sequence>
  <Overlay />                {/* 上記のすべての上に描画 */}
</AbsoluteFill>

<Sequence layout="none">は、暗黙の<AbsoluteFill>ラッパーを削除します。子が絶対配置ではなく、親のflexやgridレイアウトに参加する必要がある場合に使用します。

メディアはRemotionに属する

生の<video>、<audio>、<img>タグを使用しないでください。Remotionのコンポーネントを使用することで、レンダラーは決定論的にシークおよびフレーム抽出できます。

ニーズ使用
レンダリング内のビデオ<OffthreadVideo src>(推奨)
DOMレベルの制御が必要なビデオ<Video src>
オーディオ<Audio src volume trimBefore trimAfter>
静止画像<Img src>
埋め込みページ<IFrame src>
public/以下のファイルstaticFile("dir/name.ext")

<OffthreadVideo>はブラウザ外でFFmpegを使用してフレームを抽出するため、レンダリングがより高速かつ正確です。実際の要素(例えばcurrentTimeに基づいて何かを駆動する場合など)が必要な場合にのみ<Video>を使用します。ローカルアセットにはstaticFile()が必須です。裸の"/music.mp3"文字列はStudioでは動作してもLambdaレンダリングでは壊れます。トリミング、ボリュームランプ、再生速度についてはreferences/media.mdを参照してください。

Propsとスキーマ

Compositionの入力はReactのPropsであり、Zodスキーマによって型付けされます。これによりStudioが編集可能なコントロールをレンダリングし、不正な--propsペイロードが間違ったレンダリングではなくエラーとして失敗します。

import { z } from "zod";
import { zColor } from "@remotion/zod-types";

export const launchSchema = z.object({
  productName: z.string(),
  accent: zColor(),
  features: z.array(z.object({ title: z.string(), body: z.string() })),
});

export type LaunchProps = z.infer<typeof launchSchema>;

期間がPropsに依存する場合(未知の長さの機能リスト、未知の長さのオーディオファイルなど)、ハードコードされた推測ではなくcalculateMetadataで計算します。references/props-and-schemas.mdを参照してください。

不可譲のルール

型チェックでは検出できないサイレントバグ。完全な根拠はreferences/determinism-rules.mdにあります。

  • 壁時計禁止。 Date.now()、new Date()、performance.now()は使用しないでください。時間はuseCurrentFrame()から取得します。
  • シードなし乱数禁止。 Math.random()はフレームごとに異なる値を返し、ストロボ効果を引き起こします。Remotionのrandom(seed)を使用してください。同じシード、同じ値、すべてのフレームとすべてのレンダリングで一貫します。
  • 状態駆動アニメーション禁止。 useState / useReducer / useEffectはビジュアルを駆動してはいけません。レンダラーはフレームを順不同で並行ワーカーにマウントします。順方向に再生することで蓄積された状態は存在しません。代わりにframeから導出してください。
  • CSSアニメーション、トランジション、requestAnimationFrame禁止。 これらはブラウザ自身のクロックで動作し、レンダラーはそれを進めません。すべて最初のフレームでフリーズした状態でレンダリングされます。
  • 非同期処理はdelayRenderを使用。 フェッチ、フォント、レイアウト測定:前にdelayRender()を呼び出し、後にcontinueRender(handle)を呼び出さないと、処理が完了する前にフレームがキャプチャされます。
  • 補間をクランプする。 クランプされていないinterpolateは入力範囲外で補外されます。
  • アニメーションするものには絶対配置を使用。 ノーマルフロー内で変換された要素は、移動するたびに兄弟要素を引きずります。

既存のCompositionの編集

  • まずファイルを読んでください。無関係なタイミング、Props、ID、アセットパスは保持します。
  • 既存のCompositionのidに合わせてください。CLI、レンダリングスクリプト、CIはすべてこれでCompositionを識別します。名前の変更は破壊的変更です。
  • シーンの追加:オフセットが自動計算されるため、<Series>を推奨します。手動オフセットの<Sequence>リストでは、後続のすべてのfromを修正してください。
  • 期間の変更:<Composition>のdurationInFramesも確認してください。Compositionの長さを超えて実行されるシーンは、静かに切り詰められます。
  • コンポーネントの追加:Propsとframeの純粋関数として維持してください。

検証

コマンドの詳細はhyperframes-cliにあります。

  • npx tsc --noEmit、スキーマとProps型が実際に一致していることを確認
  • npx remotion still <id> out/probe.png --frame <n> いくつかのシーン中間点で実行し、それぞれを確認
  • npx remotion studio でレビュー、ユーザーがスクラブしてPropsを自分で調整できるようにする
  • ユーザーが承認した場合のみ npx remotion render <id>

Individual skills in this repo

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

MattiaIppoliti/tia-skills

The technique catalog: five velocity-matched SEAMS (zoom-through, INVERSE zoom-through, cut-the-curve, waterfall cut, rack-focus blur-cut) plus the two in-scene techniques — waterfall ENTRY (staggered arrival cascades for title cards / segment openers) and the nudge curve (slow-fast-slow three-phase group slides). Covers partial-travel (~12% of frame) velocity matching via mirrored power4 eases, the Z scale-sign rule, size-scaled blur (10px text / 18-20px full-frame), word-by-word staggered cuts, cascade pacing by element weight, and the 10/65/25 slide ratio. Read before authoring any transition, text-beat handoff, kinetic text entry, or group reposition. [depth, zoom, inverse-zoom, scale-sign, mirrored-zoom, rack-focus, pacing, velocity, cut-the-curve, waterfall, stagger, cascade, kinetic-text, title-card, segment-opener, nudge, slide, easing, group-motion, z-depth, motion-graphics, cinematic, transition, blur, directional-continuity]

MattiaIppoliti/tia-skills

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.

MattiaIppoliti/tia-skills

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.

MattiaIppoliti/tia-skills

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.

MattiaIppoliti/tia-skills

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), or automation envelopes drawn on a track's volume or any effect parameter. 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`.

MattiaIppoliti/tia-skills

Drive the Remotion CLI development loop: scaffold, studio, type-check, compositions, still probes, single and batch render, bundle, Lambda and Cloud Run rendering, benchmark, versions, upgrade, and GPU checks. Also use when diagnosing a build or render failure, or when looking for a capability the retired HyperFrames CLI used to own.

関連スキル