remotion
[User-Invoked] Use when creating, updating, or previewing Remotion videos.
SKILL.md.claude/skills/remotion/SKILL.md
GitHub[IMPORTANT] Use
TaskCreateto break ALL work into small tasks BEFORE starting. Keep task depth proportional to the work. MUST ATTENTION wait for user approval of scene plan (Step 3.3) before writing any files — NEVER skip. MUST ATTENTION read existing project files before modifying — NEVER overwrite scenes blindly. MUST ATTENTION updatetotalChaptersin ALL existing scene files when adding/removing scenes.
Be skeptical. Apply critical thinking. Every claim needs traced proof, confidence >80% to act.
Quick Summary
Goal: Create new Remotion video project, add/update scenes in existing one, or launch local Remotion Studio preview server.
Two Modes:
| Mode | When | Action |
|---|---|---|
| Create / Update (default) | User describes video content OR asks to update/add scenes | Scaffold new project or modify existing scenes |
| Play | User says "play", "preview", "open studio", "watch", "start server" | Find Remotion project → npm run studio |
Default project path: remotion/ (relative to workspace root). Respect any path user explicitly provides.
Key Rules:
- NEVER implement scenes before user approves the plan (Step 3.3)
- Always read existing project structure before adding/modifying scenes
- Keep
totalChaptersconsistent across ALL scene files - All animations MUST be driven by
useCurrentFrame()— CSS transitions FORBIDDEN - Always use Remotion components (
<Img>,<Video>,<Audio>) instead of native HTML elements
Implementing one of these? Copy from refs/ — do NOT implement from memory:
| Implementing... | Copy from |
|---|---|
{source-root}/components/Shared.tsx (new scaffold) |
refs/Shared.tsx — C palette, ProgressBar, ChapterBadge, CodeBlock, Pill, AnimRow |
{source-root}/utils/animations.ts (new scaffold) |
refs/animations.ts — easeOut, easeInOut, pop, staggeredEaseOut, counter |
| Typewriter or word-highlight text effect | refs/text-animations.tsx — getTypedText, Cursor, TypewriterScene, Highlight |
| TikTok-style captions with word highlight | refs/captions.tsx — CaptionedVideo, CaptionPage, delayRender, createTikTokStyleCaptions |
| Video/audio duration, dimensions, frames | refs/mediabunny-utils.ts — getVideoDuration, getAudioDuration, getVideoDimensions, canDecode, extractFrames |
| Mapbox map scene | refs/maps-mapbox.tsx — MapScene component, interactive:false, camera animation |
| ElevenLabs TTS voiceover generation | refs/generate-voiceover.ts — TTS script + calculateMetadata integration |
Contents
- Quick Summary
- Phase 0: Mode Detection
- Phase 1A: Detect Existing Project
- Phase 2: PLAY Mode
- Phase 3: CREATE / UPDATE Mode
- Update Mode: Specific Scenarios
- Remotion API Reference
- Closing Reminders
Phase 0: Mode Detection
Classify prompt:
PLAY keywords → "play", "preview", "open studio", "start server", "watch", "launch", "dev server"
CREATE/UPDATE → everything else (default)
Ambiguous → proceed with Create/Update (safe default).
Phase 1A: Detect Existing Project
Locate Remotion project before acting:
# Check default path
ls remotion/package.json 2>/dev/null
# Check if CWD is already a Remotion project
ls package.json 2>/dev/null | xargs grep -l '"remotion"' 2>/dev/null
# Check common paths
find . -maxdepth 3 -name "package.json" -exec grep -l '"remotion"' {} \; 2>/dev/null | head -5
State after detection:
PROJECT_EXISTS = true/falsePROJECT_PATH = remotion/(default) or detected pathHAS_STUDIO_SCRIPT = true/false(checkpackage.jsonscripts.studio)
Phase 2: PLAY Mode
When: User explicitly asks to preview / open studio / launch dev server.
Read references/remotion-play-mode.md when Phase 0 selects PLAY; it holds Steps 2.1–2.4: exit with the create hint when PROJECT_EXISTS = false, find the launch command (npm run studio, fallback npx remotion studio), start the dev server in the background and report the URL and composition IDs, and the optional one-frame render check.
Phase 3: CREATE / UPDATE Mode
Step 3.1 — New vs Update Decision
| Condition | Action |
|---|---|
PROJECT_EXISTS = false |
Scaffold new project → Phase 3.2 |
PROJECT_EXISTS = true |
Read existing project → Phase 3.4 |
Step 3.2 — Scaffold New Project
Read references/remotion-scaffold.md when PROJECT_EXISTS = false; it holds 3.2.1 bootstrap with npx create-video@latest --yes --blank --no-tailwind (preferred), the manual fallback, the directory structure, the package.json scripts, tsconfig.json, index.ts, and the copy-from-refs/ rule for Shared.tsx and animations.ts.
Step 3.3 — Plan Composition Structure
MUST ATTENTION wait for user confirmation before implementing any scenes.
Plan composition before writing files:
- Parse intent — What video about? What information to convey?
- Decide scene count — 1 scene per major concept (30s → ~4 scenes, 60s → ~8, 90s → ~12)
- Assign durations — Each scene: 6–12s (180–360 frames @ 30fps)
- Name scenes —
Scene01Intro,Scene02{Topic}, etc. - Write scene brief — what shown, key data, visual layout (left/right split, full-width, grid)
Present plan before writing files:
Proposed: {N} scenes, ~{total}s total
Scene 01 ({Xs}) — {topic}: {layout description}
Scene 02 ({Xs}) — {topic}: {layout description}
…
Proceed? (or adjust)
Step 3.4 — Read Existing Project (UPDATE path)
MUST ATTENTION read existing project state before any modifications.
When PROJECT_EXISTS = true:
# Read composition registry
cat {PROJECT_PATH}/{source-root}/Root.tsx
# List scene files
ls {PROJECT_PATH}/{source-root}/compositions/ 2>/dev/null || ls {PROJECT_PATH}/{source-root}/scenes/ 2>/dev/null
# Read main composition orchestrator
cat {PROJECT_PATH}/{source-root}/ClaudeAgentExplainer.tsx 2>/dev/null # or equivalent
Identify:
- Existing scene count and names
- Current
totalChapters/ composition duration - Where to insert / which scenes to modify
Target only scenes affected by user's request. Preserve all unchanged scenes.
Step 3.5 — Implement Scene Files
Scene file anatomy (follow exactly)
import { AbsoluteFill, useCurrentFrame, interpolate } from 'remotion';
import { C, ProgressBar, ChapterBadge } from '../components/Shared'; // adjust path
import { easeOut, staggeredEaseOut } from '../utils/animations'; // adjust path
// Data arrays at the top — keep out of component body
const ITEMS = [ ... ];
export const Scene{NN}{Name}: React.FC = () => {
const frame = useCurrentFrame();
return (
<AbsoluteFill style={{ background: C.bg, fontFamily: 'system-ui, -apple-system, sans-serif' }}>
<ChapterBadge index={NN} label="{Scene Name}" color={C.blue} />
<div style={{ position: 'absolute', inset: 0, display: 'flex', gap: 48, padding: '68px 72px 44px' }}>
{/* Content here */}
</div>
<ProgressBar chapterIndex={NN - 1} totalChapters={TOTAL} />
</AbsoluteFill>
);
};
Animation rules
| Element | Pattern |
|---|---|
| Eyebrow label | opacity: easeOut(frame, 0, 14) |
| Hero title | opacity: easeOut(frame, 8, 22) + translateY from 28→0 |
| Subtitle | opacity: easeOut(frame, 22, 18) |
| List items (stagger) | staggeredEaseOut(frame, i, startAt, 12, 16) |
| Cards (stagger up) | staggeredEaseOut + translateY(20→0) |
| Cards (stagger right) | staggeredEaseOut + translateX(28→0) |
| Late callout boxes | easeOut(frame, 90+, 18) |
Layout patterns
Left/Right split (most common):
<div style={{ position: 'absolute', inset: 0, display: 'flex', gap: 48, padding: '68px 72px 44px' }}>
<div style={{ width: 400, flexShrink: 0, ... }}> {/* Left panel */}
<div style={{ flex: 1, ... }}> {/* Right panel */}
</div>
Full-width column:
<div style={{ position: 'absolute', inset: 0, display: 'flex', flexDirection: 'column', padding: '68px 64px 44px', gap: 16 }}>
Centered (title/CTA scene):
<div style={{ position: 'absolute', inset: 0, display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', padding: '72px 100px', textAlign: 'center' }}>
Card grid:
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 12 }}>
Color and font guidelines
| Element | fontSize | fontWeight | Notes |
|---|---|---|---|
| Eyebrow label | 14 | 700 | category color, letterSpacing: 3 |
| Hero title | 44–56 | 800 | C.text, lineHeight: 1.1 |
| Body text | 17–21 | 400 | C.dim, lineHeight: 1.6 |
| Card label | 15–16 | 700 | category color |
| Monospace detail | 12–14 | 400 | fontFamily: 'Courier New' |
| Card container | — | — | C.surface, borderLeft: 3px solid color, borderRadius: 10–12 |
Step 3.6 — Wire Root.tsx
Multi-scene composition (with transitions)
import { TransitionSeries, linearTiming } from '@remotion/transitions';
import { fade } from '@remotion/transitions/fade';
import { Scene01Intro } from './compositions/Scene01Intro';
// ... other imports
const T = 18; // transition duration in frames
const D = {
s01: 210, // 7s
s02: 240 // 8s
// ...
};
const SCENES = Object.values(D).length;
export const TOTAL_DURATION_FRAMES = Object.values(D).reduce((a, b) => a + b, 0) - (SCENES - 1) * T;
const tr = () => <TransitionSeries.Transition presentation={fade()} timing={linearTiming({ durationInFrames: T })} />;
export const {
CompositionName
}: React.FC = () => (
<TransitionSeries>
<TransitionSeries.Sequence durationInFrames={D.s01}>
<Scene01Intro />
</TransitionSeries.Sequence>
{tr()}
<TransitionSeries.Sequence durationInFrames={D.s02}>
<Scene02Next />
</TransitionSeries.Sequence>
{/* ... */}
</TransitionSeries>
);
// Root.tsx
import { Composition } from 'remotion';
import { {CompositionName}, TOTAL_DURATION_FRAMES } from './{CompositionName}';
export const Root: React.FC = () => (
<Composition id="{CompositionId}" component={{{CompositionName}}} durationInFrames={TOTAL_DURATION_FRAMES} fps={30} width={1920} height={1080} />
);
Single-scene composition
// Root.tsx
import { Composition } from 'remotion';
import { MyScene } from './compositions/MyScene';
export const Root: React.FC = () => <Composition id="MyVideo" component={MyScene} durationInFrames={300} fps={30} width={1920} height={1080} />;
Step 3.7 — Post-scaffold: launch prompt
After creating/updating, report changed files and offer launch:
✅ Created {N} scene files in {PROJECT_PATH}/{source-root}/compositions/
Total duration: ~{X}s ({FRAMES} frames @ 30fps)
To preview: run `/remotion play` — starts Remotion Studio at http://localhost:3000
To render: cd {PROJECT_PATH} && npm run render
Update Mode: Specific Scenarios
Add a new scene
- Read
Root.tsxto find composition orchestrator and current scene count - Read
totalChaptersacross existing scenes - Determine insertion point (end = safest)
- Create new scene file following anatomy above
- Update Root / composition orchestrator:
- Add import
- Add
D.sNNentry - Add
<TransitionSeries.Sequence>block - MUST ATTENTION update
totalChaptersin ALL existing scene files (+1)
Modify an existing scene
- Read specific scene file
- Identify data array or JSX block needing change
- Make surgical edits only — do not touch unrelated sections
Change visual style / palette
- Edit
{source-root}/components/Shared.tsx→Cobject - Font changes: update
fontFamilyinAbsoluteFillstyle per scene (or add global in Shared)
Remotion API Reference
Before implementing beyond basic scene creation, read the relevant sections of references/remotion-skill-api-recipes.md:
- Animation timing, sequencing, compositions, assets, images/video/audio, GIFs and fonts: read those sections before implementing these features.
- Transitions, overlays, 3D, text effects/measurement and DOM measurement: read the matching section before implementation.
- Captions, dynamic metadata, Zod parameters, Mediabunny, FFmpeg/silence detection and audio visualization: read the matching section before using these APIs.
- Lottie, charts, maps, transparent rendering, voiceover, sound effects and Tailwind: read the matching section before implementation.
Keep animations frame-driven and use Remotion media components and staticFile() for public assets. Copy specialized implementations from the refs/ owners listed above.
Closing Reminders
Protocols in force (concise digest of the SYNC/shared blocks this skill carries):
- MUST ATTENTION wait for user approval of scene plan (Step 3.3) — NEVER implement scenes before approval
- MUST ATTENTION read existing project structure (Step 3.4) before modifications — NEVER overwrite blindly
- MUST ATTENTION update
totalChaptersin ALL scene files when adding/removing scenes — one missed file causes visual regression - MUST ATTENTION keep data arrays outside component body — NEVER define
const ITEMSinside component function - MUST ATTENTION use
npx create-video@latest --yes --blank --no-tailwindfor scaffold — NEVERnpm initunless fallback needed - MUST ATTENTION use
staggeredEaseOutfor list/card reveals — NEVER all-at-once opacity - MUST ATTENTION verify
PROJECT_EXISTSbefore Play mode — report missing project and exit - MUST ATTENTION use TaskCreate to plan ALL work before starting — mark each task done immediately
- MUST ATTENTION ALL animations driven by
useCurrentFrame()— CSS transitions, CSS animations, Tailwind animate/transition classes FORBIDDEN - MUST ATTENTION use Remotion components
<Img>,<Video>,<Audio>— NEVER native HTML elements - MUST ATTENTION use
staticFile()for all public/ folder assets — NEVER raw relative paths - MUST ATTENTION Copy from appropriate
refs/file — NEVER implement text animations, captions, mediabunny, maps, or voiceover from memory