Video Explainer
Input: a topic, article, codebase, or rough notes. Output: a single
at 1920x1080 (
) and 30 fps (or
/
when requested), plus the
,
, and
files that produced it (pass
to
only when a smaller 720p copy in
is requested).
You write the script, narration, and scene code; the scripts fetch media, synthesize voice, align words, compile HyperFrames, render MP4, run 10-check QA, and serve the review page. Commands,
syntax, engine APIs, and
keys live in
reference.md.
On first use, run
(or
when using spoken narration). If tools are missing, list them and ask before installing. Put optional
in
~/.config/video-explainer/.env
rather than chat.
1. Pick a visual mode
Support three visual modes (
in
, default
):
- Motion (default) (): Full-frame 2D kinetic graphics, live SVG routes and charts, CSS 3D cards or devices, and documentary press clippings on . Fastest and cheapest.
- Illustrated (): Hand-drawn picture-book animation with gouache, pastel, paper grain, 10 fps line boil, and word-synced characters on and . Uses about 6x the tokens of Motion.
- 3D (): Single-take Three.js camera flythroughs with studio lighting, bloom, camera-facing labels, and optional Blender meshes on . Uses about 7x the tokens of Motion.
If the user already named a mode or asked to run with defaults, proceed immediately (
, captions on). Otherwise, show the numbered list above with its token costs, ask whether they want burned-in captions (on by default), and wait for their reply before building.
2. Research, source media, and write
Create one project folder named with a short slug (
,
,
) where the user asks, else
from
, else the current folder.
Verify every claim, number, quote, and step against the user's files or primary sources. Pull real photos, product visuals, clips, or page captures when they ground the story (
,
,
), and inspect each downloaded image so broken or irrelevant assets stay out of the render. Write
:
- Keep runtime to 60 to 75 seconds (2-minute cap). Target spoken words across scenes when voiced, or beats when ( / words for ). Stay at or under ( words). When the user asks for another length, write about 2.5 spoken words per second of it and set . Cut tangents rather than rushing speech.
- Default to (smart non-engineer). Use plain English, concrete mental models, and everyday cause-and-effect without raw file paths, internal variable or function names, error codes, CLI flags, or unexplained acronyms in speech or visuals. Switch to (physical metaphors, zero jargon) or (architecture names, protocols, tradeoffs) only when requested.
- Land the hook in 3 seconds and follow one example end-to-end. Open with a concrete question, tension, or number that reads with the sound off, trace one specific request, dollar, star, or user through every step, and close by answering the opening question.
- Write clean spoken copy. Skip throat-clearing openers, binary contrasts, colon reveals, and hype adjectives. Use short sentences and active verbs.
- Set audio and theme headers:
Mode: motion | illustrated | 3d
, , (or , an audio file, or ), (, , path, or ), with word-anchored cues (), (or when the user turned them off), and Style: default | paper | blueprint
.
Go straight from
into narration, graphics, QA, and the browser review page unless the user asked to approve the script first or requested a paid Gemini API call without a configured key.
3. Narrate and align
Run
to synthesize cached per-scene audio, trim dead air, align words with Parakeet, sync
and
times back into
, and write
. Read
before coding graphics so animations and sound cues hit exact spoken words via
stage.cue("s03", "keyword", 1.2)
.
4. Build graphics efficiently
Point consecutive rows in
at
so
mounts one continuous composition and auto-injects
,
,
, plus
(
) or
and
(
).
Build in one agent; the engines are designed for it. The engine APIs and a starter composition per mode are in reference.md.
- Build on the engines. Use , / , , and instead of writing your own noise, shaders, or mesh packers.
- Make it a moving film, never slides. One hero visual fills 60 to 85% of the frame and visibly transforms every 2 to 3 seconds: the camera dives, pans, or draws a live path, and objects morph rather than swap. Cards or text on a flat background with no moving hero visual read as a slide deck. Save the built-in single-beat visuals (, , , and the rest) for one-off moments.
- Keep labels readable. Callouts are 1 to 4 words ( labels, hero numbers) with WCAG AA contrast, above the caption band ( on , on ).
- Spend tokens where they show (Illustrated and 3D). Pick one setting and move the camera through it instead of building a new world per scene. In Illustrated, bake each prop and character once and reuse it across scenes. In 3D, use procedural meshes and turn to Blender only when sculpted or fractured geometry clearly adds value.
- Keep every frame deterministic on seek. Bind updates to / and end with . Load 3D assets synchronously. Skip and CSS rules on GSAP-animated elements, and put
data-layout-allow-overflow
on full-bleed or offscreen art.
5. Preview, draft, QA, review, and final
- Token-light pre-flight: Run (~3s) and inspect the single tiled first to catch framing, contrast, or whiteout bugs. Open individual files only when diagnosing a specific beat.
- Draft and QA: Run and . Fix any failed check ( required) and inspect and (plus only around suspect transitions).
- Fresh-eyes check before the user sees it: measures motion, not whether the video looks like slides. Give and to a fresh subagent with only the mode and the hook line (judge them yourself if your agent has no subagents), and ask: Does any frame read as a slide, meaning text or cards on a flat background with no moving hero visual? Do the first 15 seconds open on a striking visual that changes every 2 to 3 seconds? Does any art look like generic clip art? Fix every yes, re-render the draft, and check again.
- Browser review loop: Start in a background shell, share its URL, and run
review.py --poll "$P/work"
in the foreground. Apply feedback, re-run only if spoken words changed, render , refresh with , run review.py --ack "$P/work" BATCH_ID
, and poll again until approved.
- Final delivery: Run and , verify eval.md, ask the user to check voice pacing and mix balance, and report the final path, duration, and loudness. Offer to save custom theme/caption tweaks to
~/.config/video-explainer/style.json
.