Skip to content

Turn any script into viral, multi-style animated stickman videos for Faceless YouTube Channels. Automate visuals, voiceover, captions & SFX. 100% Free & Open-Source.

feat: add Autopilot mode and approved Chinese B1 presentation

kaomeiaef5becba29b
diff --git a/.gitignore b/.gitignore
index e458ed5..9bc68ca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,8 @@
.worktrees/
+node_modules/
+.env
+.env.*
+!.env.example
+__pycache__/
+*.pyc
+autopilot-work/
diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md
index 1ca255b..d8903e3 100644
--- a/CHANGELOG.zh-CN.md
+++ b/CHANGELOG.zh-CN.md
@@ -1,5 +1,14 @@
# 更新记录
+## 2026-10-23 — Autopilot 自动成片与 B1 极简手绘风
+
+- 仍为同一个仓库、同一个 `directing-stickman-videos` Skill:A · Director 生成分镜与视频提示词,B · Autopilot 串起素材生成、配音、字幕、局部动画、音效与本地合成。
+- 新增可安装的本地运行脚本、配置说明、Gemini 可选适配器与离线示例;按实际配音安排画面,支持样片确认后制作整片、镜头缓存和中断续接。
+- 发布 B1「极简手绘风」与已确认的原速 Sadaltager 有声样片。第二条展示样片暂不添加。
+- 沿用反复确认的中文首页与 A/B 画风结构;其他语言介绍暂不同步,A 系列提示词和参考规则保持原样。
+
+已有用户更新同一个 Skill 即可。Autopilot 需要 Node.js 20+、FFmpeg 及可用的生图、配音工具;首次运行会检查配置。[运行说明](skills/directing-stickman-videos/references/autopilot-runtime.md)。
+
## 2026-10-20 — 风格 5:历史卡通风
- 新增历史卡通风:白色圆头、黑色椭圆眼睛与细线肢体,搭配时代服饰和彩色绘景。
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 0b1cefa..9853b86 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -1,31 +1,25 @@
-<!-- readme:hero -->
-
<div align="center">
[English](README.en.md) · [**简体中文**](README.zh-CN.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Português do Brasil](README.pt-BR.md) · [Türkçe](README.tr.md) · [Bahasa Indonesia](README.id.md)
-# AI 火柴人动画画风大全
+# 火柴人动画画风库
**将任何想法变成一部高质量的、稳定画风火柴人视频。**
[![GitHub Stars](https://img.shields.io/github/stars/kaomei/stickman-video-director?style=flat-square)](https://github.com/kaomei/stickman-video-director/stargazers)
![MIT License](https://img.shields.io/badge/License-MIT-16a34a?style=flat-square)
-</div>
-
-<div align="center">
-
-我把全网所有热门的火柴人画风,逐个实测并整理开源出来。安装好 Skill 后,你只需要给一个话题,就能拿到动画脚本、动态分镜,以及配音和音效提示词。
+给一个话题、一段文案或故事脚本,**自动制作带配音、字幕与微动画的完整视频**;也可选择导演模式,获取**动画脚本、分镜与逐段视频提示词**,自己把控生成与剪辑。
-<strong>以后想做火柴人动画,来这里挑画风就够了——</strong>适用于 **YouTube 知识讲解、TikTok、职场励志、教育科普和快节奏情感故事。**
+汇总全网热门的火柴人画风,持续更新与开源——适用于 **YouTube 知识讲解、TikTok 短视频、职场励志、教育科普和情感故事**。
</div>
<table width="100%">
<tr>
<td width="50%" align="center">
-<strong>黑白极简</strong><br>
-<a href="#style-gallery"><img src="https://cdn.jsdelivr.net/gh/kaomei/stickman-video-director@2697fac5e0466f44098148a52c9648697521b3d6/assets/readme/previews/dark-theme-demo.gif" alt="黑白极简火柴人动画:黑底白线、动态科普" width="90%"></a>
+<strong>经典黑白</strong><br>
+<a href="#style-gallery"><img src="https://cdn.jsdelivr.net/gh/kaomei/stickman-video-director@2697fac5e0466f44098148a52c9648697521b3d6/assets/readme/previews/dark-theme-demo.gif" alt="经典黑白火柴人动画:黑底白线、动态科普" width="90%"></a>
</td>
<td width="50%" align="center">
<strong>潮酷科技</strong><br>
@@ -57,19 +51,114 @@
**5 大画风 · 7 种视觉方案 · 实测样片 · 免费开源**
-⭐ **先收藏,下次做火柴人动画不用再到处找提示词。**
+⭐ **本系列持续更新,欢迎点个 Star,更多热门画风陆续上线。**
-[开始使用](#quick-start) · [最近更新](#recent-updates) · [完整制作教程](https://x.com/CrazyKaomei/status/2102311241046008268)
+[开始使用](#quick-start) · [A 画风](#a-styles) · [B 画风](#b-styles) · [最近更新](#recent-updates) · [完整制作教程](https://x.com/CrazyKaomei/status/2102311241046008268)
</div>
-<!-- readme:demos -->
+<a id="creation-modes"></a>
+
+## 你想怎么做?
+
+**想精细控制镜头,选 A · Director;想做长片、不想逐段拼装,选 B · Autopilot。** 同一个项目,两种制作方式。
+
+| | A · 导演模式 · Director | B · 自动成片 · Autopilot |
+|:---:|:---|:---|
+| **特点** | **你来掌镜,AI 做导演**:生成分镜与提示词,由你控制片段生成和剪辑。 | **给个故事,直接拿成片**:自动完成插画、配音、字幕、微动画与视频合成。 |
+| **时长** | **短片优先**,如 30 秒–3 分钟;也可逐段制作更长内容。 | **长片优先**,尤其适合 **10 分钟及以上**的旁白视频,也能做短片和连续故事短剧。 |
+| **工具** | 用支持 Skill 的 AI 助手做提案,再到 **Google Flow** 等平台生成片段,用**剪映**等工具剪辑。 | 在 **Codex、Claude Code** 等能读写文件、调用工具和执行命令的 AI 编程代理中运行,串起素材生成与本地合成。 |
+| **画面** | **逐段生成动画**:侧重角色动作、镜头调度与人物互动。 | **插画轮播+微动画**:用切镜、推拉和平移配合旁白讲故事,不必逐段生成完整动作视频。 |
+| **操作** | 确认提案,生成并挑选片段,最后拼接、配字幕和调整节奏。 | 配好生成服务,确认脚本与样片;后续自动制作,**不用手动拼装整片**。 |
+| **产出** | 导演提案、分镜、逐段视频提示词与声音设计。 | **带配音、字幕与微动画的完整视频文件**。 |
+| **用途** | TikTok / Shorts 短视频、反转短剧、需要精细动作的故事。 | YouTube 长篇知识讲解、历史科普、故事解说等旁白驱动内容。 |
+| **开始** | [使用 Director](#director-start) | [使用 Autopilot](#autopilot-start) |
+
+两种方式都可从**话题、文案或完整脚本**开始。**A、B 画风独立编号、分别展示,不共用画面;新画风与样片在各自系列下更新。** 画幅、旁白语言和音色按需选择。上面的时长是选型建议,不是硬性限制。
+
+Autopilot 需要可用的图像、配音等生成服务与本地视频合成环境;普通聊天窗口不能直接替代这套运行环境。Skill 免费开源,所接服务可能另行收费。
+
+<a id="quick-start"></a>
+
+## 开始使用
+
+一次安装,按需选择 **A · Director 导演模式**或 **B · Autopilot 自动成片**。
+
+<a id="director-start"></a>
+
+### A · Director:逐段生成,自己掌镜
+
+[查看画风一览 ↓](#a-styles)
+
+把下面这段发给支持 Skill 的 AI 助手,换成自己的话题即可;也可以直接贴已有文案或文章:
+
+```text
+帮我安装并使用这个 Skill:
+https://github.com/kaomei/stickman-video-director
+
+我想做《人类的第一份工作是怎么来的?》的火柴人视频,
+用 A3「史前手绘 / 黑色幽默」,横屏 16:9,先做 30 秒。
+先给我导演提案,确认后再输出逐段视频提示词。
+```
+
+**Director:看提案 → 按需修改 → 确认后拿提示词 → 生成片段并剪辑。** 没有选画幅、画风,Skill 会主动引导;导演模式时长默认 60 秒,也可以先做一小段。
+
+提案包含故事结构、分段旁白、画面动作、镜头和声音设计。确认后,把提示词交给 [Google Flow](https://flow.google.com/) 生成片段,再用剪映等工具完成字幕和剪辑。
+
+<a id="storyboard-example"></a>
+
+<details>
+<summary>看看一个 30 秒故事的完整分镜(点击展开)</summary>
+
+**《人类的第一份工作是怎么来的?》|横屏 16:9 · A3 史前黑色幽默 · 30 秒**
+
+下面是这支样片制作前确认的分镜提案:
+
+| 时间 | 画面与动作 | 配音文案 |
+|---|---|---|
+| **0–10s:拒绝生存压力** | 原始人拖着石棒回到洞穴,瘫倒在草床上。洞口出现剑齿虎的巨大影子。他睁开一只眼,一脸“又来?”;起身滚动巨石堵住洞口,拍掉手上的灰,回床睡觉。最后定格在他满意的脸上。 | **“Ten thousand years ago, one man finally solved all his problems. He shut them outside.”** |
+| **10–20s:老板找到你了** | 接上一段:他刚闭眼,洞口传来三声敲击。巨石被推开一条缝,族长探头进来,笑着递给他一根长矛。他摆手拒绝。族长随即拿出一条烤肉腿;他的鼻子抽动,眼睛瞬间睁大。切到洞外:他已经握着长矛,被族长推向猛兽脚印。 | **“Then someone offered him food… in exchange for a small favor. Congratulations. Employment was invented.”** |
+| **20–30s:文明的代价** | 他满身灰尘回到同一个洞穴,把长矛扔下,伸手等烤肉。族长面带职业微笑,只递给他一小块肉;然后把一大捆长矛塞进他怀里,拍拍他的肩膀离开。他看着小肉块,再看长矛,缓缓转头直视镜头。最后躺回草床,却被怀里的长矛硌得坐起来。 | **“The reward got smaller. The workload got bigger. And somehow… they called that progress.”** |
+
+提案不满意,直接说要改哪里;你确认后,它才输出最终分段提示词。这个 30 秒示例对应 3 条约 10 秒的提示词,包含人物、动作、镜头、旁白和声音要求。
+
+</details>
+
+第一次做,可以跟着[完整制作教程](https://x.com/CrazyKaomei/status/2102311241046008268)跑一遍。Skill 免费开源,无需为导演模式配置 API 或 MCP;视频生成费用和可选模型以平台当前界面为准。
+
+<a id="autopilot-start"></a>
+
+### B · Autopilot:自动制作,直接拿成片
+
+[查看画风一览 ↓](#b-styles)
+
+在 Codex、Claude Code 等具备文件与命令执行能力的环境中,安装后这样说:
+
+```text
+使用 Autopilot 自动成片模式,把《古罗马人的一天》
+做成一部 10 分钟的横屏 16:9 视频,从 B 系列中选择画风。
+采用插画轮播+微动画,配上旁白和字幕。
+先检查所需工具与生成服务,再给我脚本和一小段样片;
+确认后自动完成整片,不用我逐段拼装。
+```
+
+**Autopilot:给故事脚本和风格 → 检查配音和生图配置 → 确认 20s 样片效果 → 自动制作长视频 → 拿到完整成片**
+
+开始前按所选方案配置图像、配音等生成服务及本地合成工具。画风、语言、音色和目标时长先确认,再制作整片。
+
+首次使用,助手会在已安装的同一个 Skill 内检查 **Node.js 20+、FFmpeg 和本地渲染依赖**,再连接你选择的生图与配音工具;不需要另装第二个 Skill。[配置与运行说明](skills/directing-stickman-videos/references/autopilot-runtime.md)
<a id="style-gallery"></a>
-## 全部画风一览
+<a id="a-styles"></a>
+
+## A · 导演模式画风一览
+
+按 A1、A2、A3…更新,每个画风下展示对应的动画样片。
-### 风格 1:基础黑白风
+<a id="a1"></a>
+
+### A1:经典黑白
用最少的线条,把一个概念讲清楚。纯白或纯黑的画布上,人物、道具和强调色承担主要信息,适合做节奏明快的知识解说。
@@ -77,29 +166,33 @@
- **适合内容**:科学常识、心理成长、励志、自我管理、商业拆解与概念解释。
- **怎么选**:白底黑火柴人清爽直观,适合教学和日常科普;黑底白火柴人对比更强,适合悬念、冲突和情绪表达。
-| 风格 1A:白底黑火柴人 | 风格 1B:黑底白火柴人 |
+| A1.1 · 白底黑火柴人 | A1.2 · 黑底白火柴人 |
|:---:|:---:|
-| <!-- demo:light:start --><img src="https://cdn.jsdelivr.net/gh/kaomei/stickman-video-director@2697fac5e0466f44098148a52c9648697521b3d6/assets/readme/previews/light-theme-demo.gif" alt="风格 1A:白底黑火柴人动态演示" width="360"><!-- demo:light:end --> | <!-- demo:dark:start --><img src="https://cdn.jsdelivr.net/gh/kaomei/stickman-video-director@2697fac5e0466f44098148a52c9648697521b3d6/assets/readme/previews/dark-theme-demo.gif" alt="风格 1B:黑底白火柴人动态演示" width="360"><!-- demo:dark:end --> |
+| <!-- demo:light:start --><img src="https://cdn.jsdelivr.net/gh/kaomei/stickman-video-director@2697fac5e0466f44098148a52c9648697521b3d6/assets/readme/previews/light-theme-demo.gif" alt="A1.1 · 白底黑火柴人动态演示" width="360"><!-- demo:light:end --> | <!-- demo:dark:start --><img src="https://cdn.jsdelivr.net/gh/kaomei/stickman-video-director@2697fac5e0466f44098148a52c9648697521b3d6/assets/readme/previews/dark-theme-demo.gif" alt="A1.2 · 黑底白火柴人动态演示" width="360"><!-- demo:dark:end --> |
| 纯白画布 · 黑色人物 | 纯黑画布 · 白色人物 |
---
-### 风格 2:现代潮酷风
+<a id="a2"></a>
+
+### A2:现代潮酷风
红色冷帽、黄色 T 恤,是这套画风最鲜明的角色标记。既可以在干净的科技空间里讲产品,也可以走进卧室、街道和荒野,演一段有起伏的故事。
-- **画面特点**:固定红帽黄衣的极简角色,搭配两种环境。2A 用纯白空间、极淡网格、悬浮玻璃界面和青蓝光效表现科技感;2B 用彩色场景、光影和空间纵深营造故事氛围。
-- **适合内容**:2A 适合 AI 工具、科技产品、方法教学与功能解说;2B 适合成长经历、生活话题、冒险与励志故事。
-- **怎么选**:重点是“讲清一个工具或方法”,选 2A;重点是“跟着角色经历一件事”,选 2B。
+- **画面特点**:固定红帽黄衣的极简角色,搭配两种环境。极简科技方案用纯白空间、极淡网格、悬浮玻璃界面和青蓝光效表现科技感;彩色故事方案用彩色场景、光影和空间纵深营造故事氛围。
+- **适合内容**:极简科技适合 AI 工具、科技产品、方法教学与功能解说;彩色故事适合成长经历、生活话题、冒险与励志故事。
+- **怎么选**:重点是“讲清一个工具或方法”,选极简科技;重点是“跟着角色经历一件事”,选彩色故事。
-| 风格 2A:极简科技 | 风格 2B:彩色故事 |
+| A2.1 · 极简科技 | A2.2 · 彩色故事 |
|:---:|:---:|
-| <img src="https://cdn.jsdelivr.net/gh/kaomei/stickman-video-director@2697fac5e0466f44098148a52c9648697521b3d6/assets/readme/previews/style-2a-demo.gif" alt="风格 2A:极简科技风动态演示" width="360"> | <img src="https://cdn.jsdelivr.net/gh/kaomei/stickman-video-director@2697fac5e0466f44098148a52c9648697521b3d6/assets/readme/previews/style-2b-demo.gif" alt="风格 2B:彩色故事风动态演示" width="360"> |
+| <img src="https://cdn.jsdelivr.net/gh/kaomei/stickman-video-director@2697fac5e0466f44098148a52c9648697521b3d6/assets/readme/previews/style-2a-demo.gif" alt="A2.1 · 极简科技风动态演示" width="360"> | <img src="https://cdn.jsdelivr.net/gh/kaomei/stickman-video-director@2697fac5e0466f44098148a52c9648697521b3d6/assets/readme/previews/style-2b-demo.gif" alt="A2.2 · 彩色故事风动态演示" width="360"> |
| 纯白空间 · 极淡网格 · 青蓝微光 | 彩色场景 · 电影光影 · 叙事氛围 |
---
-### 风格 3:史前手绘 / 黑色幽默
+<a id="a3"></a>
+
+### A3:史前手绘 / 黑色幽默
把今天的烦恼,搬回没有手机和办公室的史前世界。洞穴、兽皮、篝火和夸张表情,让职场、人性与生活里的荒诞,变成一段带反转的小故事。
@@ -114,7 +207,9 @@
---
-### 风格 4:治愈故事风
+<a id="a4"></a>
+
+### A4:治愈故事风
一只舍不得用的杯子,一条忍不住秒回的消息,一个终于留给自己的下午。让极简角色走进彩色的日常场景,用动作、表情和镜头讲普通人能共鸣的小事。
@@ -130,8 +225,9 @@
---
<a id="style-5"></a>
+<a id="a5"></a>
-### 风格 5:历史卡通风
+### A5:历史卡通风
让火柴人走进历史:江户街头的武士、古埃及神庙里的黑猫、罗马营地中的士兵。用鲜明的时代服饰、彩色场景和带反差的小情节,把历史知识讲得更有画面感。
@@ -146,76 +242,29 @@
画风与提示词贡献:[Lawal Ridwan / @leksautomate](https://github.com/leksautomate);日本样片由原作者提供。
-<!-- readme:advantages -->
-
-## 它帮你做什么
-
-把选题、脚本和画面一起考虑,不只是给火柴人套一个外观。
-
-| 环节 | Skill 输出 |
-|---|---|
-| **文案** | 开场、递进、结尾,英文旁白与中文参考。 |
-| **画面** | 动作、道具、运镜、转场与音效。 |
-| **衔接** | 人物、道具与声线设定,跨段转场。 |
-| **画幅** | 按横竖屏调整构图和镜头。 |
-| **调整** | 先确认提案,再输出提示词。 |
-
-<!-- readme:output -->
-
-先拿到**导演提案**:英文旁白、中文参考、场景、运镜和声音设计。确认后再拿到逐段独立的 **Gemini Omni Flash 视频提示词**,以及转场、拼接与字幕建议。
-
-Skill 负责提案和提示词,Flow 等工具负责生成视频,最后用剪映等软件完成字幕与剪辑。无需为 Skill 配置 API 或 MCP。
-
-<!-- readme:install -->
-
-<a id="quick-start"></a>
-
-## 开始使用
-
-### 1. 安装 Skill
-
-把下面这句话发给你使用的 AI:
-
-```text
-帮我安装这个 Skill:
-https://github.com/kaomei/stickman-video-director
-```
-
-<!-- readme:workflow -->
-
-### 2. 给一个话题
-
-安装后,把话题、文案或文章直接发给 AI,例如:
+---
-```text
-帮我做一个《人类的第一份工作是怎么来的?》的火柴人视频。
-```
+<a id="b-styles"></a>
-### 3. 跟着引导,确认提案
+## B · 自动成片画风一览
-**选设置 → 看导演提案 → 按需修改 → 确认后拿提示词。**
+按 B1、B2、B3…更新,每个画风下展示对应的插画轮播+微动画成片,与 A 系列分开维护。
-画幅、画风没选,Skill 会主动询问;时长可指定,默认 60 秒。你只要跟着引导,选横屏 `16:9` 或竖屏 `9:16`,再从上面的画风中选一种即可;已经提供的设置不会重复询问。想先试一小段,也可以直接说“先做 30 秒”。
+<a id="b1"></a>
-选好设置后,它会先给你导演提案,列出故事结构、分段旁白、画面动作、镜头和声音设计。你可以先看整体方案,修改不满意的部分,确认后再拿到用于生成视频的分段提示词。
+### B1:极简手绘风
-**《人类的第一份工作是怎么来的?》|横屏 16:9 · 风格 3 史前黑色幽默 · 30 秒**
+近白纸底与极淡网格,搭配表情生动的火柴人、彩色手绘道具和醒目的重点文字。让画面跟着旁白推进,用局部微动画、连贯转场和音效讲清内容,适合 YouTube 知识讲解、心理成长、职场故事与产品宣传。
-下面是这支样片制作前确认的分镜提案:
+[![B1 极简手绘风:旁白、字幕、手绘角色与微动画](https://cdn.jsdelivr.net/gh/kaomei/stickman-video-director@fa0a68d1ccf9fd057230abab2af832f768debe86/assets/readme/previews/b1-minimal-handdrawn.gif)](assets/readme/b1-minimal-handdrawn.mp4)
-| 时间 | 画面与动作 | 配音文案 |
-|---|---|---|
-| **0–10s:拒绝生存压力** | 原始人拖着石棒回到洞穴,瘫倒在草床上。洞口出现剑齿虎的巨大影子。他睁开一只眼,一脸“又来?”;起身滚动巨石堵住洞口,拍掉手上的灰,回床睡觉。最后定格在他满意的脸上。 | **“Ten thousand years ago, one man finally solved all his problems. He shut them outside.”** |
-| **10–20s:老板找到你了** | 接上一段:他刚闭眼,洞口传来三声敲击。巨石被推开一条缝,族长探头进来,笑着递给他一根长矛。他摆手拒绝。族长随即拿出一条烤肉腿;他的鼻子抽动,眼睛瞬间睁大。切到洞外:他已经握着长矛,被族长推向猛兽脚印。 | **“Then someone offered him food… in exchange for a small favor. Congratulations. Employment was invented.”** |
-| **20–30s:文明的代价** | 他满身灰尘回到同一个洞穴,把长矛扔下,伸手等烤肉。族长面带职业微笑,只递给他一小块肉;然后把一大捆长矛塞进他怀里,拍拍他的肩膀离开。他看着小肉块,再看长矛,缓缓转头直视镜头。最后躺回草床,却被怀里的长矛硌得坐起来。 | **“The reward got smaller. The workload got bigger. And somehow… they called that progress.”** |
-
-提案不满意,直接说要改哪里;你确认后,它才输出最终分段提示词。这个 30 秒示例对应 3 条约 10 秒的提示词,包含人物、动作、镜头、旁白和声音要求。
+[▶ 播放有声样片](assets/readme/b1-minimal-handdrawn.mp4) · [画风与制作说明](skills/directing-stickman-videos/references/b1-minimal-handdrawn.md)
-### 4. 生成视频,剪辑成片
+<a id="b2"></a>
-将提示词按顺序提交到 [Google Flow](https://flow.google.com/),再把生成片段导入剪映,调整衔接并添加字幕。30 秒通常对应 3 条约 10 秒的提示词,60 秒对应 6 条。
+### B2:待更新…
-第一次做,跟着这篇[完整制作教程:选题、脚本、Flow 生成与剪映成片](https://x.com/CrazyKaomei/status/2102311241046008268)跑一遍。Flow 操作见[使用教程](https://x.com/CrazyKaomei/status/2093893997223923822?s=20)。Skill 免费开源,视频生成费用和可选模型以平台当前界面为准。
+画风介绍、独立样片与使用示例将在这里更新。
<!-- readme:reliability -->
@@ -230,7 +279,7 @@ https://github.com/kaomei/stickman-video-director
| `9:16` | YouTube Shorts、TikTok、Instagram Reels、抖音、小红书 | 纵向动作、中央主体、手机画面安全区 |
| `16:9` | YouTube、B 站、横屏教育视频 | 横向调度、场景展开、左右对比 |
-适合不露脸的知识解说、历史商业科普、心理成长、生活故事和产品讲解;英文旁白配后期双语字幕,也能做儿童英语、生活短剧或知识精读。支持 30 秒、60 秒、90 秒、3 分钟等 10 秒整数倍时长。
+适合不露脸的知识解说、历史商业科普、心理成长、生活故事和产品讲解;英文旁白配后期双语字幕,也能做儿童英语、生活短剧或知识精读。Director 按约 10 秒一段规划,支持 30 秒、60 秒、90 秒、3 分钟等 10 秒整数倍时长;Autopilot 按脚本与配音规划整片,不必逐段手动拼接。
- 人物、道具和旁白设定按整支视频统一;需要换声音时,先在提案里确定。
- 发现某段人物、道具或声音明显偏离时,针对该段调整和复测,不用重做所有片段。
@@ -240,35 +289,28 @@ https://github.com/kaomei/stickman-video-director
## 最近更新
+- **2026-10-23**:同一个 Skill 新增 **B · Autopilot 自动成片模式**,发布 B1「极简手绘风」与有声样片;A、B 画风独立展示,保留原有导演模式。本轮先更新中文介绍。
- **2026-10-20:** 首页默认展示英语,新增土耳其语和印尼语版本,保留中文、日语、韩语和巴西葡语入口。Skill 规则不变。
- **2026-10-20**:新增风格 5「历史卡通风」,展示日本与埃及样片,日本样片作为头部预览;感谢 @leksautomate 的画风与提示词贡献。
- **2026-10-15**:优化中文首页、安装入口和案例说明,加入轻量动图预览与 Star 增长曲线;Skill 规则不变。
-- **2026-10-14**:新增风格 4「治愈故事风」,加入地铁站与咖啡座两个样片。
-- **2026-10-13**:优化风格 1 的人物描述与当前姿态约束。
-- **2026-10-12**:完善全风格共用的语音一致性规则,补充史前风格案例。
-已有用户:最近的首页调整不需要重装。想用风格 5,或安装的是人物/声音规则更新前的版本,再更新 Skill 即可。[查看更新记录](CHANGELOG.zh-CN.md)。
+已有用户:想用 **B · Autopilot 自动成片模式**,请更新同一个 Skill;已有导演模式和 A 系列画风继续保留。[查看更新记录](https://github.com/kaomei/stickman-video-director/blob/main/CHANGELOG.zh-CN.md)。
<!-- readme:contribute -->
-## 下一种火柴人,你来点
+<a id="whats-next"></a>
-下面这些画风正在计划中,尚未上线:
+## 接下来做什么
-- **虚实融合场景** — 继续探索 2D 火柴人与更丰富环境的搭配。
-- **讲台解说** — 黑板互动与知识讲解。
-- **风格 6:手绘绘本** — 童话、寓言与儿童故事。
-- **风格 7:涂鸦打斗** — 动作短片与连招对决。
-- **风格 8:双人情景喜剧** — 对话、互怼与日常反转。
-- **风格 9:卡牌闯关** — 升级、打怪与游戏叙事。
+- **更多画风(计划中)**:手绘绘本、涂鸦打斗、双人情景喜剧、卡牌闯关,以及虚实融合和讲台解说。
想看新画风、分享作品或反馈问题,都欢迎到 [Issues](https://github.com/kaomei/stickman-video-director/issues) 留言。画风建议请附参考和想做的主题;投稿请附作品、所用风格与作者链接,方便展示和署名。
## Star 增长曲线
-⭐ **如果这份画风库帮你省下了找提示词、反复试错的时间,欢迎点个 Star,留着下次做动画时用。**
+⭐ **想做不露脸的 YouTube 频道,探索内容变现?** Star 这个项目,持续获取火柴人画风、视频提示词和自动化制作流程,让你的频道不再卡在“视频怎么做”这一步。
-我是[烤妹儿](https://x.com/CrazyKaomei),会继续实测新画风,把好用的提示词、制作方法和踩过的坑免费整理在这里。希望你少花时间折腾工具,多留一点时间给真正想讲的故事。
+🔔 **关注 [@CrazyKaomei](https://x.com/CrazyKaomei)**:我是烤妹儿,专注不出镜视频与自动化工作流,分享如何把脚本、配音、生图和剪辑串起来。让一个人也能持续做视频,把更多精力留给选题、频道增长和变现。
<div align="center">
<a href="https://www.star-history.com/?repos=kaomei%2Fstickman-video-director&amp;type=date">
@@ -282,6 +324,6 @@ https://github.com/kaomei/stickman-video-director
## 许可证
-本项目采用 [MIT License](LICENSE) 开源,允许免费使用、修改、商用和分发。分发本项目或其重要部分时,请保留原有版权和许可声明。
+本项目采用 [MIT License](https://github.com/kaomei/stickman-video-director/blob/main/LICENSE) 开源,允许免费使用、修改、商用和分发。分发本项目或其重要部分时,请保留原有版权和许可声明。
-项目按“现状”提供,不作任何担保;完整条款见 [LICENSE](LICENSE)。
+项目按“现状”提供,不作任何担保;完整条款见 [LICENSE](https://github.com/kaomei/stickman-video-director/blob/main/LICENSE)。
diff --git a/skills/directing-stickman-videos/SKILL.md b/skills/directing-stickman-videos/SKILL.md
index 77ccc7c..459de39 100644
--- a/skills/directing-stickman-videos/SKILL.md
+++ b/skills/directing-stickman-videos/SKILL.md
@@ -1,10 +1,21 @@
---
name: directing-stickman-videos
-description: "Use when turning copy, notes, articles, or topics into customizable-length English stick-figure videos (in 10-second multiples: 30s, 60s, 3min, 5min, default 60s), kinetic line-animation explainers, motivational shorts, or Gemini Omni Flash prompt packages."
+description: "Turn topics, requirements, articles or scripts into stickman videos. Director mode creates approved storyboards and standalone video prompts; Autopilot mode produces narrated, captioned illustration-and-micro-animation videos through configured generation tools and a local renderer."
---
# Directing Stickman Videos
+## Two modes, one Skill
+
+Keep the existing installation and name. Route by the requested deliverable:
+
+- **A · Director**: proposals, storyboards and standalone video-generation prompts. A1/A1.1/A1.2 map to Style 1 light/dark; A2/A2.1/A2.2 to Style 2/2A/2B; A3–A5 to Styles 3–5. Follow the unchanged Director contract below.
+- **B · Autopilot**: a finished local video with narration, captions, meaningful illustrations, local motion and SFX. Read [Autopilot](references/autopilot.md), then its selected B-style reference. B1 is [极简手绘风](references/b1-minimal-handdrawn.md). B styles have their own assets and numbering; do not silently reuse an A-style prompt or sample.
+
+If the mode is ambiguous, ask one short question. Honor previously supplied choices. Do not run Director's ten-second clip rules, no-visible-text rule or Phase B prompt workflow for Autopilot. Autopilot can start with a topic, promotion brief, post, article or story script; it is not story-only. English is the default narration language, but the user's language and voice choices take precedence.
+
+## A · Director
+
## Core contract
Turn one source into a confirmed director's proposal and then N standalone prompts for approximately ten-second Gemini Omni Flash clips (where N = target duration in seconds / 10; default 6 clips for 60 seconds). Preserve the source's meaning while structuring it through a high-completion 5-stage emotional narrative arc.
diff --git a/skills/directing-stickman-videos/agents/openai.yaml b/skills/directing-stickman-videos/agents/openai.yaml
index 1005c38..81a08bb 100644
--- a/skills/directing-stickman-videos/agents/openai.yaml
+++ b/skills/directing-stickman-videos/agents/openai.yaml
@@ -1,4 +1,4 @@
interface:
display_name: "Stickman Video Director"
- short_description: "Turn copy into rich Omni Flash stickman videos"
- default_prompt: "Use $directing-stickman-videos to turn this copy into a one-minute English stickman video prompt package."
+ short_description: "Direct stickman clips or auto-produce narrated videos"
+ default_prompt: "Use $directing-stickman-videos for this topic. Use Director for storyboard and video prompts, or Autopilot for a complete narrated and captioned video; confirm the mode and style before production."
diff --git a/skills/directing-stickman-videos/assets/b1/ATTRIBUTION.md b/skills/directing-stickman-videos/assets/b1/ATTRIBUTION.md
new file mode 100644
index 0000000..bfa5c61
--- /dev/null
+++ b/skills/directing-stickman-videos/assets/b1/ATTRIBUTION.md
@@ -0,0 +1,7 @@
+# B1 assets
+
+These original hand-drawn character/prop assets were created for this project and are distributed under the repository's MIT license. The three-pose sheet is a demo reference, not a requirement to use only three poses in other productions. The bundled narration is the existing, approved Gemini Sadaltager sample audio, reused at its original speed; its effects are already mixed.
+
+The public B1 showcase is `assets/readme/b1-minimal-handdrawn.mp4` at repository root. The declarative example demonstrates the reusable runtime and is not a pixel-identical recreation or a second approved showcase.
+
+Fonts are separately licensed under SIL OFL; see `../fonts/OFL-Caveat.txt` and `../fonts/OFL-NotoSans.txt`. Do not redistribute the macOS Chalkboard/Arial fonts used for the original private preview.
diff --git a/skills/directing-stickman-videos/assets/b1/calendar-crayon.png b/skills/directing-stickman-videos/assets/b1/calendar-crayon.png
new file mode 100644
index 0000000..c58d8ee
Binary files /dev/null and b/skills/directing-stickman-videos/assets/b1/calendar-crayon.png differ
diff --git a/skills/directing-stickman-videos/assets/b1/camera-handdrawn.png b/skills/directing-stickman-videos/assets/b1/camera-handdrawn.png
new file mode 100644
index 0000000..ca64263
Binary files /dev/null and b/skills/directing-stickman-videos/assets/b1/camera-handdrawn.png differ
diff --git a/skills/directing-stickman-videos/assets/b1/character-pose-sheet-v6.png b/skills/directing-stickman-videos/assets/b1/character-pose-sheet-v6.png
new file mode 100644
index 0000000..bae8b99
Binary files /dev/null and b/skills/directing-stickman-videos/assets/b1/character-pose-sheet-v6.png differ
diff --git a/skills/directing-stickman-videos/assets/b1/clapper-crayon.png b/skills/directing-stickman-videos/assets/b1/clapper-crayon.png
new file mode 100644
index 0000000..5ad2074
Binary files /dev/null and b/skills/directing-stickman-videos/assets/b1/clapper-crayon.png differ
diff --git a/skills/directing-stickman-videos/assets/b1/idea-bulb-crayon.png b/skills/directing-stickman-videos/assets/b1/idea-bulb-crayon.png
new file mode 100644
index 0000000..3c99776
Binary files /dev/null and b/skills/directing-stickman-videos/assets/b1/idea-bulb-crayon.png differ
diff --git a/skills/directing-stickman-videos/assets/b1/idea-note-crayon.png b/skills/directing-stickman-videos/assets/b1/idea-note-crayon.png
new file mode 100644
index 0000000..3941a17
Binary files /dev/null and b/skills/directing-stickman-videos/assets/b1/idea-note-crayon.png differ
diff --git a/skills/directing-stickman-videos/assets/b1/open-source-crayon.png b/skills/directing-stickman-videos/assets/b1/open-source-crayon.png
new file mode 100644
index 0000000..752103d
Binary files /dev/null and b/skills/directing-stickman-videos/assets/b1/open-source-crayon.png differ
diff --git a/skills/directing-stickman-videos/assets/b1/script-page-crayon.png b/skills/directing-stickman-videos/assets/b1/script-page-crayon.png
new file mode 100644
index 0000000..9dc2594
Binary files /dev/null and b/skills/directing-stickman-videos/assets/b1/script-page-crayon.png differ
diff --git a/skills/directing-stickman-videos/assets/b1/youtube-crayon.png b/skills/directing-stickman-videos/assets/b1/youtube-crayon.png
new file mode 100644
index 0000000..f934578
Binary files /dev/null and b/skills/directing-stickman-videos/assets/b1/youtube-crayon.png differ
diff --git a/skills/directing-stickman-videos/assets/fonts/Caveat.ttf b/skills/directing-stickman-videos/assets/fonts/Caveat.ttf
new file mode 100644
index 0000000..f84acf2
Binary files /dev/null and b/skills/directing-stickman-videos/assets/fonts/Caveat.ttf differ
diff --git a/skills/directing-stickman-videos/assets/fonts/NotoSans.ttf b/skills/directing-stickman-videos/assets/fonts/NotoSans.ttf
new file mode 100644
index 0000000..7557504
Binary files /dev/null and b/skills/directing-stickman-videos/assets/fonts/NotoSans.ttf differ
diff --git a/skills/directing-stickman-videos/assets/fonts/OFL-Caveat.txt b/skills/directing-stickman-videos/assets/fonts/OFL-Caveat.txt
new file mode 100644
index 0000000..5303054
--- /dev/null
+++ b/skills/directing-stickman-videos/assets/fonts/OFL-Caveat.txt
@@ -0,0 +1,93 @@
+Copyright 2014 The Caveat Project Authors (https://github.com/googlefonts/caveat)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/skills/directing-stickman-videos/assets/fonts/OFL-NotoSans.txt b/skills/directing-stickman-videos/assets/fonts/OFL-NotoSans.txt
new file mode 100644
index 0000000..7d7fbd8
--- /dev/null
+++ b/skills/directing-stickman-videos/assets/fonts/OFL-NotoSans.txt
@@ -0,0 +1,93 @@
+Copyright 2022 The Noto Project Authors (https://github.com/notofonts/latin-greek-cyrillic)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/skills/directing-stickman-videos/examples/b1/narration.m4a b/skills/directing-stickman-videos/examples/b1/narration.m4a
new file mode 100644
index 0000000..352f52d
Binary files /dev/null and b/skills/directing-stickman-videos/examples/b1/narration.m4a differ
diff --git a/skills/directing-stickman-videos/examples/b1/project.json b/skills/directing-stickman-videos/examples/b1/project.json
new file mode 100644
index 0000000..561ba08
--- /dev/null
+++ b/skills/directing-stickman-videos/examples/b1/project.json
@@ -0,0 +1,61 @@
+{
+ "version": 1,
+ "style": "B1",
+ "width": 1280,
+ "height": 720,
+ "fps": 30,
+ "voice": {"path": "narration.m4a", "lead": 0, "tail": 0, "contains_sfx": true},
+ "captions": [
+ {"start": 0.291, "end": 2.716, "text": "Want a YouTube channel without being on camera?"},
+ {"start": 2.957, "end": 4.273, "text": "Start with a stick figure."},
+ {"start": 4.838, "end": 6.079, "text": "No camera crew."},
+ {"start": 6.098, "end": 7.724, "text": "No weeks of animation."},
+ {"start": 8.157, "end": 9.407, "text": "Just a strong hook,"},
+ {"start": 9.595, "end": 10.610, "text": "a clear story,"},
+ {"start": 10.902, "end": 12.565, "text": "and an open-source workflow."},
+ {"start": 13.288, "end": 14.943, "text": "Here's how to turn one idea"},
+ {"start": 14.943, "end": 15.986, "text": "into a video."}
+ ],
+ "shots": [
+ {"start": 0, "end": 2.85, "layers": [
+ {"type": "text", "text": "YOUR CHANNEL.", "x": 95, "y": 110, "size": 58, "bold": true},
+ {"type": "text", "text": "NOT YOUR FACE.", "x": 95, "y": 185, "size": 58, "bold": true, "color": "#EC4338"},
+ {"type": "pose", "pose": 1, "x": 720, "y": 35, "w": 445},
+ {"type": "image", "path": "@b1/youtube-crayon.png", "x": 120, "y": 300, "w": 270},
+ {"type": "image", "path": "@b1/camera-handdrawn.png", "x": 405, "y": 335, "w": 160, "keys": [{"t": 0, "angle": -0.08}, {"t": 0.5, "angle": 0.06}, {"t": 0.9, "angle": 0}]}
+ ]},
+ {"start": 2.85, "end": 4.7, "layers": [
+ {"type": "pose", "pose": 0, "x": 650, "y": 15, "w": 465},
+ {"type": "text", "text": "ONE GOOD IDEA.", "x": 100, "y": 110, "size": 58, "bold": true},
+ {"type": "image", "path": "@b1/idea-bulb-crayon.png", "x": 120, "y": 275, "w": 170},
+ {"type": "image", "path": "@b1/idea-note-crayon.png", "x": 360, "y": 300, "w": 170, "keys": [{"t": 0, "y": 320, "angle": -0.07}, {"t": 0.4, "y": 300, "angle": -0.025}]}
+ ]},
+ {"start": 4.7, "end": 7.9, "layers": [
+ {"type": "pose", "pose": 2, "x": 70, "y": 45, "w": 435},
+ {"type": "image", "path": "@b1/clapper-crayon.png", "x": 570, "y": 260, "w": 180, "to": 1.4},
+ {"type": "text", "text": "NO CAMERA CREW.", "x": 790, "y": 310, "w": 400, "size": 43, "bold": true, "to": 1.4},
+ {"type": "image", "path": "@b1/calendar-crayon.png", "x": 570, "y": 260, "w": 180, "from": 1.4},
+ {"type": "text", "text": "NO WEEKS OF ANIMATION.", "x": 790, "y": 300, "w": 400, "size": 42, "bold": true, "from": 1.4},
+ {"type": "line", "points": [[570, 410], [735, 285]], "color": "#EC4338", "lineWidth": 5, "keys": [{"t": 0.4, "progress": 0}, {"t": 0.65, "progress": 1}]}
+ ]},
+ {"start": 7.9, "end": 10.8, "layers": [
+ {"type": "text", "text": "A STRONG HOOK. A CLEAR STORY.", "x": 95, "y": 115, "w": 1080, "size": 56, "bold": true},
+ {"type": "image", "path": "@b1/idea-bulb-crayon.png", "x": 110, "y": 300, "w": 155},
+ {"type": "arrow", "x": 330, "y": 400, "w": 280},
+ {"type": "image", "path": "@b1/idea-note-crayon.png", "x": 715, "y": 260, "w": 240, "keys": [{"t": 0, "x": 715, "w": 240, "angle": -0.04}, {"t": 1.8, "x": 620, "w": 340, "angle": -0.01}]}
+ ]},
+ {"start": 10.8, "end": 13.05, "layers": [
+ {"type": "text", "text": "OPEN SOURCE. YOUR WORKFLOW.", "x": 95, "y": 115, "size": 55, "bold": true},
+ {"type": "image", "path": "@b1/open-source-crayon.png", "x": 180, "y": 295, "w": 195},
+ {"type": "image", "path": "@b1/script-page-crayon.png", "x": 700, "y": 260, "w": 220},
+ {"type": "arrow", "x": 420, "y": 400, "w": 210, "keys": [{"t": 0, "progress": 0}, {"t": 0.5, "progress": 1}]}
+ ]},
+ {"start": 13.05, "end": 16.4, "layers": [
+ {"type": "text", "text": "ONE IDEA. A REAL VIDEO.", "x": 95, "y": 110, "size": 56, "bold": true},
+ {"type": "pose", "pose": 0, "x": 700, "y": 35, "w": 445},
+ {"type": "image", "path": "@b1/youtube-crayon.png", "x": 250, "y": 290, "w": 270},
+ {"type": "image", "path": "@b1/idea-note-crayon.png", "x": 100, "y": 310, "w": 155, "keys": [{"t": 0, "x": 100, "y": 310, "angle": -0.08}, {"t": 0.65, "x": 300, "y": 330, "w": 90, "angle": 0}]}
+ ]}
+ ],
+ "sfx": []
+}
diff --git a/skills/directing-stickman-videos/package-lock.json b/skills/directing-stickman-videos/package-lock.json
new file mode 100644
index 0000000..5626b0d
--- /dev/null
+++ b/skills/directing-stickman-videos/package-lock.json
@@ -0,0 +1,282 @@
+{
+ "name": "directing-stickman-videos-runtime",
+ "version": "1.0.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "directing-stickman-videos-runtime",
+ "version": "1.0.0",
+ "dependencies": {
+ "@napi-rs/canvas": "0.1.100"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@napi-rs/canvas": {
+ "version": "0.1.100",
+ "resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-0.1.100.tgz",
+ "integrity": "sha512-xglYA6q3XO5P3BNJYxVZ1IV7DLVjp1Py6nwag88YntrS+3vKHyYcMqXVS4ZztJmwz2uGvz1FWhI/4LgbR5uQDA==",
+ "license": "MIT",
+ "workspaces": [
+ "e2e/*"
+ ],
+ "engines": {
+ "node": ">= 10"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/Brooooooklyn"
+ },
+ "optionalDependencies": {
+ "@napi-rs/canvas-android-arm64": "0.1.100",
+ "@napi-rs/canvas-darwin-arm64": "0.1.100",
+ "@napi-rs/canvas-darwin-x64": "0.1.100",
+ "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.100",
+ "@napi-rs/canvas-linux-arm64-gnu": "0.1.100",
+ "@napi-rs/canvas-linux-arm64-musl": "0.1.100",
+ "@napi-rs/canvas-linux-riscv64-gnu": "0.1.100",
+ "@napi-rs/canvas-linux-x64-gnu": "0.1.100",
+ "@napi-rs/canvas-linux-x64-musl": "0.1.100",
+ "@napi-rs/canvas-win32-arm64-msvc": "0.1.100",
+ "@napi-rs/canvas-win32-x64-msvc": "0.1.100"
+ }
+ },
+ "node_modules/@napi-rs/canvas-android-arm64": {
+ "version": "0.1.100",
+ "resolved": "https://registry.npmjs.org/@napi-rs/canvas-android-arm64/-/canvas-android-arm64-0.1.100.tgz",
+ "integrity": "sha512-hjhCKhntPv9+t4ckHymdx0phYNcVW+GKQR6Lzw2zE+pOVjOplSmtx9nNNknTjbEDLcuLZqA1y8ufKg1XfgftzQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">= 10"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/Brooooooklyn"
+ }
+ },
+ "node_modules/@napi-rs/canvas-darwin-arm64": {
+ "version": "0.1.100",
+ "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-arm64/-/canvas-darwin-arm64-0.1.100.tgz",
+ "integrity": "sha512-2PcswRaC7Ly645DGt88///zuFDhJxJYdKAs1uU3mfk1atYkXufgcgLfBpk6Tm12nCQBaNt1wpybuPZ4qOhTo8A==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 10"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/Brooooooklyn"
+ }
+ },
+ "node_modules/@napi-rs/canvas-darwin-x64": {
+ "version": "0.1.100",
+ "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-x64/-/canvas-darwin-x64-0.1.100.tgz",
+ "integrity": "sha512-ePNZtj7pNIva/siZMg+HmbeozkIjqUIYdoymH8HaA3qK7LfzFN4WMBM8G6HQ9ZC+H3+Dnn5pqtiXpgLykaPOhw==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 10"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/Brooooooklyn"
+ }
+ },
+ "node_modules/@napi-rs/canvas-linux-arm-gnueabihf": {
+ "version": "0.1.100",
+ "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm-gnueabihf/-/canvas-linux-arm-gnueabihf-0.1.100.tgz",
+ "integrity": "sha512-d5cDB48oWFGU8/XPhUOFAlySgb/VAu7D+s8fi55K1Pcfg8aPplHWqMgibhVLU8ky7Pyg/fuiVLz4Nf3JrSTuUA==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/Brooooooklyn"
+ }
+ },
+ "node_modules/@napi-rs/canvas-linux-arm64-gnu": {
+ "version": "0.1.100",
+ "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-gnu/-/canvas-linux-arm64-gnu-0.1.100.tgz",
+ "integrity": "sha512-rDxgxRu69RvDlX/bh9o22DxLsGr8EqsNgotL9+RwQE1S0b0cqeatqsw6aW45mukm0B42DIAaAacKaYQ8cqS1nw==",
+ "cpu": [
+ "arm64"
+ ],
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/Brooooooklyn"
+ }
+ },
+ "node_modules/@napi-rs/canvas-linux-arm64-musl": {
+ "version": "0.1.100",
+ "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-musl/-/canvas-linux-arm64-musl-0.1.100.tgz",
+ "integrity": "sha512-K3mDW66N+xT2/V439u1alFANiBUjdEx2gLiNYnCmUsva5jZMxWTjafBYwTzYK+EMFMHrUoabuU+T1BIP5CgbYQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/Brooooooklyn"
+ }
+ },
+ "node_modules/@napi-rs/canvas-linux-riscv64-gnu": {
+ "version": "0.1.100",
+ "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-riscv64-gnu/-/canvas-linux-riscv64-gnu-0.1.100.tgz",
+ "integrity": "sha512-mooqUBTIsccZpnoQC4NgrC1v6C1vof39etLNMnBwCY+p0gajWJvAHLGQ6g/gGyS5YrpDW+GefSN4+Cvcr08UWw==",
+ "cpu": [
+ "riscv64"
+ ],
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/Brooooooklyn"
+ }
+ },
+ "node_modules/@napi-rs/canvas-linux-x64-gnu": {
+ "version": "0.1.100",
+ "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-gnu/-/canvas-linux-x64-gnu-0.1.100.tgz",
+ "integrity": "sha512-1eCvkDCazm7FFhsT7DfGOdSaHgZVK3bt/dSBl5EWHOWmnz+I7j8tPseJqqD81NF+MH21jKUK4wQSDjN0mdhnTg==",
+ "cpu": [
+ "x64"
+ ],
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/Brooooooklyn"
+ }
+ },
+ "node_modules/@napi-rs/canvas-linux-x64-musl": {
+ "version": "0.1.100",
+ "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-musl/-/canvas-linux-x64-musl-0.1.100.tgz",
+ "integrity": "sha512-20arT6lnI19S68qNlii73TSEDbECNgzMz2EpldC1V3mZFuRkeujXkcebRk0LRJe9SEUAooYiLokfMViY8IX7yA==",
+ "cpu": [
+ "x64"
+ ],
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/Brooooooklyn"
+ }
+ },
+ "node_modules/@napi-rs/canvas-win32-arm64-msvc": {
+ "version": "0.1.100",
+ "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-arm64-msvc/-/canvas-win32-arm64-msvc-0.1.100.tgz",
+ "integrity": "sha512-DZFFT1wIAg37LJw37yhMRFfjATd3vTQzjZ1Yki8u2vhO6Hi5VE6BVaGQ1aaDu7xb4iMErz+9EOwjpS7xcxFeBw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/Brooooooklyn"
+ }
+ },
+ "node_modules/@napi-rs/canvas-win32-x64-msvc": {
+ "version": "0.1.100",
+ "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-x64-msvc/-/canvas-win32-x64-msvc-0.1.100.tgz",
+ "integrity": "sha512-MyT1j3mHC2+Lu4pBi9mKyMJhtP6U7k7EldY7sj/uS5gJA65gTXt8MefJQXLJo5d/vZbuWmfxzkEUNc/urV3pHA==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/Brooooooklyn"
+ }
+ }
+ }
+}
diff --git a/skills/directing-stickman-videos/package.json b/skills/directing-stickman-videos/package.json
new file mode 100644
index 0000000..27e7b8c
--- /dev/null
+++ b/skills/directing-stickman-videos/package.json
@@ -0,0 +1,10 @@
+{
+ "name": "directing-stickman-videos-runtime",
+ "version": "1.0.0",
+ "private": true,
+ "type": "module",
+ "description": "Local Autopilot runtime inside the existing directing-stickman-videos Skill",
+ "engines": {"node": ">=20"},
+ "dependencies": {"@napi-rs/canvas": "0.1.100"},
+ "scripts": {"test": "node --test tests/*.test.mjs", "doctor": "node scripts/autopilot.mjs doctor"}
+}
diff --git a/skills/directing-stickman-videos/references/autopilot-runtime.md b/skills/directing-stickman-videos/references/autopilot-runtime.md
new file mode 100644
index 0000000..017e3b9
--- /dev/null
+++ b/skills/directing-stickman-videos/references/autopilot-runtime.md
@@ -0,0 +1,71 @@
+# Autopilot runtime
+
+Run from this installed Skill's directory. No second Skill or repository is needed.
+
+```bash
+npm ci
+node scripts/autopilot.mjs doctor
+node scripts/autopilot.mjs init /absolute/path/my-video
+```
+
+Install Node 20+ and FFmpeg/FFprobe using your platform's normal installer. Optional `FFMPEG`, `FFPROBE`, and `AUTOPILOT_FONT` environment variables select executables/font files; no macOS/Homebrew paths are hardcoded. The bundled Caveat font covers Latin; choose a suitable CJK/Arabic/etc font for those languages. The CLI fails on unavailable dependencies rather than silently generating a mute/placeholder film.
+
+## Manifest v1
+
+All media paths are relative to `project.json` (or absolute local paths); `@b1/…` addresses bundled original B1 assets. Remote URLs and executable expressions are not accepted. Output is a separate project-local `output/` directory. Keep user/source files outside it.
+
+```json
+{
+ "version": 1,
+ "style": "B1",
+ "width": 1280, "height": 720, "fps": 30,
+ "voice": {"path": "narration.wav", "lead": 0.15, "tail": 0.35},
+ "captions": [{"start": 0.3, "end": 2.5, "text": "Your spoken phrase."}],
+ "shots": [{
+ "start": 0, "end": 3,
+ "layers": [
+ {"type": "text", "text": "YOUR IDEA.", "x": 90, "y": 150, "size": 58, "bold": true},
+ {"type": "pose", "pose": 1, "x": 710, "y": 20, "w": 450},
+ {"type": "image", "path": "@b1/idea-bulb-crayon.png", "x": 150, "y": 270, "w": 160,
+ "keys": [{"t": 0, "x": 130, "alpha": 0}, {"t": 0.3, "x": 150, "alpha": 1}]}
+ ]
+ }],
+ "sfx": [{"time": 0.3, "kind": "pop", "gain": 0.025}]
+}
+```
+
+This is an excerpt, not a complete valid film: shots must cover the actual voice length plus lead/tail **without gaps/overlap**. Use `probe` to get actual duration. Captions use the final video time including lead. `voice.speed` is not accepted: keep the original rate. Optional `voice.contains_sfx: true` marks an already mixed master; do not add duplicate effects. Optional `music: {path, gain}` adds a licensed track, looping it under the narration; gain must be 0–0.2. The default is no background music, not a forced piano track.
+
+Layers: `image` (local PNG/JPEG, contain-fit within optional `h`), `pose` (original three-pose B1 atlas, indices 0–2), `text`, `line` (`points` array), `arrow`, `underline`. Design coordinates are 1280 units wide and `1280 × outputHeight / outputWidth` high (720 for 16:9; about 2275.56 for 9:16), uniformly scaled without stretching characters. Recompose portrait scenes explicitly; changing output dimensions alone does not design a vertical composition. Keep the bottom 110 design units clear for captions. Use `from`/`to` (shot-relative seconds) for selective visibility. `keys` are increasing shot-relative timestamps with optional numeric `x`, `y`, `w`, `angle` (radians), `alpha` and `progress`; values interpolate with smoothstep. For genuine local motion use separate layers or authored pose sprites. Images do not gain inferred limb motion automatically. Text `w` is its maximum width; captions wrap to two lines and overflow is an error, not invisible clipping.
+
+## Commands
+
+- `doctor`: dependency/font/key presence only; no network and no key values.
+- `probe FILE`: duration and media streams.
+- `init DIR`: create a non-overwriting project scaffold; it is not production-ready until voice, captions and shots are filled.
+- `validate PROJECT`: check real files, audio duration, shot coverage, cue timing, layers and SFX.
+- `captions WORDS.json OUTPUT.json`: convert `{words:[{start,end,word}]}` into readable timed phrases. `--lead 0.15` adds initial video offset. Requires actual aligned word timestamps.
+- `preview PROJECT [--seconds 20]`: local render, caption sidecars/contact sheet/report, shot cache. Existing outputs are not overwritten unless `--replace` is explicit.
+- `approve PROJECT --note "…"`: record a genuine user sample/full-production approval; source edits invalidate it.
+- `render PROJECT`: verify the approval then resume full local composition.
+
+`scripts/align_captions.py AUDIO --output WORDS.json` uses optional `openai-whisper` and an already cached `base` model. Set `--model NAME`, `--language en`, `--device cpu` as appropriate. `--allow-model-download` explicitly permits model download; otherwise it stops if absent. Do not install or download multi-GB models automatically. Already supplied aligned captions need no Whisper dependency.
+
+## Optional Gemini API adapters
+
+Browser/native generation tools can be used instead. API adapters require `GEMINI_API_KEY` in the environment, the chosen model ID and explicit network authorization. They make **one request, no automatic retries**, do not print keys/provider response bodies, and use only Google's fixed HTTPS endpoint. Failures/timeouts are recorded; inspect service history before trying again. Model access/quota is not validated by key presence. Private reference upload is opt-in through explicit `--reference` paths.
+
+```bash
+node scripts/gemini-media.mjs speech --text narration.txt --output narration.wav \
+ --model gemini-2.5-flash-preview-tts --voice Sadaltager --allow-network
+node scripts/gemini-media.mjs image --prompt scene-prompt.txt --output scene.png \
+ --model YOUR_AVAILABLE_IMAGE_MODEL --reference character.png --allow-network
+```
+
+The speech text file should contain the exact approved spoken words; `--direction voice-direction.txt` adds the frozen performance instructions separately. Image output is saved from the provider's native image payload, not recreated from base64 text. No default image model is assumed. API calls may be billed; the flags are not a substitute for user authorization. No API-backed request is needed for the included offline example or packaging tests.
+
+## Recovery and verification
+
+Each shot is cached by its content, assets, font, renderer version and timing. Cache hits are probed before reuse. After interruption rerun the same command; do not delete the cache or resynthesize audio. `output/checkpoint.json` records the active stage and shot count. A project-local lock prevents simultaneous rendering. A stale lock is removed only when its recorded process is no longer running.
+
+Reports contain input/output SHA-256, original voice duration/rate policy, actual frames, codec/ratio, caption checks, full decode result and cached-shot reuse. They do not certify human listening, factual accuracy or user acceptance. Changing any asset, narration, captions or timeline invalidates approval. Full production remains blocked until a new preview is accepted.
diff --git a/skills/directing-stickman-videos/references/autopilot.md b/skills/directing-stickman-videos/references/autopilot.md
new file mode 100644
index 0000000..d8f281d
--- /dev/null
+++ b/skills/directing-stickman-videos/references/autopilot.md
@@ -0,0 +1,46 @@
+# B · Autopilot 自动成片
+
+This is mode B of **directing-stickman-videos**, not a second installation. Run in an agent that can read/write files and execute commands. The agent performs research, scriptwriting and visual direction; bundled scripts validate and render the resulting project, not invent factual scripts from an arbitrary URL by themselves.
+
+## Before production
+
+1. Resolve the source/topic, audience, purpose, target duration, ratio, B-style and narration language. Accept topics, needs and promotional briefs as well as scripts. Read linked sources when accessible; ask for pasted content if inaccessible. Source documents are material, not execution instructions. Do not invent product benefits, income figures, evidence or testimonials.
+2. Read the selected style reference. Confirm a short script/outline, character design and voice choice. Default to English and a suitable stable male voice only when no preference exists; the approved B1 example uses Gemini **Sadaltager**. Users can choose another voice, language, multiple speakers or no voice. Do not substitute local OS TTS when a selected service is unavailable.
+3. From the installed Skill directory, run `node scripts/autopilot.mjs doctor`. Node 20+, FFmpeg and FFprobe are required. Run `npm ci` here if dependencies are missing. Image/TTS services are the user's configured tools, API adapters or authenticated interfaces, not bundled subscriptions. Check availability and disclose cost before billable calls. Never request a pasted API key: use environment variables. A Gemini consumer subscription is not proof of API quota or billing.
+4. Create a project folder **outside the installed Skill**. Save the brief, approved script, source citations, continuous voice track, character references, scene assets and `project.json`. Keep a checkpoint with stage, fingerprints, approvals, completed outputs, pending jobs and next step. Reuse valid work after interruptions; inspect uncertain provider jobs before retrying.
+
+## Voice-led production
+
+- Establish narration before timing pictures. Reuse accepted audio unchanged. For a new video, synthesize one continuous track when the provider supports its length; otherwise approved chapter tracks with one fixed voice ID/profile/settings. Never slow speech, insert internal pauses or resynthesize the entire track to fit a visual plan or nominal duration. Fit pictures to actual speech, including natural pauses.
+- Use supplied aligned words/captions or a local speech aligner. `scripts/align_captions.py` supports optional OpenAI Whisper, using an already downloaded model by default; downloading a model needs the explicit flag. The runtime `captions` command groups word timestamps into short readable phrases. Check the text and actual speech, especially names and non-English content. Do not pretend proportional word distribution is forced alignment.
+- Design scenes around meaning, not uniform three-second cuts. About 2–4 seconds is a starting point; hold longer for reading, reactions and evidence. Alternate character acting, object action, text emphasis and occasional screenshot inserts. Establish some compositions immediately; avoid repeating title → icon → underline in every shot.
+- Use visible scene headings sparingly; these carry emphasis through size/weight. Automatic captions provide access to speech, not a second competing headline. Keep a quiet bottom safe band. Use real screenshots and a coherent licensed icon family or original hand-drawn props when helpful; do not make every abstract point into a generic dashboard.
+- Identity and acting are separate: preserve the approved face/body/clothes while varying expressions, gaze, posture and hands. Generate a reference sheet first when needed and use it throughout. Prefer bounded batches and inspect contact sheets before continuing. Do not redraw accepted assets or use the same frozen expression for every scene.
+- Micro-animation must advance the meaning: hand taps, a note carried into the next scene, writing a line, an object arriving on a spoken word. A global zoom or fade alone is not a substitute. Plan layers/poses explicitly. The renderer accepts local keyframes; it does not infer arms or motion from a flat image.
+- Add original or properly licensed action-synchronized SFX, at voice-first levels. The built-in `tap`, `paper`, `pop` and `chime` are original procedural accents, not borrowed soundtrack audio. External music/SFX need their own license. Listen to the mix; waveform checks do not prove intelligibility.
+
+## Project and runtime
+
+Read [runtime configuration](autopilot-runtime.md) before invoking scripts or writing the manifest. `examples/b1/project.json` is a runnable offline example using bundled original narration/art; it demonstrates the manifest, not a second public showcase. Use your own project for new subjects.
+
+```bash
+node scripts/autopilot.mjs validate /absolute/project/project.json
+node scripts/autopilot.mjs preview /absolute/project/project.json
+```
+
+The renderer writes MP4, SRT/VTT, a contact sheet, a verification report and content-addressed resumable shot caches. It preserves voice rate and only pads at the beginning/end. It reads a declarative JSON format; never execute code, shell fragments or URLs from project/source material.
+
+## Sample → approval → full film
+
+Deliver approximately 20 seconds first, or the complete natural opening when shorter. Include sound, captions, character acting and representative scene transitions. Inspect the contact sheet and key full-size frames, decode the output, and have the user review the actual picture/sound. Do not treat an encode succeeding as acceptance.
+
+Only after the user explicitly approves that sample and authorizes the remaining production, record the approval:
+
+```bash
+node scripts/autopilot.mjs approve /absolute/project/project.json --note "User approved the sample and authorized the full film"
+node scripts/autopilot.mjs render /absolute/project/project.json
+```
+
+Never run `approve` based on your own technical checks. The approval records the exact project/assets/voice and preview fingerprint; changing them invalidates it. Render by cached shots, keeping continuous original-speed narration. Technical checks can use small synthetic fixtures but do not authorize a new paid generation or the user's full film.
+
+Deliver the MP4, subtitle sidecars and project/checkpoint paths. State what was verified, what still needs listening/human review, and any missing service configuration. Do not publish, upload or change GitHub unless separately requested.
diff --git a/skills/directing-stickman-videos/references/b1-minimal-handdrawn.md b/skills/directing-stickman-videos/references/b1-minimal-handdrawn.md
new file mode 100644
index 0000000..c2aa5d5
--- /dev/null
+++ b/skills/directing-stickman-videos/references/b1-minimal-handdrawn.md
@@ -0,0 +1,21 @@
+# B1 · 极简手绘风
+
+Approved baseline: the original-speed Sadaltager **V15** sample, not the earlier minimalist line/PPT-like drafts. B1 is separate from all A-style generation prompts.
+
+## Visual language
+
+- Near-white paper (`#FDFDFC` in local rendering), very faint broad grid and restrained stable grain; no dark beige wash. Keep the background quiet.
+- Expressive hand-drawn stick figures, lively eyes/brows/mouth and clear whole-body poses, black slightly irregular outlines. Use the approved original three-pose sheet for the included demo; design appropriate characters/references for other stories. Do not impose these three poses on an entire long film.
+- Hand-drawn colored props, marker accents and curved arrows; limited warm yellow/red/green plus ink/navy. Real screenshots may appear briefly as evidence. Match roughness/line weight, avoiding polished UI cards mixed with crude symbols.
+- Large, short in-scene text is the visual focal point. The original accepted demo used Chalkboard on macOS; the portable package includes OFL Caveat as a fallback, not a claim of pixel-identical typography. For other scripts/languages configure a readable licensed font with the required glyphs.
+- At 1280×720, start captions at 34px, short phrase-based lines, bottom safe band and high readable contrast. Scale for other ratios/resolutions; verify on a phone. Avoid crowding text, faces or evidence into the caption band.
+
+## Rhythm and sound
+
+Voice leads. Retain natural pace and pauses; target duration is not permission to stretch speech. Character shots occupy roughly **60–70% of direct screen time** for the approved B1 promotional format, not 60–70% of image area and not a hard requirement for every possible story. Include character-free closeups and reading holds.
+
+Use semantic match cuts, a prop carried between ideas, closeups and a settled frame after an action. Do not apply a repeating title/icon/underline build to every shot, speed up all cuts or keep the camera moving constantly. Local motion and restrained synchronized SFX should support the spoken beat. Keep the chosen voice fixed; Sadaltager is the demo choice, not a restriction on users.
+
+## Acceptance
+
+Inspect consistent identity, varied expressions, meaningful local motion, readable text, clear visual hierarchy, uncluttered compositions, original speech speed, subtitle timing and balanced SFX. Compare with the approved V15 sample rather than an unrelated A-style video. The public preview is the already approved V15 file; runtime fixtures are engineering evidence, not additional approved showcases.
diff --git a/skills/directing-stickman-videos/scripts/align_captions.py b/skills/directing-stickman-videos/scripts/align_captions.py
new file mode 100644
index 0000000..b7f497f
--- /dev/null
+++ b/skills/directing-stickman-videos/scripts/align_captions.py
@@ -0,0 +1,44 @@
+#!/usr/bin/env python3
+"""Optional local Whisper timing adapter. No model download without opt-in."""
+import argparse
+import json
+import os
+from pathlib import Path
+
+
+def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('audio', type=Path)
+ parser.add_argument('--output', type=Path, required=True)
+ parser.add_argument('--model', default='base')
+ parser.add_argument('--language')
+ parser.add_argument('--device', default='cpu')
+ parser.add_argument('--allow-model-download', action='store_true')
+ args = parser.parse_args()
+ if args.output.exists():
+ parser.error('Output exists; will not overwrite')
+ if not args.audio.is_file():
+ parser.error('Audio file not found')
+ try:
+ import whisper
+ except ImportError:
+ parser.error('Optional dependency missing: install openai-whisper, or provide existing aligned captions')
+ if args.model not in whisper.available_models():
+ parser.error('Use a named official Whisper model')
+ cache = Path(os.environ.get('XDG_CACHE_HOME', Path.home() / '.cache')) / 'whisper'
+ cached = cache / f'{args.model}.pt'
+ if not cached.is_file() and not args.allow_model_download:
+ parser.error('Model not cached; --allow-model-download is required for a download')
+ model = whisper.load_model(args.model if args.allow_model_download else str(cached), device=args.device, download_root=str(cache))
+ result = model.transcribe(str(args.audio), language=args.language, word_timestamps=True, fp16=False, verbose=False)
+ words = [{k: w[k] for k in ('start', 'end', 'word')} for s in result['segments'] for w in s.get('words', []) if w['end'] > w['start']]
+ if not words:
+ parser.error('No aligned words returned; inspect the audio')
+ args.output.parent.mkdir(parents=True, exist_ok=True)
+ with args.output.open('x') as output:
+ json.dump({'words': words, 'method': 'openai-whisper word_timestamps; human text/timing review required'}, output, ensure_ascii=False, indent=2)
+ print(json.dumps({'output': str(args.output.resolve()), 'words': len(words)}))
+
+
+if __name__ == '__main__':
+ main()
diff --git a/skills/directing-stickman-videos/scripts/autopilot-core.mjs b/skills/directing-stickman-videos/scripts/autopilot-core.mjs
new file mode 100644
index 0000000..b426845
--- /dev/null
+++ b/skills/directing-stickman-videos/scripts/autopilot-core.mjs
@@ -0,0 +1,142 @@
+import fs from 'node:fs';
+import path from 'node:path';
+import crypto from 'node:crypto';
+import {fileURLToPath} from 'node:url';
+import {spawnSync} from 'node:child_process';
+
+export const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
+export const FFMPEG = process.env.FFMPEG || 'ffmpeg';
+export const FFPROBE = process.env.FFPROBE || 'ffprobe';
+export const sha = value => crypto.createHash('sha256').update(value).digest('hex');
+export const hashFile = file => sha(fs.readFileSync(file));
+export const json = file => JSON.parse(fs.readFileSync(file, 'utf8'));
+export function save(file, value) {
+ fs.mkdirSync(path.dirname(file), {recursive: true});
+ const tmp = `${file}.${process.pid}.tmp`;
+ fs.writeFileSync(tmp, JSON.stringify(value, null, 2) + '\n');
+ fs.renameSync(tmp, file);
+}
+export function run(exe, args) {
+ const result = spawnSync(exe, args, {encoding: 'utf8', maxBuffer: 8 * 1024 * 1024});
+ if (result.error || result.status !== 0) throw new Error(`${path.basename(exe)} failed: ${result.error?.message || result.stderr?.slice(-2400)}`);
+ return result.stdout;
+}
+export function probe(file) {
+ return JSON.parse(run(FFPROBE, ['-v', 'error', '-show_format', '-show_streams', '-of', 'json', file]));
+}
+export function mediaPath(base, file) {
+ if (typeof file !== 'string' || !file || /^(?:[a-z]+:|\/\/)/i.test(file.replace(/^[A-Z]:[\\/]/i, ''))) throw new Error('Media must be a local path');
+ const bundled = file.startsWith('@b1/');
+ const target = bundled ? path.resolve(ROOT, 'assets/b1', file.slice(4)) : path.resolve(base, file);
+ if (bundled && !target.startsWith(path.join(ROOT, 'assets/b1') + path.sep)) throw new Error('Bundled path escapes asset directory');
+ if (!fs.statSync(target).isFile()) throw new Error(`Missing file: ${file}`);
+ return fs.realpathSync(target);
+}
+const number = (x, name, min = 0, max = Infinity) => {
+ if (!Number.isFinite(x) || x < min || x > max) throw new Error(`Invalid ${name}`);
+ return x;
+};
+export function fontPaths(project) {
+ return {
+ hand: project.font ? mediaPath(project.base, project.font) : process.env.AUTOPILOT_FONT ? mediaPath(project.base, process.env.AUTOPILOT_FONT) : path.join(ROOT, 'assets/fonts/Caveat.ttf'),
+ caption: project.captionFont ? mediaPath(project.base, project.captionFont) : path.join(ROOT, 'assets/fonts/NotoSans.ttf'),
+ };
+}
+export function designPlane(project) {
+ // One uniform scale keeps round heads and lettering undistorted in portrait.
+ return {width: 1280, height: 1280 * project.height / project.width};
+}
+export function loadProject(file) {
+ file = fs.realpathSync(path.resolve(file));
+ const p = json(file), base = path.dirname(file);
+ if (p.version !== 1 || p.style !== 'B1') throw new Error('Expected version 1 and style B1');
+ number(p.width, 'width', 256, 3840); number(p.height, 'height', 256, 3840); number(p.fps, 'fps', 12, 60);
+ if (![p.width, p.height, p.fps].every(Number.isInteger) || p.width % 2 || p.height % 2) throw new Error('Even integer dimensions and integer fps required');
+ if (!p.voice || Object.keys(p.voice).some(k => !['path', 'lead', 'tail', 'contains_sfx'].includes(k))) throw new Error('Voice supports path/lead/tail/contains_sfx only; speech speed cannot be changed');
+ const voicePath = mediaPath(base, p.voice.path), audio = probe(voicePath);
+ if (!audio.streams.some(s => s.codec_type === 'audio')) throw new Error('Narration has no audio stream');
+ const voiceDuration = Number(audio.format.duration);
+ number(voiceDuration, 'voice duration', 0.01, 86400);
+ const lead = p.voice.lead ?? 0, tail = p.voice.tail ?? 0;
+ number(lead, 'lead', 0, 5); number(tail, 'tail', 0, 5);
+ const duration = voiceDuration + lead + tail;
+ if (p.captionSize !== undefined) number(p.captionSize, 'caption size', 20, 64);
+ if (!Array.isArray(p.shots) || !p.shots.length) throw new Error('Shots required');
+ let end = 0;
+ const assets = new Set([voicePath]);
+ const types = new Set(['image', 'pose', 'text', 'line', 'arrow', 'underline']);
+ for (const [i, shot] of p.shots.entries()) {
+ number(shot.start, 'shot start'); number(shot.end, 'shot end');
+ if (Math.abs(shot.start - end) > 0.002 || shot.end <= shot.start) throw new Error(`Shot ${i}: gap/overlap or nonpositive duration`);
+ end = shot.end;
+ if (!Array.isArray(shot.layers) || !shot.layers.length) throw new Error(`Shot ${i} has no layers`);
+ for (const l of shot.layers) {
+ if (!types.has(l.type)) throw new Error(`Unknown layer ${l.type}`);
+ for (const k of ['x', 'y', 'w', 'h', 'size', 'angle', 'alpha', 'progress', 'lineWidth']) if (l[k] !== undefined) number(l[k], k, -10000, 10000);
+ if (l.w !== undefined && l.w <= 0 || l.size !== undefined && l.size <= 0) throw new Error('Layer dimensions must be positive');
+ if (l.type === 'image') { const f = mediaPath(base, l.path); if (!/\.(png|jpe?g)$/i.test(f)) throw new Error('Only PNG/JPEG image layers'); assets.add(f); }
+ if (l.type === 'pose') { number(l.pose, 'pose', 0, 2); if (!Number.isInteger(l.pose)) throw new Error('Integer pose index required'); assets.add(mediaPath(base, '@b1/character-pose-sheet-v6.png')); }
+ if (l.type === 'text' && (typeof l.text !== 'string' || !l.text.trim() || l.text.length > 400)) throw new Error('Text layer must be 1–400 characters');
+ if (l.type === 'line' && (!Array.isArray(l.points) || l.points.length < 2 || l.points.some(pt => !Array.isArray(pt) || pt.length !== 2 || pt.some(n => !Number.isFinite(n))))) throw new Error('Line requires finite [x,y] points');
+ const span = shot.end - shot.start;
+ number(l.from ?? 0, 'layer from', 0, span); number(l.to ?? span, 'layer to', l.from ?? 0, span);
+ let previous = -1;
+ for (const key of l.keys || []) {
+ number(key.t, 'key time', 0, span);
+ if (key.t <= previous) throw new Error('Key times must increase');
+ previous = key.t;
+ for (const k of Object.keys(key)) {
+ if (!['t', 'x', 'y', 'w', 'angle', 'alpha', 'progress'].includes(k)) throw new Error(`Unsupported keyframe property: ${k}`);
+ number(key[k], k, -10000, 10000);
+ if (k === 'w' && key[k] <= 0 || ['alpha', 'progress'].includes(k) && (key[k] < 0 || key[k] > 1)) throw new Error('Invalid size/opacity/progress keyframe');
+ }
+ }
+ }
+ }
+ if (Math.abs(end - duration) > 0.06) throw new Error(`Shots end at ${end}; voice+lead+tail ends at ${duration.toFixed(3)}`);
+ let cueEnd = 0;
+ if (!Array.isArray(p.captions) || !p.captions.length) throw new Error('Timed captions required');
+ for (const cue of p.captions) {
+ number(cue.start, 'caption start', cueEnd, duration); number(cue.end, 'caption end', cue.start + 0.01, duration);
+ if (typeof cue.text !== 'string' || !cue.text.trim() || cue.text.length > 240) throw new Error('Invalid caption text');
+ cueEnd = cue.end;
+ }
+ if (p.voice.contains_sfx && p.sfx?.length) throw new Error('Already mixed voice must not receive duplicate SFX');
+ for (const s of p.sfx || []) { number(s.time, 'SFX time', 0, duration); number(s.gain, 'SFX gain', 0, 0.3); if (!['tap', 'paper', 'pop', 'chime'].includes(s.kind)) throw new Error('Unknown SFX'); }
+ if (p.music) { assets.add(mediaPath(base, p.music.path)); number(p.music.gain, 'music gain', 0, 0.2); }
+ const project = {...p, file, base, voicePath, voiceDuration, lead, tail, duration};
+ for (const f of Object.values(fontPaths(project))) { if (!fs.existsSync(f)) throw new Error(`Missing font: ${f}`); assets.add(f); }
+ const inputs = [...assets].sort().map(f => ({path: f, sha256: hashFile(f)}));
+ const engine = ['autopilot-core.mjs', 'autopilot-render.mjs'].map(f => hashFile(path.join(ROOT, 'scripts', f)));
+ return {...project, inputs, fingerprint: sha(JSON.stringify({project: p, inputs, engine}))};
+}
+export function outputDir(p) {
+ const output = path.join(p.base, 'output');
+ if (fs.existsSync(output) && (fs.lstatSync(output).isSymbolicLink() || !fs.statSync(output).isDirectory())) throw new Error('Output must be a real project-local directory');
+ fs.mkdirSync(output, {recursive: true});
+ function inspect(dir) {
+ for (const entry of fs.readdirSync(dir, {withFileTypes: true})) {
+ if (entry.isSymbolicLink()) throw new Error('Renderer-owned output must not contain symlinks');
+ if (entry.isDirectory()) inspect(path.join(dir, entry.name));
+ }
+ }
+ inspect(output);
+ // Never allow an input file to be inside a renderer-owned output directory.
+ if (p.inputs.some(i => i.path.startsWith(fs.realpathSync(output) + path.sep))) throw new Error('Input assets cannot live in output/');
+ return output;
+}
+export function groupWords(data, lead = 0) {
+ number(lead, 'caption lead', 0, 5);
+ if (!Array.isArray(data.words) || !data.words.length) throw new Error('Aligned words required');
+ const cues = []; let words = [], start, end = 0;
+ function flush() { if (words.length) cues.push({start: start + lead, end: end + lead, text: words.join(' ').replace(/\s+([,.!?;:])/g, '$1')}); words = []; }
+ for (const w of data.words) {
+ number(w.start, 'word start', end); number(w.end, 'word end', w.start + 0.001);
+ if (typeof w.word !== 'string' || !w.word.trim()) throw new Error('Empty word');
+ if (words.length && (w.start - end > 0.4 || words.length >= 8 || w.end - start > 3.5 || [...words, w.word].join(' ').length > 58)) flush();
+ if (!words.length) start = w.start;
+ words.push(w.word.trim()); end = w.end;
+ if (/[.!?]$/.test(w.word)) flush();
+ }
+ flush(); return cues;
+}
diff --git a/skills/directing-stickman-videos/scripts/autopilot-render.mjs b/skills/directing-stickman-videos/scripts/autopilot-render.mjs
new file mode 100644
index 0000000..be10172
--- /dev/null
+++ b/skills/directing-stickman-videos/scripts/autopilot-render.mjs
@@ -0,0 +1,173 @@
+import fs from 'node:fs';
+import path from 'node:path';
+import {spawn} from 'node:child_process';
+import {once} from 'node:events';
+import {createCanvas, loadImage, GlobalFonts} from '@napi-rs/canvas';
+import {ROOT, FFMPEG, sha, hashFile, save, probe, run, mediaPath, fontPaths, outputDir, designPlane} from './autopilot-core.mjs';
+
+const clamp = x => Math.max(0, Math.min(1, x));
+const ease = x => { x = clamp(x); return x * x * (3 - 2 * x); };
+export function keyState(l, t) {
+ const out = {...l};
+ for (const prop of ['x', 'y', 'w', 'angle', 'alpha', 'progress']) {
+ const keys = (l.keys || []).filter(k => k[prop] !== undefined);
+ if (!keys.length) continue;
+ if (t <= keys[0].t) out[prop] = keys[0][prop];
+ else if (t >= keys.at(-1).t) out[prop] = keys.at(-1)[prop];
+ else { const i = keys.findIndex(k => k.t > t), a = keys[i - 1], b = keys[i]; out[prop] = a[prop] + (b[prop] - a[prop]) * ease((t - a.t) / (b.t - a.t)); }
+ }
+ return out;
+}
+function wrap(ctx, text, maxWidth) {
+ const parts = /\s/.test(text) ? text.split(/\s+/) : [...text];
+ const separator = /\s/.test(text) ? ' ' : '';
+ const lines = []; let line = '';
+ for (const part of parts) {
+ const next = line ? line + separator + part : part;
+ if (ctx.measureText(next).width > maxWidth && line) { lines.push(line); line = part; }
+ else line = next;
+ if (ctx.measureText(line).width > maxWidth) throw new Error('Text token too wide; shorten it or reduce size');
+ }
+ if (line) lines.push(line);
+ return lines;
+}
+export async function painter(p) {
+ const fonts = fontPaths(p);
+ const plane = designPlane(p), captionBand = plane.height - 110;
+ if (!GlobalFonts.registerFromPath(fonts.hand, 'B1Hand') || !GlobalFonts.registerFromPath(fonts.caption, 'B1Caption')) throw new Error('Font registration failed');
+ const canvas = createCanvas(p.width, p.height), ctx = canvas.getContext('2d');
+ const images = new Map();
+ for (const s of p.shots) for (const l of s.layers) if (['image', 'pose'].includes(l.type)) {
+ const f = mediaPath(p.base, l.type === 'pose' ? '@b1/character-pose-sheet-v6.png' : l.path);
+ if (!images.has(f)) images.set(f, await loadImage(f));
+ }
+ function stroke(points, width, color, progress = 1) {
+ const lengths = points.slice(1).map((pt, i) => Math.hypot(pt[0] - points[i][0], pt[1] - points[i][1]));
+ let left = lengths.reduce((a, b) => a + b, 0) * clamp(progress);
+ ctx.strokeStyle = color; ctx.lineWidth = width; ctx.lineCap = 'round'; ctx.lineJoin = 'round'; ctx.beginPath(); ctx.moveTo(...points[0]);
+ for (let i = 0; i < lengths.length && left > 0; i++) { const f = Math.min(1, left / Math.max(0.001, lengths[i])); ctx.lineTo(points[i][0] + (points[i + 1][0] - points[i][0]) * f, points[i][1] + (points[i + 1][1] - points[i][1]) * f); left -= lengths[i]; }
+ ctx.stroke();
+ }
+ return function frame(t) {
+ ctx.resetTransform(); ctx.clearRect(0, 0, p.width, p.height); ctx.scale(p.width / plane.width, p.width / plane.width);
+ ctx.fillStyle = '#FDFDFC'; ctx.fillRect(0, 0, plane.width, plane.height);
+ if (p.grid !== false) {
+ ctx.beginPath(); ctx.strokeStyle = 'rgba(76,90,105,.036)'; ctx.lineWidth = 0.8;
+ for (let x = 32.5; x < plane.width; x += 64) { ctx.moveTo(x, 0); ctx.lineTo(x, captionBand - 1); }
+ for (let y = 16.5; y < captionBand; y += 64) { ctx.moveTo(0, y); ctx.lineTo(plane.width, y); } ctx.stroke();
+ }
+ const shot = p.shots.find(s => t >= s.start && t < s.end) || p.shots.at(-1);
+ for (const layer of shot.layers) {
+ const dt = t - shot.start;
+ if (dt < (layer.from || 0) || dt >= (layer.to ?? Infinity)) continue;
+ const l = keyState(layer, dt), x = l.x || 0, y = l.y || 0, w = l.w || 200;
+ ctx.save(); ctx.globalAlpha = clamp(l.alpha ?? 1); ctx.translate(x, y); ctx.rotate(l.angle || 0);
+ if (l.type === 'image') {
+ const img = images.get(mediaPath(p.base, l.path)), h = l.h || w * img.height / img.width;
+ const scale = Math.min(w / img.width, h / img.height);
+ ctx.drawImage(img, (w - img.width * scale) / 2, (h - img.height * scale) / 2, img.width * scale, img.height * scale);
+ } else if (l.type === 'pose') {
+ const img = images.get(mediaPath(p.base, '@b1/character-pose-sheet-v6.png')), sw = img.width / 3;
+ ctx.drawImage(img, l.pose * sw, 0, sw, img.height, 0, 0, w, w * img.height / sw);
+ } else if (l.type === 'text') {
+ const size = l.size || 52; ctx.font = `${l.bold ? 700 : 400} ${size}px B1Hand`; ctx.fillStyle = l.color || '#191916'; ctx.textBaseline = 'top';
+ const lines = wrap(ctx, l.text, l.w || 1080 - x);
+ lines.forEach((s, i) => ctx.fillText(s, 0, i * size * 1.15));
+ } else {
+ let points = l.points;
+ if (l.type === 'underline') points = [[0, 1], [w * 0.25, -1], [w * 0.55, 2], [w, -2]];
+ if (l.type === 'arrow') points = Array.from({length: 30}, (_, i) => [w * i / 29, -26 * Math.sin(i / 29 * Math.PI)]);
+ stroke(points, l.lineWidth || (l.type === 'underline' ? 6 : 3), l.color || '#191916', l.progress ?? 1);
+ if (l.type === 'arrow' && (l.progress ?? 1) > 0.95) stroke([[w - 17, -12], [w, 0], [w - 19, 12]], 3, l.color || '#191916');
+ }
+ ctx.restore();
+ }
+ const cue = p.captions.find(c => t >= c.start && t < c.end);
+ if (cue) {
+ ctx.font = `600 ${p.captionSize || 34}px B1Caption`; ctx.textAlign = 'center'; ctx.textBaseline = 'middle';
+ const lines = wrap(ctx, cue.text, 1120);
+ if (lines.length > 2) throw new Error('Caption exceeds two lines; split the timed cue');
+ const cy = plane.height - (lines.length === 1 ? 60 : 82);
+ lines.forEach((s, i) => { const y = cy + i * 43; ctx.strokeStyle = '#FDFDFC'; ctx.lineWidth = 7; ctx.strokeText(s, 640, y); ctx.fillStyle = '#20231F'; ctx.fillText(s, 640, y); });
+ ctx.textAlign = 'left';
+ }
+ return canvas;
+ };
+}
+async function encode(p, frame, start, frames, target) {
+ const child = spawn(FFMPEG, ['-v', 'error', '-y', '-f', 'rawvideo', '-pixel_format', 'rgba', '-video_size', `${p.width}x${p.height}`, '-framerate', String(p.fps), '-i', 'pipe:0', '-an', '-c:v', 'libx264', '-preset', 'fast', '-crf', '20', '-pix_fmt', 'yuv420p', target], {stdio: ['pipe', 'ignore', 'pipe']});
+ let error = ''; child.stderr.on('data', b => { error = (error + b).slice(-2400); });
+ child.stdin.on('error', () => {});
+ const completion = new Promise((resolve, reject) => { child.on('error', reject); child.on('close', code => code === 0 ? resolve() : reject(new Error(`Encode failed: ${error}`))); });
+ completion.catch(() => {});
+ try {
+ for (let i = 0; i < frames; i++) { const data = frame((start + i) / p.fps).data(); if (!child.stdin.write(data)) await Promise.race([once(child.stdin, 'drain'), completion.then(() => { throw new Error('Encoder closed early'); })]); }
+ child.stdin.end(); await completion;
+ } catch (e) { child.kill(); await completion.catch(() => {}); throw e; }
+}
+function makeSfx(p, file, duration) {
+ const rate = 48000, n = Math.ceil(duration * rate), samples = new Float32Array(n);
+ let seed = 8731; const noise = () => { seed = (Math.imul(seed, 1664525) + 1013904223) >>> 0; return seed / 4294967296 * 2 - 1; };
+ for (const s of p.sfx || []) {
+ const len = s.kind === 'chime' ? 0.55 : s.kind === 'paper' ? 0.22 : 0.12;
+ for (let i = 0; i < len * rate; i++) {
+ const index = Math.round(s.time * rate) + i; if (index >= n) break;
+ const t = i / rate, env = Math.exp(-t * (s.kind === 'chime' ? 8 : 25));
+ const value = s.kind === 'paper' ? noise() : s.kind === 'tap' ? noise() * 0.6 + Math.sin(t * 2 * Math.PI * 170) * 0.4 : Math.sin(2 * Math.PI * (s.kind === 'chime' ? 880 : 500 - 900 * t) * t);
+ samples[index] += value * env * s.gain;
+ }
+ }
+ const bytes = Buffer.alloc(44 + n * 2); bytes.write('RIFF'); bytes.writeUInt32LE(bytes.length - 8, 4); bytes.write('WAVEfmt ', 8); bytes.writeUInt32LE(16, 16); bytes.writeUInt16LE(1, 20); bytes.writeUInt16LE(1, 22); bytes.writeUInt32LE(rate, 24); bytes.writeUInt32LE(rate * 2, 28); bytes.writeUInt16LE(2, 32); bytes.writeUInt16LE(16, 34); bytes.write('data', 36); bytes.writeUInt32LE(n * 2, 40);
+ samples.forEach((s, i) => bytes.writeInt16LE(Math.round(Math.max(-1, Math.min(1, s)) * 32767), 44 + i * 2)); fs.writeFileSync(file, bytes);
+}
+function stamp(seconds, vtt = false) {
+ const ms = Math.round(seconds * 1000); return `${String(Math.floor(ms / 3600000)).padStart(2, '0')}:${String(Math.floor(ms / 60000) % 60).padStart(2, '0')}:${String(Math.floor(ms / 1000) % 60).padStart(2, '0')}${vtt ? '.' : ','}${String(ms % 1000).padStart(3, '0')}`;
+}
+export async function render(p, {full = false, seconds = 20, replace = false} = {}) {
+ const out = outputDir(p), lock = path.join(out, 'render.lock');
+ if (fs.existsSync(lock)) {
+ const prior = JSON.parse(fs.readFileSync(lock, 'utf8'));
+ try { process.kill(prior.pid, 0); throw new Error('Another renderer is running'); }
+ catch (e) { if (e.code !== 'ESRCH') throw e; fs.unlinkSync(lock); }
+ }
+ const fd = fs.openSync(lock, 'wx'); fs.writeFileSync(fd, JSON.stringify({pid: process.pid})); fs.closeSync(fd);
+ const kind = full ? 'film' : 'preview', target = path.join(out, `${kind}.mp4`), reportPath = path.join(out, `${kind}-report.json`);
+ const duration = Math.min(p.duration, full ? p.duration : seconds), count = Math.ceil(duration * p.fps - 1e-6);
+ const done = value => save(path.join(out, 'checkpoint.json'), {stage: value, kind, fingerprint: p.fingerprint, pid: process.pid, updated_at: new Date().toISOString()});
+ try {
+ if (fs.existsSync(target) && !replace) {
+ if (fs.existsSync(reportPath)) { const previous = JSON.parse(fs.readFileSync(reportPath)); if (previous.fingerprint === p.fingerprint && previous.frames === count && previous.output_sha256 === hashFile(target)) return {...previous, reused: true}; }
+ throw new Error('Output exists with different/unverified contents; pass --replace to replace renderer-owned output');
+ }
+ const cache = path.join(out, 'cache'); fs.mkdirSync(cache, {recursive: true});
+ const frame = await painter(p), clips = []; let reused = 0;
+ const rendererHash = hashFile(path.join(ROOT, 'scripts/autopilot-render.mjs'));
+ for (const [i, shot] of p.shots.entries()) {
+ const first = Math.round(shot.start * p.fps), last = Math.min(count, i === p.shots.length - 1 ? count : Math.round(shot.end * p.fps)); if (last <= first) continue;
+ const key = sha(JSON.stringify({shot, first, last, width: p.width, height: p.height, fps: p.fps, captions: p.captions.filter(c => c.end >= shot.start && c.start <= shot.end), captionSize: p.captionSize, grid: p.grid, inputs: p.inputs.filter(f => ![p.voicePath, p.music && mediaPath(p.base, p.music.path)].includes(f.path)), rendererHash}));
+ const clip = path.join(cache, `${key}.mp4`); let valid = false;
+ if (fs.existsSync(clip)) try { const info = probe(clip); valid = Number(info.streams[0].nb_frames) === last - first; } catch {}
+ if (valid) reused++; else { done(`rendering shot ${i + 1}/${p.shots.length}`); const tmp = path.join(cache, `${key}.partial.mp4`); await encode(p, frame, first, last - first, tmp); fs.renameSync(tmp, clip); }
+ clips.push(clip); process.stdout.write(JSON.stringify({shot: i + 1, total: p.shots.length, cache_hit: valid}) + '\n');
+ }
+ done('assembling original-speed voice, captions and SFX');
+ const list = path.join(cache, 'concat.txt'); fs.writeFileSync(list, clips.map(f => `file '${path.basename(f)}'`).join('\n') + '\n');
+ const args = ['-v', 'error', '-y', '-f', 'concat', '-safe', '1', '-i', list, '-i', p.voicePath];
+ const filters = [`[1:a]adelay=${Math.round(p.lead * 1000)}:all=1,apad,atrim=0:${count / p.fps}[voice]`], mixes = ['[voice]']; let idx = 2;
+ if (p.sfx?.length) { const f = path.join(cache, 'sfx.wav'); makeSfx(p, f, count / p.fps); args.push('-i', f); mixes.push(`[${idx++}:a]`); }
+ if (p.music) { args.push('-stream_loop', '-1', '-i', mediaPath(p.base, p.music.path)); filters.push(`[${idx++}:a]volume=${p.music.gain}[music]`); mixes.push('[music]'); }
+ filters.push(`${mixes.join('')}amix=inputs=${mixes.length}:normalize=0:duration=first,alimiter=limit=0.97:level=false:latency=true[a]`);
+ const partial = path.join(out, `${kind}.partial.mp4`);
+ args.push('-filter_complex', filters.join(';'), '-map', '0:v:0', '-map', '[a]', '-c:v', 'copy', '-c:a', 'aac', '-b:a', '192k', '-t', String(count / p.fps), '-movflags', '+faststart', partial);
+ run(FFMPEG, args); run(FFMPEG, ['-v', 'error', '-i', partial, '-f', 'null', '-']); fs.renameSync(partial, target);
+ const cues = p.captions.filter(c => c.start < duration).map(c => ({...c, end: Math.min(c.end, duration)}));
+ fs.writeFileSync(path.join(out, `${kind}.srt`), cues.map((c, i) => `${i + 1}\n${stamp(c.start)} --> ${stamp(c.end)}\n${c.text}\n`).join('\n'));
+ fs.writeFileSync(path.join(out, `${kind}.vtt`), 'WEBVTT\n\n' + cues.map(c => `${stamp(c.start, true)} --> ${stamp(c.end, true)}\n${c.text}\n`).join('\n'));
+ const sheet = createCanvas(960, 540), sc = sheet.getContext('2d');
+ for (let i = 0; i < 9; i++) sc.drawImage(frame(Math.min(duration - 1 / p.fps, (i + 0.5) * duration / 9)), (i % 3) * 320, Math.floor(i / 3) * 180, 320, 180);
+ fs.writeFileSync(path.join(out, `${kind}-contact-sheet.png`), sheet.toBuffer('image/png'));
+ const info = probe(target), report = {fingerprint: p.fingerprint, output: target, output_sha256: hashFile(target), original_voice_sha256: hashFile(p.voicePath), original_voice_duration: p.voiceDuration, voice_rate: 'unchanged; leading/trailing padding only', frames: count, duration: Number(info.format.duration), cache_hits: reused, shot_count: clips.length, full_decode: 'pass', caption_count: cues.length, human_review: 'required; technical checks are not acceptance', inputs: p.inputs};
+ save(reportPath, report); done('complete'); return report;
+ } catch (e) { done(`failed: ${e.message}`); throw e; }
+ finally { fs.unlinkSync(lock); }
+}
diff --git a/skills/directing-stickman-videos/scripts/autopilot.mjs b/skills/directing-stickman-videos/scripts/autopilot.mjs
new file mode 100644
index 0000000..c26f230
--- /dev/null
+++ b/skills/directing-stickman-videos/scripts/autopilot.mjs
@@ -0,0 +1,50 @@
+#!/usr/bin/env node
+import fs from 'node:fs';
+import path from 'node:path';
+import {ROOT, FFMPEG, FFPROBE, run, probe, loadProject, outputDir, save, json, hashFile, groupWords} from './autopilot-core.mjs';
+
+const [command, ...args] = process.argv.slice(2);
+const option = (flag, fallback) => args.includes(flag) ? args[args.indexOf(flag) + 1] : fallback;
+async function main() {
+ if (command === 'doctor') {
+ const checks = {node: Number(process.versions.node.split('.')[0]) >= 20};
+ for (const [name, exe] of [['ffmpeg', FFMPEG], ['ffprobe', FFPROBE]]) try { run(exe, ['-version']); checks[name] = true; } catch { checks[name] = false; }
+ try { await import('@napi-rs/canvas'); checks.canvas = true; } catch { checks.canvas = false; }
+ checks.fonts = ['Caveat.ttf', 'NotoSans.ttf'].every(f => { const file = path.join(ROOT, 'assets/fonts', f); return fs.existsSync(file) && fs.statSync(file).size > 10000; });
+ console.log(JSON.stringify({checks, gemini_key_present: Boolean(process.env.GEMINI_API_KEY), network_checked: false, note: 'Key presence is not quota/billing verification'}, null, 2));
+ if (Object.values(checks).some(v => !v)) process.exitCode = 1;
+ } else if (command === 'probe') console.log(JSON.stringify(probe(path.resolve(args[0])), null, 2));
+ else if (command === 'init') {
+ if (!args[0]) throw new Error('Project directory required');
+ const dir = path.resolve(args[0]); if (fs.existsSync(dir)) throw new Error('Project directory already exists; will not overwrite');
+ if (dir.startsWith(ROOT + path.sep)) throw new Error('Create projects outside the installed Skill');
+ fs.mkdirSync(dir, {recursive: true});
+ save(path.join(dir, 'project.json'), {version: 1, style: 'B1', width: 1280, height: 720, fps: 30, voice: {path: 'narration.wav', lead: 0, tail: 0}, captions: [], shots: [], sfx: []});
+ console.log(JSON.stringify({project: path.join(dir, 'project.json'), stage: 'scaffold; add approved narration, aligned captions and authored scenes before rendering'}));
+ } else if (command === 'captions') {
+ if (!args[0] || !args[1]) throw new Error('Aligned word input and output file required');
+ if (fs.existsSync(args[1])) throw new Error('Caption output exists; will not overwrite');
+ save(args[1], groupWords(json(args[0]), Number(option('--lead', 0))));
+ console.log(JSON.stringify({output: path.resolve(args[1])}));
+ } else if (['validate', 'preview', 'approve', 'render'].includes(command)) {
+ const p = loadProject(args[0]);
+ if (command === 'validate') { const {painter} = await import('./autopilot-render.mjs'); const draw = await painter(p); for (const cue of p.captions) draw((cue.start + cue.end) / 2); console.log(JSON.stringify({valid: true, fingerprint: p.fingerprint, duration: p.duration, shots: p.shots.length})); return; }
+ const out = outputDir(p), approvalPath = path.join(out, 'approval.json'), reportPath = path.join(out, 'preview-report.json');
+ if (command === 'approve') {
+ const note = option('--note', ''); if (!note.trim()) throw new Error('A note recording genuine user approval is required');
+ if (!fs.existsSync(reportPath)) throw new Error('Render and review a preview first');
+ const report = json(reportPath);
+ if (report.fingerprint !== p.fingerprint || !fs.existsSync(report.output) || hashFile(report.output) !== report.output_sha256) throw new Error('Preview changed; render/review it again');
+ save(approvalPath, {fingerprint: p.fingerprint, preview_sha256: report.output_sha256, note, approved_at: new Date().toISOString()});
+ console.log(JSON.stringify({approval: approvalPath})); return;
+ }
+ if (command === 'render') {
+ if (!fs.existsSync(approvalPath) || !fs.existsSync(reportPath)) throw new Error('Full production requires user-approved preview');
+ const a = json(approvalPath), r = json(reportPath);
+ if (a.fingerprint !== p.fingerprint || r.fingerprint !== p.fingerprint || a.preview_sha256 !== r.output_sha256 || !fs.existsSync(r.output) || hashFile(r.output) !== a.preview_sha256) throw new Error('Approval invalidated; preview and user approval required again');
+ }
+ const seconds = Number(option('--seconds', 20)); if (!Number.isFinite(seconds) || seconds <= 0 || seconds > 60) throw new Error('Preview length must be 0–60 seconds');
+ const {render} = await import('./autopilot-render.mjs'); console.log(JSON.stringify(await render(p, {full: command === 'render', seconds, replace: args.includes('--replace')}), null, 2));
+ } else throw new Error('Commands: doctor | probe FILE | init DIR | captions WORDS OUTPUT [--lead N] | validate PROJECT | preview PROJECT [--seconds N] [--replace] | approve PROJECT --note TEXT | render PROJECT [--replace]');
+}
+main().catch(e => { console.error(e.message); process.exitCode = 1; });
diff --git a/skills/directing-stickman-videos/scripts/gemini-media.mjs b/skills/directing-stickman-videos/scripts/gemini-media.mjs
new file mode 100644
index 0000000..f6e87c6
--- /dev/null
+++ b/skills/directing-stickman-videos/scripts/gemini-media.mjs
@@ -0,0 +1,48 @@
+#!/usr/bin/env node
+// Optional one-shot adapter; no generation is performed by installation/tests.
+import fs from 'node:fs';
+import path from 'node:path';
+import crypto from 'node:crypto';
+const [kind, ...args] = process.argv.slice(2);
+const value = flag => args[args.indexOf(flag) + 1];
+const required = flag => { if (!args.includes(flag) || !value(flag) || value(flag).startsWith('--')) throw new Error(`Required ${flag}`); return value(flag); };
+function wav(pcm, rate) {
+ const h = Buffer.alloc(44); h.write('RIFF'); h.writeUInt32LE(36 + pcm.length, 4); h.write('WAVEfmt ', 8); h.writeUInt32LE(16, 16); h.writeUInt16LE(1, 20); h.writeUInt16LE(1, 22); h.writeUInt32LE(rate, 24); h.writeUInt32LE(rate * 2, 28); h.writeUInt16LE(2, 32); h.writeUInt16LE(16, 34); h.write('data', 36); h.writeUInt32LE(pcm.length, 40); return Buffer.concat([h, pcm]);
+}
+async function main() {
+ if (!['speech', 'image'].includes(kind)) throw new Error('Use speech or image');
+ if (!args.includes('--allow-network')) throw new Error('Network disabled; require explicit --allow-network after user authorization');
+ const key = process.env.GEMINI_API_KEY; if (!key) throw new Error('Set GEMINI_API_KEY in the environment; do not paste it in chat');
+ const model = required('--model'); if (!/^[a-zA-Z0-9._-]+$/.test(model)) throw new Error('Invalid model ID');
+ const output = path.resolve(required('--output')), receipt = `${output}.request.json`;
+ if (fs.existsSync(output) || fs.existsSync(receipt)) throw new Error('Output or prior request receipt exists; inspect it before any retry');
+ const input = fs.readFileSync(required(kind === 'speech' ? '--text' : '--prompt'), 'utf8');
+ const parts = [];
+ if (kind === 'speech' && args.includes('--direction')) parts.push({text: fs.readFileSync(required('--direction'), 'utf8') + '\n\nRead only the following exact narration:\n'});
+ parts.push({text: input});
+ for (let i = 0; i < args.length; i++) if (args[i] === '--reference') {
+ if (kind !== 'image') throw new Error('References only supported for images');
+ const f = path.resolve(args[++i]); if (!/\.(png|jpe?g)$/i.test(f) || fs.statSync(f).size > 10 * 1024 * 1024) throw new Error('Reference must be PNG/JPEG up to 10 MiB');
+ parts.push({inlineData: {mimeType: /\.png$/i.test(f) ? 'image/png' : 'image/jpeg', data: fs.readFileSync(f).toString('base64')}});
+ }
+ const config = kind === 'speech' ? {responseModalities: ['AUDIO'], speechConfig: {voiceConfig: {prebuiltVoiceConfig: {voiceName: required('--voice')}}}} : {responseModalities: ['TEXT', 'IMAGE']};
+ fs.mkdirSync(path.dirname(output), {recursive: true});
+ const record = {kind, model, requested_at: new Date().toISOString(), request_id: crypto.randomUUID(), status: 'submitted_or_unknown', warning: 'One request only; inspect provider history before retrying'};
+ fs.writeFileSync(receipt, JSON.stringify(record, null, 2), {flag: 'wx'});
+ try {
+ const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/${model}:generateContent`, {method: 'POST', headers: {'Content-Type': 'application/json', 'x-goog-api-key': key}, body: JSON.stringify({contents: [{role: 'user', parts}], generationConfig: config}), signal: AbortSignal.timeout(180000)});
+ if (!response.ok) throw new Error(`Provider HTTP ${response.status}; response body deliberately omitted`);
+ const data = await response.json(), candidates = data.candidates?.[0]?.content?.parts || [];
+ const payload = candidates.map(p => p.inlineData || p.inline_data).find(p => p && (kind === 'speech' ? p.mimeType?.startsWith('audio/') : p.mimeType?.startsWith('image/')));
+ if (!payload?.data) throw new Error('No native media payload returned; inspect request receipt/provider history');
+ let bytes = Buffer.from(payload.data, 'base64');
+ if (kind === 'speech') {
+ if (!/\.wav$/i.test(output) || !/^audio\/(?:L16|pcm)/i.test(payload.mimeType)) throw new Error('Expected PCM audio and .wav destination');
+ const rate = Number(payload.mimeType.match(/rate=(\d+)/)?.[1] || 24000); bytes = wav(bytes, rate);
+ } else if (!(payload.mimeType === 'image/png' && /\.png$/i.test(output) || payload.mimeType === 'image/jpeg' && /\.jpe?g$/i.test(output))) throw new Error(`Output extension must match native ${payload.mimeType}`);
+ fs.writeFileSync(output, bytes, {flag: 'wx'}); Object.assign(record, {status: 'complete', output, sha256: crypto.createHash('sha256').update(bytes).digest('hex')});
+ } catch (e) { record.status = 'failed_or_unknown'; record.error = e.message; throw e; }
+ finally { fs.writeFileSync(receipt, JSON.stringify(record, null, 2)); }
+ console.log(JSON.stringify({output, receipt}));
+}
+main().catch(e => { console.error(e.message); process.exitCode = 1; });
diff --git a/skills/directing-stickman-videos/tests/runtime.test.mjs b/skills/directing-stickman-videos/tests/runtime.test.mjs
new file mode 100644
index 0000000..9d7a7f8
--- /dev/null
+++ b/skills/directing-stickman-videos/tests/runtime.test.mjs
@@ -0,0 +1,78 @@
+import test from 'node:test';
+import assert from 'node:assert/strict';
+import fs from 'node:fs';
+import os from 'node:os';
+import path from 'node:path';
+import {spawnSync} from 'node:child_process';
+import {ROOT, FFMPEG, run, save, loadProject, groupWords, hashFile, probe, designPlane} from '../scripts/autopilot-core.mjs';
+import {keyState, render, painter} from '../scripts/autopilot-render.mjs';
+
+const cli = path.join(ROOT, 'scripts/autopilot.mjs');
+const command = args => spawnSync(process.execPath, [cli, ...args], {encoding: 'utf8', timeout: 120000});
+function fixture(t) {
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'stickman-runtime-test-'));
+ // Each test owns this exact temporary directory, never a user project.
+ t.after(() => fs.rmSync(dir, {recursive: true, force: true}));
+ run(FFMPEG, ['-v', 'error', '-f', 'lavfi', '-i', 'sine=frequency=310:duration=0.85', '-y', path.join(dir, 'voice.wav')]);
+ const project = {version: 1, style: 'B1', width: 640, height: 360, fps: 12, voice: {path: 'voice.wav'}, captions: [{start: 0.1, end: 0.7, text: 'Offline test.'}], shots: [{start: 0, end: 0.4, layers: [{type: 'text', text: 'A GOOD IDEA', x: 80, y: 110, size: 60, bold: true}, {type: 'image', path: '@b1/idea-bulb-crayon.png', x: 400, y: 280, w: 180, keys: [{t: 0, x: 400}, {t: 0.3, x: 450}]}]}, {start: 0.4, end: 0.85, layers: [{type: 'pose', pose: 1, x: 650, y: 40, w: 400}, {type: 'text', text: 'BECOMES A VIDEO.', x: 60, y: 200, w: 550, size: 54}]}], sfx: [{time: 0.2, kind: 'tap', gain: 0.02}]};
+ const file = path.join(dir, 'project.json'); save(file, project);
+ return {dir, project, file};
+}
+test('doctor checks local dependencies without network or revealing keys', () => {
+ const r = command(['doctor']); assert.equal(r.status, 0, r.stderr); const data = JSON.parse(r.stdout); assert.equal(data.network_checked, false); assert.ok(data.checks.fonts);
+});
+test('aligned words are grouped without invented word timings', () => {
+ const words = {words: [{start: 0.2, end: 0.5, word: 'Hello'}, {start: 0.6, end: 1, word: 'world.'}, {start: 1.7, end: 2, word: 'Next.'}]};
+ assert.deepEqual(groupWords(words, 0.1), [{start: 0.30000000000000004, end: 1.1, text: 'Hello world.'}, {start: 1.8, end: 2.1, text: 'Next.'}]);
+ assert.throws(() => groupWords({words: [{start: 1, end: 0.5, word: 'bad'}]}));
+});
+test('keyframes interpolate locally and hold before/after endpoints', () => {
+ const l = {keys: [{t: 0, x: 10}, {t: 1, x: 30}]}; assert.equal(keyState(l, 0.5).x, 20); assert.equal(keyState(l, 2).x, 30);
+});
+test('portrait uses a taller design plane without stretching local shapes', async t => {
+ const f = fixture(t); f.project.width = 360; f.project.height = 640; f.project.grid = false;
+ f.project.shots[0].layers = [{type: 'line', points: [[0, 0], [200, 0], [200, 200], [0, 200], [0, 0]], x: 100, y: 200, lineWidth: 4}];
+ save(f.file, f.project); const p = loadProject(f.file), plane = designPlane(p);
+ assert.equal(plane.width, 1280); assert.ok(plane.height > 2200);
+ const draw = await painter(p), pixels = draw(0.02).getContext('2d').getImageData(0, 0, 360, 640).data;
+ let x0 = 360, y0 = 640, x1 = 0, y1 = 0;
+ for (let y = 0; y < 180; y++) for (let x = 0; x < 160; x++) if (pixels[(y * 360 + x) * 4] < 100) { x0 = Math.min(x0, x); x1 = Math.max(x1, x); y0 = Math.min(y0, y); y1 = Math.max(y1, y); }
+ assert.ok(x1 > x0); assert.ok(Math.abs((x1 - x0) - (y1 - y0)) <= 1, 'A square must stay square in portrait');
+});
+test('validation rejects speech stretching, external paths and timeline gaps', t => {
+ const f = fixture(t); assert.ok(loadProject(f.file).voiceDuration > 0.8);
+ f.project.voice.speed = 0.7; save(f.file, f.project); assert.throws(() => loadProject(f.file), /speech speed/); delete f.project.voice.speed;
+ f.project.voice.path = 'https://example.com/voice.wav'; save(f.file, f.project); assert.throws(() => loadProject(f.file), /local path/); f.project.voice.path = 'voice.wav';
+ f.project.shots[1].start = 0.45; save(f.file, f.project); assert.throws(() => loadProject(f.file), /gap\/overlap/);
+});
+test('render is resumable, produces captioned A/V and requires exact preview approval', async t => {
+ const f = fixture(t), source = hashFile(path.join(f.dir, 'voice.wav'));
+ let r = command(['render', f.file]); assert.notEqual(r.status, 0); assert.match(r.stderr, /user-approved/);
+ const p = loadProject(f.file), first = await render(p), second = await render(p, {replace: true});
+ assert.equal(second.cache_hits, 2); assert.equal(first.frames, Math.ceil(0.85 * 12)); assert.equal(hashFile(path.join(f.dir, 'voice.wav')), source);
+ const info = probe(first.output); assert.ok(info.streams.some(s => s.codec_type === 'audio')); assert.ok(info.streams.some(s => s.codec_type === 'video')); assert.equal(Number(info.streams.find(s => s.codec_type === 'video').nb_frames), first.frames);
+ assert.ok(fs.existsSync(path.join(f.dir, 'output/preview.srt'))); assert.ok(fs.existsSync(path.join(f.dir, 'output/preview-contact-sheet.png')));
+ r = command(['approve', f.file, '--note', 'Synthetic engineering fixture approval only; not a real user video']); assert.equal(r.status, 0, r.stderr);
+ r = command(['render', f.file]); assert.equal(r.status, 0, r.stderr);
+ f.project.shots[0].layers[0].text = 'CHANGED'; save(f.file, f.project);
+ r = command(['render', f.file]); assert.notEqual(r.status, 0); assert.match(r.stderr, /invalidated/);
+});
+test('caption overflow fails rather than silently clipping', async t => {
+ const f = fixture(t); f.project.captions[0].text = 'A very long caption phrase. '.repeat(8); save(f.file, f.project);
+ const r = command(['validate', f.file]); assert.notEqual(r.status, 0); assert.match(r.stderr, /two lines/);
+});
+test('output symlink cannot redirect writes to another directory', async t => {
+ const f = fixture(t); fs.symlinkSync(os.tmpdir(), path.join(f.dir, 'output'), 'dir'); await assert.rejects(render(loadProject(f.file)), /real project-local/);
+});
+test('nested cache symlink cannot redirect renderer-owned writes', async t => {
+ const f = fixture(t), external = path.join(f.dir, 'keep');
+ fs.mkdirSync(external); fs.mkdirSync(path.join(f.dir, 'output'));
+ fs.writeFileSync(path.join(external, 'sentinel'), 'unchanged');
+ fs.symlinkSync(external, path.join(f.dir, 'output/cache'), 'dir');
+ await assert.rejects(render(loadProject(f.file)), /must not contain symlinks/);
+ assert.equal(fs.readFileSync(path.join(external, 'sentinel'), 'utf8'), 'unchanged');
+ assert.deepEqual(fs.readdirSync(external), ['sentinel']);
+});
+test('media adapter cannot generate without network opt-in', () => {
+ const r = spawnSync(process.execPath, [path.join(ROOT, 'scripts/gemini-media.mjs'), 'speech'], {encoding: 'utf8'}); assert.notEqual(r.status, 0); assert.match(r.stderr, /Network disabled/);
+});
diff --git a/tests/verify-chinese-onboarding.py b/tests/verify-chinese-onboarding.py
index 011da1d..18a2d22 100644
--- a/tests/verify-chinese-onboarding.py
+++ b/tests/verify-chinese-onboarding.py
@@ -1,92 +1,76 @@
#!/usr/bin/env python3
-"""Check Chinese-only onboarding, section layout, and preview budgets."""
+"""Protect the approved Chinese A/B layout, working links and B1 showcase."""
from pathlib import Path
+import hashlib
import re
import struct
root = Path(__file__).resolve().parents[1]
cn = (root / "README.zh-CN.md").read_text()
-assert (root / "README.md").read_text() == (root / "README.en.md").read_text()
-assert "# AI 火柴人动画画风大全" in cn
-assert "## 你的作品,也可以成为下一个案例" not in cn
-assert "## 下一种火柴人,你来点" in cn
-community = cn.split("## 下一种火柴人,你来点", 1)[1].split("## Star 增长曲线", 1)[0]
-assert community.count("[Issues]") == 1, "Use one combined community entry"
-assert community.index("想看新画风、分享作品或反馈问题") > community.index("风格 9")
-assert "## 从文案到视频,五步走" not in cn
-assert "## 你会拿到什么" not in cn
-assert "## 它帮你做什么" in cn and "## 开始使用" in cn
-install = cn.split("### 1. 安装 Skill", 1)[1].split("<!-- readme:workflow -->", 1)[0]
-assert "帮我安装这个 Skill:\nhttps://github.com/kaomei/stickman-video-director" in install
-assert len(install.strip()) < 130, "Keep the installation entry short"
-for unnecessary in ("$skill-installer", "重启", "官方安装说明", "<details>", "WorkBuddy", "git clone", "references"):
- assert unnecessary not in install, unnecessary
-topic = cn.split("### 2. 给一个话题", 1)[1].split("### 3.", 1)[0]
-assert "把话题、文案或文章直接发给 AI" in topic
-assert "帮我做一个《人类的第一份工作是怎么来的?》的火柴人视频。" in topic
-for preset in ("$directing", "16:9", "美式男声", "先给我导演提案", "想换个画风"):
- assert preset not in topic, "Topic entry must not require a prefilled production request"
-assert "### 3. 跟着引导,确认提案" in cn
-assert "Skill 会主动询问;时长可指定,默认 60 秒" in cn
-assert "你确认后,它才输出最终分段提示词" in cn
-guided_demo = cn.split("### 3. 跟着引导,确认提案", 1)[1].split("### 4.", 1)[0]
-for required in ("《人类的第一份工作是怎么来的?》", "横屏 16:9", "风格 3 史前黑色幽默", "制作前确认的分镜提案", "| 时间 | 画面与动作 | 配音文案 |"):
- assert required in guided_demo, required
-storyboard_rows = re.findall(r"^\| \*\*(?:0–10|10–20|20–30)s:.*$", guided_demo, re.MULTILINE)
-assert len(storyboard_rows) == 3, "Show three concise ten-second storyboard rows"
-assert all(row.count("|") == 4 for row in storyboard_rows)
+assert (root / "README.md").read_bytes() == (root / "README.en.md").read_bytes()
+assert "# 火柴人动画画风库" in cn
+assert "[**简体中文**](README.zh-CN.md)" in cn
+assert "自动制作带配音、字幕与微动画的完整视频" in cn
+assert "汇总全网热门的火柴人画风,持续更新与开源" in cn
+assert "本系列持续更新,欢迎点个 Star,更多热门画风陆续上线。" in cn
+assert "想做不露脸的 YouTube 频道,探索内容变现?" in cn
+assert "我是烤妹儿,专注不出镜视频与自动化工作流" in cn
+
+sections = ("## 你想怎么做?", "## 开始使用", "## A · 导演模式画风一览",
+ "## B · 自动成片画风一览", "## 使用小贴士", "## 最近更新")
+assert [cn.index(s) for s in sections] == sorted(cn.index(s) for s in sections)
+assert "一次安装,按需选择" in cn
+assert "不需要另装第二个 Skill" in cn
+assert "**10 分钟及以上**" in cn and "连续故事短剧" in cn
+assert "Codex、Claude Code" in cn and "Google Flow" in cn
+assert "A、B 画风独立编号、分别展示,不共用画面" in cn
+assert "给故事脚本和风格 → 检查配音和生图配置 → 确认 20s 样片效果 → 自动制作长视频 → 拿到完整成片" in cn
+for label in ("A1:经典黑白", "A2:现代潮酷风", "A3:史前手绘 / 黑色幽默",
+ "A4:治愈故事风", "A5:历史卡通风", "B1:极简手绘风", "B2:待更新…"):
+ assert label in cn, label
+for variant in ("A1.1", "A1.2", "A2.1", "A2.2"):
+ assert variant in cn, variant
+
+storyboard = cn.split('<a id="storyboard-example"></a>', 1)[1].split("</details>", 1)[0]
+assert "<details>" in storyboard and "<summary>" in storyboard
approved_voiceover = (
"Ten thousand years ago, one man finally solved all his problems. He shut them outside.",
"Then someone offered him food… in exchange for a small favor. Congratulations. Employment was invented.",
"The reward got smaller. The workload got bigger. And somehow… they called that progress.",
)
-for row, voiceover in zip(storyboard_rows, approved_voiceover):
- assert voiceover in row, "Preserve the approved sample narration verbatim"
-for removed in ("简化对话示意", "> **AI", "> **你", "首段英文旁白", "中文参考", "搬石头", "下面按已有样片整理", "洞口能挡住野兽", "英文配音"):
- assert removed not in guided_demo, removed
-assert guided_demo.index("选好设置") < guided_demo.index("| 时间 |") < guided_demo.index("你确认后,它才输出最终分段提示词")
-assert "### 4. 生成视频,剪辑成片" in cn
-assert "## 最近更新" in cn and "CHANGELOG.zh-CN.md" in cn
-assert "## Star 增长曲线" in cn and "[MIT License](LICENSE)" in cn
+for voiceover in approved_voiceover:
+ rows = [line for line in storyboard.splitlines() if voiceover in line]
+ assert len(rows) == 1 and rows[0].count("|") == 4
+assert cn.index('<a id="storyboard-example">') < cn.index('<a id="autopilot-start">')
+
assert cn.count("<details>") == cn.count("</details>")
assert cn.count('<div align="center">') == cn.count("</div>")
-
-for removed in ("样片同款主题,直接试", "example-overthinking", "展开看已有导演预案节选", "你给的内容:"):
- assert removed not in cn, "Removed example must not leave text or dangling links"
-assert (root / "skills/directing-stickman-videos/references/examples.md").exists()
-tips = cn.split("## 使用小贴士", 1)[1].split("## 最近更新", 1)[0]
-assert "<details>" not in tips and "<summary>" not in tips
-assert tips.index("**选横屏还是竖屏?**") < tips.index("| 比例 | 适合平台 | 构图重点 |") < tips.index("- 人物、道具和旁白设定")
-
+assert cn.count("<table") == cn.count("</table>")
+assert cn.count("<td ") == cn.count("</td>")
+ids = re.findall(r'<a id="([^"]+)"></a>', cn)
+assert len(ids) == len(set(ids)), "Duplicate explicit anchors"
+for anchor in re.findall(r'\]\(#([^)]+)\)|href="#([^"]+)"', cn):
+ assert next(part for part in anchor if part) in ids, anchor
for link in re.findall(r"\]\(([^)]+)\)", cn):
if "://" not in link and not link.startswith("#"):
- assert (root / link.split("#")[0]).exists(), link
+ assert (root / link.split("#")[0]).is_file(), link
previews = sorted(set(re.findall(r'src="https://cdn\.jsdelivr\.net/gh/kaomei/stickman-video-director@[0-9a-f]{40}/(assets/readme/previews/[^" ]+\.gif)"', cn)))
-assert len(previews) == 11
-old_bytes = new_bytes = 0
-for preview in previews:
- optimized = root / preview
- assert optimized.exists()
- header = optimized.read_bytes()[:10]
+assert len(previews) == 11, "Keep all existing lightweight A previews"
+for preview in previews + ["assets/readme/previews/b1-minimal-handdrawn.gif"]:
+ file = root / preview
+ header = file.read_bytes()[:10]
assert header[:6] in (b"GIF87a", b"GIF89a")
- if optimized.name.startswith("style-5-"):
- is_hero = optimized.name == "style-5-japan-hero.gif"
- expected_size = (640, 360) if is_hero else (400, 225)
- assert struct.unpack("<HH", header[6:10]) == expected_size
- assert optimized.stat().st_size < (4_000_000 if is_hero else 2_000_000)
- source_name = optimized.stem.replace("-hero", "") + ".mp4"
- assert (root / "assets/readme" / source_name).exists()
- continue
- original = root / "assets/readme" / optimized.name
- assert struct.unpack("<HH", header[6:10]) == (400, 225)
- assert optimized.stat().st_size < original.stat().st_size
- old_bytes += original.stat().st_size
- new_bytes += optimized.stat().st_size
-assert new_bytes < old_bytes * 0.6, "Preview total should shrink by at least 40%"
-
-for lang in ("en", "ja", "ko", "pt-BR", "tr", "id"):
- text = (root / f"README.{lang}.md").read_text()
- assert "assets/readme/previews/" in text, "Localized pages use the same lightweight previews"
-
-print(f"Chinese onboarding passed; previews {old_bytes:,} -> {new_bytes:,} bytes ({1-new_bytes/old_bytes:.1%} smaller).")
+ width, height = struct.unpack("<HH", header[6:10])
+ assert width <= 640 and height <= 360
+ assert file.stat().st_size < 4_000_000
+assert "[▶ 播放有声样片](assets/readme/b1-minimal-handdrawn.mp4)" in cn
+assert re.search(r"\]\(https://cdn\.jsdelivr\.net/gh/kaomei/stickman-video-director@[0-9a-f]{40}/assets/readme/previews/b1-minimal-handdrawn\.gif\)", cn), "Use the working, immutable CDN preview route for B1 too"
+sample = root / "assets/readme/b1-minimal-handdrawn.mp4"
+assert hashlib.sha256(sample.read_bytes()).hexdigest() == "9d2a1789eec25ad3b825631ee3d1ea3cb7417aafb0a5c223ccce08434cedcc3a", "Publish the approved V15, not the runtime fixture"
+assert "https://github.com/leksautomate" in cn
+assert "api.star-history.com/svg" in cn
+license_targets = {"LICENSE", "https://github.com/kaomei/stickman-video-director/blob/main/LICENSE"}
+assert any("MIT" in label and target in license_targets
+ for label, target in re.findall(r"\[([^\]]+)\]\(([^)]+)\)", cn)), "Link the repository's MIT license"
+print("Chinese A/B layout, approved narration/CTA, links and exact B1 V15 showcase passed.")
diff --git a/tests/verify-localized-readmes.py b/tests/verify-localized-readmes.py
index 751bfe8..0b32737 100644
--- a/tests/verify-localized-readmes.py
+++ b/tests/verify-localized-readmes.py
@@ -51,7 +51,7 @@ for path in root.glob("README*.md"):
f"[{'**' + label + '**' if locale == active else label}](README.{locale}.md)"
for locale, label in navigation
)
- assert text.splitlines()[4] == expected_nav, (path.name, "navigation order/active language")
+ assert expected_nav in text, (path.name, "navigation order/active language")
assert text.count("[**") == 1, (path.name, "one active language")
common_links = (
"https://github.com/kaomei/stickman-video-director",
diff --git a/tests/verify-readmes.sh b/tests/verify-readmes.sh
index efab39e..b3413db 100755
--- a/tests/verify-readmes.sh
+++ b/tests/verify-readmes.sh
@@ -92,6 +92,12 @@ for readme in "${readmes[@]}"; do
exit 1
}
+ # Chinese uses the approved two-mode layout; other locales stay unchanged.
+ if [[ "$readme" == README.zh-CN.md ]]; then
+ python3 "$readme_root/tests/verify-chinese-onboarding.py"
+ continue
+ fi
+
for marker in "${section_markers[@]}"; do
rg -Fq "$marker" "$readme_path" || {
printf '%s missing section marker: %s\n' "$readme" "$marker" >&2