Motion Render
/motion-render <theme> – with a single phrase, create an animated video explaining the theme, add narration and BGM, and output an MP4 file.
Narration and BGM are always added. Do not create a video without audio. When converting an existing Motion video to MP4, also write scene-appropriate narration and generate BGM.
How to Decide: Decide Without Asking
Claude decides everything except the theme. Only follow what the user explicitly specifies. Do not stop to ask questions.
| Item | Default |
|---|---|
| Duration | ~60 seconds (6–9 scenes). Final length is determined by narration length |
| Visual style / color scheme | Decide based on the theme. If the user's organization has a standard design system, use its color scheme |
| Voice / speech rate | Kore, 1.1x speed |
| BGM | Write prompt for Lyria based on the theme's atmosphere (see "BGM" below) |
| Output directory | $MOTION_RENDER_OUT_DIR if specified, otherwise current directory. If current directory is a git repository, use a non-working directory like ~/Movies |
Motion's Artifact type requires asking about Style, Colors, and Length during creation, but this skill treats it as if the user asked to "decide and handle it" and decides without asking.
0. Preparation (Check First, Every Time)
This skill uses the motion-render command for rendering and composition. If installed as a Claude Code plugin, the plugin provides motion-render and the user does nothing. If installed as a standalone skill (via skills CLI, etc.), use the skill's directory (the "Base directory for this skill" passed to Claude, referred to as <skill>).
- Run
motion-render --versionand compare with theversionin<skill>/package.json. If the same, proceed. - If the command is missing or the version differs, run
npm install -g "<skill>". If this fails due to permissions or sandbox restrictions, instruct the user to reinstall it as a Claude Code plugin (see README's "Installation"; additional work will then be unnecessary). - Without
GEMINI_API_KEY,narrateandbgmwill fail. If they fail, instruct the user to obtain an API key from Google AI Studio, addexport GEMINI_API_KEY=...to their shell configuration, and restart Claude Code. - If Chromium fails to start with
bootstrap_check_in ... Permission deniedwhen runningmotion-render stillsetc., it is because it is running inside the Claude Code sandbox. Instruct the user to add the following to~/.claude/settings.json(Claude cannot change its own permission settings):"sandbox": { "excludedCommands": ["motion-render:*"] }and"permissions": { "allow": ["Bash(motion-render:*)"] }
On the first run of stills or build, Chromium (~210 MB) will be downloaded automatically.
Prerequisites
- Run
motion-renderby itself. Adding anything around it like| grep,&&,FOO=1 motion-renderwill cause it to run inside the sandbox and Chromium will fail to start. The same applies tonarrateandbgm, which use the network. - Create the working directory
<work>in the scratchpad (or working directory if no scratchpad) with a lowercase English name representing the theme.
Working Directory
<work>/
script.json # Script (written by Claude)
timing.json # Scene durations (written by narrate)
audio/ # <scene_id>.wav, bgm.mp3, mix.m4a
film/ # Video data retrieved from Motion (extracted by prepare)
Format of script.json:
{
"title": "Workload Identity Federation",
"bgm": "Calm, focused electronic music for a cloud security explainer: soft pulsing synth, light percussion, 100 BPM",
"scenes": [
{ "id": "title", "name": "Title", "narration": "With Workload Identity Federation, ..." },
{ "id": "token", "name": "Token Issuance", "narration": "..." }
]
}
iduses lowercase letters, numbers, and-. Must match the scene id in Motion.narrationis the text to be read by TTS. Write proper nouns and acronyms as they are (e.g.,GitHub Actions). Screen text remains in its original form.- Optional:
voice,speed,bgmVolume(default 0.15),lead,tail,endHold
Procedure
1. Write the Storyboard and Script
Divide the theme into one event per scene. For explaining a mechanism, the following structure works well:
- Place appearing elements (e.g., GitHub Actions, Token, Google Cloud STS, Service Account) as cards in the scene.
- Depict interactions (tokens, requests) as chips moving between cards. Show order with a numbered flow diagram and highlight the current step.
- At the beginning, state "what this is about"; at the end, state "what the result is" in one sentence.
- Narration per scene is 1–2 sentences (5–9 seconds when spoken).
Prioritize accuracy. If unsure about any part of the mechanism explanation, verify it with official documentation before writing.
2. Create Narration (Determines Scene Durations)
motion-render narrate <work>
This produces timing.json with the start time and duration of each scene. Use these values directly for Motion scene dur.
3. Create Motion Video
- Use
Artifact’squickstart(intent: "other") orlist(scope: "types") to find the Motion type’stype_url, then create it with atitle. - Follow the returned Motion type instructions to create scenes. However:
- Do not ask questions (see "How to Decide" above).
- The scene
idanddurinscenes.jsonmust match those intiming.json. - Do not create Motion’s built-in BGM (
score.js). This skill handles the audio.
- You may create BGM in parallel:
motion-render bgm <work>
4. Retrieve and Review Video Data
- Use
Artifact’sreadwithpaths: ["index.html", "artifact-type/app.js", "artifact-type/app.css"],out_dir: <work>/film - Use
ArtifactData’slist(collection: "modules") andget(film/script) saving toout_dir: <work>/store motion-render prepare <work>/store <work>/filmmotion-render stills <work>/film <work>/stills <comma-separated mid-scene times in seconds>to see all scenes. If there are unnatural line breaks, overflow, or overlap in headings, fix the Motion side and redo step 4.
5. Create MP4
motion-render build <work> [<output.mp4>]
Place narration at the start of each scene, overlay BGM at constant volume, and create MP4. It will stop if narration or BGM is missing.
6. Verify and Report
- Use
ffprobeto check that the file has both video and audio tracks and the correct duration. - Report: output path, duration, scene flow, BGM atmosphere, Motion URL. If you did not listen to the audio, note that you did not.
BGM
In script.json’s bgm field, write an English prompt that matches the theme’s atmosphere. Be specific about instruments, tempo, and mood.
| Theme Type | Prompt Example |
|---|---|
| Technical mechanism / security | calm focused electronic, soft pulsing synth, light percussion, ~100 BPM |
| News / announcement | modern news broadcast theme, driving synth arpeggio, tight electronic drums, ~120 BPM |
| Product introduction / upbeat topic | warm upbeat, marimba and electric piano, light shaker, ~110 BPM |
| Retrospective / mellow | gentle ambient piano, soft pads, slow |
If the user says the BGM is "lame" etc., rewrite bgm and redo motion-render bgm → motion-render build. No need to re-render the video (the build command renders each time, but no changes on the Motion side are needed).
When Converting an Existing Motion Video to MP4
Also add audio when given a URL. Retrieve the video data (step 4), and for each scene in scenes.json, write narration that fits within that scene’s duration (approx. 7–8 characters per second; use the same id as in scenes.json). build will place narration at the actual scene start time in the video and warn if any narration doesn’t fit within the scene. If warnings appear, trim the script or increase speed and redo from narrate.
Files
scripts/cli.mjs:motion-rendercommandscripts/audio.mjs: Gemini TTS / Lyria calls (with 90-second timeout and retries) and audio mixingscripts/work.mjs: Validation ofscript.jsonand calculation oftiming.jsonscripts/render.mjs: Opens player and returns frames. Blocks external communication during rendering and enables Chromium sandbox