Communitygithub.com

Remotion Compose

将自然语言视频简报转换为完整的、可即时预览的 Remotion 合成——提取时长、场景、品牌颜色、宽高比和实际文案;规划帧预算;并编写数据驱动的 React/TypeScript 代码(使用 useCurrentFrame、interpolate、spring、AbsoluteFill 和 Sequence),注册在 Root.tsx 中。当有人说“制作一个 20 秒的产品演示视频”、“为功能导览制作动画”、“为这个营销短片编写 Remotion 代码”,或者想要一个可以在 Studio 中逐帧浏览的场景合成时使用。请勿用于渲染、迭代或批量生成最终的 MP4 文件(请使用 remotion-render),也请勿用于安装和搭建项目(请使用 remotion-setup)。

Remotion Compose 是什么?

Remotion Compose 是一个 AI 驱动的技能,专为将自然语言视频简报转化为可立即预览的完整 Remotion 合成而设计。它适用于 Claude Code、Cursor 和 Codex 等平台,能够从用户的简短描述中提取关键参数,如视频时长、场景顺序、品牌配色方案、字体、宽高比和文案。随后,该技能会自动创建一个结构化的帧预算,为每个场景分配时间,并生成数据驱动的 React/TypeScript 代码,利用 Remotion 的核心动画 API(如 useCurrentFrame、interpolate 和 spring)实现逐帧动画。最终输出的 .tsx 文件会注册在 Root.tsx 中,用户可以直接在 Remotion Studio 中预览和调整。该技能强调纯函数式动画、确定性随机数生成以及通过 props 传递所有数据,以确保在不同分辨率(16:9、9:16、1:1)和帧率下的一致性和可复用性,避免了 CSS 过渡、异步数据请求或硬编码值等常见错误。

兼容平台~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/SkillMedev/skills/tree/HEAD/skills/remotion-compose

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Remotion Compose 是做什么的?

你将一份自然语言简报变成完整的、可即时预览的 Remotion 合成——真实的 React/TypeScript,带有帧驱动的动画。输出是 src/compositions/ 中的一个 .tsx 文件,注册在 src/Root.tsx 中,用户可以在 Studio 中立即预览,或交给 remotion-render。

当任何请求涉及创建、生成、动画化或“为产品演示、导览、功能展示或营销动画编写视频代码”时触发——包括“制作一个 20 秒的展示 X 的视频”。

第一步 - 提取简报

在获得这些信息之前不要开始编码。将它们打包成一个紧凑的批次询问;用合理的默认值填补明显的空白,而不是停滞不前:

  1. 时长(秒)和 fps(默认 30 - 产品和营销视频的标准,渲染成本是 60fps 的一半。仅在动画精细光标运动或滚动 UI(30fps 明显卡顿)时才使用 60fps)。
  2. 场景 - 按顺序发生的事情。推动生成一个节奏列表:“Logo,然后三个功能,最后 CTA”优于“我的应用演示”。
  3. 品牌 - 主色/强调色/背景色的 hex 值,以及字体(一个 @remotion/google-fonts 的字体族名称)。
  4. 宽高比 / 平台 - 16:9 横屏(1920×1080)、9:16 竖屏(1080×1920)用于社交平台,或 1:1 正方形(1080×1080)。
  5. 文案 - 实际的标题/功能名称/CTA 文本。切勿编造产品声明;询问真实文案。

在所有地方将秒转换为帧:durationInFrames = seconds * fps。典型总长度:社交/产品演示 15-60 秒,广告短片 6-15 秒。

第二步 - 构建场景计划

每个视频一个 <Composition>,每个场景一个组件,在时间线上用 <Sequence> 拼接。在编写代码之前规划好帧预算:

总计:20s @ 30fps = 600 帧
  开场(Logo)       帧   0-90    (Sequence from=0   durationInFrames=90)
  功能 1           帧  90-240   (Sequence from=90  durationInFrames=150)
  功能 2           帧 240-390   (Sequence from=240 durationInFrames=150)
  功能 3           帧 390-540   (Sequence from=390 durationInFrames=150)
  CTA 结尾         帧 540-600   (Sequence from=540 durationInFrames=60)

预算时的节奏阈值:

  • 任何包含文本的片段至少给 2 秒(30fps 下 60 帧)——入场动画加停留。一个标题每个字大约需要 150-200ms 的停留才能被阅读;一个 6 个字的标题在“落地后”需要大约 1 秒的停留。
  • 入场动画:10-20 帧。淡入淡出和退出:12-15 帧。再长显得拖沓,再短像故障。
  • 除非是故意的闪切,否则场景不要短于约 45 帧。

<Sequence from={F}> 会移动子组件的本地时钟,因此该组件内的 useCurrentFrame() 从 0 开始。将每个场景动画视为从第 0 帧开始。

第三步 - 核心 API 参考

  • useCurrentFrame() - 当前帧(时钟)。一切动画都是它的函数。
  • useVideoConfig() - { fps, width, height, durationInFrames }。
  • interpolate(frame, [inFrames], [outValues], opts) - 线性映射。对于入场/退出动画,始终传递 { extrapolateLeft: "clamp", extrapolateRight: "clamp" },这样值就不会超出范围。
  • spring({ frame, fps, config }) - 基于物理的 0→1(略微过冲)。用于任何需要感觉“生动”的效果(弹出、滑动、缩放进入)。
  • AbsoluteFill - 一个全屏绝对定位的 div;每个场景的基础层。
  • Sequence - 时间移位和时间边界子组件(场景调度器)。
  • Series / Series.Sequence - 无需手动计算 from 偏移量的背靠背场景。
  • Img, staticFile - 见第六步。

第四步 - spring() vs interpolate()

使用 spring() 当……使用 interpolate() 当……
运动应该感觉有物理感——弹出、反弹、缩放进入、滑动进入需要在精确帧之间进行精确的线性控制
你想要自然的稳定/过冲效果淡入淡出(透明度 0→1)、颜色变化、进度条,以及任何需要按帧计时的内容
卡片、Logo、徽章的入场淡入淡出和退出,过冲效果会看起来不对劲

模式——用 spring 驱动变换,用 interpolate 驱动透明度:

const { fps } = useVideoConfig();
const frame = useCurrentFrame();
const pop = spring({ frame, fps, config: { damping: 200 } });   // 0 → 1, 活泼
const opacity = interpolate(frame, [0, 15], [0, 1], { extrapolateRight: "clamp" });
const scale = interpolate(pop, [0, 1], [0.8, 1]);

damping: 200 是万能配置——快速稳定,几乎察觉不到过冲。较低的阻尼(~10-20)会明显反弹;仅在需要反弹效果时使用。

第五步 - 标准产品演示结构

除非简报另有说明,否则采用这种结构:Logo/品牌介绍 → N 个功能展示 → CTA 结尾。 使其数据驱动(第六步),以便变体无需额外提示。

// src/compositions/ProductDemo.tsx
import {
  AbsoluteFill, Sequence, useCurrentFrame, useVideoConfig,
  interpolate, spring,
} from "remotion";
import { loadFont } from "@remotion/google-fonts/Inter";

const { fontFamily } = loadFont();

export type Feature = { title: string; body: string };
export type ProductDemoProps = {
  brand: string;
  colors: { bg: string; fg: string; accent: string };
  logoText: string;
  features: Feature[];
  cta: string;
};

const Intro: React.FC<{ text: string; colors: ProductDemoProps["colors"] }> = ({ text, colors }) => {
  const frame = useCurrentFrame();
  const { fps } = useVideoConfig();
  const s = spring({ frame, fps, config: { damping: 200 } });
  const scale = interpolate(s, [0, 1], [0.7, 1]);
  const opacity = interpolate(frame, [0, 12], [0, 1], { extrapolateRight: "clamp" });
  return (
    <AbsoluteFill style={{ backgroundColor: colors.bg, justifyContent: "center", alignItems: "center" }}>
      <h1 style={{ fontFamily, fontSize: 120, color: colors.fg, transform: `scale(${scale})`, opacity }}>
        {text}
      </h1>
    </AbsoluteFill>
  );
};

const FeatureCallout: React.FC<{ feature: Feature; colors: ProductDemoProps["colors"] }> = ({ feature, colors }) => {
  const frame = useCurrentFrame();
  const { fps } = useVideoConfig();
  const slide = spring({ frame, fps, config: { damping: 200 } });
  const x = interpolate(slide, [0, 1], [-60, 0]);
  const opacity = interpolate(frame, [0, 15], [0, 1], { extrapolateRight: "clamp" });
  return (
    <AbsoluteFill style={{ backgroundColor: colors.bg, justifyContent: "center", paddingLeft: 160 }}>
      <div style={{ transform: `translateX(${x}px)`, opacity }}>
        <div style={{ fontFamily, fontSize: 32, color: colors.accent, fontWeight: 700, letterSpacing: 2 }}>
          {feature.title.toUpperCase()}
        </div>
        <div style={{ fontFamily, fontSize: 64, color: colors.fg, maxWidth: 1100, marginTop: 16 }}>
          {feature.body}
        </div>
      </div>
    </AbsoluteFill>
  );
};

const Outro: React.FC<{ cta: string; colors: ProductDemoProps["colors"] }> = ({ cta, colors }) => {
  const frame = useCurrentFrame();
  const opacity = interpolate(frame, [0, 18], [0, 1], { extrapolateRight: "clamp" });
  return (
    <AbsoluteFill style={{ backgroundColor: colors.accent, justifyContent: "center", alignItems: "center" }}>
      <h2 style={{ fontFamily, fontSize: 84, color: colors.bg, opacity }}>{cta}</h2>
    </AbsoluteFill>
  );
};

export const ProductDemo: React.FC<ProductDemoProps> = ({ colors, logoText, features, cta }) => {
  const intro = 90;
  const per = 150;
  const outro = 60;
  return (
    <AbsoluteFill>
      <Sequence durationInFrames={intro}>
        <Intro text={logoText} colors={colors} />
      </Sequence>
      {features.map((f, i) => (
        <Sequence key={i} from={intro + i * per} durationInFrames={per}>
          <FeatureCallout feature={f} colors={colors} />
        </Sequence>
      ))}
      <Sequence from={intro + features.length * per} durationInFrames={outro}>
        <Outro cta={cta} colors={colors} />
      </Sequence>
    </AbsoluteFill>
  );
};

在 src/Root.tsx 中注册,使用相同的数字计算 durationInFrames 并提供 defaultProps:

<Composition
  id="ProductDemo"
  component={ProductDemo}
  durationInFrames={90 + 3 * 150 + 60}
  fps={30}
  width={1920}
  height={1080}
  defaultProps={{
    brand: "Acme",
    colors: { bg: "#0B0B0F", fg: "#FFFFFF", accent: "#6C5CE7" },
    logoText: "Acme",
    features: [
      { title: "Fast", body: "Ship in seconds, not sprints." },
      { title: "Simple", body: "One prompt, one video." },
      { title: "Yours", body: "Your brand, your copy." },
    ],
    cta: "Start free →",
  }}
/>

对于竖屏/社交平台,设置 width={1080} height={1920};对于正方形,1080×1080。保持组件相同——只有画布改变。

第六步 - 数据驱动的 props 与静态资源

上面的组合是完全数据驱动的:每个词和颜色都是一个 prop。这就是关键所在——变体(新文案、新调色板、本地化文本)无需重新提示;只需传递不同的 props(remotion-render 通过 JSON 文件批量处理)。

静态资源(Logo、截图、音频)存放在 public/assets/ 中,并通过 staticFile() 引用——不要使用 import 或原始路径:

import { Img, staticFile } from "remotion";
<Img src={staticFile("assets/logo.png")} />

第七步 - 输出

将完成的文件保存到 src/compositions/<VideoName>.tsx,在 src/Root.tsx 中注册,并告诉用户使用 npx remotion studio (http://localhost:3000) 预览。然后交接:“在 Studio 中预览。告诉我需要修改什么——太快了、颜色不对、文案要改——我会编辑并重新渲染(remotion-render)。”

不要做

  • 不要使用 CSS 过渡/动画或 setTimeout/setInterval 来制作动画。Remotion 独立且并行渲染每一帧;任何不是从 useCurrentFrame() 派生出来的内容,在最终渲染中即使可能在浏览器预览中看起来正常,也会变得不可见或不一致。
  • 不要使用 Math.random() 进行散布/粒子效果——每个渲染工作线程会得到不同的值,帧将不再匹配。使用 Remotion 的 random(seed) 来实现确定性的伪随机。
  • 不要在没有 delayRender() / continueRender() 的情况下获取数据或等待异步操作——渲染器会在数据到达之前捕获帧。
  • 不要在场景组件内硬编码 fps、width 或 height——从 useVideoConfig() 中读取它们,这样切换 30↔60fps 或横屏↔竖屏就不会破坏每个时序和布局。
  • 不要在入场/退出的插值上省略 extrapolateLeft/Right: "clamp"——透明度会超过 1,元素在范围结束后会漂移到画布之外。
  • 不要编造标题、功能声明或 CTA——使用用户的真实文案,如果缺少则询问。

质量标准

  • 每个动画值都是 useCurrentFrame()(加上 props)的纯函数——在 Studio 中向后预览与向前播放看起来一样。
  • 计划中的帧预算总和恰好等于 Root.tsx 中的 durationInFrames,并且没有文本段落的停留时间低于其可读最小值。
  • 所有文案和颜色都通过类型化的 props 传递,并提供了 defaultProps——没有字面量隐藏在场景组件中。
  • 资源通过 staticFile() 加载;文件注册干净,在 Studio 中预览时没有控制台错误。

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

SkillMedev/skills

Designs REST API surfaces - resource naming, HTTP method and status-code semantics, error shapes, pagination, and filtering - and delivers an endpoint spec a consumer can build against without asking questions. Use when someone asks "how should I name this endpoint", "what status code should this return", "should this be PUT or PATCH", "how do I paginate this list", or is reviewing an API before it ships to external consumers. Do NOT use for planning breaking-change rollouts and deprecation windows - use api-versioning-strategist instead; for GraphQL type and resolver design - use graphql-schema instead; for generating client SDKs from an existing spec - use api-client-generator instead; for designing inbound webhook endpoints - use webhook-receiver-hardener instead.

SkillMedev/skills

Produce an accurate, properly timed caption track (SRT or WebVTT) from a video's audio - transcribing or aligning to the voiceover script, timing cues to speech, and enforcing line-length and reading-speed rules so captions are readable and in sync. Use when someone says "generate captions", "make subtitles from the audio", "transcribe and caption this", "export an SRT or VTT", "the captions are out of sync", or "the subtitles flash by too fast to read". Do NOT use to burn-in, style, reframe, or position an existing caption track for a platform (9:16, brand styling, safe areas) - that is social-video-formatter; do NOT use to animate text word-by-word as a motion graphic - that is kinetic-typography; do NOT use to write the spoken script in the first place - that is narration-script.

SkillMedev/skills

Turns data and charts into a decision-driving narrative structured as headline finding, trend, implication, and recommended action - with finding-led chart titles, context for every number, annotation guidance, and honest flags on any conclusion the data cannot support. Use when someone says "turn these numbers into a story", "what's the takeaway from this data", "help me present these results to leadership", or has charts but no narrative. Do NOT use for compressing a long document into a one-pager - use executive-summary instead - or for running the analysis that produces the findings - use eda-playbook instead.

SkillMedev/skills

Use when a task needs live or historical money data - "convert USD to EUR", "current/past exchange rate", "FX rate on this date / over this range", or "current price of Bitcoin/Ethereum, market cap, 24h change". Frankfurter (ECB reference rates, no key) is the FX default; CoinGecko's free keyless tier covers crypto. Do NOT use for stock quotes or equities - no keyless stock API survives verification, say so instead of guessing; do NOT use for country economic indicators like GDP or inflation series - use government-open-data instead; if the request is a vague "I need live data", route through public-data-api-picker.

SkillMedev/skills

Builds a driver-based FP&A operating model linking business inputs to P&L, balance sheet, and cash flow outputs. Use when building an annual plan, preparing investor materials, running scenario analysis, or stress-testing the business.

SkillMedev/skills

Use when a task needs live geographic lookups - "geocode this address", "what's at these coordinates" (reverse geocoding), "lat/lon for this city", "which country/state is this ZIP or postal code in", or "country facts: capital, currency, population, flag". Nominatim (OpenStreetMap) is the geocoding default; Zippopotam for postal codes; APICountries for country facts. All keyless. Do NOT use for weather at a location - use weather-climate instead; do NOT use for country-level statistics over time (GDP, population trends) - use government-open-data instead; if the request is a vague "I need live data", route through public-data-api-picker.

SkillMedev/skills

Runs the full Getting Things Done loop - capture, clarify, organize, reflect, engage - building a trusted system of context lists, a projects list with defined next actions, and a weekly review habit. Use when someone says "I'm overwhelmed and things are slipping through the cracks", "set up GTD for me", "help me do a brain dump and organize it", or "my to-do list is a mess". Do NOT use for just running the weekly review ritual itself - use weekly-review instead - or for clearing an email backlog - use inbox-zero.

SkillMedev/skills

Processes any email backlog to zero using the 4Ds - Delete, Delegate, Defer, Do - with a mass-archive strategy for the obvious, a touch-each-email-once discipline, and a keep-it-clear system of batched processing windows, ruthless unsubscribing, filters, and a minimal folder setup. Use when someone says "I have 5,000 unread emails", "help me get to inbox zero", "email is eating my whole day", or treats their inbox as a to-do list. Do NOT use for drafting the reply emails themselves or prioritization rules for an ongoing support queue - use email-triage instead - or for protecting focus time around the email windows - use deep-work-planner instead.

SkillMedev/skills

Write landing-page copy section by section - hero, social proof, features-as-benefits, objections, CTA - leading with one promise and proving it down the page. Use when someone asks "write my landing page", "improve my hero headline", "what should the homepage say", "turn these features into benefits", or is shipping a new page for a launch or campaign. Do NOT use for testing and optimizing an existing page's conversion rate - use landing-page-cro instead; for the one-line claim itself use positioning-statement; for the full message ladder use messaging-hierarchy.

SkillMedev/skills

Improves an existing landing page's conversion rate through evidence-first CRO - audit heatmaps and recordings, write structured hypotheses, prioritize with ICE scoring, and run one-variable tests to statistical significance. Use when someone asks "why isn't my landing page converting", "audit this page before we scale spend", "which A/B test should we run first", or after a CVR drop or ahead of a paid-traffic push. Do NOT use for writing a new landing page from scratch - use landing-page-copy instead. Do NOT use for auditing the ad accounts sending the traffic - use paid-acquisition-audit instead. Do NOT use for reading the results of a finished experiment - use ab-test-analyzer instead.

SkillMedev/skills

Runs structured coaching sessions using values clarification and the GROW model, ending every session with one committed action, a deadline, and an if-then plan for the likely obstacle. Use when someone says "I feel stuck in my life", "help me figure out what I want", "hold me accountable to my goals", or "coach me through this decision". Do NOT use for building a stress toolkit - use stress-management instead - or a journaling practice - use journal-framework; for a standing goal-tracking system, use goals-accountability. Coaching, not therapy: signs of clinical distress route to a licensed professional.

SkillMedev/skills

Adapts English content for a target language and region - swapping idioms, setting the right formality register, replacing cultural references, converting dates, units, and currency - and delivers the localized text with a notes column explaining each adaptation and flagging what needs a native reviewer. Use when someone asks "localize this copy for the Japanese market", "adapt our marketing copy for the Mexican market", "make this translation sound native instead of literal", or a literal translation reads foreign, stiff, or risky. Do NOT use for auditing in-product UI text quality - use ux-writing-audit instead.

SkillMedev/skills

Scaffolds a new Remotion video project wired for Claude Code Agent Skills - Node check, create-video scaffold, skills install, folder conventions, Google Fonts, and a smoke-test render. Use whenever someone wants to start making videos with Remotion and Claude, even just "make product videos with Claude.

SkillMedev/skills

Classifies incident severity (SEV1-4) using impact, scope, and urgency signals and decides who to page. Use when an alert fires or a report comes in and a severity call must be made quickly.

SkillMedev/skills

Use the Skill Me catalog from inside any conversation - discover, install, and manage Claude skills through the Skill Me MCP, and load installed skills automatically each session.

SkillMedev/skills

Write one platform-native caption from a topic and brand voice, with a front-loaded hook, native length, and a single earned CTA. Use when the user gives a topic (and optionally brand voice or a described image/video) and asks for an Instagram, LinkedIn, X/Twitter, or TikTok caption. Do NOT use when the user wants a dedicated standalone LinkedIn post - use linkedin-post-writer instead; or a multi-post X thread - use tweet-thread-builder instead; or to adapt one existing piece of content into versions for several channels - use cross-platform-reformatter instead.

SkillMedev/skills

Reframe and export a finished video for social platforms - 9:16 ↔ 16:9 cropping, burned-in captions, a platform-native first frame, loop design, and per-platform specs (aspect, length, safe areas) for TikTok, Reels, Shorts, X, and LinkedIn. Use when someone says "make this vertical", "crop to 9:16", "format for TikTok/Reels/Shorts", "add captions/subtitles", "why is my video cut off on mobile", "resize for Instagram", or "export for social". Do NOT use when the question is about the storyboard or shot order before any video exists (use video-storyboard); the animation craft of how elements move (use motion-design-principles); animated word-by-word caption styling (use kinetic-typography); palette, contrast, or lighting (use motion-color-and-light); directing the product-demo content and screen choreography (use product-demo-director); or scoring, beat-syncing, or audio (use sound-and-music-sync) - this is the craft layer that decides WHAT to format for the feed, then hands a concrete spec to remotion-compo...

SkillMedev/skills

Writes and tunes PySpark jobs - join strategy and broadcast size limits, shuffle-partition sizing, skew diagnosis and salting, UDF avoidance, caching, and output file layout - with concrete size and skew thresholds. Use when someone asks "why is my Spark job slow", "should I broadcast this join", "one task takes forever while the rest finish", "my job OOMs during a join", or is writing a new PySpark ETL job. Do NOT use for Kafka topic, consumer-group, or streaming-pipeline design - use kafka-pipelines instead; do NOT use for single-machine dataframe work that fits in memory - use pandas-expert instead.

SkillMedev/skills

Builds clean, performant, accessible SwiftUI views with correct state ownership, scoped invalidation, and smooth list scrolling, and reviews existing SwiftUI code against a concrete frame-time and re-render budget. Use when someone asks "why does my SwiftUI list stutter", "should this be @State or @Observable", "my whole screen re-renders when one row changes", "how do I animate this transition", or wants a SwiftUI view built or refactored. Do NOT use for cross-platform React Native apps - use react-native-pro instead; do NOT use for Flutter widget trees - use flutter-widget-architect instead; do NOT use for Android Compose UIs - use jetpack-compose-builder instead.

相关技能