AgentSkillsCN

remotion-best-practices

为 ComfyUI 工作流模板管理国际化与翻译。同步翻译、新增语言、检查翻译覆盖率,以及管理本地化文件。当用户提出以下需求时使用:翻译、添加翻译、同步翻译、检查翻译、缺失翻译、添加语言、本地化、国际化、i18n、更新翻译、翻译状态、哪些模板需要翻译、语言支持、同步本地化、翻译描述、翻译标题、添加中文、添加日语、添加西班牙语、多语言、多语种。可通过“翻译”、“translation”、“i18n”、“locale”、“language”、“localize”、“internationalize”、“同步翻译”、“缺失翻译”等短语触发。

SKILL.md
--- frontmatter
name: remotion-best-practices
description: Generate Remotion video compositions with React. Use when creating videos, animations, property showcases, or any video rendering task. Provides frame-based animation patterns, composition setup, and Remotion-specific APIs.
allowed-tools: Read, Grep, Glob, Bash(npm:*, npx:remotion*)

Remotion Video Generation

Core Principles

  1. ALL animations use useCurrentFrame() - NEVER CSS transitions
  2. Use staticFile() for local assets in /public
  3. Always clamp interpolations with extrapolateRight: 'clamp'
  4. Premount sequences with premountFor prop for smooth transitions
  5. Use delayRender() and continueRender() for async data

Quick Reference

Animation Pattern

tsx
import { useCurrentFrame, interpolate } from 'remotion';

const frame = useCurrentFrame();
const opacity = interpolate(frame, [0, 30], [0, 1], {
  extrapolateRight: 'clamp',
});
const scale = interpolate(frame, [0, 30], [0.8, 1], {
  extrapolateRight: 'clamp',
  easing: Easing.out(Easing.cubic),
});

Composition Setup

tsx
import { Composition } from 'remotion';

<Composition
  id="PropertyVideo"
  component={PropertyShowcase}
  durationInFrames={300}
  fps={30}
  width={1920}
  height={1080}
  schema={PropertySchema}
  defaultProps={{ ... }}
/>

Sequence Pattern

tsx
<Sequence from={0} durationInFrames={90}>
  <Scene1 />
</Sequence>
<Sequence from={90} durationInFrames={90}>
  <Scene2 />
</Sequence>

Detailed Rules

Common Patterns

Spring Animation

tsx
import { spring, useCurrentFrame, useVideoConfig } from 'remotion';

const { fps } = useVideoConfig();
const scale = spring({
  fps,
  frame,
  config: { damping: 200 },
});

Loading External Assets

tsx
import { delayRender, continueRender, staticFile } from 'remotion';

const [handle] = useState(() => delayRender());
useEffect(() => {
  loadAsset().then(() => continueRender(handle));
}, []);

Audio Sync

tsx
import { Audio, Sequence } from 'remotion';

<Audio src={voiceoverUrl} volume={1} />
<Sequence from={30}> {/* Start after 1 second */}
  <AnimatedText />
</Sequence>