--- 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 an 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 for generating clips with AI video models." --- # code-video The user directs; you make the rest. A video's parts are its 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 at any time. 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/`. ## When the look is yours Aim for a piece people would watch twice. 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. Pick the means that image 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`.** 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 goes in the treatment's Decisions); a key in the environment, or a question tool that answers at once, is not. - **API keys stay in the environment**, never in files, logs or command lines. - **Licenses are respected:** fonts, images, footage and voices keep theirs; every file from outside code gets a line in `videos/