---
catalog_id: "R-017"
kind: "repo"
domain: "agent"
domain_label: "Agent 编排 / Agent Systems"
date: "2026-11-26"
title: "remotion-dev/skills"
verdict: "路由技能配14子技能与硬约束，稳控Agent写视频代码"
summary: "Remotion 官方多 Agent 技能包与插件分发机制（含 remotion-dev/claude-code-plugin），通过路由型 SKILL.md、14 个垂直子技能、防错硬约束与构建期嵌入式引用重写脚本让编码 Agent 稳定输出可预览且可渲染的视频代码"
summary_en: "Official Remotion multi-agent skill pack combining a routing SKILL.md, 14 vertical sub-skills, hard guardrails, and build-time ref rewriting."
canonical_url: "https://oumuatown.com/repos/remotion-dev__skills/"
markdown_url: "https://oumuatown.com/repos/remotion-dev__skills.md"
og_image_zh: "https://oumuatown.com/og/zh/R-017.png"
og_image_en: "https://oumuatown.com/og/en/R-017.png"
cite_count: 33
repo: "remotion-dev/skills"
github_url: "https://github.com/remotion-dev/skills"
commit: "a3f4098"
tags:
  - "agent-skills"
  - "remotion"
  - "claude-code-plugin"
  - "prompt-engineering"
  - "video-generation"
github_repos:
  - "https://github.com/remotion-dev/skills/tree/a3f4098"
  - "https://github.com/haidrrrry/claude-remotion-skill/tree/1dcbe5e"
---

# R-017 · remotion-dev/skills

> **结论 / Verdict**: 路由技能配14子技能与硬约束，稳控Agent写视频代码
> **EN Summary**: Official Remotion multi-agent skill pack combining a routing SKILL.md, 14 vertical sub-skills, hard guardrails, and build-time ref rewriting.

## Provenance & Evidence

- Primary Repository: https://github.com/remotion-dev/skills (@a3f4098)
- Referenced Repository: https://github.com/haidrrrry/claude-remotion-skill/tree/1dcbe5e
- Verified Source Citations (#Lxx): 33
- Web Reader: https://oumuatown.com/repos/remotion-dev__skills/

# remotion-dev/skills

> 仓库地址：https://github.com/remotion-dev/skills · 审计版本：`remotion-dev/skills@a3f4098`（补充协同仓库：`remotion-dev/claude-code-plugin@f96c742`） · 审计日期：2026-11-26
> 来源文章：[关联文章](../articles/2026-11-26-fable-5-2-motion-playbook.md)

## 定位与解决的真问题

- **核心定位与目标用户**：Remotion 官方维护的标准化 Agent Skills 知识库（`version: "4.0.547"`，同源维护于 `remotion-dev/remotion/packages/skills/` 并同步镜像到 `remotion-dev/skills` 与 `remotion-dev/claude-code-plugin`），面向 Claude Code、Codex、Cursor、Kimi Code、OpenCode 等编码 Agent。
- **相比常规做法解决的关键痛点**：
  1. **根治 LLM 写视频代码的高频通病**：大模型默认会用 CSS `transition`/`@keyframes`、Tailwind 动画类、`requestAnimationFrame`、Three.js `useFrame` 或非内联动态变量来写动效，在 Remotion 多 Tab 离线抓帧中必然闪烁或失效。技能库用明确 `MUST`/`SHOULD` 约束和正反代码示例（👍 / 👎）堵住这些陷阱。
  2. **兼顾离线渲染与 Remotion Studio 双向可视化编辑**：不仅教 Agent 写出能渲染的 React 代码，还系统性编码了 Remotion Studio 静态可写回结构规范（内联字面量、独立 transform 属性、connected compositions），避免生成的视频变成黑盒不可调代码。
  3. **解决跨多 Agent 宿主的分发格式冲突**：针对 Claude Code 插件市场不允许二进制/可执行文件与跨技能相对路径跳转的限制，在构建阶段自动重写嵌套入口与示例代码格式。

## 技术栈与核心目录结构

- **语言 / 运行时 / 关键依赖**：Markdown + YAML Frontmatter（Agent Skills 规范）、TypeScript 构建与校验脚本（Bun/Node 执行）、JSON 插件清单（`.claude-plugin/plugin.json` & `marketplace.json`）。
- **关键目录树与职责划分**（`remotion-dev/skills@a3f4098`）：
  - `skills/`（14 个技能包）：
    - `remotion-best-practices/`：顶层总路由 `SKILL.md`（根据任务意图路由到下属技能），并将其他 13 个子技能以嵌入副本方式聚合在内部。
    - 垂直工作流技能：`remotion-create/`（新项目脚手架与版式规则）、`remotion-markup/`（核心 React/动画/字体/媒体/特效/3D/FFmpeg 规则，含 `remotion-maps/`）、`remotion-interactivity/`（Studio 可编辑时间轴与 Schema）、`remotion-studio/`（预览启动规范）、`remotion-render/`（MP4/透明视频/OTIO 导出）、`remotion-captions/`、`remotion-maps/`（Mapbox/MapLibre/MapTiler/Cesium）、`remotion-elements/`、`remotion-multimedia/`（Mediabunny 元数据）、`remotion-saas/`、`remotion-docs/`（Algolia API + `.md` 文档拉取工作流）、`remotion-license/`、`remotion-upgrade/`。
  - `scripts/`：技能生态同步与验证脚本，包括 `prepare-embedded-skills.ts`、`sync-agent-skills.ts`、`sync-embedded-skills.ts`、`validate-links.ts`、`sync-readme.ts`。
- **协同包装仓库（`remotion-dev/claude-code-plugin@f96c742`）**：
  - `.claude-plugin/plugin.json` 与 `.claude-plugin/marketplace.json`：声明插件名 `remotion`（v4.0.547）、`skills: "./skills/"` 及 GitHub 市场元数据，其 `README.md#L35-L37` 明确标示本仓库由主仓库 `packages/claude-code-plugin/build.mts` 自动生成。

## 核心实现源码级剖析（附文件路径与行号）

1. **路由器式渐进披露架构与跨技能嵌入重写（`skills/remotion-best-practices/SKILL.md#L1-L119`、`scripts/prepare-embedded-skills.ts#L13-L205`）**：
   - `remotion-best-practices/SKILL.md`（119 行）保持极度精简，不堆砌具体 API 细节，而是充当意图路由器（如创建项目 -> `remotion-create`、写组件 -> `remotion-markup`、地图 -> `remotion-maps`、转写字幕 -> `remotion-captions`），避免一次性塞满上下文窗口。
   - **构建期嵌入与防目录逃逸机制**：由于 Agent Skills 规范要求每个顶层技能自包含，不允许用 `../other-skill/` 跨目录引用。`sync-embedded-skills.ts`（`scripts/sync-embedded-skills.ts#L24-L100`）先将所有子技能链接嵌入到 `remotion-best-practices/`（及将 `remotion-maps` 嵌入 `remotion-markup/`），随后发布构建脚本 `prepare-embedded-skills.ts`（`scripts/prepare-embedded-skills.ts#L97-L205`）执行两步关键变换：
     1. `prepareEmbeddedSkillRoot` 把嵌套子技能目录下的 `SKILL.md` 全部重命名为 `REFERENCE.md` 并重写引用路径，确保 Agent 运行时**仅将顶层技能识别为可触发 Skill**，防止内部出现几十个重复技能入口（`prepare-embedded-skills.ts#L108-L168`）。
     2. `removeCrossSkillLinksFromMarkdown` 扫描所有 Markdown 相对链接，凡指向 `skillRoot` 外部的 `[label](../foo/bar.md)` 一律重写为纯文本描述 ``label (`bar.md` in the `foo` skill)``（`prepare-embedded-skills.ts#L13-L59`）。
   - `validate-links.ts`（`scripts/validate-links.ts#L95-L225`）在 CI 中验证所有内部相对链接可达且嵌套目录中不存在遗漏的 `SKILL.md`；`sync-agent-skills.ts`（`scripts/sync-agent-skills.ts#L10-L92`）将技能目录统一软链到 `.agents/skills/*` 与 `.claude/skills -> ../.agents/skills`。

2. **`claude-code-plugin` 自动化打包与市场合规转换（`remotion-dev/remotion` 仓库 `packages/claude-code-plugin/build.mts#L21-L168` & `test/plugin.test.ts#L13-L144`）**：
   - 主仓库发布脚本 `build.mts` 复制 `packages/skills/skills/` 到输出目录时，显式过滤掉 Claude 无需使用的 `remotion-icon.svg` 与 Codex 专用 `agents/openai.yaml`（`build.mts#L37-L45`），再调用 `prepareEmbeddedSkills(skillsOut)`（`build.mts#L61`）。
   - **绕过插件文件类型与安全限制**：Claude Code 插件校验拒绝 `.ts`/`.tsx`/`.mjs`/`.geojson` 及包含空字节或 shebang `#!` 的文件，并限制总文件数 `<= 512`、单文件 `<= 256 KiB`（`test/plugin.test.ts#L48-L71`）。`build.mts#L66-L163` 自动将所有 `.ts`/`.tsx`/`.mjs` 示例代码文件包装转换成 `.md` 代码块文档（如 `Foo.tsx.md`），将 `.geojson` 重命名为 `.json`，并把正文 Markdown 中引用这些代码路径的反引号与链接同步改写为新的 `.md` 目标。
   - **分发清单**：生成的 `.claude-plugin/plugin.json`（`remotion-dev/claude-code-plugin/.claude-plugin/plugin.json#L1-L27`）声明 `"skills": "./skills/"` 与同源版本号，配合 `marketplace.json`（`.claude-plugin/marketplace.json#L1-L30`）接入 Claude Code `/plugin` 生态。

3. **编码进规则文件中的防错清单（Anti-Mistakes Encoded for Agents）**：
   - **帧纯度与状态禁令**：
     - 显式禁止 CSS `transition` / `animation` 与 Tailwind 动画类，强制要求一切随时间变化的属性由 `useCurrentFrame` + `interpolate` 驱动（`skills/remotion-markup/SKILL.md#L33-L36`）。
     - 在 Three.js / React Three Fiber 中严禁使用 `@react-three/fiber` 的 `useFrame`，要求所有模型/Shader 运动由 `useCurrentFrame` 驱动且其内部 `<Sequence>` 必须设 `layout="none"`（`skills/remotion-markup/3d.md#L46-L86`）。
     - 禁止直接对异步加载元素放行，在 Mapbox/MapLibre/Cesium 规则中强制要求在地图初始化及每帧相机同步外包裹 `delayRender` / `continueRender`，并限定离屏 WebGL 容器尺寸 `<= 4096px` 且 CSS 缩放 `scale <= 1` 以防浏览器静默降采样导致瓦片模糊闪烁（`skills/remotion-maps/techniques/maplibre/TECHNIQUE.md#L17-L18`、`references/render-stability.md#L15-L57`）。
   - **Studio 可编辑性与性能防呆**：
     - 强制 `useCurrentFrame` 下沉到最小叶子组件，禁止放在顶层合成组件引发整棵树重渲染（`skills/remotion-markup/SKILL.md#L20-L25`）。
     - 明确反模式示例（`👎`）：禁止把 `interpolate` 抽成中间变量再拼装 `transform` 字符串，必须内联在 `style={{ scale, translate, rotate }}` 中且显式设置 `extrapolateLeft/Right: 'clamp'` 和 `output: 'perceptual-scale'`（`skills/remotion-markup/SKILL.md#L70-L100`、`timing.md#L24-L86`）；禁止在 `<Composition>` 上抽取/展开/`satisfies` 声明 `defaultProps`，必须内联对象字面量以便 Studio 源码回写（`compositions.md#L72-L110`、`remotion-interactivity/SKILL.md#L124-L209`）。
     - 禁止在未等待字体加载前测量文本尺寸，必须先 `loadFont.waitUntilDone` 并传 `validateFontIsLoaded: true`（`measuring-text.md#L87-L116`）。
   - **工作流与环境防踩坑**：
     - 脚手架前先检查隐藏文件并区分 `.DS_Store` 与 `.env`/`.git`，避免直接清盘或被 `create-video` 拒绝（`skills/remotion-create/SKILL.md#L18-L23`）。
     - 默认保持视觉尺寸安全区与字号下限（1080p 下主标题 `>= 84px`、正文 `>= 44px`、边距 `>= 80/100px`，`skills/remotion-create/video-layout.md#L4-L9`）；禁止未要求时覆盖 `--browser-executable`，无交互终端必须显式传 `[composition-id]`，多帧渲染后必须列出目录而非猜测补零位数（`skills/remotion-render/SKILL.md#L9-L73`）。
     - 防止靠幻觉写过时 API：`remotion-docs/SKILL.md#L10-L46` 内置 Algolia 搜索 API 与给任意文档 URL 追加 `.md` 后缀直接拉取纯文本手册的规范。

## 亮点设计 vs 局限/坑点

- **值得借鉴的设计**：
  - **单一真源 + 编译期多宿主适配（Single Source -> Multi-Target Build）**：技能源码集中在 `packages/skills/`，通过确定性脚本分别产物化为通用 `.agents/skills`（带 `openai.yaml`）与受限的 `claude-code-plugin`（源码自动转 Markdown、嵌套 `SKILL.md` 转 `REFERENCE.md`、文件数与体积自动化断言），零手工维护成本。
  - **正反例并排（👍 / 👎）+ 规则外显因果**：每条禁令不只说“不要用 X”，而是直接解释“为什么”（如“提取常量后 Studio 无法回写源码”“超 4096px 后 Chromium 会静默降采样造成瓦片糊”），大幅提高 Agent 在边缘场景下的遵循度。
  - **工作流强制优先预览再渲染**：明确要求“除非用户明确索要 MP4，否则先启动 Studio 预览让人审阅”，把高耗时的视频渲染推迟到人为确认后（`remotion-best-practices/SKILL.md#L45-L95`）。
- **局限、隐含假设与潜在坑点**：
  - **强假设使用 Remotion Studio 源码可编辑模式**：部分规则（如禁止提取常量样式、禁止封装 `transform` 字符串、强制内联字面量）会牺牲一部分纯代码项目的抽象优雅度；在纯 headless/批量渲染场景（不打开 Studio 改源码）反而会增加 JSX 重复。
  - **嵌套副本增大仓库文件数**：为了绕过跨技能目录限制，`remotion-best-practices` 内部嵌入了全部子技能文件（在插件构建中甚至把 `.tsx` 也拆成 `.tsx.md`），需严格控制总文件数接近插件平台 512 文件的上限（`test/plugin.test.ts#L48`）。
  - **仅针对 Remotion 4.x+ 生态**：规则深度绑定 `@remotion/media`（新视频组件）、`@remotion/effects`、`<HtmlInCanvas>` 与 `Interactive.*` API，老版本 Remotion 项目（v3 / 纯 `<OffthreadVideo>` 旧写法）需先对齐依赖版本。

## 可复用的模块或设计模式

- **如何迁移到未来项目**：
  1. **多端 Agent Skill 分发流水线**：若个人/团队维护的 Skills（如 `yiji-motion-video`、`remotion-explainer-video`、`kb-swarm-digest`）需同时分发给 Claude Code Plugin、Codex 与 Cursor，可直接复用 `prepare-embedded-skills.ts`（嵌套 `SKILL.md -> REFERENCE.md` + 跨技能相对链接自动降级为文本提示）与 `validate-links.ts`（CI 断链守卫）。
  2. **代码型规则文档化范式**：在编写技术类 `SKILL.md` 时，采用「轻量路由 `SKILL.md` + 场景切片 `.md` + 成对 👍/👎 反例 + 文档 `.md` 后缀在线查证指南」，能有效控制主上下文 Token 并遏制模型常见幻觉。
  3. **视频类 Skill 中的防呆清单复用**：其中“主标题/正文最小字号比 + 安全边距”“地图/WebGL 画布尺寸上限防静默降采样”“字体就绪栅栏后再做文本测量”可直接移植到 `yiji-motion-video` 与 `code-rendered-film` 的审校 checklist 中。
- **关联 Pattern**：[agentic-video-and-3d-toolchain-matrix](../patterns/agentic-video-and-3d-toolchain-matrix.md) · [anti-ai-slop-design-and-numeric-prompts](../patterns/anti-ai-slop-design-and-numeric-prompts.md)

## Cross-Referenced Specimens

- [A-001 · The Fable 5.2 Motion Playbook：从单条提示词到成片的确定性动效工程手册](https://oumuatown.com/articles/2026-11-26-fable-5-2-motion-playbook.md) — 用纯帧函数与节拍主时钟根除代码动效渲染漂移
- [P-001 · Agent 驱动视频剪辑、2D/3D 动画与跨宿主技能选型矩阵（Agentic Video, 3D & Skill Toolchain Matrix）](https://oumuatown.com/patterns/agentic-video-and-3d-toolchain-matrix.md) — 视频生成、三维自动化与跨宿主技能选型边界与避坑矩阵
- [P-002 · 反 AI Slop 审美门禁、防收敛发牌与物理数值提示词体系（Anti-AI-Slop & Numeric Prompting）](https://oumuatown.com/patterns/anti-ai-slop-design-and-numeric-prompts.md) — 用物理数值契约、有状态发牌与像素验收根除 AI 模板味
- [P-014 · 手绘像素风格化、参考动效逐帧逆向复刻与多运行时确定性寻帧闭环（Hand-Drawn/Pixel Stylization, Animation Remake & Deterministic Stepping Loop）](https://oumuatown.com/patterns/hand-drawn-pixel-stylization-and-animation-remake-loop.md) — 手绘像素四通道风格化、逆向逐帧复刻与多引擎离线寻帧闭环
- [P-034 · 代码艺术风格配方、参数化解说语法与全链路防 AI-Slop 门禁体系（Artistic Style Recipes, Explainer Grammars & Anti-Slop QA）](https://oumuatown.com/patterns/artistic-code-style-recipes-and-explainer-grammars.md) — 材料与时代风格拆解配参数化语法，叠加像素音画硬门禁
- [R-177 · haidrrrry/claude-remotion-skill](https://oumuatown.com/repos/haidrrrry__claude-remotion-skill.md) — 十条硬规配抽帧闭环，把Remotion做出手工动效质感
- [A-002 · 15 个动效与视频工程开源仓库全景清单（附 Fable 5.2 实战管线）](https://oumuatown.com/articles/2026-11-26-flxrnc-15-animation-repos.md) — 十五个动效与视频工程开源仓串起代码出片全链路
- [A-007 · 12 个手绘与像素动效开源仓库管线 + @seeconvm Fable 5.2 20 章全流程实战课程](https://oumuatown.com/articles/2026-11-27-0xnicc0-12-hand-drawn-motion-repos.md) — 手绘像素动效七仓补位与二十章代码成片排障资产库
- [A-038 · huashu-art-motion（36+17 风格代码动画引擎）与 15 个动效/视频开源仓生态拆解](https://oumuatown.com/articles/2026-12-03-voxyz-huashu-art-motion-and-15-motion-repos.md) — 36画风9语法配三道物理门禁，15仓串起AI动效生态
