Create an animation with OpenRive
Use this skill when the requested result is a real .riv asset, not a mockup or a CSS-only animation.
Choose the connection
-
Prefer the OpenRive MCP server when the agent has an MCP connection.
- Local stdio uses the configured
openriveserver in.mcp.json. - HTTP MCP uses the deployment's
/api/mcpendpoint and a scoped bearer key. - Remote MCP requests must send
.rivbytes asdataBase64; filesystem paths are local-stdio only.
- Local stdio uses the configured
-
Use the OpenRive CLI when MCP is unavailable:
bun run cli templates bun run cli new "Animation name" --template interactive-button bun run cli info "Animation name" --json bun run cli export "Animation name" ./animation.riv bun run cli validate ./animation.riv -
If neither interface is available, explain the missing connection and provide the exact setup needed. Do not invent a
.rivbinary or silently substitute an unrelated format.
Work on Windows and Linux
- Use
buncommands and agent file tools; do not require Bash,sed,grep,chmod,/tmp, or Unix-only process behavior. - Quote paths that contain spaces. Use
./relative/pathin documentation when a shell path is needed, and let the host shell resolve the absolute path. - Keep web asset URLs and paths inside generated JavaScript in forward-slash form. Host application code must use its platform path API rather than concatenating backslashes or slashes.
- Local stdio MCP works on both Windows and Linux when the client launches
bunfrom the repository. If an agent cannot create symlinks, install skills with--copy.
Build the file
- Call
list_templatesfirst. Pick the smallest template or example that teaches the requested behavior; useblankonly when no existing starter fits. - Create one named project and keep its project id/ref for the entire task.
- Name every artboard, object, timeline, state machine, state, property, and theme that the host application will need to address later. Names are the stable handoff API.
- Use the high-level OpenRive API through MCP tools. Do not edit the internal serialized document directly.
- For interaction, prefer data-binding properties with
add_propertyandset_property_value. Useadd_inputonly when preserving a legacy file that already depends on deprecated state-machine inputs. Add transitions and listeners against the named property. - For visual customization, define theme colors and bind fills/strokes to them. This gives the host application a safe way to recolor the animation.
- For motion, create a timeline, add keyframes, then connect it to an animation state. Use explicit easing and duration. For pointer interaction, add a named hit-area shape and listener rather than relying on an invisible DOM overlay.
- Keep the artboard bounds and origin intentional. Confirm the requested animation fits the artboard at its default size.
Inspect and hand off
- Call
get_projectafter meaningful edits. Confirm the object tree, timelines, state machines, properties, and themes. - Export the actual
.rivfile:- local MCP: use
export_rivwith a local path; - HTTP MCP: use the returned
dataBase64and decode it in the host project; - CLI: use
openrive export <project> <out.riv>.
- local MCP: use
- Run
inspect_rivoropenrive infoon the exported bytes. Verify the artboard and runtime names that the embedding code will use. - Run
openrive validatefor imported or re-exported files. Unmodified source files must remain byte-identical after a round trip. - If the user wants a self-contained demo, export a preview bundle with
openrive export <project> <out.zip> --bundleand explain the offline versus CDN runtime choice.
Completion report
Report the project ref, exported file path or transport, artboard names, animation/state-machine/property names, runtime assumptions, and validation result. Include the next step from openrive-embed-animation when the file will be used in an application.
Safety and quality rules
- Never delete a project unless the user explicitly asks; use a scratch project for experiments.
- Never overwrite an existing
.rivwithout confirming the destination or creating a backup. - Do not claim that an animation works in a host runtime until the host project loads it and the relevant controls are exercised.
- Preserve OpenRive attribution in a source-code comment next to the embedding integration. Keep it out of rendered UI unless the user explicitly requests visible branding.
- If an OpenRive-owned bug reproduces while creating or exporting the file, follow
openrive-report-issueautomatically and include the resulting issue or duplicate link in the handoff.