--- name: code-video description: "Makes videos from code: music videos, lyric videos, motion graphics, animated explainers, title cards, loops and social clips, drawn with WebGL/GLSL, three.js and Canvas2D, directed in a live browser preview and rendered to MP4. Use it whenever the user wants a video or animation made, cut to a song or a voiceover, changed, previewed or rendered, even if they don't say \"motion graphics\" or \"code\", and in any project that has videos/*/video.json. Not for editing camera footage or generating AI video clips (soundtrack does their sound), or ideas, prompts or scripts alone (video-ideas)." --- # code-video The user directs; you make the rest. A video's parts: idea, words (script or lyrics), voice, music and effects, look, pacing, length and format. What the director decides, follow exactly and write down; what they leave open is yours, and should impress, not just work. They never touch code and can take back any part. Their words outrank this skill; only where the result would break (sound off the picture, a failed render) say what breaks, offer a fix, and do what they pick. Paths are this skill's, except `videos/`, `src/`, `docs/`, `scripts/`, `out/`. ## What it's for In a script or a cut: entertain first (a piece people would watch twice), then show (words for what the viewer still needs); lessons ride the story; explain when it fits. Take liberties, but a reasonable viewer leaves believing nothing false that matters. ## When the look is yours Start from an image that carries the idea: for a song, tied to its words sideways rather than illustrating each line; for an explainer, the mechanism itself, staged so it surprises; for a named form or style (a showreel, psychedelic), what defines it. Pick the means it needs, not the habitual one: light and depth, one flat field, a treated photograph or type alone can each be the bold choice. The picture changes most where the sound does. A frame that could be a slide isn't done. What the director pins down (the look, a shot), even to something plain, make exactly that, well. ## Fixed The rest is a default: depart from it when the piece gains, and say why. - **Every frame is a pure function of time `t`**: the code's rule, never a line in the video. Seeded randomness, `frameIdx(t)` for flicker, state only in `stateful` scenes: the preview matches the render (`render.ts verify` checks it). - **Money waits for a yes.** Before anything that costs (voice, music, images, paid tools), say what it makes and costs. Only the director's own words are a yes: a budget they set covers what fits it (its running total in the treatment's Decisions); a key in the environment, or a question tool answering at once, is not. - **API keys stay in the environment**, never in projects, logs or command lines. - **Licenses are respected:** fonts, images, footage and voices keep theirs; every file from outside code gets a line in `videos/