motion-lab
A Claude Code plugin for directed, frame-exact motion design.
Claude writes code that draws every frame of an animation, then renders it, looks at the frames, measures them,
fixes what's off and exports it for X and the web. Because each frame is a pure function of time, every frame is
reproducible, every edit is a number, and Claude can check its own work instead of saying "looks great".
Both loops were made by the plugin from a two-sentence brief, in one headless session each
(three.js, 44 turns; plain HTML, 38 turns).
Contents
Quick start
1. Install the plugin
claude plugin marketplace add ajitpratap0/motion-lab
claude plugin install motion-lab@motion-lab
Or inside a Claude Code session: /plugin marketplace add ajitpratap0/motion-lab, then
/plugin install motion-lab@motion-lab.
2. Have the tools on your machine
| Tool | Why | Install |
|---|
| Node.js 20+ | runs the scripts | brew install node / winget install OpenJS.NodeJS.LTS |
| ffmpeg + ffprobe | encoding, GIFs, contact sheets, audio measurement | brew install ffmpeg / winget install Gyan.FFmpeg |
| Playwright + Chromium | renders frames | per project: npm i -D playwright && npx playwright install chromium |
/motion-lab:motion-setup checks all three and scaffolds the project folder. It never installs system packages
without asking.
3. Ask for an animation in an empty folder:
/motion-lab:motion-lab Make a 5-second seamless three.js loop, 1080x1080 at 24 fps: a small brass gyroscope on a
slate plinth. The outer ring tips over, the inner rotor spins up, and the whole thing settles back to rest so the
loop closes. Studio product look, soft key light, one rim light, no text.
You end up with:
motion-lab.json project settings (size, fps, length, ban list)
PROMPT.md the directed prompt: every adjective replaced by a number
anim.html the scene, one self-contained file
audit.json machine checks derived from PROMPT.md
RECEIPTS.md your brief, the directed prompt, every follow-up, audit and export results
out/anim.mp4 H.264, X-ready
out/anim.gif single palette, exact frame delays
out/post.md caption + reply thread showing how it was made
You can also call any step on its own, for example /motion-lab:motion-review on an existing scene or
/motion-lab:motion-fix when a render flickers.
How it works
flowchart LR
B[Brief] --> D[Direct<br/>PROMPT.md]
D --> Bu[Build<br/>anim.html]
Bu --> R[Render + review<br/>2-4 rounds]
R --> A[Audit<br/>numbers as checks]
A --> S[Score<br/>optional]
S --> E[Export<br/>MP4 / GIF / X limits]
E --> Rc[Receipts]
R -. notes .-> Bu
A -. failures .-> Bu
- Direct. The brief becomes a prompt on a fixed template: GOAL, OUTPUT, TIME, LOOK, MOTION, SHOTS, BANNED, QA.
"Smooth and premium" becomes
cubic-bezier(0.22, 1, 0.36, 1) over 18 frames.
- Build. One HTML file (plain DOM/Canvas/SVG, three.js, or a Remotion / HyperFrames / Motion project) that
follows the render contract. A hook lints every edit.
- Render and review. A review pack (stills, labelled contact sheet, speed graph, probe values) goes to the
motion-reviewer agent, which returns notes tied to frame numbers. One or two notes are applied per round.
- Audit. The
motion-auditor agent turns every number in the prompt into a check (hit frames, landing values,
bounds, loop seam, determinism) and runs them against the live scene.
- Score (optional). Sound is synthesized in code from the scene's events with Web Audio, then measured from
the decoded file: each hit lands one frame after its picture, about -14 LUFS, true peak at or below -1 dBTP.
- Export. MP4 and GIF are checked against X's limits, and the loop seam is diffed.
- Receipts. Your words and Claude's directed prompt are kept apart and counted, so the post says honestly
how it was made.
Part of a review pack: a contact sheet with frame numbers, so review notes can name the frame.
The render contract