Communitygithub.com

animated-story-short

Make a ~45-60 s vertical animated story short (flat 2D cartoon characters in a colourful 3D town, ink outlines, lens blur, gliding cameras, Kokoro voiceover, word-by-word captions, synthesized music and sound effects) with three.js inside Remotion, fully on the user's own computer with free tools. Proven on "The Coin on the Doorstep" (English and Hindi, 54 s, 1080x1920). Use when the user asks to make an animated short, a cartoon short, a story short for YouTube Shorts / Reels, "use the cartoon short skill", or a Hindi version of one.

animated-story-short 是什麼?

animated-story-short is a Claude Code agent skill that make a ~45-60 s vertical animated story short (flat 2D cartoon characters in a colourful 3D town, ink outlines, lens blur, gliding cameras, Kokoro voiceover, word-by-word captions, synthesized music and sound effects) with three.js inside Remotion, fully on the user's own computer with free tools. Proven on "The Coin on the Doorstep" (English and Hindi, 54 s, 1080x1920). Use when the user asks to make an animated short, a cartoon short, a story short for YouTube Shorts / Reels, "use the cartoon short skill", or a Hindi version of one.

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/PratikMbade/animated-story-short/tree/HEAD

在你喜歡的 AI 中提問

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

說明文件

Animated story short (three.js + Remotion + Kokoro)

template/ is a complete, working project: the short The Coin on the Doorstep (13 shots, 2 characters, 54 s). Every new short starts as a copy of it. You keep the engine and rewrite the story parts.

Story, characters and voice are always the user's OWN. Never copy an existing channel's characters or scripts.

Before you start

  • Work in the user's project folder. If it has no src/videos/, copy everything in template/ into it.
  • Check Node.js 20+, Python 3.11 and ffmpeg. Install what is missing (ask first if it needs a password).
  • npm install (versions in package.json are pinned on purpose, see Gotchas).
  • Python: create .venv, then pip install -r requirements.txt. Always run Python as .venv/bin/python.
  • Default to 1080x1920, 30 fps, captions on, GPU rendering. Follow the user's request where it differs.

Pipeline

  1. Story → story/story.txt. About 110-125 words (≈50 s). Hook question in the first 2 seconds, 2 characters, ONE place, one twist at the end, short sentences. Write it so it can be staged with two people standing in one street: every extra location costs a new set. If the user gave no topic, pick one and say so.
  2. Voice → .venv/bin/python voice_words.py story/story.txt a af_heart. Writes voice/voice.wav and voice/words.json (start/end time of every word; Kokoro gives these for English). Copy voice/voice.wav to public/ only if a composition needs it; the final audio is muxed with ffmpeg.
  3. Shot plan in src/videos/<name>/story.ts (copy src/videos/coin/ to a new folder and register it in src/Root.tsx):
    • W: the cue words and their times, read from words.json.
    • TOTAL: frames = audio seconds x 30.
    • SHOTS: one per story beat, frame range, light day / golden, sunDir.
    • CAMS: per shot, keys {f, dur?, cut?, s}. Cut on big jumps, glide 18-30 f otherwise, every hold creeps in.
    • KICKS (impact shakes), DOF (lens blur per beat, focus on the eyes), XFADE, FLASH_AT.
    • Every visual reaction lands 0-3 frames BEFORE its word.
    • Keep faces in the upper half: captions own the band at 68-80 % of the height.
  4. Cast in cast.ts: outfits (Outfit), then one function per character that returns pose, expression, look direction and blink for a shot id and time. 14 expressions exist in toon.ts (Expr). Coins, bubbles, bursts and twinkles are small canvas drawings pushed as fx. Use the SAME outfit options in front and side view (dress is drawn in front view only).
  5. Set in world.ts / build.ts: the town, river and bridge are already there. Add only what the story needs (the template adds a picket fence, a broken-window decal and six hand-placed houses on the far-bank main street, x = -6..6, z = 47..76). Houses, trees and hedges are procedural; no model files are needed.
  6. Test frames before anything else. node scripts/stills.mjs out/s_ 20,300,800 0.5, then python3 scripts/sheet.py out/sheet.jpg 5 out/s_*.jpg and LOOK at the sheet. Render one frame first: if it is blank, fix that before building (see Gotchas). Check every shot: subject in frame, nobody cut off, faces lit, nothing covered by captions. Fix and repeat until clean.
  7. Captions: build captions.json from words.json (pages of 1-3 words, max ~15 letters, break at punctuation and pauses). Captions.tsx draws them; the spoken word is yellow.
  8. Sound → .venv/bin/python scripts/sound.py writes out/mix.wav: the voice, an original synthesized tune ducked under speech, and effects placed on cue words. Edit the cue list for the new story. Nothing is sampled, so nothing needs a licence. Lock picture timing before making sound.
  9. Render on the GPU: npx remotion render src/index.ts <Comp> out/video.mp4 --gl=angle --hardware-acceleration=if-possible --codec=h264 --video-bitrate=16M --concurrency=3 then mux and set loudness for YouTube: ffmpeg -y -i out/video.mp4 -i out/mix.wav -map 0:v:0 -map 1:a:0 -c:v copy -af "loudnorm=I=-14:TP=-1.5:LRA=7" -ar 48000 -c:a aac -b:a 192k -shortest -movflags +faststart output/short-1.mp4
  10. Check the result: ffmpeg -i output/short-1.mp4 -vf "blackdetect=d=0.05:pix_th=0.05,freezedetect=n=0.001:d=0.4" -af ebur128 -f null - (no black or frozen spans, about -14 LUFS), plus a contact sheet of the whole video. Tell the user plainly what you checked and that you cannot hear the audio.
  11. Deliver the mp4 and list anything that differs from what they asked.

Another language (proven for Hindi)

Keep the picture. voice_hi.py holds the translated story as phrases, each with the start time of its English phrase and the latest time it may end. It speaks each phrase with Kokoro (lang_code="h", voices hf_alpha, hf_beta, hm_omega, hm_psi), speeds a phrase up only if it overruns (cap 1.25x; shorten the wording instead of going faster), and writes voice/voice_hi.wav plus captions_hi.json. Kokoro gives no word times outside English, so caption words are spread across each phrase by length. Then: .venv/bin/python scripts/sound.py voice/voice_hi.wav out/mix_hi.wav, render with --props='{"lang":"hi"}', mux. Drop narration the picture already shows ("he shouts", "she whispers") to win time.

Gotchas (all hit while making the template)

  • Blank frame: the @react-three/postprocessing wrapper renders nothing with React 19 / R3F 9. Bridge.tsx drives postprocessing's own EffectComposer by hand inside useFrame. Keep it that way.
  • three must stay at 0.176.0: newer versions removed shadow features this engine uses.
  • 404 messages for kenney/*.glb are harmless: those models are optional.
  • A low sun behind a house row leaves every face in violet shade. Give each shot a sunDir that shines along the open street (template: SUN_DAY, SUN_GOLD).
  • A 9:16 frame is narrow: two characters must stand within ~3 m, or the camera must sit 9+ m back.
  • Characters are flat cards that always face the lens. There is no back view: when the story needs someone to look at something behind them, cut to that thing alone.
  • To hide a body behind a fence, lower the card (y) so the ground swallows the legs.
  • Devanagari captions: font Kohinoor Devanagari, no negative letter spacing.
  • ffmpeg builds without drawtext exist (Homebrew default): do not rely on burned-in frame numbers.
  • A full 54 s render takes about a minute on an Apple M3 with the GPU.

Credits

The engine (world, characters, ink, lens blur, grade) comes from the MIT-licensed "Claude Animated Shorts" skill by Mr omi. This skill is a fixed and extended working copy of it with a new example short, captions, Kokoro word timing, a Hindi path and a sound script. Keep LICENSE when you share it.

相關技能