Remotion Rule: Compositions
Remotion skill rule: Defining compositions, stills, folders, default props and dynamic metadata. Part of the official Remotion Agent Skill for programmatic video in React.
What it is
This is a Remotion agent skill rule that teaches AI coding assistants how to define compositions, stills, folders, default props, and dynamic metadata in Remotion projects. Remotion is a framework for creating videos programmatically using React components. This rule is part of the official Remotion Agent Skill.
The rule is designed for developers using AI coding tools like Claude Code to build Remotion video projects. It provides the patterns and constraints the AI needs to generate correct composition configurations.
How it saves time or tokens
Without this rule, an AI assistant might generate incorrect Remotion composition code -- wrong prop types, missing duration parameters, or invalid folder structures. The rule encodes Remotion's composition API conventions so the AI produces correct code on the first attempt, avoiding back-and-forth debugging.
The rule also documents dynamic metadata patterns for calculating video duration and dimensions from external data, which is non-obvious from the Remotion documentation alone.
How to use
- Install the Remotion skills:
npx skills add remotion-dev/skills
- The rule activates automatically when working with compositions in a Remotion project.
- Ask your AI assistant to create compositions, and it will follow the patterns defined in this rule.
Example
import { Composition, Folder, Still } from 'remotion';
export const RemotionRoot: React.FC = () => {
return (
<>
<Folder name='main'>
<Composition
id='MyVideo'
component={MyVideoComponent}
durationInFrames={300}
fps={30}
width={1920}
height={1080}
defaultProps={{
title: 'Hello World',
backgroundColor: '#000000'
}}
/>
</Folder>
<Folder name='thumbnails'>
<Still
id='Thumbnail'
component={ThumbnailComponent}
width={1280}
height={720}
defaultProps={{ title: 'My Video' }}
/>
</Folder>
</>
);
};
This defines a video composition at 1080p/30fps with default props, organized in folders with a still image for thumbnail generation.
Related on TokRepo
- AI coding tools -- Explore tools for AI-assisted development
- AI video tools -- Browse video creation and editing tools
Common pitfalls
- Compositions must have
durationInFrames,fps,width, andheightproperties. Omitting any of these produces a build error. Stills do not requiredurationInFramesorfps. - Default props must match the component's prop types exactly. TypeScript will catch mismatches at build time, but runtime errors from incorrect prop types can be confusing.
- Folder names must be unique at the same level. Duplicate folder names cause rendering issues in the Remotion Studio sidebar.
Frequently Asked Questions
A Composition defines a video with duration, frame rate, and dimensions. A Still defines a single-frame image with only width and height. Use Stills for thumbnails, social media images, or any single-frame render.
Yes. Remotion supports calculateMetadata, a function that computes duration, dimensions, and other metadata from props. This is useful when video duration depends on external data like audio length or text content.
Use Remotion's Folder component to group related compositions. Folders appear as collapsible sections in the Remotion Studio sidebar. You can nest folders for deeper organization.
Yes. Use the --props flag with the Remotion CLI to pass JSON props at render time. These override the defaultProps defined in the Composition component. This enables rendering the same composition with different data.
Yes. This rule is part of the Remotion Agent Skill, which integrates with Claude Code and other AI coding assistants. Install it with npx skills add remotion-dev/skills, and it activates automatically when working on Remotion projects.
Citations (3)
- Remotion Documentation— Remotion framework for programmatic video in React
- Remotion Composition Docs— Composition API and default props
- Remotion Skills GitHub— Remotion Agent Skills
Related on TokRepo
Source & Thanks
Created by Remotion. Licensed under MIT. remotion-dev/skills — Rule:
compositions
Part of the Remotion AI Skill collection on TokRepo.
Discussion
Related Assets
Claude-Flow — Multi-Agent Orchestration for Claude Code
Layers swarm and hive-mind multi-agent orchestration on top of Claude Code with 64 specialized agents, SQLite memory, and parallel execution.
ccusage — Real-Time Token Cost Tracker for Claude Code
CLI that reads ~/.claude logs and breaks down Claude Code token spend by day, session, and project — pluggable into your statusline.
SuperClaude — Workflow Framework for Claude Code
Adds 16+ slash commands, 9 cognitive personas, and a smart flag system to Claude Code in one pipx install.