A video lesson is one continuous animated scene, synced word by word to one narrator, that explains one concept. The source can be anything: a topic, a link, a PDF, code, notes, or a lesson.html from the lesson skill. Everything is written to ./lessons/<slug>/ (an existing lesson keeps its folder). Scripts live in this skill's folder (scripts/, tts/); first run needs scripts/setup.sh.
Steps
-
Script →
script.json. Read the source. A bare topic, or a source too thin to explain from, means research first: 1–3 primary sources (official docs, the paper, the creator's post), every claim traced to one. One concept per video; if the source holds several, name the one you are filming. Then write a new text for the ear:{"title": "...", "sub": "...", "lang": "pt", "lines": [{"id": "a1", "text": "One short sentence.", "concept": true}]}- Climb the ladder (real scenario → what breaks → concrete example step by step → why → only then the name → the fix, saying which part of the problem each fix removes), retold as speech.
- One sentence per line, short (fragments are fine: "And it obeys.").
"concept": trueon the line that closes a concept adds a 1.2 s pause after it. Target rhythm ~154 words/min with pauses: a dense, breathless script sounds rushed even read slowly. - Compare with
example/durable-objects/script.json, the approved bar. - Depth, not a timer: every idea gets one concrete example with names and values. ~3,500 characters ≈ 4 min; measure before generating audio.
- End on a one-line summary. Done when the character count is in range and every idea has its example.
-
Voice →
scripts/voice.sh lessons/<slug> [--tts <name>] [--voice <name>]. Runs the narrator (tts/<name>.py, defaultkokoro), thenscripts/align.py(faster-whisper) for word times. Done when it printsokwith ≥ 90% of words heard. -
Scene →
scenes.tsx. First readexample/durable-objects/scenes.tsxwhole to calibrate how much happens on screen, how the drawing is composed and how objects morph; take the bar, not its subject or positions. Then copytemplate/scenes.tsxand build the animation by every rule inSTYLE.md. Pieces are inengine/src/kit.tsxandengine/src/ds.tsx. Every time comes from speech:at('phrase'), never a fixed second. -
Review →
scripts/review.sh lessons/<slug>, as many rounds as it takes. Done when it exits 0 and you have written one line per item of the STYLE.md checklist naming the strip you checked it on. Fix and rerun on any miss. -
Render →
scripts/render.sh lessons/<slug>→video.mp4+poster.jpg. -
Present →
video.html, a theater page: the video large on the left with its own player, the essentials on the right. Writepage.json(format at the top ofscripts/page.py: summary, 4–6 chapters and 4–8 concepts each pinned to an exact narration phrase, 3 questions that make the viewer apply the concept to a new case), then runpython3 scripts/page.py lessons/<slug>. It buildsvideo.htmlfromtemplate/video.html, and links it fromlesson.htmlwhen one exists. Openvideo.html. Done when it plays with chapters and concept stars in place; reply with what the video covers, in a few lines.