agentleFS
jhartquistjhartquist/claude-remotion-kickstart/CLAUDE.md

claude-remotion-kickstart

CLAUDE.md120 starsChanged 12 months agoMITView on GitHub

This is a Remotion video project designed to make it easier to create videos programmatically with Claude. The project uses React, TypeScript, and Tailwind CSS. Always use pnpm for all commands. Do not use npm or npx. Components have black/white defaults with className prop for theming: Transitions use Remotion's built-in <TransitionSeries>, not component props: Timing uses <Sequence> for positioning, not component props: All utilities default to 60fps and can be used anywhere (components, config files, etc.):

  • Installs packages

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

22 rules. About 0 are common, 11 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always use pnpm for all commands: Do not use npm or npx.

    line 11
  2. Very specific:

    Run /new-composition my-video: - Create a new composition with boilerplate

    line 70
  3. Very specific:

    Transitions: use Remotion's built-in <TransitionSeries>, not component props:

    line 87
  4. Distinctive:

    All utilities default to 60fps and can be used anywhere (components, config files, etc.):

    line 118
  5. Distinctive:

    Use these for transcript-based timing:

    line 132
  6. Very specific:

    Use the createComposition helper:

    line 149
  7. Very specific:

    Use /new-composition to add your own compositions

    line 170
  8. Very specific:

    All videos run at 60fps. Available in src/presets.ts:

    line 174
  9. Distinctive:

    Use Tailwind CSS classes

    line 183
  10. Very specific:

    Use the remotion-documentation MCP tool for specific questions.

    line 212
  11. Distinctive:

    Create a new video composition with boilerplate structure.

    line 218
  12. Distinctive:

    Use timestamps for precise segment timing

    line 238
  13. Distinctive:

    Voice library: Search and use voices

    line 269
  14. Distinctive:

    Music generation: Create background music

    line 271
  15. Very specific:

    Run /new-composition my-video to create a new composition

    line 301
  16. Distinctive:

    Add/modify segments as needed

    line 304
  17. Very specific:

    Use /generate-image for reference images

    line 309
  18. Very specific:

    Use /generate-video for video clips

    line 310
  19. Distinctive:

    Use ElevenLabs MCP tools for voiceovers

    line 311
  20. Distinctive:

    Create segments timed to the transcript

    line 318
  21. Very specific:

    Use <Sequence from={...}> for precise positioning

    line 319
  22. Distinctive:

    Don't run the dev server unless explicitly asked

    line 323

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Overview

This is a Remotion video project designed to make it easier to create videos programmatically with Claude. The project uses React, TypeScript, and Tailwind CSS.

Package Manager

Always use pnpm for all commands. Do not use npm or npx.

Common Commands

# Install dependencies
pnpm i

# Start development preview
pnpm run dev

# Lint code
pnpm run lint

# Render a composition (by ID)
pnpm exec remotion render Example1-Landscape

# Render still image
pnpm exec remotion still Example1-Landscape

# Upgrade Remotion
pnpm run upgrade

Architecture

Project Structure

src/
├── components/              # Reusable components (black/white theme, className override)
│   ├── TitleSlide.tsx       # Full-screen title
│   ├── ContentSlide.tsx     # Header + body text
│   ├── CodeSlide.tsx        # Code with title
│   ├── DiagramSlide.tsx     # Mermaid/D2 diagrams
│   ├── VideoSlide.tsx       # Video playback
│   ├── BRollVideo.tsx       # B-roll with zoom
│   ├── ZoomableVideo.tsx    # Video with zoom segments
│   ├── Screenshot.tsx       # Scrolling screenshot
│   ├── Logo.tsx             # Logo overlay (animated)
│   ├── Caption.tsx          # Subtitle/caption overlay
│   ├── AsciiPlayer.tsx      # Terminal recording playback
│   ├── Code.tsx             # Syntax-highlighted code
│   ├── Diagram.tsx          # Diagram renderer
│   └── Music.tsx            # Background music with fade
├── compositions/
│   ├── example1/            # Reference: basic slideshow
│   └── example2/            # Reference: multi-feature demo
├── utils/
│   ├── createComposition.tsx  # Helper to create compositions
│   └── segmentTranscript.ts   # Parse transcripts for timing
├── config.ts                # Timing utilities: secondsToFrames(), framesToSeconds()
├── presets.ts               # VIDEO_PRESETS (aspect ratios, 60fps)
├── content.ts               # Sample content for component previews
└── Root.tsx                 # Composition registry

Quick Start

  1. Run /new-composition my-video - Create a new composition with boilerplate
  2. Edit src/compositions/my-video/content.ts - Change the text
  3. Edit src/compositions/my-video/config.ts - Adjust timing (in seconds)
  4. Run pnpm exec remotion render MyVideo - Render your video

Key Concepts

Components have black/white defaults with className prop for theming:

// Default black background, white text
<TitleSlide title="Hello" />

// Custom theme via Tailwind classes
<TitleSlide title="Hello" className="bg-blue-900 text-yellow-300" />

Transitions use Remotion's built-in <TransitionSeries>, not component props:

// GOOD: Use Remotion's TransitionSeries for fades
<TransitionSeries>
  <TransitionSeries.Sequence durationInFrames={180}>
    <TitleSlide title="Hello" />
  </TransitionSeries.Sequence>
  <TransitionSeries.Transition
    presentation={fade()}
    timing={linearTiming({ durationInFrames: 30 })}
  />
  <TransitionSeries.Sequence durationInFrames={300}>
    <ContentSlide header="Main" content="..." />
  </TransitionSeries.Sequence>
</TransitionSeries>

Timing uses <Sequence> for positioning, not component props:

import { secondsToFrames } from "../../config";

// GOOD: Position with Sequence (secondsToFrames defaults to 60fps)
<Sequence from={secondsToFrames(5.2)} durationInFrames={secondsToFrames(2.7)}>
  <Logo src="logo.svg" />
</Sequence>

Timing Utilities

All utilities default to 60fps and can be used anywhere (components, config files, etc.):

import { secondsToFrames, framesToSeconds } from "../../config";

// Convert seconds to frames (defaults to 60fps)
secondsToFrames(2.5)        // => 150 frames
secondsToFrames(2.5, 30)    // => 75 frames (custom fps)

// Convert frames to seconds
framesToSeconds(150)        // => 2.5 seconds
framesToSeconds(150, 30)    // => 5 seconds (custom fps)

Use these for transcript-based timing:

// In config.ts - define segment timing from transcript
export const SEGMENTS = {
  intro: { start: 0, end: 3.2 },
  feature: { start: 3.2, end: 8.5 },
};

// In Composition.tsx
<Sequence from={secondsToFrames(SEGMENTS.intro.start)}>
  <IntroSegment />
</Sequence>

Composition Pattern

Use the createComposition helper:

import { createComposition } from "../../utils/createComposition";

const MyVideoComposition: React.FC = () => {
  // ... video content
};

export const MyVideo = createComposition({
  name: "MyVideo",
  component: MyVideoComposition,
  durationInSeconds: 10,
  preset: "Landscape-1080p",
});

Root.tsx Structure

  • Examples folder with reference compositions
  • Components folder with previews for each component
  • Use /new-composition to add your own compositions

Video Presets

All videos run at 60fps. Available in src/presets.ts:

  • Landscape-720p: 1280x720 @ 60fps
  • Landscape-1080p: 1920x1080 @ 60fps
  • Square-1080p: 1080x1080 @ 60fps
  • Portrait-1080p: 1080x1920 @ 60fps

Styling

  • Use Tailwind CSS classes
  • Default theme: bg-black text-white
  • Override via className prop on most components
  • Code uses github-dark theme by default
  • AsciiPlayer uses nord theme by default

Preloading Assets

For seamless playback in the Studio, prefetch audio/video assets. Use staticFile() for local files in public/:

import { prefetch, staticFile } from "remotion";

// Prefetch at module level (outside component)
prefetch(staticFile("audio/music.mp3"));
prefetch(staticFile("audio/voiceover.mp3"));

const MyComposition: React.FC = () => {
  // <Audio> automatically uses prefetched blob URL
  return <Audio src={staticFile("audio/music.mp3")} />;
};

Remotion Context

Reference @context/remotion.md for detailed Remotion patterns and APIs. Reference @context/remotion-video.md for details around embedding videos. Reference @context/remotion-audio.md for details around embedding audio.

Use the remotion-documentation MCP tool for specific questions.

Slash Commands

/new-composition

Create a new video composition with boilerplate structure.

Usage: /new-composition my-video-name

Creates:

  • Folder structure with config, content, segments
  • Composition.tsx with createComposition helper
  • Title and content segments

/transcribe

Transcribe audio from video/audio files using Deepgram API.

Usage: /transcribe path/to/media.mp4

Features:

  • Auto-extracts audio from video files
  • Outputs timestamped JSON transcript
  • Use timestamps for precise segment timing

/generate-image

Generate images using Nano Banana Pro via Replicate.

Usage: /generate-image A futuristic city at sunset

/generate-video

Generate videos using Veo 3.1 via Replicate.

Usage: /generate-video A camera flying through clouds

/screenshot

Take full page screenshots at 1280x720 viewport.

Usage: /screenshot https://example.com

MCP Tools

Playwright

  • Visit websites and take screenshots
  • Debug compositions in browser
  • Capture reference images

ElevenLabs

  • Text-to-speech: Generate voiceovers
  • Voice library: Search and use voices
  • Sound effects: Generate from text descriptions
  • Music generation: Create background music

Replicate

  • Veo 3.1: Generate videos with audio
  • Nano Banana Pro: Generate/edit images

Component Reference

ComponentPropsNotes
TitleSlidetitle, className?Full-screen title
ContentSlideheader, content, className?Header + body
CodeSlidetitle?, code, language, highlightLines?, animatedHighlights?, className?Code with title
DiagramSlidetitle?, type, diagram, theme?, sketch?, className?Mermaid/D2
VideoSlidefilename, startTime?Video playback
BRollVideofilename, startTime?, endTime?, zoomStart?, zoomEnd?, playbackRate?B-roll with zoom
ZoomableVideosrc, zoomSegmentsMultiple zoom regions
Screenshotsrc, scrollSpeed?, scrollDelaySeconds?Scrolling screenshot
Logosrc, alt?, position?, size?Animated logo overlay
Captiontranscript, className?Subtitle overlay
AsciiPlayermode, castFile, playbackSpeed?, startTime?, theme?Terminal recording
Codecode, language, highlightLines?, animatedHighlights?, theme?Syntax highlighting
Diagramtype, diagram, theme?, sketch?Render diagrams
Musicsrc, volume?, fadeInSeconds?, fadeOutSeconds?, loop?Background audio

Workflow Examples

Basic Video Creation

  1. Run /new-composition my-video to create a new composition
  2. Edit src/compositions/my-video/content.ts with your text
  3. Edit src/compositions/my-video/config.ts for timing
  4. Add/modify segments as needed
  5. Render: pnpm exec remotion render MyVideo

AI-Generated Assets

  1. Use /generate-image for reference images
  2. Use /generate-video for video clips
  3. Use ElevenLabs MCP tools for voiceovers
  4. Combine assets in Remotion compositions

Timed Content from Transcripts

  1. /transcribe video.mp4 to get timestamps
  2. Parse results.channels[0].alternatives[0].words
  3. Create segments timed to the transcript
  4. Use <Sequence from={...}> for precise positioning

  • Don't run the dev server unless explicitly asked

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.