Communitygithub.com

rizadaniel2-cozy-ritual/remotion-dev

**Remotion Claudeスキル**は、Claude AI内でプログラムによるビデオ作成とレンダリングを可能にする包括的なTypeScriptモジュールです。Reactコンポーネントを使用してビデオコンポジションの作成、管理、レンダリングを行うための直感的なAPIを提供します。

remotion-dev とは?

Remotion Claudeスキルは、Claude AI環境内でReactベースのビデオをプログラム的に作成・管理・レンダリングするためのTypeScriptモジュールです。このスキルは、`createRemotionSkill`関数を使ってインスタンス化し、ビデオコンポジションの作成、登録、レンダリングキューの管理を可能にします。主要な機能として、Reactコンポーネントによるカスタムビデオの定義、h264やProResなどの複数の出力フォーマット対応、イントロやスライドショー用のテンプレートシステム、`TextOverlay`コンポーネントやフェードインアニメーションなどのビルドインコンポーネントライブラリを備えています。TypeScriptで完全な型安全性が確保されており、CLIとしても直接利用可能です。このスキルは、Claudeとの対話的なビデオ制作や自動化ワークフローに特に有用で、CRF、コーデック、並行処理数などのレンダリングオプションを細かく制御できます。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/rizadaniel2-cozy-ritual/remotion-dev/tree/HEAD

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

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

ドキュメント

Remotion Claudeスキルドキュメント

概要

Remotion Claudeスキルは、Claude AI内でプログラムによるビデオ作成とレンダリングを可能にする包括的なTypeScriptモジュールです。Reactコンポーネントを使用してビデオコンポジションの作成、管理、レンダリングを行うための直感的なAPIを提供します。

特長

  • ✅ ビデオコンポジションの作成 - Reactコンポーネントでビデオプロジェクトを定義
  • ✅ コンポジションの管理 - ビデオコンポジションの登録、取得、整理
  • ✅ レンダリングキューの管理 - バッチレンダリングのためにコンポジションをキューに入れる
  • ✅ 複数の出力フォーマット - h264、h265、VP8、VP9、ProRes、PNGシーケンスに対応
  • ✅ テンプレートシステム - 一般的なビデオパターン向けの事前構築済みテンプレート
  • ✅ コンポーネントライブラリ - TextOverlayやアニメーションなどのすぐに使えるコンポーネント
  • ✅ 型安全性 - 包括的なインターフェースを備えた完全なTypeScriptサポート

インストール

# Remotionリポジトリをクローン
git clone https://github.com/remotion-dev/remotion.git
cd remotion

# 依存関係をインストール
bun install

# スキルは以下にあります:
packages/skills-evals/remotion-claude-skill.ts

クイックスタート

1. スキルインスタンスの作成

import { createRemotionSkill } from './remotion-claude-skill';

const skill = createRemotionSkill({
  projectName: 'my-video-project',
  width: 1920,
  height: 1080,
  fps: 30,
  durationInFrames: 150,
});

2. Reactコンポーネントの作成

import React from 'react';

export const MyVideo: React.FC<{ title: string }> = ({ title }) => {
  return (
    <div style={{
      flex: 1,
      backgroundColor: '#000',
      display: 'flex',
      justifyContent: 'center',
      alignItems: 'center',
      fontSize: 100,
      color: '#fff',
      fontWeight: 'bold',
    }}>
      {title}
    </div>
  );
};

3. コンポジションの登録

skill.createComposition(
  'my-video',
  'My Video Title',
  MyVideo,
  {
    durationInFrames: 150,
    fps: 30,
    width: 1920,
    height: 1080,
    defaultProps: { title: 'Hello World' },
  }
);

4. レンダリングキューへ追加

skill.queueForRender('my-video', {
  codec: 'h264',
  outputLocation: './output/my-video.mp4',
  overwrite: true,
});

5. メタデータの取得

const metadata = skill.getMetadata();
console.log(metadata);
// {
//   name: 'Remotion Claudeスキル',
//   version: '1.0.0',
//   compositionsCount: 1,
//   queueLength: 1,
//   ...
// }

APIリファレンス

RemotionClaudeSkill クラス

コンストラクタ

constructor(config: RemotionSkillConfig)

提供された設定で新しいスキルインスタンスを作成します。

パラメータ:

  • config: width、height、fps、durationInFrames、projectNameを含む設定オブジェクト

メソッド

createComposition(id, name, component, options?): CompositionDefinition

新しいコンポジションを作成して登録します。

skill.createComposition(
  'intro',
  'イントロシーケンス',
  IntroComponent,
  {
    durationInFrames: 200,
    fps: 60,
    width: 1920,
    height: 1080,
    defaultProps: { subtitle: 'My Project' },
  }
);
registerComposition(definition): void

既に定義されたコンポジションを登録します。

const composition: CompositionDefinition = {
  id: 'outro',
  name: 'アウトロシーケンス',
  component: OutroComponent,
  durationInFrames: 150,
  fps: 30,
  width: 1920,
  height: 1080,
};

skill.registerComposition(composition);
getCompositions(): CompositionDefinition[]

登録された全てのコンポジションを返します。

const all = skill.getCompositions();
console.log(`合計コンポジション数: ${all.length}`);
getComposition(id): CompositionDefinition | undefined

IDで特定のコンポジションを取得します。

const intro = skill.getComposition('intro');
if (intro) {
  console.log(`見つかりました: ${intro.name}`);
}
queueForRender(compositionId, options): void

コンポジションをレンダリングキューに追加します。

skill.queueForRender('intro', {
  codec: 'h264',
  outputLocation: './videos/intro.mp4',
  crf: 18,
  concurrency: 4,
  overwrite: true,
});
getRenderQueue(): RenderOptions[]

キューに入っている全てのレンダリングジョブを返します。

const queue = skill.getRenderQueue();
console.log(`キュー内のジョブ数: ${queue.length}`);
clearRenderQueue(): void

キューに入っている全てのレンダリングジョブをクリアします。

skill.clearRenderQueue();
getMetadata(): object

スキルのメタデータと統計情報を返します。

const metadata = skill.getMetadata();
console.log(metadata.capabilities);
generateTemplate(type?): string

ビデオコンポーネントのテンプレートを生成します。

// オプション: 'intro' | 'animation' | 'slideshow'
const template = skill.generateTemplate('animation');
console.log(template);

インターフェース

RemotionSkillConfig

interface RemotionSkillConfig {
  projectName: string;
  width: number;
  height: number;
  fps: number;
  durationInFrames: number;
}

CompositionDefinition

interface CompositionDefinition {
  id: string;
  name: string;
  component: React.ComponentType;
  durationInFrames: number;
  fps: number;
  width: number;
  height: number;
  defaultProps?: Record<string, unknown>;
}

RenderOptions

interface RenderOptions {
  codec: 'h264' | 'h265' | 'vp8' | 'vp9' | 'prores' | 'png';
  pixelFormat?: 'yuv420p' | 'yuv422p' | 'yuv444p';
  crf?: number;
  audioBitrate?: string;
  videoBitrate?: string;
  outputLocation: string;
  concurrency?: number;
  overwrite?: boolean;
  logFn?: (message: string) => void;
  errorFn?: (error: Error) => void;
}

ビルドインコンポーネント

TextOverlay

シンプルなテキストオーバーレイコンポーネント。

import { TextOverlay } from './remotion-claude-skill';

export const MyVideo = () => (
  <TextOverlay
    text="Hello Claude!"
    fontSize={80}
    color="#fff"
    backgroundColor="rgba(0,0,0,0.7)"
  />
);

アニメーションユーティリティ

createFadeInAnimation

フェードインアニメーションのCSSを生成します。

import { createFadeInAnimation } from './remotion-claude-skill';

const animation = createFadeInAnimation(150, 30);
// 戻り値: "@keyframes fadeIn { ... }"

テンプレート

イントロテンプレート

const template = skill.generateTemplate('intro');

黒い背景にシンプルなテキストタイトルを表示します。

アニメーションテンプレート

const template = skill.generateTemplate('animation');

スプリングアニメーションとスケーリング効果を示します。

スライドショーテンプレート

const template = skill.generateTemplate('slideshow');

スライドショー効果のための複数シーケンスの作成方法を示します。

完全な例

import React from 'react';
import { createRemotionSkill, TextOverlay } from './remotion-claude-skill';
import { useCurrentFrame, useVideoConfig } from 'remotion';

// スキルインスタンスを作成
const skill = createRemotionSkill({
  projectName: 'demo',
  width: 1920,
  height: 1080,
  fps: 30,
  durationInFrames: 300,
});

// コンポーネントを定義
const DemoVideo: React.FC<{ message: string }> = ({ message }) => {
  const frame = useCurrentFrame();
  const { durationInFrames, fps } = useVideoConfig();
  
  const progress = frame / durationInFrames;
  const opacity = Math.min(progress * 2, 1);
  
  return (
    <div style={{
      flex: 1,
      backgroundColor: '#1a1a2e',
      display: 'flex',
      justifyContent: 'center',
      alignItems: 'center',
      opacity,
    }}>
      <TextOverlay
        text={message}
        fontSize={100}
        color="#00d4ff"
        backgroundColor="rgba(0,0,0,0.8)"
      />
    </div>
  );
};

// コンポジションを登録
skill.createComposition('demo', 'デモビデオ', DemoVideo, {
  durationInFrames: 300,
  fps: 30,
  width: 1920,
  height: 1080,
  defaultProps: { message: 'Remotion + Claudeへようこそ' },
});

// レンダリングキューへ追加
skill.queueForRender('demo', {
  codec: 'h264',
  outputLocation: './output/demo.mp4',
  crf: 18,
  overwrite: true,
});

// メタデータを確認
console.log(skill.getMetadata());

高度な機能

複数コンポジション

skill.createComposition('intro', 'イントロ', IntroComponent, {...});
skill.createComposition('main', 'メインコンテンツ', MainComponent, {...});
skill.createComposition('outro', 'アウトロ', OutroComponent, {...});

// 全てをレンダリングキューへ追加
for (const comp of skill.getCompositions()) {
  skill.queueForRender(comp.id, {
    codec: 'h264',
    outputLocation: `./videos/${comp.id}.mp4`,
    overwrite: true,
  });
}

カスタムProps

interface VideoProps {
  title: string;
  subtitle: string;
  duration: number;
}

const MyVideo: React.FC<VideoProps> = ({ title, subtitle, duration }) => {
  // コンポーネントコード
};

skill.createComposition('custom', 'カスタムビデオ', MyVideo, {
  defaultProps: {
    title: '私のタイトル',
    subtitle: '私のサブタイトル',
    duration: 5,
  },
});

条件付きレンダリング

const ConditionalVideo: React.FC<{ showSubtitle?: boolean }> = ({ showSubtitle }) => {
  return (
    <div>
      <h1>メインコンテンツ</h1>
      {showSubtitle && <h2>サブタイトル</h2>}
    </div>
  );
};

ベストプラクティス

  1. TypeScriptを使用する - コンポーネントとPropsの完全な型安全性を活用
  2. 再利用可能なコンポーネントを作成する - 一般的なパターン用のコンポーネントライブラリを構築
  3. パフォーマンスを最適化する - 重い計算にはメモ化を使用
  4. バッチレンダリング - 複数のコンポジションをキューに入れて起動オーバーヘッドを削減
  5. エラーを処理する - RenderOptionsのerrorFnを使用したエラーハンドリング
  6. Propsを検証する - 常にデフォルトPropsとユーザー入力を検証

トラブルシューティング

コンポジションが見つからない

try {
  skill.queueForRender('nonexistent', {...});
} catch (error) {
  console.error('コンポジションが見つかりません:', error.message);
}

レンダリングキューの管理

// 新しいジョブを追加する前にキューをクリア
skill.clearRenderQueue();

// キューの長さを確認
console.log(`保留中のレンダリング: ${skill.getRenderQueue().length}`);

設定の検証

const config = skill.getMetadata();
console.log('現在の設定:');
console.log(`- 解像度: ${config.config.width}x${config.config.height}`);
console.log(`- FPS: ${config.config.fps}`);
console.log(`- 長さ: ${config.config.durationInFrames} フレーム`);

Claudeとの統合

Claude会話内での使用

  1. スキルを参照して対話的にビデオを作成
  2. リアルタイムでコンポーネントを修正
  3. 比較のために複数のバージョンをキューに入れる
  4. 設定をJSONとしてエクスポート

Claudeとのやり取り例

ユーザー: "ポッドキャスト用のイントロビデオを作成して"

Claude: Remotion Claudeスキルを使ってイントロビデオを作成します。

skill.createComposition('podcast-intro', 'ポッドキャストイントロ', PodcastIntro, {
  durationInFrames: 180,
  fps: 30,
  width: 1920,
  height: 1080,
  defaultProps: {
    podcastName: 'あなたのポッドキャスト名',
    tagline: '重要な対話',
  },
});

リソースリンク

ライセンス

このスキルはRemotionと同じライセンスに従います。詳細はLICENSE.mdを参照してください。

貢献

このスキルへの改善を貢献するには:

  1. リポジトリをフォーク
  2. 機能ブランチを作成
  3. 変更を適用
  4. プルリクエストを送信

詳細はCONTRIBUTING.mdを参照してください。

サポート

関連スキル