Video Generation Pipeline
Topic: $topic
Target duration: $duration minutes
CLI tool: ../cli/bin/claude-video.js
** MANDATORY FIRST STEP — do this BEFORE anything else, no exceptions: **
Ask the user these questions BEFORE reading help commands, before planning,
before creating any files. Do NOT proceed until they answer ALL of them:
Before I start:
Do you want to review the animation before final render?
- Yes — I'll pause after assembly so you can annotate problems in your browser.
- No — Fully autonomous, render without stopping.
What quality level?
- Standard — Automated validation + storyboard checks.
- Maximum — All standard checks PLUS visual verification sub-agents that render
every diagram and scene to PNG and visually inspect for layout issues. Slower but
catches problems the LLM can't see from code alone.
How deep should the explanations go? Here are three estimated lengths based on
what you asked for:
- Brief (~X minutes) — Cover the main concepts, skip details. Quick overview.
- Standard (~Y minutes) — Explain each concept clearly with examples.
- Deep (~Z minutes) — Full deep-dive with step-by-step walkthroughs,
exercises, formula derivations, and repeated summaries for retention.
(Fill X, Y, Z with estimates based on the source material and topic complexity.)
After the user answers, spawn the planner agent immediately with the topic,
source material path, user answers, and estimated duration. Do NOT pick colors
yourself — the planner creates the design brief with the full palette.
When the planner returns:
- Read
plan/design-brief.json
- Confirm the accent color with the user: "I'll use #XXXXXX as the accent."
- Store in progress.json:
"human_review", "max_quality", "target_depth",
"estimated_duration_min", "accent_color", and the full palette
- The planner also creates
plan/outline.json — review it before proceeding
Pass plan/design-brief.json path to EVERY sub-agent delegation. Sub-agents
read their colors from this file. The accent color MUST NOT change across the video.
DO NOT skip this. DO NOT assume the answers. DO NOT start implementation until
the planner has completed and the user has confirmed the accent color.
Stage 0: References
Ensure the project's references/ folder exists and contains the source material
for the video. This folder is the single source of factual truth — all
explanations, narration, and diagrams must be grounded in its contents. It may
contain source files, research markdown, external links, or paths to other resources.
If the user provided source material, confirm it's in references/ before proceeding.
Stage 1: Plan (via planner agent)
- Spawn planner agent with topic, source material, user answers, estimated duration
- Planner reads
references/ and CLI guides, then creates:
plan/design-brief.json — color palette (0-saturation dark backgrounds), content plan, watchlist
plan/outline.json — chapter/scene structure
- Confirm accent color with user
- Create a project directory at
../projects/$topic/ (if planner hasn't already),
including references/ for source material
- Create plan/chapters/chXX.json for each chapter
- Create plan/scenes/chXX_sXX.json for each scene
Stage 2: Diagrams
- Identify unique diagrams needed from the outline
- For each diagram, spawn a diagram-author agent
- Verify each diagram passes validation
- IF max_quality: For EACH diagram, spawn a visual-verifier agent that:
- Renders the diagram to PNG via
--preview 0
- Reads the PNG and visually inspects for: overlapping text, text outside containers,
misaligned connector lines, components out of position, unreadable labels,
elements clipped by the viewport edge, poor spacing, unclear hierarchy
- Returns a strict list of fixes — diagram-author must apply ALL fixes and re-verify
- This loop repeats until the visual-verifier passes with zero issues
Stage 3: Scenes
- For each chapter, spawn a chapter-coordinator agent
- Each coordinator creates and verifies all scenes in its chapter
- Quality audit: randomly preview 2-3 scenes per chapter AT DIFFERENT TIMESTAMPS
- If previews at t=25%, t=50%, t=75% of a scene look identical → the scene is STATIC
- Static scenes must be rewritten with staggered data-appear and data-highlight events
- Every scene needs ≥8 data-appear (staggered), ≥3 data-highlight (synced to narrator)
- Diagram elements must start GREY and only highlight when narrator discusses them
- Viewport zooms must use
data-viewport-focus="#element-id" to target specific
elements — do NOT compute translate values manually (the CLI auto-centers)
- IF max_quality: For EACH scene, spawn a visual-verifier agent that:
- Renders the scene at 3 timestamps (25%, 50%, 75% of scene duration)
- Reads each PNG and checks: elements visible? highlights active? text readable?
layout correct? colors muted except current highlight? no overlapping elements?
- Returns a strict list of fixes — the scene must be corrected and re-verified
Stage 4: Timing
- For each chapter, spawn a timing-engineer agent
- Update all scene files with exact TTS timestamps
Stage 5: Assembly + Automated Review
- Combine chapter files into final HTML
- Run storyboard with auto-scaled frame count
- Inspect storyboard against the 10-point checklist
- ALL automated checks must pass before proceeding
Stage 6: Human Review (only if opted in)
- Generate review page:
node ../cli/bin/claude-video.js assembly/video.html --review -o assembly/review
- Tell the user to open the review HTML in their browser
- Wait for the user to paste annotations or say "approved"
- If annotations: fix issues, re-run stages 5-6 until approved
- This does NOT replace any automated checks — it is additional
Stage 7: Render
node ../cli/bin/claude-video.js assembly/video.html -o output/video.mp4 --tts --tts-engine supertonic --tts-model supertonic-3
Progress Tracking
After every completed unit, update progress.json. If conversation is compacted, read progress.json to resume.
1---2name: make-video3description: Video Generation Pipeline4---56## Video Generation Pipeline78Topic: $topic9Target duration: $duration minutes10CLI tool: ../cli/bin/claude-video.js1112** MANDATORY FIRST STEP — do this BEFORE anything else, no exceptions: **1314Ask the user these questions BEFORE reading help commands, before planning,15before creating any files. Do NOT proceed until they answer ALL of them:1617> Before I start:18>19> 1. Do you want to review the animation before final render?20> - **Yes** — I'll pause after assembly so you can annotate problems in your browser.21> - **No** — Fully autonomous, render without stopping.22>23> 2. What quality level?24> - **Standard** — Automated validation + storyboard checks.25> - **Maximum** — All standard checks PLUS visual verification sub-agents that render26> every diagram and scene to PNG and visually inspect for layout issues. Slower but27> catches problems the LLM can't see from code alone.28>29> 3. How deep should the explanations go? Here are three estimated lengths based on30> what you asked for:31> - **Brief** (~X minutes) — Cover the main concepts, skip details. Quick overview.32> - **Standard** (~Y minutes) — Explain each concept clearly with examples.33> - **Deep** (~Z minutes) — Full deep-dive with step-by-step walkthroughs,34> exercises, formula derivations, and repeated summaries for retention.35>36> (Fill X, Y, Z with estimates based on the source material and topic complexity.)3738After the user answers, spawn the **planner** agent immediately with the topic,39source material path, user answers, and estimated duration. Do NOT pick colors40yourself — the planner creates the design brief with the full palette.4142When the planner returns:43- Read `plan/design-brief.json`44- Confirm the accent color with the user: "I'll use **#XXXXXX** as the accent."45- Store in progress.json: `"human_review"`, `"max_quality"`, `"target_depth"`,46 `"estimated_duration_min"`, `"accent_color"`, and the full palette47- The planner also creates `plan/outline.json` — review it before proceeding4849Pass `plan/design-brief.json` path to EVERY sub-agent delegation. Sub-agents50read their colors from this file. The accent color MUST NOT change across the video.5152DO NOT skip this. DO NOT assume the answers. DO NOT start implementation until53the planner has completed and the user has confirmed the accent color.5455---5657### Stage 0: References58Ensure the project's `references/` folder exists and contains the source material59for the video. This folder is the **single source of factual truth** — all60explanations, narration, and diagrams must be grounded in its contents. It may61contain source files, research markdown, external links, or paths to other resources.62If the user provided source material, confirm it's in `references/` before proceeding.6364### Stage 1: Plan (via planner agent)651. Spawn planner agent with topic, source material, user answers, estimated duration662. Planner reads `references/` and CLI guides, then creates:67 - `plan/design-brief.json` — color palette (0-saturation dark backgrounds), content plan, watchlist68 - `plan/outline.json` — chapter/scene structure693. Confirm accent color with user704. Create a project directory at `../projects/$topic/` (if planner hasn't already),71 including `references/` for source material725. Create plan/chapters/chXX.json for each chapter736. Create plan/scenes/chXX_sXX.json for each scene7475### Stage 2: Diagrams767. Identify unique diagrams needed from the outline778. For each diagram, spawn a diagram-author agent789. Verify each diagram passes validation7910. **IF max_quality:** For EACH diagram, spawn a visual-verifier agent that:80 - Renders the diagram to PNG via `--preview 0`81 - Reads the PNG and visually inspects for: overlapping text, text outside containers,82 misaligned connector lines, components out of position, unreadable labels,83 elements clipped by the viewport edge, poor spacing, unclear hierarchy84 - Returns a strict list of fixes — diagram-author must apply ALL fixes and re-verify85 - This loop repeats until the visual-verifier passes with zero issues8687### Stage 3: Scenes8811. For each chapter, spawn a chapter-coordinator agent8912. Each coordinator creates and verifies all scenes in its chapter9013. Quality audit: randomly preview 2-3 scenes per chapter AT DIFFERENT TIMESTAMPS91 - If previews at t=25%, t=50%, t=75% of a scene look identical → the scene is STATIC92 - Static scenes must be rewritten with staggered data-appear and data-highlight events93 - Every scene needs ≥8 data-appear (staggered), ≥3 data-highlight (synced to narrator)94 - Diagram elements must start GREY and only highlight when narrator discusses them95 - Viewport zooms must use `data-viewport-focus="#element-id"` to target specific96 elements — do NOT compute translate values manually (the CLI auto-centers)9714. **IF max_quality:** For EACH scene, spawn a visual-verifier agent that:98 - Renders the scene at 3 timestamps (25%, 50%, 75% of scene duration)99 - Reads each PNG and checks: elements visible? highlights active? text readable?100 layout correct? colors muted except current highlight? no overlapping elements?101 - Returns a strict list of fixes — the scene must be corrected and re-verified102103### Stage 4: Timing10413. For each chapter, spawn a timing-engineer agent10514. Update all scene files with exact TTS timestamps106107### Stage 5: Assembly + Automated Review10815. Combine chapter files into final HTML10916. Run storyboard with auto-scaled frame count11017. Inspect storyboard against the 10-point checklist11118. ALL automated checks must pass before proceeding112113### Stage 6: Human Review (only if opted in)11419. Generate review page: `node ../cli/bin/claude-video.js assembly/video.html --review -o assembly/review`11520. Tell the user to open the review HTML in their browser11621. Wait for the user to paste annotations or say "approved"11722. If annotations: fix issues, re-run stages 5-6 until approved11823. This does NOT replace any automated checks — it is additional119120### Stage 7: Render12124. `node ../cli/bin/claude-video.js assembly/video.html -o output/video.mp4 --tts --tts-engine supertonic --tts-model supertonic-3`122123### Progress Tracking124After every completed unit, update progress.json. If conversation is compacted, read progress.json to resume.