Communitygithub.com

remocn-setup

讓 Remotion 專案準備好可以使用 `npx shadcn add @remocn/<name>`:將 @remocn 註冊表加入 components.json、將 @/* 路徑加入 tsconfig.json,並在 remotion.config.ts 中加入相同別名。請在首次安裝 remocn 元件之前,或當 shadcn add 或 Remotion 打包器無法解析 remocn 匯入時使用。

remocn-setup 是什麼?

remocn-setup 是一個專為 Remotion 專案設計的 AI 助手技能,用於自動完成專案初始化設定,讓開發者能夠順利使用 `npx shadcn add @remocn/<name>` 指令安裝 remocn 元件。由於 `shadcn init` 無法識別 Remotion 框架,且 Remotion 的打包器不讀取 tsconfig 路徑別名,因此需要手動調整三個檔案:components.json、tsconfig.json 和 remotion.config.ts。此技能能夠檢查專案是否為合法的 Remotion 專案,並依序修改或建立這些檔案,確保 @remocn 註冊表、TypeScript 路徑別名 @/* 以及打包器別名正確設定。支援 Claude Code、Cursor 等具備檔案操作能力的 AI 代理工具,透過讀取與編輯專案檔案來完成設定。最後會回報各步驟的執行結果,讓開發者清楚知道哪些檔案已被建立、修改或保持不變。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/augustusday/auto-edicao/tree/HEAD/skills/remocn-setup

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

為 Remotion 專案準備 remocn

專案根目錄:$ARGUMENTS(若為空則為當前資料夾)

shadcn init 會拒絕 Remotion 專案(「無法偵測到支援的框架」),而且 Remotion 的打包器不讀取 tsconfig 路徑。因此一個全新的專案在安裝第一個元件之前需要進行三處小修改。請使用您的檔案工具自行依序完成這些修改。若專案已有對應設定,則跳過該步驟。

0. 檢查專案

讀取專案根目錄下的 package.json。

  • 若無 package.json:停止並告知使用者。
  • 若 dependencies 或 devDependencies 中沒有 remotion:則這不是 Remotion 專案,停止並告知使用者。 remocn-video 技能會透過 npx create-video@latest --yes --blank <folder> 建立此類專案。

若使用者已有一個專案,請列出接下來步驟中將觸及的檔案,並在編輯前徵求同意。

1. components.json

  • 檔案缺失: 建立並填入以下內容:

    {
      "$schema": "https://ui.shadcn.com/schema.json",
      "style": "new-york",
      "rsc": false,
      "tsx": true,
      "tailwind": { "config": "", "css": "", "baseColor": "neutral", "cssVariables": false },
      "aliases": {
        "components": "@/components",
        "utils": "@/lib/utils",
        "ui": "@/components/ui",
        "lib": "@/lib",
        "hooks": "@/hooks"
      },
      "registries": { "@remocn": "https://remocn.dev/r/{name}.json" }
    }
    
  • 檔案存在但缺少 registries["@remocn"]: 在 registries 中加入 "@remocn": "https://remocn.dev/r/{name}.json",必要時建立該物件。其餘欄位保持不變。

  • 已包含 @remocn: 略過。

2. tsconfig.json 中的 @/* 路徑

remocn 元件之間透過 @/ 互相匯入,因此 TypeScript 必須能夠解析此路徑。tsconfig.json 可能包含註解與結尾逗號:請就地編輯並保留它們。

找出 別名資料夾,即 @/ 所指向的相對專案根目錄的資料夾。步驟 3 會用到它。

  • 若 compilerOptions.paths["@/*"] 已存在: 略過該檔案。別名資料夾為其第一個不含結尾 /* 的條目(./src/* → src),如果設有 compilerOptions.baseUrl,則相對於 baseUrl 解析,否則相對於 tsconfig.json 所在的資料夾。
  • 若檔案有 extends 且自身沒有 paths: 本地的 paths 將會取代繼承的對應,而非合併。開啟它擴展的設定(僅一層,僅限相對路徑)。如果該設定有 @/*,則略過兩個檔案,並從該處取得別名資料夾,相對於父級資料夾解析。如果沒有,則不要編輯:告訴使用者在其 paths 定義處加入 "@/*": ["./src/*"],並使用 src 作為別名資料夾。
  • 其他情況: 在 compilerOptions.paths 中加入 "@/*": ["./src/*"],必要時建立 paths 並保留現有條目。如果 baseUrl 不是 .,則改為撰寫相對於 baseUrl 的 src 路徑。別名資料夾為 src。
  • 若無 tsconfig.json: 不要建立它。別名資料夾為 src。

3. remotion.config.ts 中的 @ 別名

打包器需要同樣的別名。在專案根目錄尋找 remotion.config.ts,然後再找 remotion.config.js。如果檔案中已包含 withRemocnAlias,則略過。

別名目標為 path.join(process.cwd(), "<別名資料夾>"),如果別名資料夾就是專案根目錄本身,則為 process.cwd()。

  • 無設定檔: 建立 remotion.config.ts,包含以下的匯入陳述式與程式碼區塊。
  • remotion.config.ts 已存在: 在檔案頂部加入 import path from "node:path"; 和 import { Config } from "@remotion/cli/config";(若尚未匯入),然後在檔案結尾附加以下區塊。
  • remotion.config.js 已存在: 附加相同的區塊,但不含型別標註(const withRemocnAlias = (config) => ({ ... }) 和 config.resolve?.alias ?? {}),以及相同兩個匯入陳述式(若缺失)。
// remocn 元件之間透過 components.json 中的 "@/" 別名互相匯入。
// 打包器不讀取 tsconfig 路徑,因此在此處也解析別名。
// 兩個覆寫都是刻意的:Remotion CLI 會同時對 webpack 和 rspack 套用 overrideBundlerConfig,
// 而 Remocn Studio 的預覽僅讀取 overrideWebpackConfig。
// 兩者都從專案根目錄執行,也就是 process.cwd() 所指的位置。
const withRemocnAlias = <C extends { resolve?: object }>(config: C): C => ({
  ...config,
  resolve: {
    ...config.resolve,
    alias: {
      ...((config.resolve as { alias?: object } | undefined)?.alias ?? {}),
      "@": path.join(process.cwd(), "src"),
    },
  },
});
// overrideBundlerConfig 僅存在於較新的 Remotion 4 版本中。
if (typeof Config.overrideBundlerConfig === "function") {
  Config.overrideBundlerConfig(withRemocnAlias);
}
Config.overrideWebpackConfig(withRemocnAlias);

如果別名目標與上述不同,請將 path.join(process.cwd(), "src") 替換為步驟 2 得出的別名目標。

4. 回報

用簡短幾行告知使用者每個步驟的執行結果:建立、修改或保持不變,以及任何需要手動添加的項目。之後 npx shadcn@latest add @remocn/<name> 即可在該專案中正常運作。

Individual skills in this repo

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

auto-edicao

Edita Reels, Shorts e TikToks verticais de ponta a ponta, conversando - corta o bruto, trata o áudio, monta cenas de motion em Remotion e entrega o vídeo medido e revisado. Orquestra as skills video-use (transcrição, cortes, legendas, grade) e remocn (componentes de animação para Remotion) e acrescenta o processo, os formatos, o padrão de qualidade e as armadilhas técnicas que as duas não cobrem. Use sempre que o usuário quiser editar, cortar, legendar, animar ou finalizar um vídeo vertical, montar um vídeo só com voz e motion, fazer uma mini-aula ou um vídeo com prints e telas, ajustar áudio, loudness ou trilha, renderizar com Remotion, ou revisar a qualidade de um vídeo, mesmo que não cite video-use, remocn nem Remotion. Exemplos - "edita esse vídeo pra mim", "corta os silêncios e põe legenda", "faz um reels com a minha narração e animações", "o áudio ficou baixo", "renderiza em pedaços que o disco está acabando", "revisa esse vídeo antes de eu postar".

remocn

Pick, install and compose remocn components: ready-made Remotion animations, transitions, backgrounds, captions, UI primitives and video templates from a shadcn registry. Use when building a video or scene out of prebuilt parts (product demo, launch, changelog, intro, social clip), adding an animation, transition or background to a Remotion project, or choosing between components. Activate for polished Remotion video work even when remocn isn't named. Works alongside the Remotion skills: questions about the Remotion API itself (interpolate, spring, Sequence, rendering, config) belong to them, not to this skill.

remocn-video

Make a complete Remotion video from a short brief with remocn components: pick the archetype, plan a storyboard with frame budgets, install the components, compose the scenes, check the render and point to Remocn Studio for tuning and export. Use when the user asks for a whole video (product demo, launch, feature announcement, changelog, OSS showcase, CLI demo, testimonials, year in review, pricing, logo bumper), not a single component.

相關技能