Remotion best practices

From elophanto/EloPhanto · View interactive version

Remotion best practices is an AI agent skill from the GitHub repository elophanto/EloPhanto. Best practices for Remotion - Video creation in React. Use when asked to create, render, or edit videos programmatically.

How to use this skill

Skill file

Triggers

EloPhanto Workflow

When asked to create a video, follow this sequence:

  1. Read rules: Load the relevant rule files below based on the task:
  1. Scaffold (do NOT use npx create-video — it requires interactive prompts):

```bash

mkdir -p /tmp/elophanto/<project-name>

cd /tmp/elophanto/<project-name> && npm init -y

cd /tmp/elophanto/<project-name> && npm install remotion @remotion/cli @remotion/media react react-dom typescript @types/react

```

CRITICAL: Every shell_execute command MUST start with cd /tmp/elophanto/<project-name> &&.

The shell does NOT persist working directory between calls.

  1. Create project files:

Minimal entry point:

```typescript

// src/index.ts

import {registerRoot} from 'remotion';

import {Root} from './Root';

registerRoot(Root);

```

Minimal root:

```typescript

// src/Root.tsx

import {Composition} from 'remotion';

import {MyVideo} from './MyVideo';

export const Root = () => (

<Composition id="MyVideo" component={MyVideo}

durationInFrames={300} fps={30} width={1920} height={1080} />

);

```

  1. Build: Write React components following Remotion patterns from the rules.

Key APIs: useCurrentFrame(), useVideoConfig(), interpolate(), spring(),

<AbsoluteFill>, <Sequence>, <Series>, <Audio>, <Video>, <Img>

  1. Render (ALWAYS do this — never stop before rendering):

```bash

cd /tmp/elophanto/<project-name> && npx remotion render src/index.ts <CompositionId> out/video.mp4 --timeout=60000

```

Use --timeout=120000 for complex videos. Always pass timeout: 300 to shell_execute for renders.

The cd is REQUIRED — without it, npx remotion will fail with "could not determine executable".

IMPORTANT: Do NOT stop after writing files. You MUST attempt the render step.

The user expects a rendered .mp4 file, not just source code.

For complex videos, use swarm_spawn to delegate the build to a coding agent.

Design System — Apply Every Time

CRITICAL: Always read knowledge/system/remotion-video-creation.md before writing any video code.

It contains the full design system (colors, fonts, animations, scene templates) that must be applied

to every video regardless of content. Key rules:

When to use

Use this skill whenever you are dealing with Remotion code or asked to create videos programmatically.

Captions

When dealing with captions or subtitles, load the ./rules/subtitles.md file for more information.

Using FFmpeg

For some video operations, such as trimming videos or detecting silence, FFmpeg should be used. Load the ./rules/ffmpeg.md file for more information.

Audio visualization

When needing to visualize audio (spectrum bars, waveforms, bass-reactive effects), load the ./rules/audio-visualization.md file for more information.

Sound effects

When needing to use sound effects, load the ./rules/sound-effects.md file for more information.

How to use

Read individual rule files for detailed explanations and code examples:

Verify

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.