Communitygithub.com

riaz37/remotion-ui

使用 RemotionUI 建立 Remotion 影片:CLI 安裝工作流程、組件註冊與代理索引。適用於使用者需要附字幕的社交短片、創作者 Reels、資料故事或程式化影片。

remotion-ui 是什麼?

這個技能讓 AI 代理能夠引導使用者使用 RemotionUI 在 Remotion 中建立完整的合成影片。它提供了一個 CLI 驅動的工作流程,用於安裝和自訂預先建置的影片組件,類似 shadcn/ui 的模式——組件是複製到使用者專案中的原始碼檔案,而非 npm 依賴項。該技能支援多種影片目標,包括社交短片、創作者 Reels、Podcast 片段和資料解說,並從集中式元件清單中挑選合適的旗艦合成。它強制執行嚴格的 Remotion 動畫規則,以確保伺服器端逐幀渲染的正確性,禁止使用 CSS 動畫或瀏覽器計時 API,並強制使用 `useCurrentFrame()`、`interpolate()` 和 `spring()` 等基於幀的基礎元件。該技能適用於 Claude Code、Cursor 和 Codex 等 AI 編碼代理,透過明確的規則和指令要求處理 RemotionUI 安裝(`npx remotion-ui add`)、診斷(`npx remotion-ui doctor`)和組件自訂,同時透過 `remotionui.com/ai` 的 JSON 端點提供自動索引存取。

相容平台~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. 了解影片目標(社交短片、Podcast、資料故事、產品介紹)。
  2. 從 https://remotionui.com/ai/components.json 挑選一個旗艦合成。
  3. 如果設定看起來有問題,執行 npx remotion-ui doctor。
  4. 安裝:npx remotion-ui add <name>
  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
創作者 Reelcreator-reel
Podcast 片段podcast-clip
資料解說data-story
產品發布intro

Individual skills in this repo

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

相關技能