Communitygithub.com

ever-just/agentskills

ジェネレーターを使ったアニメーションプログラミングが可能なTypeScriptライブラリ。リアルタイムエディタを備え、説明動画、コードウォークスルー、教育コンテンツに最適です。

agentskills とは?

Motion Canvasは、TypeScriptのジェネレーターを使用してアニメーションをプログラムするためのライブラリです。説明動画、コードウォークスルー、教育コンテンツの作成に特化しており、18,000以上のGitHubスターを獲得しています。 このスキルは、Claude CodeやCursorなどのAIエージェントがMotion Canvasを使用したアニメーションプロジェクトをセットアップ、コーディング、レンダリングするのを支援します。ジェネレーター関数を用いたシーンベースのアニメーション、並列・逐次アニメーション、コードハイライト、イージングなどのコアコンセプトをカバーしており、リアルタイムエディタによるインタラクティブなプレビューも提供します。また、Remotionとの比較も行い、ユースケースに応じた適切なツール選択を支援します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ever-just/agentskills/tree/HEAD/skills/motion-canvas

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

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

ドキュメント

Motion Canvas ― TypeScriptアニメーションエンジン(説明動画向け)

ジェネレーターを使ったアニメーションプログラミングが可能なTypeScriptライブラリ。リアルタイムエディタを備え、説明動画、コードウォークスルー、教育コンテンツに最適です。

概要

  • リポジトリ: github.com/motion-canvas/motion-canvas(18K以上のスター)
  • 言語: TypeScript
  • ライセンス: MIT
  • インストール: npm create @motion-canvas@latest
  • ドキュメント: motioncanvas.io/docs

コアコンセプト

プロジェクトセットアップ

npm create @motion-canvas@latest my-animation
cd my-animation
npm install
npm start  # エディタがlocalhost:9000で開きます

シーン

すべてのアニメーションはシーンで構成されます。シーンはジェネレーター関数です:

import { makeScene2D } from "@motion-canvas/2d";
import { createRef } from "@motion-canvas/core";
import { Circle } from "@motion-canvas/2d/lib/components";

export default makeScene2D(function* (view) {
  const circle = createRef<Circle>();

  view.add(<Circle ref={circle} size={100} fill="#e13238" />);

  // 円をアニメーション
  yield* circle().scale(2, 0.6);
  yield* circle().opacity(0, 0.3);
});

ジェネレーターによるアニメーション

yield* キーワードがアニメーションをフレーム単位で駆動します:

// 逐次アニメーション(一つずつ実行)
yield* rect().position.x(300, 1);   // 1秒かけて右に移動
yield* rect().fill("#00ff00", 0.5); // 0.5秒かけて色を変更

// 並列アニメーション(同時実行)
yield* all(
  rect().position.x(300, 1),
  rect().rotation(360, 1),
);

// 遅延と組み合わせて連鎖
yield* chain(
  rect().opacity(1, 0.3),
  waitFor(0.5),
  rect().scale(2, 0.6),
);

// 指定時間待機
yield* waitFor(2); // 2秒待機

ノード(ビジュアル要素)

import { Rect, Circle, Line, Txt, Img, Video, Layout } from "@motion-canvas/2d/lib/components";

// 長方形
<Rect width={200} height={100} fill="#333" radius={10} />

// テキスト
<Txt text="Hello" fontSize={48} fill="white" fontFamily="monospace" />

// 円
<Circle size={80} fill="#e13238" />

// 画像
<Img src={myImage} width={400} />

// レイアウト(フレックスボックス)
<Layout direction="column" gap={20} alignItems="center">
  <Txt text="Title" />
  <Rect width={200} height={50} />
</Layout>

シグナル(リアクティブ値)

import { createSignal } from "@motion-canvas/core";

const progress = createSignal(0);

// コンポーネント内で使用
<Rect width={() => progress() * 400} height={20} fill="blue" />

// シグナルをアニメーション
yield* progress(1, 2); // 0から1まで2秒かけてアニメーション

イージング

import { easeInOutCubic, easeOutBounce, linear } from "@motion-canvas/core";

yield* rect().position.x(300, 1, easeInOutCubic);
yield* circle().scale(2, 0.8, easeOutBounce);

コードハイライト

import { Code, lines, word } from "@motion-canvas/2d/lib/components";

const code = createRef<Code>();

view.add(
  <Code
    ref={code}
    fontSize={24}
    code={`function hello() {\n  console.log("world");\n}`}
  />
);

// 特定の行をハイライト
yield* code().selection(lines(1, 2), 0.3);

// コードの変更をアニメーション
yield* code().code(
  `function hello() {\n  return "world";\n}`,
  0.6,
);

コマンド

# エディタを起動(ライブプレビュー)
npm start

# 動画にレンダリング
npx motion-canvas render

# 特定のシーンをレンダリング
npx motion-canvas render --scene=myScene

ベストプラクティス

  1. アニメーション対象にはrefを使用: アニメーションするノードには createRef<Circle>() を使用
  2. ジェネレーターを基本としたフロー: 逐次的に考える ― yield* があなたのタイムラインです
  3. 並列処理には all() を使用: 同時アニメーションをグループ化
  4. リアクティブデータにはシグナル: 複数のノードが依存する値に使用
  5. フレックスボックスにはLayoutコンポーネント: 子要素を自動配置
  6. シーンは短く保つ: 長いアニメーションは複数のシーンに分割
  7. エディタを活用: リアルタイムプレビューとスクラブは非常に貴重

Motion Canvas vs Remotion:いつどちらを使うべきか

Motion CanvasRemotion
最適な用途教育、説明製品、マーケティング
アニメーションスタイル命令型(ジェネレーター)宣言型(React)
エディタ組み込みリアルタイムRemotion Studio
コードアニメーションファーストクラス対応手動実装
エコシステム成長中大規模(npmパッケージ)
音声同期組み込みオーディオ同期手動同期

ソース

  • リポジトリ: github.com/motion-canvas/motion-canvas
  • ドキュメント: motioncanvas.io/docs
  • サンプル: motioncanvas.io/docs/examples

Individual skills in this repo

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

ever-just/agentskills

> Declarative animations for React. Springs, gestures, layout animations, and page transitions. GPU-accelerated, production-ready.

ever-just/agentskills

> Create animated logos, icons, and micro-interactions as lightweight Lottie JSON files. No After Effects needed — build animations entirely in code.

ever-just/agentskills

> Add animated subtitles and captions to Remotion videos from .SRT files. TikTok-style word-by-word highlights, karaoke effects, and more.

ever-just/agentskills

> Create videos programmatically using React components. The most mature framework for code-driven video production.

ever-just/agentskills

> Copy-paste video components for Remotion. Intros, text effects, transitions, and full scene templates. Like shadcn/ui but for video.

ever-just/agentskills

Extract actionable intelligence from video content across YouTube, Vimeo, and company websites. Video reveals what text sources cannot: facility scale, team composition, product demonstrations, signage, event attendance, and operational reality.

ever-just/agentskills

Optimize and embed an existing video as a fast, crisp, autoplaying hero/background/loop on a website. Use when adding or replacing a video on a marketing site and it is too heavy, will not autoplay (especially on mobile/Safari), shows a codec error, or looks soft — to transcode it to web-safe H.264 with the right pixel format, faststart, retina-aware sizing, and a poster frame, then embed and verify it actually plays. This is optimization + embedding of footage you already have, not creating/animating a video (for that use remotion/moviepy/motion-canvas). Use when the user says "add this video to the site", "the hero video is too big / won't play / isn't crisp", "replace the homepage video", or "make this loop on the landing page".

ever-just/agentskills

Full conversion audit for any homepage or landing page. Use when someone asks to "review my homepage," "audit my landing page," "why isn't my page converting," "check my website," or wants feedback on their marketing page. Requires URL or screenshot before proceeding.

ever-just/agentskills

Automatically fetch YouTube video transcripts, generate structured summaries, and send full transcripts to messaging platforms. Detects YouTube URLs and provides metadata, key insights, and downloadable transcripts.

関連スキル