motion-canvas
What it does
This skill guides the AI agent in creating animated videos with Motion Canvas, a TypeScript framework. It is for developers and creators who want code-based video animation.
When to use it
- βWhen you want to set up a new Motion Canvas project from scratch with the right configuration.
- βWhen you are building animations with generator functions and reactive signals.
- βWhen you are fixing a build or import error in an existing Motion Canvas project.
Skill link
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/video/motion-canvas/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCan you set up a new Motion Canvas project and make a simple animated title card?β
5 new skills a week. 1 minute to read.
How it works
The agent sets up the project with the needed configuration, writes TypeScript scenes with animations, and uses the live preview to check them.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Motion Canvas - Production-Ready Video Creation with TypeScript
Complete production-ready skill for creating programmatic videos using Motion Canvas, including critical ESM/CommonJS workarounds, full configuration templates, and comprehensive troubleshooting.
β οΈ CRITICAL: ESM/CommonJS Interoperability Issue
IMPORTANT: The @motion-canvas/vite-plugin package is distributed as CommonJS, which causes import errors in modern ESM projects. The standard import motionCanvas from '@motion-canvas/vite-plugin' WILL NOT WORK.
You MUST use the createRequire workaround documented in the Setup section below.
When to use
Use this skill whenever you are dealing with Motion Canvas code to obtain domain-specific knowledge about:
- Creating animated videos using TypeScript and generator functions
- Building animations with signals and reactive values
- Working with vector graphics and Canvas API
- Synchronizing animations with voice-overs and audio
- Using the real-time preview editor for instant feedback
- Implementing procedural animations with flow control
- Creating informative visualizations and diagrams
- Animating text, shapes, and custom components
- Setting up Motion Canvas projects from scratch with correct configuration
- Troubleshooting common setup and build errors
Core Concepts
Motion Canvas allows you to create videos using:
- Generator Functions: Describe animations using JavaScript generators with
yield*syntax - Signals: Reactive values that automatically update dependent properties
- Real-time Preview: Live editor with instant preview powered by Vite
- TypeScript-First: Write animations in TypeScript with full IDE support
- Canvas API: Leverage 2D Canvas for high-performance vector rendering
- Audio Synchronization: Sync animations precisely with voice-overs
Complete Setup Guide
Step 1: Initialize Project
# Create project directory
mkdir my-motion-canvas-project
cd my-motion-canvas-project
# Initialize package.json
npm init -y
Step 2: Configure package.json for ESM
CRITICAL: Add "type": "module" to enable ESM imports.
{
"name": "my-motion-canvas-project",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
}
}
Step 3: Install ALL Required Dependencies
CRITICAL: Must include @motion-canvas/ui - the plugin will fail without it.
npm install --save-dev @motion-canvas/core @motion-canvas/2d @motion-canvas/vite-plugin @motion-canvas/ui vite typescript
Step 4: Create Project Structure
my-motion-canvas-project/
βββ package.json # "type": "module" required
βββ vite.config.js # Use .js NOT .ts (see Step 5)
βββ tsconfig.json # TypeScript configuration
βββ index.html # HTML entry point
βββ src/
βββ project.ts # Project configuration with scenes
βββ scenes/
βββ example.tsx # Animation scene
Step 5: Create vite.config.js with ESM/CommonJS Workaround
CRITICAL: Use vite.config.js (NOT .ts) with the createRequire workaround.
File: vite.config.js
import {defineConfig} from 'vite';
import {createRequire} from 'module';
// WORKAROUND: @motion-canvas/vite-plugin is CommonJS, must use require
const require = createRequire(import.meta.url);
const motionCanvasModule = require('@motion-canvas/vite-plugin');
const motionCanvas = motionCanvasModule.default || motionCanvasModule;
export default defineConfig({
plugins: [
motionCanvas({
project: './src/project.ts',
}),
],
});
Why .js instead of .ts?
- Vite config runs before TypeScript compilation
- The
createRequireworkaround works reliably in plain JavaScript - Avoids additional type resolution complexity
Step 6: Create tsconfig.json
CRITICAL: Include esModuleInterop and allowSyntheticDefaultImports.
File: tsconfig.json
{
"compilerOptions": {
"target": "ES2020",
"module": "ES2020",
"lib": ["ES2020", "DOM"],
"jsx": "react-jsx",
"jsxImportSource": "@motion-canvas/2d/lib",
"moduleResolution": "node",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}
Step 7: Create ind
FAQ
Are there known setup problems?
Yes. The skill warns that a Vite plugin import can fail in modern projects and gives a fix.
Does it need programming skills?
Yes. The videos are built with TypeScript code, which the agent writes for you.
Can it sync with voice-overs?
Yes. The skill covers synchronizing animations with audio.
Details
Original description by the author
Complete production-ready guide for Motion Canvas with ESM/CommonJS workarounds, full setup templates, and troubleshooting for programmatic video creation using TypeScript
Popularity
- GitHub stars
- 33k
- Ranking position
- #9092
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
owasp-security
33kTeaches your agent OWASP security guidance for web apps, APIs, mobile, containers and AI agents, so it can spot common weaknesses and suggest fixes.
agent-management
33kLets your agent create, list, hibernate, wake, rename and delete AI agents using the AI Maestro command line, managing each agent's lifecycle.
agent-messaging
33kLets your agent send, receive and reply to signed messages between AI agents, using the Agent Messaging Protocol, mostly on your own machine.
docs-search
33kLets your agent search auto-generated code documentation for function signatures, class definitions and comments, so it checks the real API before changing code.
Similar skills
blender-motion-state-inspection
280kAllows inspection of details in 3D animations. It's useful for checking poses, movements, and character alignment in animations.
manim-video
280kLets your agent create animated explainer videos. It uses Manim to generate clear graphs and diagrams for technical concepts.
remotion-video-creation
280kGuides your agent in creating videos using React with the Remotion library. It covers best practices for animations, audio, captions, and other visual elements.