← 返回 Skills 市场
mariokarras

Remotion Best Practices

作者 Mario Karras · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
300
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install abm-remotion-best-practices
功能描述
When the user wants to create videos programmatically with React using Remotion. Also use when the user mentions 'create video,' 'Remotion,' 'React video,' '...
使用说明 (SKILL.md)

Remotion Best Practices

You help users create videos programmatically using React and Remotion. Your goal is to scaffold projects, write compositions, build animated scene components, and render final video output -- all following Remotion v4 conventions and best practices.

Before Starting

Check for product marketing context first: If .agents/product-marketing-context.md exists (or .claude/product-marketing-context.md in older setups), read it before asking questions. Use that context and only ask for information not already covered or specific to this task.

Understand what the user needs (ask if not provided):

  1. What video to create -- subject, purpose, and visual style
  2. Target duration and dimensions -- e.g., 15 seconds at 1920x1080
  3. New or existing project -- whether to scaffold fresh or add to an existing Remotion project

Workflow

Step 1: Set Up Project

Check if a Remotion project already exists:

  • Look for package.json with @remotion/core in dependencies or devDependencies
  • If found: skip scaffolding and add a new composition to the existing src/Root.tsx
  • If not found: scaffold a new project:
npx create-video@latest my-video

After scaffolding, verify all @remotion/* packages are on the same version:

npm ls | grep remotion

For detailed setup configuration, read references/setup.md.

Step 2: Define Composition in Root.tsx

Register your video as a Composition in src/Root.tsx:

import { Composition } from "remotion";
import { MyScene } from "./MyScene";

export const RemotionRoot: React.FC = () => {
  return (
    \x3CComposition
      id="MyVideo"
      component={MyScene}
      durationInFrames={900}  // 15s at 60fps
      fps={60}
      width={1920}
      height={1080}
      defaultProps={{ title: "My Video" }}
    />
  );
};

Key points:

  • Use fps={60} as the project default (60fps for smooth animation)
  • Use PascalCase for composition IDs (e.g., MyVideo, ProductDemo)
  • Calculate durationInFrames as seconds * fps (15s at 60fps = 900 frames)

Step 3: Build Scene Components

Use AbsoluteFill as the root layout container. Use useCurrentFrame() and useVideoConfig() for animation state. Use \x3CSequence> for timeline positioning.

Minimal animated component:

import { useCurrentFrame, useVideoConfig, interpolate, AbsoluteFill } from "remotion";

export const MyScene: React.FC\x3C{ title: string }> = ({ title }) => {
  const frame = useCurrentFrame();
  const { fps } = useVideoConfig();
  const opacity = interpolate(frame, [0, 30], [0, 1], {
    extrapolateRight: "clamp",
  });

  return (
    \x3CAbsoluteFill style={{ justifyContent: "center", alignItems: "center" }}>
      \x3Ch1 style={{ opacity, fontSize: 80, color: "white" }}>{title}\x3C/h1>
    \x3C/AbsoluteFill>
  );
};

For physics-based animation, use spring():

import { spring } from "remotion";

const scale = spring({
  frame,
  fps,
  config: { damping: 12, stiffness: 100 },
});

For detailed animation patterns including spring() configuration, multi-step interpolation, and easing functions, read references/animations.md.

Step 4: Add Multi-Scene Timeline

Use \x3CSequence> to compose multiple scenes on a timeline:

import { Sequence, AbsoluteFill } from "remotion";

export const MyVideo: React.FC = () => {
  return (
    \x3CAbsoluteFill style={{ backgroundColor: "black" }}>
      \x3CSequence durationInFrames={180}>
        \x3CIntroScene />
      \x3C/Sequence>
      \x3CSequence from={180} durationInFrames={600}>
        \x3CMainContent />
      \x3C/Sequence>
      \x3CSequence from={780} durationInFrames={120}>
        \x3COutroScene />
      \x3C/Sequence>
    \x3C/AbsoluteFill>
  );
};

Each \x3CSequence> resets useCurrentFrame() to 0 for its children, so each scene animates independently. The from prop sets when the scene starts on the parent timeline.

Step 5: Render Video

Preview in browser:

npx remotion preview src/index.ts

Render locally:

npx remotion render src/index.ts MyVideo out/video.mp4

Render with custom props:

npx remotion render src/index.ts MyVideo out/video.mp4 --props='{"title":"Hello"}'

For output formats, quality settings, and advanced render options, read references/rendering.md.

For AWS Lambda rendering at scale, read references/lambda.md.

See tools/integrations/remotion.md for the full CLI command reference.

Key Rules

  1. Version pinning -- All @remotion/* packages must be the same version. Never update one independently. See tools/integrations/remotion.md for details.
  2. Deterministic rendering -- Never use Math.random(). Use random('seed') from the remotion package for deterministic random values.
  3. FPS from config -- Always get fps from useVideoConfig(). Never hardcode fps values in animation calculations.
  4. Clamp interpolation -- Use interpolate() with extrapolateRight: "clamp" to prevent values exceeding the target range.
  5. Default 60fps -- All compositions use fps={60} unless the user specifies otherwise.

Output Format

Deliver a working Remotion project with:

  1. src/Root.tsx -- Composition registration with correct dimensions, fps, and duration
  2. Scene components -- One .tsx file per scene with animations
  3. Render command -- The exact npx remotion render command to produce the final video
  4. Preview command -- npx remotion preview src/index.ts for browser preview

If adding to an existing project, deliver the new composition entry for Root.tsx and the new scene component files.

Related Skills

  • video-ad-creation: Standard ad format compositions (15s/30s/60s) with product showcase templates
  • social-video-content: Social platform video formats (9:16 vertical, 1:1 square, 16:9 landscape)
安全使用建议
This skill is an authoritatitive Remotion how-to and appears coherent. Before using it: (1) be aware the agent may read a local product-marketing-context file in your workspace if present — only keep files there you’re comfortable sharing with the agent; (2) commands like `npx create-video@latest` and `npm install` will fetch and run third-party packages from the npm registry — verify you trust the packages and pin versions in your project if needed; (3) AWS credentials are only necessary if you follow the optional Lambda rendering path — never provide AWS keys unless you intend to deploy to your AWS account and understand the IAM permissions required; (4) when in doubt, run the recommended commands manually in a controlled environment rather than allowing autonomous execution.
功能分析
Type: OpenClaw Skill Name: abm-remotion-best-practices Version: 1.0.0 The skill bundle provides legitimate instructions and documentation for using the Remotion framework to create videos programmatically with React. It includes standard project scaffolding commands (npx create-video), rendering instructions, and best practices for animations and AWS Lambda deployment, all of which align with the stated purpose without any signs of malicious intent or data exfiltration.
能力评估
Purpose & Capability
Name/description match the content: the SKILL.md and references exclusively cover scaffolding, composition patterns, animation, rendering, and optional Lambda rendering for Remotion v4. Required items (none declared) are proportionate to the stated purpose.
Instruction Scope
The instructions are focused on Remotion workflows (scaffold, add compositions, preview, render, optional Lambda). They also instruct the agent to read a workspace file (.agents/product-marketing-context.md or .claude/product-marketing-context.md) if present — this is reasonable to reuse existing user-provided context, but it is an undeclared file read (the skill metadata did not list required config paths).
Install Mechanism
This is instruction-only (no install spec or code). It recommends running npx and npm install commands (e.g., npx create-video@latest, npm install @remotion/lambda). Downloading packages via npm/npx is expected for this tooling but does involve fetching third-party code at runtime — normal for Remotion but something the user should be aware of.
Credentials
The skill declares no required environment variables, which is appropriate for local development. The Lambda reference documents AWS environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, REMOTION_AWS_REGION) as required for optional serverless rendering; these are appropriate but are not required by default. Users must provide AWS credentials only if they follow the Lambda workflow.
Persistence & Privilege
No elevated privileges requested: always:false, user-invocable:true, and the skill doesn't request persistent presence or modify other skills or system-wide settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install abm-remotion-best-practices
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /abm-remotion-best-practices 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release with best practices for creating programmatic videos using Remotion v4 and React. - Covers project setup, composition structure, scene animation patterns, and the full rendering pipeline. - Provides workflow for both new and existing Remotion projects, including CLI commands. - Emphasizes deterministic rendering, version pinning, 60fps by default, and proper animation techniques. - Clear output format: composition file, scene components, and exact render/preview commands.
元数据
Slug abm-remotion-best-practices
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Remotion Best Practices 是什么?

When the user wants to create videos programmatically with React using Remotion. Also use when the user mentions 'create video,' 'Remotion,' 'React video,' '... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 300 次。

如何安装 Remotion Best Practices?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install abm-remotion-best-practices」即可一键安装,无需额外配置。

Remotion Best Practices 是免费的吗?

是的,Remotion Best Practices 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Remotion Best Practices 支持哪些平台?

Remotion Best Practices 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Remotion Best Practices?

由 Mario Karras(@mariokarras)开发并维护,当前版本 v1.0.0。

💬 留言讨论