Communitygithub.com

shaharsha/producing-animated-episodes

Use when making a narrated or voiced animated video with recurring characters - an anime, cartoon or comic episode, a short for a group chat, a story video about friends, family, a class or a team - from photos, a chat export, a story idea or a script, in any visual style, Hebrew/RTL or English. Also use when such a video has subtitles or cards too fast to read, music stopping early, the ending cut off, lines buried under music, mouths out of sync, a gesture before its line, or one face...

What is producing-animated-episodes?

producing-animated-episodes is a Codex agent skill that use when making a narrated or voiced animated video with recurring characters - an anime, cartoon or comic episode, a short for a group chat, a story video about friends, family, a class or a team - from photos, a chat export, a story idea or a script, in any visual style, Hebrew/RTL or English. Also use when such a video has subtitles or cards too fast to read, music stopping early, the ending cut off, lines buried under music, mouths out of sync, a gesture before its line, or one face...

Works with~Claude Code✓Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/shaharsha/claude-skills/tree/HEAD/skills/producing-animated-episodes

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Producing animated episodes

Overview

A vertical, voiced, subtitled, animated episode: character art, panels, cloned or library voices, music, image-to-video clips and lip-sync, cut by an engine that times every shot from the real dialogue audio. One episode.json holds the whole project, and engine/episode.py runs every phase from it. The sibling skills do the provider work.

Use the engine; don't write your own edit scripts. Timeline, overlays, subtitles, right-to-left text, the mix, durations and lip-sync joins are already in engine/. It was proven by rebuilding a real 3.5-minute episode: identical frames, identical audio, and the exact length the original had missed. A hand-written edit rediscovers every bug in references/troubleshooting.md.

The audio is the master. Shot lengths, subtitle times and lip-sync parts come from the finished dialogue files. Never estimate a timing from text.

You can't watch or hear. You check frames, durations and numbers. The human judges likeness, voices, pronunciation, timing and jokes. Plan their gates and keep them.

Requires:

  • These skills next to this one: image-generation, elevenlabs-tts, generating-video-clips.
  • Python 3 with pip install -r <this-skill-dir>/requirements.txt (Pillow built with RAQM, numpy; OpenCV optional).
  • ffmpeg 7 or newer.
  • Fonts: styles and subtitles name font keys (bold, hblack, black in the example) that fonts maps to installed .ttf files. For Hebrew and Latin, Rubik and Heebo (free, Google Fonts) work well; check blocks on a missing one.
  • Keys in env vars, set in every shell that runs the engine: OPENAI_IMAGE_API_KEY, ELEVENLABS_API_KEY, GEMINI_API_KEY, FAL_KEY.

To see the whole pipeline work with no API calls, run python3 <this-skill-dir>/engine/episode.py /tmp demo, then check and build the demo project it creates.

The pipeline and its gates

Every gate is a stop: send the artifact, ask, wait. Commands are python3 <this-skill-dir>/engine/episode.py PROJECT <command>. Costs measured 2026-10.

#PhaseCommandGate (the human)Cost
1Story and scriptscript.md from templates/script.template.mdthe script, and every sensitive topic-
2Character bibletemplates/characters.template.md, then characters in episode.json--
3Faces, cards, promotechars face, chars card key=face.png, chars final keyslikeness, on one sheet of all cards~$0.30 per character
4Panelspanels draft, then panels final idsevery panel, on a sheet~$0.30 per panel
5Voicesone sample per voice (elevenlabs-tts)every voice, by ear, before the batchcents
6Lineslinesthe set by ear, with timestamps; names A/Bcents to a few $
7Music and SFXsoundthe musiccents
8Animaticbuild (no clips yet: stills with camera moves)pace and order, before any video spendfree
9Animationanimate, sheets, retakes with animate S --takes 2 + animate pick S Kmotion, from sheets~$0.10 per second of clip, per take
10Lip-synclipsync prep, face points in config, lipsync runspot-check frames~$0.13 per second
11Edit and deliverbuild, sheet, deliverthe human watches the mp4free

Commands, inputs, outputs and failure handling for each phase: references/pipeline.md.

Writing the script

Rules that held up (details and a worked example: references/script-writing.md):

  • A hook in the first 3-4 seconds (a cold open on the problem), then the title. Under 30 seconds, put the title and end card as overlays on story shots and skip the montage.
  • Every recurring character speaks at least once. An intro montage, one word each in their own voice at about 1.2-1.5 s per card, is cheap and loved.
  • On-screen text must be readable: about 0.8 s plus 0.06 s per character; 1.2-1.5 s for a short card; 4-6 s for a final caption. Give cards a mindur.
  • Plant clues early and pay them off. Callbacks to a group's real running jokes land hardest.
  • Sensitive topics are the user's call. List every private detail you'd like to use (health, money, relationships, family, fights), ask about each, and use only what they confirm.
  • Lines of 12 words or fewer, numbers in words. On-screen text stays in normal spelling; pronunciation fixes go in pronounce.
  • Music and sound effects, even for narration. At least one music bed and a few effects (whooshes on cuts, a hit on the reveal); a silent bed sounds unfinished.

episode.json in one screen

templates/episode.example.json is a complete small episode; every key is in references/config-schema.md. The parts you edit most:

  • characters: display name, color, voice, and the prompt fields from the character bible.
  • speakers: voices that are never drawn, such as a narrator ({"display": null, "voice": "<id>"} gives subtitles without a name).
  • lines: id, speaker, text with audio tags; trim and level on one-word lines.
  • shots: image, lines ("[email protected]" overlaps the previous line), pads, mindur, camera, fx, sfx, overlays, clip offset and speed.
  • music_cues: [cue, from shot, to shot, volume, offset]. The build warns when a cue is shorter than its window.
  • lipsync: which shots, which lines to skip, one face point per part.
  • prompts: override char_style and panel_style for a different look (3D cartoon, watercolor, photoreal).

Building and reviewing

  • Batch the fixes. A full build takes minutes. Collect every note from a review round (a line take, a pad, a clip offset), apply them all, then rebuild once.
  • Segments are cached and tracked. build re-renders exactly the shots whose inputs changed: a new clip or lip-synced version, a promoted panel, an edited line, shot or style. build --only S05,S06 forces those shots; --force re-renders everything.
  • A lip-synced shot is redone after any change to its clip, offset, speed or lines: lipsync prep S05 && lipsync run S05. Until then the build warns it is stale and uses the raw clip.
  • Regenerating an existing asset needs --force (sound theme --force, animate S05 --force); without it, existing files are kept and only gaps are filled.
  • Review with sheets. sheet puts 3 frames per shot on a page. When the human names a moment by time, extract and read those frames before answering (ffmpeg -ss T -i build/<output>.mp4 -frames:v 1 f.jpg).
  • check before every build: missing assets, keys, sibling skills, and overlay text wider than the frame.
  • Durations are verified at the end of every build. Audio shorter than video fails the build instead of cutting the ending.
  • Before sending: references/qa-checklist.md.

Working with the human

  • Send every artifact with your file-sending tool and offer to reveal it in Finder; don't just print a path. The final step is deliver and sending that file.
  • For audio, say what to listen for and where ("at 0:41, does Dani's name sound right?"). Never claim you heard it.
  • Pronunciation and voice choices are theirs: A/B files with timestamps (elevenlabs-tts).
  • Before each paid phase, give the cost estimate; after it, the running total.

When something looks wrong

SymptomFix
Cards or captions too fast to readraise mindur / post: ~1.2-1.5 s per short card, 4-6 s for the final caption
A title clipped at both edgescheck warns; lower the style's size or add wrap
Music stops before the section endsthe build warned: raise the cue's seconds, sound <cue> --force; or split the section into two cues
The ending is cut offcan't happen with the engine (exact-length mix, duration check); in hand-made muxes, see deck-to-video
A line is buried under musiclevel_clips.py --report on that line, then a firmer take; lower that cue's volume
A character points or acts before their lineclip_off past it, or split the shot and crop the first part with clip_cam
Mouths don't move with the wordslip-sync phase; if the wrong mouth moves, fix its face point
One face bigger in the group shotinstall OpenCV (faces are equalized), or mirror a card whose prop covers a neighbor
Hebrew renders reversed or unjoinedPillow without RAQM: check says how to fix it
A name or loanword mispronounceda pronounce entry, A/B by ear

More, with causes: references/troubleshooting.md.

Related skills

Individual skills in this repo

This repo contains 3 individual skills — each has its own dedicated page.

shaharsha/deck-to-video

Use when turning a slide deck plus per-slide narration audio into an mp4 video — a self-playing/self-presenting deck video, "slides to video", "presentation to mp4", a shareable WhatsApp/Slack/Drive video of a narrated deck, or when a slide video needs a per-slide progress bar / countdown / slide counter. Also use when a slide video should highlight, glow or spotlight the element being talked about in time with the voice, or when narration and on-screen animation need syncing. Also use when...

shaharsha/generating-video-clips

Use when turning a still image, illustration, comic panel or character art into a short animated clip (image-to-video), choosing a video model or provider (Gemini Omni, Veo, Seedance, Kling, ElevenLabs Flows) or hitting their API gates, lip-syncing a character's mouth to existing dialogue audio (Sync, fal.ai, active speaker), or fixing a generated clip with artifacts - duplicated props, a door or a second figure appearing, hands through bodies, glowing eyes, a gesture repeated at the start,...

shaharsha/image-generation

Generate logos, icons, UI mockups, hero images, product shots, and other design assets using OpenAI GPT Image 2.5 (Sunburst, Flare) or Google Gemini (Nano Banana 2, Nano Banana Pro, Nano Banana 2 Lite). Use whenever the user asks to create, design, generate, mock up, render, or illustrate a visual asset, needs a transparent PNG, or asks for image prompt engineering. Picks the right model and quality for the job, writes a model-specific prompt following the official prompting rules of each...

Related Skills