Communitygithub.com

riaz37/remotion-ui

使用 RemotionUI 构建 Remotion 视频:CLI 安装工作流、注册合成以及代理索引。当用户需要带字幕的社交媒体片段、创作者短片、数据故事或程序化视频时使用。

remotion-ui 是什么?

该技能用于帮助开发者通过 RemotionUI 构建完整的 Remotion 合成,而不是零散的特效。它提供了一个基于 CLI 的工作流,用于将现成的源组件(类似 shadcn/ui 的风格)复制到用户项目中。支持多种视频目标,包括社交媒体竖屏片段、创作者短片、播客片段、数据解释器和产品介绍。该技能强制要求所有渲染时的动画必须使用 Remotion 的帧驱动原语(如 useCurrentFrame()、interpolate()、spring() 和 Sequence),严禁使用 CSS 过渡、动画或 Tailwind 动画类,因为这些基于浏览器时间的方法在服务端逐帧渲染时无法正确运行。它维护了一个组件注册表和代理索引,方便 AI 自动查找和选择最合适的合成。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/riaz37/remotion-ui/tree/HEAD/packages/remotion-ui/templates/agent-skill

在你喜欢的 AI 中提问

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

文档

RemotionUI 代理

当帮助用户使用 RemotionUI 构建完整的 Remotion 合成(而非一次性特效)时,使用此技能。

硬性规则

  • 使用 Remotion 文档 了解框架基础知识。
  • 使用 RemotionUI 将现成的源组件复制到用户的仓库中。
  • 在导入组件之前,先运行 npx remotion-ui@latest add <component>。
  • 从本地路径导入:@/compositions/...、@/remotion/scenes/...、@/remotion/primitives/...
  • 切勿从 remotion-ui npm 包中导入 UI 组件——它只提供一个 CLI,而不是组件库。组件是复制粘贴的源文件,类似于 shadcn/ui。

Remotion 动画规则(强制)

RemotionUI 组件是普通的 Remotion 源文件。所有渲染时的运动必须由 Remotion 的基于帧的原语驱动,而不是浏览器时间 API,因为输出是服务端逐帧渲染的,而不是在浏览器中实时播放:

  • 使用 useCurrentFrame() 读取当前帧,使用 interpolate() 将帧范围映射到值范围,并使用 spring() 实现物理的自然运动。
  • 使用 <Sequence from={...} durationInFrames={...}> 控制时间序列——绝不要使用 setTimeout、setInterval 或 requestAnimationFrame。
  • 切勿对必须出现在渲染视频中的任何内容使用 CSS 过渡、CSS animation / @keyframes 或 Tailwind 动画工具类(animate-*、transition-*)。这些在实时浏览器中基于挂钟时间运行,在 Remotion 服务端渲染期间不存在逐帧精度——它们在输出中会看起来错误或完全缺失。
  • 可以正常使用 Tailwind 进行静态布局/间距/颜色类——该规则仅适用于运动/时间相关的属性。
  • 所有透明度/位置/缩放/旋转值都通过 interpolate(frame, [inputRange], [outputRange], { extrapolateLeft: "clamp", extrapolateRight: "clamp" }) 或 spring({ frame, fps, config }) 推导,然后通过内联 style 应用(例如 style={{ opacity, transform: \translateY(${y}px)` }}`)。
  • 从 useVideoConfig() 获取 fps,不要硬编码常量。

工作流

  1. 理解视频目标(社交媒体片段、播客、数据故事、产品介绍)。
  2. 从 https://remotionui.com/ai/components.json 选择主合成。
  3. 如果设置看起来有问题,运行 npx remotion-ui doctor。
  4. 安装:npx remotion-ui add <名称>
  5. 从本地源路径导入并在 Root.tsx 中组合。
  6. 根据品牌、时间和布局自定义复制的源——遵循上述动画规则。

代理索引

CLI(代理友好)

npx remotion-ui init --existing          # 引导 remotion-ui.json
npx remotion-ui doctor --json            # 诊断设置
npx remotion-ui search -q caption --json
npx remotion-ui view social-clip --json
npx remotion-ui list --json
npx remotion-ui add social-clip caption-highlight

现有的 Remotion 项目

cd your-remotion-project
npx remotion-ui init --existing
npx remotion-ui add social-clip
npm run dev

合成优先默认配置

目标主合成
9:16 社交媒体片段social-clip
创作者短片creator-reel
播客片段podcast-clip
数据解释器data-story
产品发布intro

Individual skills in this repo

This repo contains 1 individual skill — each has its own dedicated page.

相关技能