Communitygithub.com

動畫紀錄片

用 Claude 完全透過程式碼製作一部卡通紀錄片(真實故事,3-12 分鐘,16:9),不使用任何 AI 影片模型。膠囊頭角色以程式碼繪製、分層場景搭配視差效果、文字直接繪製在場景物品上、透過旁白字詞進行硬剪輯、使用 ElevenLabs 配音,並以 Remotion 渲染。

動畫紀錄片 是什麼?

這項技能讓 Claude 化身為動畫電影製作人,完全透過程式碼(使用 Remotion 框架)來創作一部真實故事改編的卡通紀錄片。與使用 AI 影片生成模型不同,此方法能確保角色從頭到尾保持一致的外觀與動作,不會出現角色斷頭、變臉或繪製不一致的問題,並且每一幀都能在修改後重新渲染。這項技能適合以下場景:使用者想要製作動畫紀錄片、卡通風格的歷史或真實故事影片、或者明確提到「像 Spruce Goose 那樣的影片」。它支援 Node.js 18+ 環境,並透過 npm 管理依賴。工作流程包含:研究階段(建立事實來源文件)、腳本階段(撰寫配音稿)、角色設定階段(定義角色外觀與服裝)、以及最終的渲染階段。系統內建了一個完整的動畫引擎,包含角色骨架系統、場景繪製工具、攝影機與視差效果,以及嚴格的品質檢查規則,例如文字不可超出場景邊界、避免畫面閃爍、確保角色不被畫面切斷等。唯一的付費環節是使用 ElevenLabs 進行配音。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/generalizingai/claude-animated-documentary-skill/tree/HEAD/animated-documentary

在你喜歡的 AI 中提問

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

說明文件

Animated documentary in code

You (Claude) build the whole film as code: every character, set, light, sign and camera move is drawn on a canvas each frame by Remotion. No video generation model is used, so characters never get cut off, never change faces between shots, and every frame can be re-rendered after a fix. The only paid step is the voiceover.

The starter project lives next to this file in starter/. It already contains a working engine and a 12-second demo.

First run (set up once)

  1. Copy starter/ into the user's project folder (for example ./my-doc/). Work only in that copy.
  2. cd my-doc && npm install (needs Node 18+).
  3. npx remotion still src/index.ts Demo out/check.png --frame=180 and look at the image. If it shows an office with a seated character and a caption, the engine works. Show it to the user.

The engine (what is in starter/src/engine/)

  • rig.ts - the character rig drawHisto(pen, outfit, opts). Outfits: jacket/pants/shoes/shirt/tie colours, hat (fedora/cap/none), hairStyle (slick, bald, tufts, short, swept, long, swoop, mop, curly, spiky, bun, buzz, ponytail, afro, combover, quiff), stache, glasses + glassesStyle, leather, medals, build (lanky/stout/normal/slim), headShape, earrings, lashes... Opts: expr (neutral, smug, grin, happy, shock, angry, yell, worried, panic, content, stern, pout, laugh, sad, sneaky), talk 0..1, blink, look -1..1, mode (stand/stroll/sit), phase (walk cycle), lean, hand positions l/r, prop (newspaper/papers). Design box 600 x 1000, feet at y 975.
  • kit.ts - drawing helpers for sets: shape (filled + ink outline), box, rect, rrect, lin/rad gradients, soft (contact shadow), beam/glow/patch (painted light), dust, and lettering that lives ON things: board (wooden signboard), card (taped paper note), hand (painted/chalk/stamp text, auto-shrinks to fit its board), label, print. Fonts: F.sign (Londrina Solid), F.chalk (Caveat Brush), F.stamp (Special Elite), F.paper (Inter). CTX = per-shot switches the set reads (sign text, event frames).
  • types.ts - a SET is Layer[], back to front. Each layer has par (parallax depth: 0.8 far sky, 1.0 the character plane, 1.1-1.25 foreground) and either draw(pen, frame) or cast: "slotName" (where characters stand).
  • film.tsx - the compositor: spline camera, parallax, character lighting from the shot's look, light pool, vignette, bloom, grade, burned-in captions, and an audit mode that logs text touching edges/captions/characters.
  • shots.ts - buildPlan(sets, shots, total, audio, subs), camera helper P(x, y, zoom, roll), act(...) to place a character, blinkAt, and timingHelpers(timing) giving C("l03") (cut before line 3) and W("l03", "word") (the frame a word is spoken).

Study src/demo/office.ts and src/demo/street.ts before writing any set: that is the target finish.

The look (do not drift)

  • Characters: white capsule heads, no nose, small oval or line eyes, angular open mouths, thick dark-brown ink that swells on the shadow side, a hard cel shadow plus a soft gradient, a warm rim light. Same outfit in every scene.
  • Real people: recognisable by silhouette props only (hair shape, glasses, a signature jacket). Never a traced likeness. Private individuals: deliberately not a likeness.
  • Sets: painted in code, layered back to front, drawn past the frame edges (overscan) so the camera can move, painted light (window beams, lamp glows, floor patches), contact shadows where things meet the floor, rich grounded colour.
  • Text goes ON things: place names on signboards, dates on chalkboards or calendars, money and headlines on newspapers, documents on paper cards. No floating stickers, no lower-thirds.
  • Edit: hard cuts on narration words, shots 2-6 s, every shot a slow eased camera move (never a locked frame), the first 7 seconds cut fast (3-4 shots). No whooshes, no card flips, no glitch effects.

Hard rules (check every one before you deliver)

  1. Text never leaves its board and never touches a frame edge, even during camera moves. Prefer wide framings over crops of text-heavy sets. Run the audit render (below) and fix every EDGE / SUB / ACTOR line.
  2. No flicker: nothing switches on/off in a single frame. Never use Math.random() (use the seeded hh(i, s)), never step things with Math.floor(f / n). Lights ease on, counters roll, signs fade in with sm().
  3. No body problems: nobody is cut by the frame bottom mid-chest unless it is a deliberate close-up; people behind a desk sit in a cast slot BETWEEN the chair layer and the desk layer; nobody walks through furniture; nobody vanishes mid-shot; characters are never blurred.
  4. Facts: every claim in the script has a source. Real people never get invented dialogue: only verbatim, on-record quotes, and the narrator says who said it. Allegations are attributed ("according to reports in ...").
  5. Never clone a real person's voice. The narrator is a stock ElevenLabs voice the user picks.
  6. No set more than about 5 shots in a row unless it is a deliberate recurring device.
  7. Ask the user before anything that costs money, and say what it costs.

Pipeline

  1. Research. Pick a true story. Build docs/FACTS.md: every fact on its own line with its source URL and a tag: CONFIRMED / REPORTED / DENIED / UNKNOWN. Use web search; prefer primary sources.
  2. Script. Write docs/script.txt: one narration line per paragraph, blank line between them (this is what voice.py reads). About 150 words per minute. A narrator with attitude, short punchy lines, a new turn every 20-45 seconds, chapters for anything over 4 minutes, and an ending that separates what is confirmed from what is not. Show the user the script and get a yes before voicing.
  3. Cast. Define each character as an outfit in src/episode/cast.ts. Render a model sheet (a still of each character in a simple set) and get the user's approval before building scenes.
  4. Voice. The user needs an ElevenLabs account. Ask them to set the key in their own terminal (export ELEVENLABS_API_KEY=..., never paste it into chat or a file) and pick a narrator voice id. Then: python3 scripts/voice.py docs/script.txt . --voice <id> This writes public/vo/lNN.mp3 and src/episode/timing.json. Re-voice one line with --only l07. Fix pronunciation by rewriting the text (spell years and odd names out).
  5. Sets. One file per set in src/episode/sets/, exported as Layer[], registered in Episode.tsx with a look (LK(ambient, shade, keyColour, keyX, keyY, shadowPool, vignette)). Build 4-8 sets for a 4-minute film. Check each set with a still before using it.
  6. Shot plan. In src/episode/Episode.tsx, list the shots in time order: { set, a: C("l04"), from, to, ctx, cast }. Cut on words with W(line, word). Split any shot longer than ~8 s. npx tsc --noEmit -p tsconfig.json must pass.
  7. Check before rendering. One still per shot at its middle frame: npx remotion still src/index.ts Episode out/shot07.png --frame=<frame> --scale=0.5 Look at every still yourself. Fix cut-off text, heads hidden by desks, characters through furniture.
  8. Audit + render. Audit pass (fast, half size): npx remotion render src/index.ts Episode out/audit.mp4 --scale=0.5 --props='{"audit":true}' 2>&1 | grep "AUD|" Fix every reported line. Then the final: npx remotion render src/index.ts Episode out/episode.mp4
  9. Sound. Optional but recommended: a quiet music bed (about 20 dB under the voice) and a few real sound effects on key moments (a door, a stamp, a crowd). Mix with ffmpeg, keep the voice at about -14 LUFS.
  10. QA. Pull a contact sheet (ffmpeg -i out/episode.mp4 -vf fps=1/3,scale=480:-1,tile=6x6 out/sheet.jpg) and look for black frames, frozen shots, text off its board. Fix, re-render, deliver with a title that says the payoff.

Gotchas

  • F.* fonts load from Google Fonts at render time; the compositor waits for them. Renders need internet once.
  • Remotion copies public/ into a temp folder for every render: keep public/ small (voice files only).
  • Long films render faster in chunks: --frames=0-2999, --frames=3000-5999, then join with ffmpeg concat.
  • A set's draw function gets the shot-local frame f (0 at the cut). Use it for anything that moves.
  • If W(line, word) throws, the word is not in that line: check timing.json for how the voice spelled it.

相關技能