Documentation / Artifact types

Motion

Motion creates short animated films—explainers, product promos, launch clips, UI walkthroughs, title sequences, and animated GIFs—built as deterministic HTML, CSS, and JavaScript scenes drawn as a pure function of time t over painted, lit sets, backed by small JSON documents (db/). One film can hold several versions and play in several aspect ratios.

When NOT to use Motion: Don't use it when a human presenter wants to step through static slides at their own pace (use Slides) or for static marketing graphics (use Design).

Key features

  • Deterministic time-driven scenes: Each scene (modules/scene-<id>.js) renders cleanly from time t, ensuring smooth interactive scrubbing in the browser and frame-accurate video export.
  • Rough cut → live finalize workflow: Opens immediately after the rough cut (stage: "rough"), so you watch the storyboard play while the agent builds out scenes, drawings, music, and polish live. Once the film is whole, the agent looks at stills of every scene and mends what they show before handing it over.
  • Painted sets and a plan you can edit: Each scene paints its set in layers with one key light, depth and weather, and moves things by a shared plan (W.plan), so later changes to a camera move or a thing's timing are small data edits.
  • Scene transitions: Each scene can come on with a fade, push, wipe or iris ("enter" in scenes.json); change it on the page too.
  • Procedural score & captioned voiceover: Synthesize background music and sound effects in code (modules/score.js), attach recorded voiceover clips with synced captions (modules/narration.js), or play a video clip's own sound (an interview, a talk) sentence by sentence under captions, with no audio file cut by hand.
  • Direct by-hand editing without code: Right inside the player, you can retype text, recolor palettes, refont typography, recut scene lengths and transitions, retouch individual element styles, add titles, and lay videos, photos, shapes and sounds over scenes—stored in separate non-destructive records that the agent respects on future turns.
  • Filmstrip timeline: Scene cards with thumbnail frames, a ruler and zoom, plus a row each for titles, captions, transitions, overlays and sound.
  • Your own photos, videos and captions: Add a photo or a video as a scene from the page, edit what's said right on the picture, or load captions from an SRT or VTT file.
  • Versions and aspect ratios: Ask for three more versions or a different one, pick between them in a strip above the player, or add Vertical 9:16, Square 1:1 or Portrait 4:5 to the same film—laid out again for that shape, not cropped.
  • Undo the agent's turn: When the agent finishes, the page offers to undo everything it just changed in one step.
  • Design System & real UI assets: Install a Design System or upload your product's real logos, icons, fonts, screenshots, and clips.
  • Flash-safety & visual verification: Built-in Rust/WASM flash analysis enforces safe motion (no flashing/cutting > 3 times/sec), and agents can render headless Chromium stills at exact timestamps to inspect every scene visually.
  • Moment & spot comments: Pin comments to an exact timestamp or a specific point in the frame, then click Send to agent.
  • Exports: Export to MP4, GIF, MOV with transparency (for overlays), a standalone HTML player, or a source ZIP from Share → Export.

How to use (for users)

Create an animated film

/open-artifacts motion a 20-second launch animation for our open-source CLI tool
/open-artifacts motion a 30-second animated explainer showing how DNS resolution works
/open-artifacts motion a 10-second looping promo GIF using our Acme design system

Play, tweak by hand & export

  • Watch & scrub: Play/pause, scrub the timeline, toggle captions/audio, and watch scenes arrive live starting from the rough cut.
  • Tweak directly: Click on-screen copy to retype it, swap colors or fonts, trim/extend scene durations, change a transition, add a title or a shape, or restyle single elements by hand.
  • More versions & aspect ratios: Use the strip above the player to ask for more versions, duplicate or rename one, or add another aspect ratio.
  • Pin feedback in time & space: Pause on any frame, pin a comment to that moment or a spot on screen (e.g. "slow down the reveal here and make the headline punchier"), and click Send to agent.
  • Export: Open Share → Export to render MP4, GIF, MOV, standalone HTML player, or source ZIP.

How to use (for agents)

  • Type ID: motion (type_url: "open-artifacts://type/motion")
  • Storage model: Live JSON document store under <root>/db/:
    • db/film/meta.json — {"v": 1, "title", "updatedAt"}
    • db/film/script.json — {"code": "window.CUT = kit.scenes();"} (written last in the first batch)
    • db/modules/scenes.json.json — scene list and transitions, stage ("rough" → "final"), dimensions, FPS, palettes, fonts, "prompt": "2", other aspect ratios ("ratios")
    • db/modules/base.css.json, shared.js.json (the plan and its runner), shared-<n>-<thing>.js.json (the kit and shared drawings), scene-<id>.js.json, score.js.json, narration.js.json
    • db/versions/, db/version-modules/, db/version-edits/ — the film's other versions
    • db/assets/<name>.json — uploaded images, fonts, video/audio clips (/_blob/<id>)
    • Page-owned by-hand records (read-only for agents): retyped.json, recolored.json, refaced.json, fetched-fonts.json, recut.json, retouched.json, laid.json, hand-titles.json.
  • Limits: 1–24 scenes; up to 36,000 seconds (10 hours); 200 KiB per document (larger modules split into <name>~1…~99); up to 500 modules (16 MiB total) and 96 assets; batches up to 50 writes / 1 MB.

Workflow & commands

Task Under daemon (MCP tools) Standalone CLI (artifact-types/motion/scripts/cli.mjs)
Create Artifact {action: "publish", type_url: "open-artifacts://type/motion", title, open: "after_first_write"} open-artifacts open <root> --type motion --title "<title>" --json
Read store ArtifactData {action: "list" | "get", url, ...} open-artifacts read-db <root> [path] [--text]
Write / batch ArtifactData {action: "batch" | "set" | "update" | "str_replace", url, ...} open-artifacts write-db <root> '<writes>' (supports {"$file":"..."})
Upload media/audio Artifact {action: "call", url, name: "upload", args: {file: "<abs path>"}} open-artifacts upload <root> <file>... [--name N]
Validate Artifact {action: "call", url, name: "check"} open-artifacts check <root>
Look at frames Artifact {action: "call", url, name: "snapshot"} (the page as it draws now) open-artifacts stills <root> --at <t1,t2,...> [--scale n]
Bring an older film up to date Artifact {action: "call", url, name: "upgrade"} open-artifacts upgrade <root> [--dry-run] [--json]
Signal waiting for user Artifact {action: "call", url, name: "asking"} open-artifacts asking <root> [--done]
Inspect time/scene/version Artifact {action: "call", url, name: "context"} open-artifacts context <root>

Key rules for agents

  1. Open early on rough cut: Write film/meta, modules/scenes.json ("stage": "rough", "prompt": "2"), modules/base.css, and film/script first and show the page immediately—before authoring final scenes or score—so the user watches progress live.
  2. Respect by-hand edits: Never write the page's by-hand records (retyped.json, recolored.json, refaced.json, fetched-fonts.json, recut.json, retouched.json, laid.json, hand-titles.json). If any exist on a film, read artifact-types/motion/reference/by-hand.md in full before editing.
  3. Call asking before asking the user a question while the film page is open so the UI shows "Waiting for you".
  4. Safety & honesty: No scene shorter than 1 second; nothing flashes/blinks/cuts more than 3 times per second; no deceptive countdowns or external URLs. Always run check, then look at the whole film once with stills (or snapshot) and mend what it shows.
  5. Older films: If scenes.json has no "prompt": "2", run upgrade once ahead of the first change.

For complete kit API, rough-cut/finalize/look guides, painting, sound synthesis, voiceover, versions, aspect ratios, and explainer craft, read artifact-types/motion/SKILL.md and artifact-types/motion/reference/.