animate
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAnimate
Animate
You make short animated videos in code: one , drawn and scored procedurally, deterministic frame by frame, rendered with a headless browser and ffmpeg. The story follows a grammar studied from strong short-form animation; the look is a style — a plug-in kit chosen from styles/ or made from the user's references with new-style.md.
<canvas>Requirements: Node 18+, Playwright with Chromium (), ffmpeg on PATH. Check them first; if one is missing, tell the user the install command and stop. For a voice-over, Python with () times every word; without it the word times are estimated.
npm i -g playwright && npx playwright install chromiumfaster-whisperpip install faster-whisperAll paths below are relative to this skill's base directory. Pieces live in the user's project at (create if needed); styles the user makes live in .
pieces/<name>/pieces/<project>/styles/<name>/你可以用代码制作短动画视频:单个元素,通过程序化方式绘制画面与配乐,逐帧生成确定性结果,通过无头浏览器和ffmpeg渲染输出。故事遵循从优质短动画中总结的叙事语法;视觉效果由风格套件决定——你可以从styles/目录中选择预设的插件式风格套件,也可以根据用户的参考图按照new-style.md的说明创建新风格。
<canvas>环境要求: Node 18+、安装了Chromium的Playwright()、PATH中配置了ffmpeg。请先检查环境;如果缺少依赖,请告知用户安装命令并终止流程。如果需要旁白,需要安装带的Python环境()来逐词计时;没有的话则会估算词的时间点。
npm i -g playwright && npx playwright install chromiumfaster-whisperpip install faster-whisper以下所有路径均相对于本技能的根目录。动画项目存放在用户项目的目录下(如需要请创建目录);用户创建的风格存放在目录下。
pieces/<name>/pieces/<project>/styles/<name>/Non-negotiables
硬性规则
- No animating before the storyboard is approved. The check-ins exist because a wrong story or look costs a full build.
- Look at references before drawing anything — the user's, or the style's and demo. Then check every key frame against grammar/FRAME.md and the style's own checklist in its
sample.png.STYLE.md - Every factual claim on screen is checked with a web search and listed with its source in the brief. Never claim "first" without a source.
- Single file, all code: one ; everything is drawn and synthesized in code — no image/audio/video files, no
index.htmlURIs, no URLs, no web fonts in the code.data:enforces it. Two opt-in exceptions, both the user's own: assets (screenshots and logos intools/build.mjs, embedded by the build) and a music track (joined at export). See Assets and Music below.<piece>/assets/ - Deterministic: seeded randomness only (), the boil index
RNG(...)for per-step variation. NeverBor wall-clock time.Math.random() - Reference media stays local. Never commit it, copy its code, or name its artist in published output unless the user asks to credit them.
- "Done" is measured: passes and you have looked at the contact sheets. Report the numbers, not "looks good".
tools/review.mjs - Ask with options. Use AskUserQuestion with a recommended default first, so the user can answer in one click.
- 分镜未通过审批前不得开始动画制作。 设置确认环节是因为故事或视觉风格出错会导致整个构建工作白费。
- 绘制任何内容前先查看参考资料——可以是用户提供的参考,或是对应风格的和演示示例。然后对照grammar/FRAME.md以及该风格
sample.png中的检查清单,逐一检查每个关键帧。STYLE.md - 屏幕上的所有事实性表述都必须通过网络搜索验证,并在需求说明中列出来源。没有来源的情况下绝对不能声称“首个”“第一”。
- 单文件、纯代码: 仅一个文件;所有画面和音效都通过代码绘制与合成——代码中不得包含图片/音频/视频文件、
index.htmlURI、外部URL、网页字体。data:会强制执行此规则。有两个可选的例外,且都必须是用户自有内容:资源文件(assets)(存放在tools/build.mjs中的截图和logo,构建时会嵌入)和音乐轨道(导出时合并)。详见下文的资源与音乐部分。<piece>/assets/ - 确定性: 仅使用带种子的随机数(),通过波动指数
RNG(...)实现逐步骤变化。绝对不能使用B或系统时间。Math.random() - 参考媒体仅保存在本地。 除非用户要求署名,否则不得提交参考内容、复制其代码,或是在公开输出中提及原作者。
- “完成”需量化验证: 必须通过检查,且你已查看过联系表。要汇报具体数据,而不是“看起来不错”。
tools/review.mjs - 提问时提供选项。 使用AskUserQuestion时优先给出推荐的默认选项,这样用户可以一键回答。
The flow
工作流程
0. Intake
0. 需求收集
Ask the questions in intake.md — only the ones you can't infer. For the look, build the gallery (, ~3s), show it and ask: which of these, or show me a reference? Then study the references yourself against FRAME.md and the style's checklist.
node tools/gallery.mjs <out.png> [<project>/styles]提出intake.md中的问题——只问你无法推断的问题。关于视觉风格,先生成风格画廊(命令:,耗时约3秒),展示给用户并询问:选择其中一种,还是提供参考图? 然后你需要对照FRAME.md和对应风格的检查清单,仔细研究参考资料。
node tools/gallery.mjs <out.png> [<project>/styles]1. Story check (text, fast)
1. 故事确认(文本形式,快速完成)
Pick the format from grammar/FORMATS.md — the plot engine decides it (a history is a chronology joined by morphs; a mission cuts on the beat; a list is a catalogue). Read grammar/STORY.md. Web-check the facts. Then show the user:
- the one-line idea and the sayable device ("the spark gains a ray each era and ends as the answer")
- the format and why, the style, length, BPM
- a numbered beat table: time, what happens, the bridge into the next beat, the sound's role (where the silence is, where the loudest hit is)
Ask: approve / change beats / different angle. Revise until approved. This is where "I meant X, not Y" gets caught cheaply.
从grammar/FORMATS.md中选择叙事格式——由剧情引擎决定(历史类是通过变形衔接的时间线;任务类是按节拍切换;列表类是目录式呈现)。请先阅读grammar/STORY.md。通过网络核查事实。然后向用户展示:
- 一句话创意和核心叙事手法(例如“火花在每个时代获得一道光芒,最终化作答案”)
- 选择的叙事格式及理由、视觉风格、时长、BPM
- 带编号的节拍表:包含时间点、事件、到下一个节拍的过渡方式、音效的作用(静默位置、最强重拍位置)
询问用户:确认通过 / 修改节拍 / 换个角度。 反复修改直到获得批准。这个阶段能以最低成本发现“我要的是X不是Y”这类理解偏差。
2. Look check (2–4 style frames)
2. 视觉风格确认(2-4张风格帧)
Start the piece at : copy and from the style's demo () — it already speaks the style's kit and joins eras with a morph — or from templates/beat-cut/ for a piece that cuts hard on the beat (8ths, a 16th-note rush on odd frames, one era per shot, framings from cameras), or templates/piece/ for the plainest cut-paper morph. Set in , then write and fresh (the template's are placeholders).
pieces/<name>/piece.jsonsrc/styles/<name>/demo/"style"piece.jsonbrief.mdLOG.md- A shipped style: read its and demo and draw with its kit.
STYLE.md - The user's references: follow new-style.md. Measure the references first (); the piece's own style frames are the matched frames, so this is one check-in: the compare sheets and the frames together. Save the style folder after the piece is approved (the piece becomes its "proven on").
tools/measure/refs.mjs
Draw 2–4 of the most different beats as full-size frames. Each must pass FRAME.md and the style's checklist. Render them side by side with (or with set to those beats), and show the image. Ask: thumbs up per frame / change the look / try another style.
node tools/still.mjs pieces/<name> 2.25,9.75,16.5 look.png --scale 0.5tools/storyboard.mjsTIMELINE.board在目录下创建动画项目:从对应风格的演示目录()复制和目录——演示项目已经适配了该风格的套件,并且用变形效果衔接不同时代——如果是按节拍硬切的项目(八分节拍,奇数帧有十六分音符快切效果,每个镜头对应一个时代,采用相机取景),则从templates/beat-cut/复制;如果是最简单的剪纸变形项目,则从templates/piece/复制。在中设置字段,然后重新编写和(模板中的内容只是占位符)。
pieces/<name>/styles/<name>/demo/piece.jsonsrc/piece.json"style"brief.mdLOG.md- 内置风格: 阅读其和演示示例,使用对应的套件进行绘制。
STYLE.md - 用户提供的参考图: 遵循new-style.md的说明。首先测量参考图(使用);项目的风格帧本身就是匹配后的帧,因此这是一次确认:同时展示对比表和风格帧。项目获批后保存风格文件夹(该项目将成为此风格的“验证案例”)。
tools/measure/refs.mjs
选择2-4个差异最大的节拍,绘制为全尺寸帧。每个帧都必须通过FRAME.md和风格检查清单的要求。使用命令将它们并排渲染(或者使用,将设置为这些节拍),然后展示图片。询问用户:逐帧点赞确认 / 修改视觉风格 / 尝试其他风格。
node tools/still.mjs pieces/<name> 2.25,9.75,16.5 look.png --scale 0.5tools/storyboard.mjsTIMELINE.board3. Storyboard check (every beat)
3. 分镜确认(覆盖所有节拍)
Draw every beat in the approved look. Fill with one key time per beat () and render the board. Ask for thumbs up/down by panel number and notes; redraw what's down; repeat. The panels are the video's own scene functions, so nothing is redrawn later.
TIMELINE.board{ t, title, sound, next }使用已确认的视觉风格绘制所有节拍的画面。在中为每个节拍填写一个关键时间点(格式为),然后渲染分镜。请用户按面板编号点赞/点踩并给出备注;重画未通过的面板;重复此过程直到全部通过。这些面板就是视频本身的场景函数,因此后续无需重画任何内容。
TIMELINE.board{ t, title, sound, next }4. Build
4. 构建
- Write (spec, style, beats, bridges, sound plan, claims + sources). Keep a
pieces/<name>/brief.md.LOG.md - Animate the scenes: timed actions with ,
TT,ev(t, d), write-ons (see craft.md → Motion). Wire eras, cameras and bridges inpopS(t)(morph-joined formats) or leavesrc/bridges.jsfor hard cuts.BRIDGES = [] - →
node tools/build.mjs pieces/<name>(the style's kit is pulled in fromindex.htmlpiece.json)."style" - Test tiles while building: — look at them; tile across every morph and cut.
node tools/tile.mjs pieces/<name> tile.png <frames...> - Score in (see craft.md → Sound).
src/score.js - → frames,
node tools/export.mjs pieces/<name> --share, stems,audio.wav,renders/final.mp4(renders/share.mp4for every format;--formats 9:16,1:1,16:9for motion blur on 1s styles). Iterate the mix with--blur 4(re-renders the score and remuxes it, ~4× faster).--only-audio - → contact sheets per shot, cut grid, morph grid, story arc, anchor, text (cut off / overlapping / under the phone UI) and sound (the loudest moment, the silence before it, LUFS). Fix until it passes, view the sheets, write a per-shot PASS table in
node tools/review.mjs pieces/<name>. Trust the text check over your eye: a cropped label looks fine on a contact sheet.LOG.md
- 编写(包含规格、风格、节拍、过渡、音效方案、事实声明+来源)。维护
pieces/<name>/brief.md日志。LOG.md - 制作场景动画:使用、
TT、ev(t, d)、手写出现效果等实现定时动作(参见craft.md → 动效部分)。在popS(t)中连接不同时代、相机和过渡效果(变形衔接格式),如果是硬切则设置src/bridges.js。BRIDGES = [] - 执行→ 生成
node tools/build.mjs pieces/<name>(风格套件会从index.html的piece.json字段引入)。"style" - 构建过程中测试拼接图:执行——查看拼接效果;每个变形和切分处都要生成拼接图检查。
node tools/tile.mjs pieces/<name> tile.png <frames...> - 在中编写配乐(参见craft.md → 音效部分)。
src/score.js - 执行→ 生成帧序列、
node tools/export.mjs pieces/<name> --share、分轨文件、audio.wav、renders/final.mp4(添加renders/share.mp4可导出所有比例的版本;添加--formats 9:16,1:1,16:9可为1帧风格添加运动模糊)。使用--blur 4迭代调整混音(仅重新渲染配乐并重新封装,速度约为原来的4倍)。--only-audio - 执行→ 生成每个镜头的联系表、切分网格、变形网格、故事弧线、锚点、文本检查(是否被截断/重叠/被手机UI遮挡)和音效检查(最响时刻、之前的静默、LUFS响度)。修复问题直到通过检查,查看联系表,在
node tools/review.mjs pieces/<name>中编写每个镜头的PASS表格。要相信文本检查结果而不是肉眼:被裁剪的标签在联系表上可能看起来没问题。LOG.md
5. Deliver
5. 交付
Send . Say in a few lines: what it is, the checks' numbers, what the review caught and fixed, the weakest shot, and what you haven't verified (e.g. you can't listen to the score). Ask what should change: story, look, transitions, pacing, sound.
renders/share.mp4发送。用几句话说明:这是什么内容、检查的各项数据、审核中发现并修复的问题、最薄弱的镜头,以及你未验证的内容(例如你无法收听配乐)。询问用户需要修改什么:故事、视觉风格、过渡、节奏、音效。
renders/share.mp46. Learn
6. 复盘总结
After each run append to the piece's . If something new went wrong or worked, propose a one-line rule for craft.md, the style's or a kit change, and add it when the user agrees.
LOG.mdSTYLE.md每次运行后,向项目的追加内容。如果出现了新的问题或有效的新方法,为craft.md、对应风格的或套件修改提议一条单行规则,经用户同意后添加。
LOG.mdSTYLE.mdVoice-over (optional)
旁白(可选)
Ask at intake (question 3). With a voice, the voice is the clock: each beat starts ~0.3s after the previous sentence ends, and the big moments land on spoken words. The script is the storyboard: one line per beat.
- Write the script to :
pieces/<name>/voice/script.json. Write numbers and names the way they should be said. Keep it ≤ 3.5 words/s; give a line a longer{ "lead": 1.2, "tail": 1.8, "lines": [{ "id": "open", "text": "As it is spoken.", "after": 0.45 }, ...] }where the picture needs time to land (a count, a caption, the silence before the payoff).after - Build before the voice exists: makes a timing voice with the OS's own speech (never ship it), so the whole piece can be animated and reviewed.
node tools/voice.mjs pieces/<name> --scratch - The takes: one file per line, saved as with
voice/<id>.mp3set on the line."file"- The ElevenLabs connector (if the user has it: Claude's Settings → Connectors → ElevenLabs, signed in with OAuth, no API key): find 2–3 narrators that fit with its voice search, generate one line in each (one variation each, not four), let the user pick, then generate every line once with that voice and model. The generation result gives a short-lived download link per take: save each into . It costs about one credit per character; say the total before the full run. If the connector was added during the session, its tools may only appear after the app restarts.
voice/ - The user's own recording, one file per line (or cut from one take).
- Never fetch a voice from a site the user didn't point to, and never clone a voice without its owner's consent.
- The ElevenLabs connector (if the user has it: Claude's Settings → Connectors → ElevenLabs, signed in with OAuth, no API key): find 2–3 narrators that fit with its voice search, generate one line in each (one variation each, not four), let the user pick, then generate every line once with that voice and model. The generation result gives a short-lived download link per take: save each into
- →
node tools/voice.mjs pieces/<name>(the lines with their pauses) andvoice/voice.wav(every line's and word's start and end, heard in the audio by faster-whisper, locally). The build injects it asvoice.json.VOICE - In the head: is a line,
VL(id)when its n-thVW(id, word, n)starts; beats start at the previous line'sword;t1 + 0.3comes fromTIMELINE.narrationandVOICE.linesfromDURATION. Cue Writes and flashes on the words that name them. Put the payoff hit in a pause before the line that names it: a hit under speech is ducked away.VOICE.duration - :
piece.json. Export mixes the voice over the score (the score at"voice": { "file": "voice/voice.wav", "music": -12 }dB, ducked further while the voice speaks) to −14 LUFS. Review judges the story arc and the payoff window on the score alone (music; a voice is louder than any hit) and the voice with its NARRATION check.renders/audio-score.wav - Re-takes and script edits: replace a line's file (or edit its text), rerun , rebuild: scenes cued from
voice.mjsmove with it. A changed word can orphan a cue that points at it; check those beats.VOICE
在需求收集阶段询问(第3个问题)。如果使用旁白,旁白就是时间基准:每个节拍在前一句话结束后约0.3秒开始,重要时刻要落在说出的词语上。脚本就是分镜:每个节拍对应一行。
- 将脚本写入:格式为
pieces/<name>/voice/script.json。数字和名称要按照朗读的方式书写。语速保持在≤3.5词/秒;如果画面需要时间呈现(比如计数、字幕、高潮前的静默),给对应行设置更长的{ "lead": 1.2, "tail": 1.8, "lines": [{ "id": "open", "text": "As it is spoken.", "after": 0.45 }, ...] }值。after - 在旁白生成前先构建: 执行,用系统自带的语音生成临时计时旁白(绝对不能随成品交付),这样整个动画项目就可以进行动画制作和审核。
node tools/voice.mjs pieces/<name> --scratch - 录制素材: 每行对应一个文件,保存为,并在对应行设置
voice/<id>.mp3字段。"file"- ElevenLabs连接器(如果用户已配置:Claude设置 → 连接器 → ElevenLabs,通过OAuth登录,无需API密钥):用语音搜索功能找到2-3个合适的朗读者,每个生成一行样本(每个一种变体,不要四种),让用户选择,然后用选定的语音和模型一次性生成所有行。生成结果会提供每个素材的短期下载链接:将每个文件保存到目录。大约每个字符消耗1个积分;在完整生成前告知用户总消耗。如果是在会话期间添加的连接器,相关工具可能需要重启应用后才会显示。
voice/ - 用户自己的录音,每行一个文件(或从一段录音中剪切)。
- 绝对不要从用户未指定的网站获取语音,未经所有者同意绝对不要克隆语音。
- ElevenLabs连接器(如果用户已配置:Claude设置 → 连接器 → ElevenLabs,通过OAuth登录,无需API密钥):用语音搜索功能找到2-3个合适的朗读者,每个生成一行样本(每个一种变体,不要四种),让用户选择,然后用选定的语音和模型一次性生成所有行。生成结果会提供每个素材的短期下载链接:将每个文件保存到
- 执行→ 生成
node tools/voice.mjs pieces/<name>(带停顿的各行旁白)和voice/voice.wav(每行、每个词的开始和结束时间,由faster-whisper在本地识别音频得到)。构建时会将其作为voice.json注入。VOICE - 在头部代码中:对应一行旁白,
VL(id)表示第n个VW(id, word, n)开始的时间;节拍从上一行的word开始;t1 + 0.3来自TIMELINE.narration,VOICE.lines来自DURATION。在提到对应内容的词语上触发手写效果和闪烁效果。将高潮重拍放在对应台词之前的停顿中:语音下的重拍会被闪避处理,效果不佳。VOICE.duration - 在中配置:
piece.json。导出时会将旁白混合到配乐之上(配乐音量为"voice": { "file": "voice/voice.wav", "music": -12 }分贝,旁白播放时会进一步闪避),最终输出为−14 LUFS。审核会单独基于配乐判断故事弧线和高潮窗口(music;旁白话比任何重拍都响),并通过NARRATION检查来评估旁白。renders/audio-score.wav - 重录和脚本编辑: 替换某行的文件(或编辑其文本),重新运行,然后重新构建:从
voice.mjs触发的场景会随之调整。修改词语可能会导致指向它的触发点失效;请检查这些节拍。VOICE
Music: the user's own track (optional)
音乐:用户自有音轨(可选)
Ask at intake (question 6). Without a track the score is composed in code on a 120 BPM grid. With one:
- Put it in the piece: (WAV, MP3 or M4A), and in
pieces/<name>/audio/track.wav:piece.json("music": { "file": "audio/track.wav", "start": 12.0, "gain": 0, "fade": 0.5 }= where in the song the piece begins).start - →
node tools/beats.mjs pieces/<name>/audio/track.wav pieces/<name> --start 12 --dur <piece length>: the tempo, the first beat, every beat and bar, the strongest hits, the loudest moment and the drops. Passbeats.jsonif the user knows the tempo; check its "other tempos" line otherwise (double / half / two-thirds time is the usual miss).--bpm 128 - The build injects it as ; the starter head reads
BEATSandBPMfrom it, andGRID0snaps a time to the song's 8th grid. Put cuts, morphs and cues ononBeat(t). The song decides the arc: put the turn on a drop (onBeat(...)) and the payoff on its loudest hit (BEATS.quiet,BEATS.loudest), not where a composed score would have put them.BEATS.hits - The score () keeps only sound effects (
src/score.js): export replaces the music bus with the track, mixes the sfx stem on top and normalises to −14 LUFS. Review's grid usesto = 's'; its SOUND section says whether the loudest moment lands in the payoff act.TIMELINE.gridOffset - The browser preview still plays the composed score (no audio files in the page); the export has the track.
在需求收集阶段询问(第6个问题)。如果没有音轨,配乐会以120 BPM的网格在代码中合成。如果使用用户提供的音轨:
- 将音轨放入项目目录:(支持WAV、MP3或M4A格式),并在
pieces/<name>/audio/track.wav中配置:piece.json("music": { "file": "audio/track.wav", "start": 12.0, "gain": 0, "fade": 0.5 }表示动画从歌曲的哪个时间点开始)。start - 执行→ 生成
node tools/beats.mjs pieces/<name>/audio/track.wav pieces/<name> --start 12 --dur <项目时长>:包含速度、第一个节拍、每个节拍和小节、最强重拍、最响时刻和drop点。如果用户知道速度,传入beats.json;否则检查其“其他速度”行(通常容易误判为2倍/半速/三分之二速)。--bpm 128 - 构建时会将其作为注入;启动头部会从中读取
BEATS和BPM,GRID0会将时间对齐到歌曲的八分音符网格。将切分、变形和触发点都放在onBeat(t)上。歌曲决定叙事弧线: 将转折点放在drop点(onBeat(...)),将高潮放在最响的重拍上(BEATS.quiet、BEATS.loudest),而不是按照合成配乐的习惯位置放置。BEATS.hits - 配乐文件()中只保留音效(
src/score.js):导出时会用用户音轨替换音乐总线,将音效分轨混合在上面,并归一化到−14 LUFS。审核的网格使用to = 's';其SOUND部分会说明最响时刻是否落在高潮段落。TIMELINE.gridOffset - 浏览器预览仍然播放合成配乐(页面中没有音频文件);导出版本才会包含用户音轨。
Assets: real screenshots and logos (optional)
资源文件:真实截图和logo(可选)
Ask at intake (question 7) when the subject is a product. Then:
- screenshots the user's own site (a page, a section, the logo). Ask before capturing anything they don't own. Logo files they give you go in
node tools/capture.mjs <url> pieces/<name>/assets/home.png [--selector "css"] [--full] [--dark] [--hide "css"]too (PNG, SVG, JPG, WEBP).assets/ - embeds everything in
tools/build.mjsintoassets/(the piece stays one file, and the canvas stays readable by the checks);index.htmlappears once the images are decoded, and every tool waits for it.window.renderFrame - Draw them with inside the style's own framing (a torn-paper photo, an inked frame, a printed card) so they belong to the look.
drawAsset('home.png', x, y, w, h, { fit: 'cover' | 'contain', r })returns the image.asset(name) - Real product UI only: animate the real screens (crop, push in, reveal, point at them with the hero); never draw a fake screen as if it were the product. Sample brand colours from the screenshots.
当主题是产品时,在需求收集阶段询问(第7个问题)。然后:
- 执行来截取用户自有网站的截图(整个页面、某个部分、logo)。在截取他们不拥有的内容前必须先询问。用户提供的logo文件也放在
node tools/capture.mjs <url> pieces/<name>/assets/home.png [--selector "css"] [--full] [--dark] [--hide "css"]目录下(支持PNG、SVG、JPG、WEBP格式)。assets/ - 会将
tools/build.mjs中的所有内容嵌入到assets/中(项目仍然是单文件,canvas仍然可以被检查工具读取);图片解码完成后会出现index.html,所有工具都会等待它。window.renderFrame - 使用在风格自带的画框中绘制资源(比如撕纸照片、墨线框、印刷卡片),让它们融入整体视觉风格。
drawAsset('home.png', x, y, w, h, { fit: 'cover' | 'contain', r })返回图片对象。asset(name) - 仅使用真实产品UI: 用真实屏幕制作动画(裁剪、推入、揭示、用主角指向它们);绝对不要绘制假屏幕冒充产品。从截图中提取品牌色。
Formats: one piece, several shapes (optional)
格式:一个项目,多种比例(可选)
Ask at intake (question 2, multi-select). List them in (the first is the main one). The starter's head reads and sets , , and ; scenes place things with , and size them with , and choose a different arrangement with / where a shape needs it (a column of three on 9:16, a row of three on 16:9). Never crop a 9:16 render to 16:9.
piece.json"formats": ["9:16", "1:1", "16:9"]?format=WHSAFECXLX(fraction)LY(fraction)UNITPORTRAITWIDE- →
node tools/export.mjs pieces/<name> --formats 9:16,1:1,16:9 --share(main) andrenders/final.mp4for the others.final-<w>x<h>.mp4 - Review each: (and
node tools/review.mjs pieces/<name> --format 16:9/tile/still/textchecktakestoryboardtoo). The text check matters most here: a wide caption that fits 16:9 can run off 9:16.--format
在需求收集阶段询问(第2个问题,多选)。在的字段中列出(例如,第一个是主格式)。启动头部会读取参数并设置、、和;场景使用、定位元素,用设置尺寸,并在需要时通过 / 选择不同的布局(9:16下三个元素竖排,16:9下三个元素横排)。绝对不要将9:16的渲染结果裁剪成16:9。
piece.json"formats"["9:16", "1:1", "16:9"]?format=WHSAFECXLX(fraction)LY(fraction)UNITPORTRAITWIDE- 执行→ 生成
node tools/export.mjs pieces/<name> --formats 9:16,1:1,16:9 --share(主格式)和其他比例的renders/final.mp4文件。final-<w>x<h>.mp4 - 逐一审核:执行(
node tools/review.mjs pieces/<name> --format 16:9/tile/still/textcheck命令也支持storyboard参数)。这里文本检查最为重要:适合16:9的宽字幕可能会在9:16下超出屏幕。--format
Motion: springs and blur
动效:弹簧动画与模糊
- Springs ():
kit/core.jsmoves a value with a little overshoot and a settle;springMove(t0, a, b, SPRING.snappy)follows a value through many targets without a jump. Presets:springTrack([[t, v], ...])(UI),snappy(cards, camera),smooth(big type, logos),heavy(mascots). Closed-form, so frames stay deterministic. On-2s styles step them every 2 frames, as they should.playful - Motion blur: averages 4 sub-frames per frame — only for styles on 1s (
export.mjs --blur 4: math, isometric); hand-drawn looks on 2s are crisp on purpose (export warns).STYLE.ones
- 弹簧动画():
kit/core.js会让值带有一点超调然后稳定下来;springMove(t0, a, b, SPRING.snappy)可以让值在多个目标之间平滑过渡,不会跳变。预设包括:springTrack([[t, v], ...])(适用于UI)、snappy(适用于卡片、相机)、smooth(适用于大字体、logo)、heavy(适用于吉祥物)。采用闭式解,因此帧保持确定性。对于2帧风格,弹簧动画会每2帧更新一次,符合风格要求。playful - 运动模糊: 会为每帧平均4个子帧——仅适用于1帧风格(
export.mjs --blur 4:数学、等距);2帧的手绘风格故意保持清晰(导出时会发出警告)。STYLE.ones
Parallel agents (long pieces)
并行代理(长动画项目)
A 45–60s piece has 10–15 scenes; split the drawing across agents once the storyboard is approved:
- One file per section or era, owned by one agent (
src/,src/era-01.js, …). List them insrc/era-02.jspiece.json; they take the place of"scenes": [...]in the build order.src/scenes.js - The shared parts stay with you: (TIMELINE, eras, shots, cues),
src/head.html, the score, and the kit. Agents read them but never edit them; if a scene needs a kit helper, they write it in their own file under a prefixed name.src/bridges.js - Brief each agent with the approved board panel(s), the style's , the era's time range and cue names, its bridge objects (what must be in frame at the boundary), and the rules: deterministic, no new globals without the era prefix, tile its frames and look at them.
STYLE.md - joins them; you build, tile across every boundary, and run the review.
build.mjs
45-60秒的项目有10-15个场景;分镜获批后,可以将绘制工作拆分给多个代理:
- 每个部分或时代对应一个文件,由一个代理负责(
src/、src/era-01.js等)。在src/era-02.js的piece.json字段中列出这些文件;它们会在构建顺序中替代"scenes"。src/scenes.js - 共享部分由你负责: (TIMELINE、时代、镜头、触发点)、
src/head.html、配乐和套件。代理只能读取这些文件,绝对不能修改;如果某个场景需要套件辅助函数,代理要在自己的文件中以带前缀的名称编写。src/bridges.js - 向每个代理下达任务说明,内容包括已批准的分镜面板、风格的、对应时代的时间范围和触发点名称、过渡对象(边界处必须出现在画面中的内容),以及规则:必须确定性、没有时代前缀不得新增全局变量、生成帧的拼接图并检查。
STYLE.md - 会合并所有文件;你负责构建、检查每个边界的拼接图,并运行审核。
build.mjs
Files
文件说明
| path | what | read when |
|---|---|---|
| intake.md | the questions and defaults | step 0 |
| craft.md | the distilled rules: story, frame, motion, timing, sound, code, review | before step 1, and when building |
| grammar/FORMATS.md | 8 story formats (engine × stage × clock), invariants, which are proven | step 1 |
| grammar/STORY.md | beat-level story rules with evidence | step 1 |
| grammar/FRAME.md | what a single key frame must hold, in any style | steps 2–3 |
| styles/ | the styles: | steps 0, 2, building |
| new-style.md | making a new style from the user's references | step 2 |
| RNG, easing, geometry, the hand-drawn line (wobble, ink, paint, hatch, pencil, stipple, grain), cameras, time helpers | building |
| the renderer: eras, push-ins, zoom bumps, shape-morph bridges, overlays — draws through the style's STYLE hooks | building |
| the storyboard renderer | steps 2–3 |
| synth (pluck, pad, drone, bass, sub, noiseHit, sweep, riser, chime, blip), loudness stage | scoring |
| templates/ | | step 2 |
| build, tile, still, storyboard, export, review, textcheck, compare (reference vs frame), gallery, framehash (pixel-identity check), beats (a supplied track's beat map), capture (screenshots of the user's site), voice (a voice-over's lines and word times); | throughout |
| examples/history-of-ai/ | a full 60s worked example (cut paper) | when unsure how something fits |
| 路径 | 内容 | 何时阅读 |
|---|---|---|
| intake.md | 问题和默认值 | 第0步 |
| craft.md | 提炼的规则:故事、帧、动效、计时、音效、代码、审核 | 第1步之前,以及构建时 |
| grammar/FORMATS.md | 8种叙事格式(引擎×舞台×时钟)、不变量、已验证的格式 | 第1步 |
| grammar/STORY.md | 带依据的节拍级故事规则 | 第1步 |
| grammar/FRAME.md | 任意风格下单个关键帧必须满足的要求 | 第2-3步 |
| styles/ | 风格库: | 第0、2步,以及构建时 |
| new-style.md | 根据用户参考图创建新风格 | 第2步 |
| RNG、缓动、几何、手绘线条(抖动、墨水、油漆、排线、铅笔、点画、颗粒)、相机、时间辅助函数 | 构建时 |
| 渲染器:时代、推入、缩放抖动、形状变形过渡、叠加层——通过风格的STYLE钩子绘制 | 构建时 |
| 分镜渲染器 | 第2-3步 |
| 合成器(拨弦、垫音、持续低音、贝斯、超低音、噪声打击、扫频、上升音、风铃、点音)、响度阶段 | 配乐制作时 |
| templates/ | | 第2步 |
| 构建、拼接、静态帧、分镜、导出、审核、文本检查、对比(参考图vs帧)、画廊、帧哈希(像素一致性检查)、节拍(用户提供音轨的节拍图)、截图(用户网站截图)、旁白(旁白的行和词的时间); | 全程 |
| examples/history-of-ai/ | 完整的60秒示例(剪纸风格) | 不确定如何实现时 |
Honesty about what's proven
关于已验证内容的诚实说明
Formats F2 (chronology / morph chain) and F4 (mission) have each produced a piece that passed every check from the card alone; F5 (fixed-hero journey) has several. The others are documented from study but unproven — say so when you pick one. Cut paper and crosshatch have carried full pieces; riso, sketchbook, math and pixel each come from one or two finished pieces plus a demo; isometric was made from references with new-style.md and so far has only its demo; a style made from new references is new ground until it has carried a piece. WebGL motion design (ray-marched 3D, motion blur, bloom) is not a shipped style yet.
F2(时间线/变形链)和F4(任务)格式都已产出过仅靠卡片就能通过所有检查的完整项目;F5(固定主角旅程)有多个成功案例。其他格式是通过研究总结的,但尚未经过验证——选择时请告知用户这一点。剪纸和交叉墨线风格已支撑过完整项目;Riso、速写本、数学、像素风格各有一两个完成项目加一个演示;等距风格是通过new-style.md从参考图生成的,目前只有演示版本;从新参考图生成的风格在支撑完整项目之前都属于全新尝试。WebGL动态设计(光线步进3D、运动模糊、bloom效果)目前还不是内置风格。