SkillsMar 29, 2026·2 min read

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.

TL;DR
This Remotion rule covers defining compositions, stills, folders, default props, and dynamic metadata for video.
§01

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.

§02

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.

§03

How to use

  1. Install the Remotion skills:
npx skills add remotion-dev/skills
  1. The rule activates automatically when working with compositions in a Remotion project.
  1. Ask your AI assistant to create compositions, and it will follow the patterns defined in this rule.
§04

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.

§05

Related on TokRepo

§06

Common pitfalls

  • Compositions must have durationInFrames, fps, width, and height properties. Omitting any of these produces a build error. Stills do not require durationInFrames or fps.
  • 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

What is the difference between a Composition and a Still?+

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.

Can I calculate composition duration dynamically?+

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.

How do I organize many compositions?+

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.

Can I pass data to compositions at render time?+

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.

Does this rule work with Claude Code?+

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)
🙏

Source & Thanks

Created by Remotion. Licensed under MIT. remotion-dev/skills — Rule: compositions

Part of the Remotion AI Skill collection on TokRepo.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets