Communitygithub.com

explainer-videos

Produces narrated explainer videos end to end: brief, script, storyboard, ElevenLabs narration with word timings, animation timed to the words (Manim, Remotion or Psychopomp), sound effects, a ducked music bed, captions, loudness mastering and a verified MP4. Use when asked to make an explainer video, animated walkthrough, narrated Manim video, 3Blue1Brown-style visualization, illustrated or Kurzgesagt-style film, product demo or launch video, motion-graphics piece, or to cut and tighten a screen recording.

What is explainer-videos?

explainer-videos is a Claude Code agent skill that produces narrated explainer videos end to end: brief, script, storyboard, ElevenLabs narration with word timings, animation timed to the words (Manim, Remotion or Psychopomp), sound effects, a ducked music bed, captions, loudness mastering and a verified MP4. Use when asked to make an explainer video, animated walkthrough, narrated Manim video, 3Blue1Brown-style visualization, illustrated or Kurzgesagt-style film, product demo or launch video, motion-graphics piece, or to cut and tighten a screen recording.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/sammyjoyce/explainer-video-skill/tree/HEAD/skills/explainer-videos

Ask in your favorite AI

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

Documentation

Explainer videos

Narration first. Picture timed to the spoken words. A verified MP4 at the end.

Contents

Pick the pipeline

Route by the request. Read the pipeline's reference before writing any code.

The requestPipelineReference
Explain a concept, protocol, codebase or comparison with diagramsA. Manim, 3Blue1Brown stylemanim.md, manim-style.md
A polished illustrated film with sound design and a score, often from a supplied scriptB. Remotion filmremotion-film.md
A product launch or demo of a real appC. Remotion over Playwright capturesremotion-demo.md
A crafted motion-graphics piece with 60 fps motion blurD. Psychopomp (Rust)psychopomp.md
Cut, tighten or package an existing recordingE. video-edit-clirecordings.md

When the request could be either an explainer or a product demo, ask which before building. An agent once built a mechanism explainer when a promo was wanted.

Pipeline A is the default. It runs end to end from a one-line prompt and is the cheapest. Pipelines B, C and D stop at approval gates. stages.md lists the gates and Sam's prompts for each stage.

Rules for every pipeline

  1. Brief before build. Write brief.md first: audience and prerequisites, the one question the video answers, the misconception to dislodge, the central visual metaphor, the "aha" moment, and target length at about 150 spoken words a minute. In B, C and D, show the brief and wait for approval before building. In A, keep going unless the user asked to see it.
  2. Every claim traces to a source you read. For code topics, read the source, not only the README. Sparse-clone repos into src/. Fact-check the script before any paid voice.
  3. Invent nothing. No made-up product names, URLs, people, numbers or UI. No "demo data" or "prototype" labels on screen. If something does not exist yet, say so in the brief and ask.
  4. The key lives in the environment. Run preflight.sh before any paid step. Never print, guess or echo the key, and never paste it into a prompt or file. The scripts read ELEVENLABS_API_KEY, not ELEVEN_API_KEY. If the key is missing, tell the user before any paid step. The free scratch voice still works. Never mix voiced and silent segments in a delivered film.
  5. Spend once. Freeze the script wording before paid voice. Run every paid script with --dry-run first and report the characters or seconds. Draft with the free scratch voice (--provider say) where the pipeline allows. Every script caches by a hash of its inputs. Regenerate a take with --redo (narrate.py and sfx.py take keys, music.py takes none), never by deleting caches or lock files.
  6. Plan the mix before generating audio. Decide which sounds, where, and at what level relative to the voice before calling sfx.py or music.py. A reference video for the sound design helps. First-pass effects were "far too loud" when this was skipped.
  7. Look at what you render. A render that finishes proves the code runs, not that it looks right. Review every draft with contact_sheet.sh and full-size frames, using a new filename each round. review.md has the per-frame checklist.
  8. Small requests stay small. When the user asks for one change, change only that. Sam's phrase for this is "not the content, just that".
  9. Long runs keep a decision log. Append ts, phase, decision, why, evidence, result rows to decisions.tsv so another agent can pick up a crashed run.

Setup

$SKILL below means the folder holding this file, for example ~/.claude/skills/explainer-videos. Scripts run in place from $SKILL/scripts. They need only Python 3's standard library, ffmpeg and ffprobe.

SKILL=~/.claude/skills/explainer-videos
bash "$SKILL/scripts/preflight.sh" manim      # or remotion, psychopomp, all

preflight.sh checks ffmpeg filters (loudnorm, ebur128, sidechaincompress, alimiter, drawtext), libx264, the ElevenLabs key without printing it, macOS say, fonts, and the pipeline's toolchain. Fix every FAIL before starting. A missing key is a WARN, because the scratch voice needs none.

  • ffmpeg. Homebrew's ffmpeg-full has drawtext (contact-sheet timestamps) and libass. It is keg-only, so put $(brew --prefix ffmpeg-full)/bin first on PATH. Plain ffmpeg works without timestamps.
  • Manim. On macOS, brew install cairo pango pkg-config, then uv tool install manim and uv tool update-shell. On NixOS, pip install manim fails building pycairo, so use nix build nixpkgs#manim.
  • Remotion. Node.js with npm. The starter pins remotion and @remotion/cli 4.0.538.
  • Voice. python3 "$SKILL/scripts/narrate.py" --list-voices lists the voices on the account. Put the chosen ID in script.json or ELEVENLABS_VOICE_ID. There is no default voice.

Pipeline A. Manim

One NarratedScene per video. say(key) starts a clip. at(word) waits until 0.2 s before a spoken word. remaining() is the time left in the clip plus 0.35 s of padding, and done() holds until then. Read manim.md for the full workflow and manim-style.md before the first scene.

Set up the project and write brief.md, storyboard.md and the real segments in script.json:

mkdir -p dns-explainer/review && cd dns-explainer
cp "$SKILL/assets/script.json" "$SKILL/assets/manim/scene.py" "$SKILL/scripts/narrated.py" .
python3 "$SKILL/scripts/narrate.py" script.json --out audio --dry-run    # billable characters, no key or voice needed

Pick a voice with narrate.py --list-voices and put its ID in script.json. Then narrate, draft and review:

python3 "$SKILL/scripts/narrate.py" script.json --out audio
manim -ql --disable_caching scene.py Explainer > review/render.log 2>&1 || tail -30 review/render.log
grep '^SYNC' review/render.log                    # must print nothing
bash "$SKILL/scripts/contact_sheet.sh" media/videos/scene/480p15/Explainer.mp4 review/sheet-1.png 5 4

When the draft passes review, render and finish:

manim -qh --disable_caching scene.py Explainer > review/render-hq.log 2>&1 || tail -30 review/render-hq.log
python3 "$SKILL/scripts/finish.py" media/videos/scene/1080p60/Explainer.mp4 dns-explainer.mp4
bash "$SKILL/scripts/master.sh" dns-explainer.mp4
bash "$SKILL/scripts/verify.sh" dns-explainer.mp4 review/render-hq.log

With a music bed from music.py, add --music audio/music.mp3 to the finish.py line. Run Manim from the project folder, because narrated.py loads audio/ relative to it. finish.py ducks the bed under the voice with a sidechain, adds the soft mov_text caption track from Manim's .srt, and writes AAC with +faststart.

Pipelines B and C. Remotion

The starter in assets/remotion/ renders a captioned film from script.json with no scene code. Each segment key shows a placeholder until a component is registered for it in src/scenes.tsx.

Build the scratch cut. It costs nothing and gives the user a full film to approve:

mkdir dns-film && cd dns-film
cp -R "$SKILL/assets/remotion/." . && cp "$SKILL/assets/script.json" .
export EXPLAINER_SKILL="$SKILL"          # package.json falls back to ~/.claude/skills/explainer-videos
npm install
npm run voice:scratch                     # macOS say, word times estimated by character count
npm run timeline                          # public/audio/timing.json -> src/timeline.json (frames)
npm run studio                            # build scenes against the scratch cut
npm run typecheck && npm run render       # out/film.mp4, the scratch cut

Stop and show the scratch cut. Only after the user approves it, make the paid version. Write sfx.json and music.json and place the effects and MUSIC first (remotion-film.md):

npm run voice -- --dry-run && npm run voice
npm run timeline
npm run sfx -- --dry-run && npm run sfx
npm run music -- --dry-run && npm run music
npm run typecheck && npm run render
npm run master && npm run verify
  • Scenes cue on words with cue(key, "word"), the frame of that word relative to the segment start. It throws when the word is missing, so a script edit cannot silently break a cue.
  • Music goes in through MUSIC in src/Film.tsx. It is ducked per frame by src/duck.ts, an automation curve built from the narration timings.
  • Sound effects go in as <Audio> inside a <Sequence> at a level in dB relative to the voice, because sfx.py normalises every clip to the narration's loudness. The starter places none. remotion-film.md has the component.
  • Pipeline B's design gates (storyboard, art direction, three style versions) are in remotion-film.md. Pipeline C's capture and choreography are in remotion-demo.md.

Scripts

Run each script from the project folder. Every paid script has --dry-run, which needs no key.

ScriptDoesMain flags
preflight.sh [manim|remotion|psychopomp|all]Checks tools, filters, fonts and the key
narrate.py script.jsonOne MP3 per segment plus timing.json with word times, via ElevenLabs /with-timestamps. Neighbouring text goes along as previous_text and next_text. Every take is kept in <out>/.takes/, so returning to earlier inputs costs nothing--out DIR, --provider elevenlabs|say, --say-voice NAME, --redo k1,k2, --dry-run, --list-voices
narrated.pyNarratedScene for Manim. Copy next to scene.py
timeline.py script.jsonLays segments on a frame timeline for Remotion, with captions. Fails if a segment is missing from timing.json, its text changed, or its MP3 is missing. Re-run narrate.py after changing voice or settings--timing, --public, --out, --fps 30, --lead 0.25, --tail 0.45, --outro 3.0, --hold key=sec
sfx.py sfx.jsonGenerates sound effects and normalises each to --target on every run--out audio/sfx (npm run sfx uses public/sfx), --target -23, --redo a,b, --dry-run
music.py music.jsonGenerates a music bed from a prompt or a per-chapter composition plan, normalised to --target on every run--out audio/music.mp3 (npm run music uses public/audio/music.mp3), --target -23, --redo, --dry-run
finish.py RENDER.mp4 OUT.mp4Manim finish. Ducked music bed, soft captions from RENDER.srt when it exists, AAC, faststart--music FILE, --music-db -11
master.sh VIDEO.mp4 [LUFS]Static gain to -16 LUFS plus a -2 dBFS limiter, in place. Keeps caption streams
verify.sh VIDEO.mp4 [RENDER.log] [LUFS]PASS or FAIL for h264, aac, A/V drift, loudness, true peak and SYNC lines
contact_sheet.sh VIDEO OUT.png [COLS] [ROWS]Grid of evenly spaced frames, timestamped when ffmpeg has drawtext
loudness.py FILE...Prints duration, integrated LUFS and true peak per file

eleven.py and loudness.py are shared modules. eleven.py reads the key from ELEVENLABS_API_KEY, then XI_API_KEY, then .env.local or .env in the working folder, and retries HTTP 429, 500, 502 and 503.

Data shapes

script.json. Segment order is video order. One to four sentences per segment, so a fix re-records seconds.

{"voice_id": "<voice id>", "model_id": "eleven_multilingual_v2",
 "voice_settings": {"stability": 0.5, "similarity_boost": 0.75},
 "segments": {"intro1": "Every good explainer answers one question.", "core1": "..."}}

timing.json, written by narrate.py: {key: {duration, hash, text, words: [{w, start, end}]}} in seconds.

sfx.json: {"sounds": {name: {prompt, seconds, influence?, loop?}}}. Example prompts are in audio.md.

music.json is the request body for ElevenLabs POST /v1/music. Use either prompt with music_length_ms and force_instrumental, or composition_plan.chunks with one chunk per chapter, each 3 to 120 seconds.

src/timeline.json, written by timeline.py, in frames:

{"fps": 30, "total": 1234,
 "segments": [{"key": "intro1", "start": 0, "voice": 8, "end": 230, "audio": "audio/intro1.mp3",
               "words": [["Every", 12, 20]]}],
 "captions": [[12, 95, "Every good explainer answers one question."]]}

A segment's scene starts at start, its voice at voice (start plus lead), and the next segment at its end.

Audio levels

sfx.py and music.py normalise every clip to -23 LUFS by default. Set --target to the narration's loudness, which loudness.py audio/*.mp3 prints. With every clip at one loudness, a placement level is dB relative to the voice.

LayerLevelWhere it is set
Music under speech-17 dB, lifting to -11 in pauses of 1.5 s or more and -8 after the last lineduck.ts (Remotion)
Music bed, Manim-11 dB under the voice before a sidechain duck keyed on the voicefinish.py --music-db
Sound effectsAccents sat a median of about 24 dB under voice peaks in Sam's mix, never within 6 dBthe <Audio volume> per placement
Master-16 LUFS integrated, true peak at or below -1 dBTPmaster.sh, checked by verify.sh

audio.md has voice settings, SFX and music prompts, the three ducking methods and costs.

Deliver

verify.sh must pass, and the last contact sheet must have been looked at. Then report:

  • the output path, duration and resolution,
  • loudness and true peak from verify.sh,
  • ElevenLabs characters, SFX seconds and music length generated, from the dry runs,
  • anything not verified, such as a fact you could not source or a frame you did not check.

References

Read only what the current stage needs.

FileRead when
stages.mdPlanning the run. Stage order, gates and Sam's prompts per stage
manim.mdBuilding pipeline A, including parallel chapter workers for long videos
manim-style.mdBefore the first Manim scene. Look, layout rules and Manim gotchas
remotion-film.mdBuilding pipeline B. Design gates, scenes, cues and the scratch-voice cut
remotion-demo.mdBuilding pipeline C. Capturing the real app and choreographing it
psychopomp.mdBuilding pipeline D
recordings.mdEditing real footage with video-edit-cli
audio.mdAny voice, SFX or music work, and mixing
review.mdEvery draft. Frame checklist, feedback rounds and how Sam steers

Related Skills