Communitygithub.com

remocn-setup

使 Remotion 项目准备好执行 `npx shadcn add @remocn/<name>`:向 components.json 添加 @remocn 注册表,向 tsconfig.json 添加 @/* 路径,并向 remotion.config.ts 添加相同的别名。在安装第一个 remocn 组件之前,或当 shadcn add 或 Remotion 打包器无法解析 remocn 导入时使用。

remocn-setup 是什么?

此技能自动配置 Remotion 项目,使其能够与 @remocn 组件库协同工作,并在运行 `npx shadcn add @remocn/<name>` 之前做好准备。它解决了 shadcn init 无法识别 Remotion 框架以及 Remotion 打包器不读取 tsconfig 路径的两个关键问题。该技能会检查 package.json 确认项目为 Remotion 项目,然后按顺序执行三项修改:在 components.json 中添加 @remocn 注册表;在 tsconfig.json 中设置 @/* 路径别名(处理继承、baseUrl 等情况);在 remotion.config.ts 中添加相同的别名,供 webpack/rspack 打包器使用。最后,它会向用户报告每个步骤的执行结果。该技能适用于 Remotion 项目初始设置,兼容 Claude Code、Cursor、Codex 等支持文件操作的 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"]: 将 "@remocn": "https://remocn.dev/r/{name}.json" 添加到 registries 中,如果需要则创建该对象。保留其他所有字段不变。

  • 已包含 @remocn: 保持原样。

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

remocn 组件通过 @/ 相互导入,因此 TypeScript 需要解析它。tsconfig.json 可能包含注释和尾随逗号:原地编辑并保留它们。

计算出别名文件夹,即 @/ 指向的、相对于项目根目录的文件夹。在第 3 步中需要用到它。

  • compilerOptions.paths["@/*"] 已存在: 保留文件。其别名文件夹是第一个条目去掉尾部 /* 后的部分(./src/* → src),如果设置了 compilerOptions.baseUrl,则相对于该 baseUrl 解析,否则相对于 tsconfig.json 所在文件夹。
  • 文件有 extends 且没有自己的 paths: 本地 paths 会替换继承的映射,而不是合并。打开它扩展的配置(仅一级,仅限相对路径)。如果那个配置有 @/*,则保留两个文件并从那里获取别名文件夹,相对于父文件夹解析。如果没有,则不要编辑:告诉用户在定义路径的地方添加 "@/*": ["./src/*"],并使用 src 作为别名文件夹。
  • 其他情况: 将 "@/*": ["./src/*"] 添加到 compilerOptions.paths 中,如果需要则创建 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") 替换为实际的别名目标。

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.

相关技能