motion2code · lovisdotio, cursor — Claude Code rule: what it does, how to install
The motion2code rule for Claude Code rebuilds motion design videos as SVG and GSAP code. It triggers during work on index, compare, site pages, and SVG files.
MIT ★ 361 updated 2026-10-20
.cursor/rules/motion2code.mdcWhat motion2code does
The rule turns motion design videos into code using an inline SVG at source resolution and a single GSAP timeline as the clock. The agent runs scripts/study_video.py before writing code, and checks the result with scripts/frame_diff.py and scripts/check_anim.py --runtime before finishing.
The code setup exposes window.anim with tl, duration, seek, play, and pause, plus parameters like ?t=, ?external=1, and data-ready. Words stay exact to the prompt, colors are flat sampled, and the source video is never regenerated or embedded.
The rule points to the separate motion2code skill located in ~/.cursor/skills, ~/.claude/skills, or .agents/skills.
What it helps with
- rebuild motion design as SVG and GSAP
- check animations before completion
- study source video before coding
- ensure smooth code loops
Example prompts for the agent
- Rebuild this motion video as SVG and GSAP with motion2code
- Run study_video.py before writing the animation code
- Check the animation runtime with check_anim.py
How to install motion2code
Manually: put the files in place
.cursor/rules/motion2code.mdcFrontmatter: description, globs, alwaysApply
1Plugin marketplace
/plugin marketplace add lovisdotio/motion2code/plugin install motion2code@motion2code2Manually: put the files in place
.claude/rules/motion2code.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/motion2code.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/motion2code.mdManually: put the files in place
.clinerules/motion2code.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about motion2code
How to install motion2code in Claude Code?
Run /plugin marketplace add lovisdotio/motion2code followed by /plugin install motion2code@motion2code, then place the file in .claude/rules/motion2code.md.
What does motion2code do?
It structures the workflow for turning motion design videos into SVG and GSAP timelines with strict script checks.
What is required to run motion2code?
The rule requires the matching motion2code skill installed in the skill directories so the rule can point to it.
Source text
motion2code.mdc · MIT
---
description: Rebuilding a motion design video as SVG + GSAP code (replay, compare, loop, real site)
globs: **/index.html,**/compare.html,**/site.html,**/*.svg
alwaysApply: false
---
Copy this file into your project's `.cursor/rules/`. Install the skill too (Cursor reads `~/.cursor/skills`,
`~/.claude/skills` and `.agents/skills`), so the rule can point at it.
- Use the `motion2code` skill: `scripts/study_video.py` before writing code, `scripts/frame_diff.py` and
`scripts/check_anim.py --runtime` before calling it done.
- One inline SVG at the source resolution, one GSAP timeline as the only clock, `window.anim = { tl, duration,
seek, play, pause }`, `?t=`, `?external=1`, `data-ready`.
- Only the given source video, never regenerated or embedded; words exactly as in the prompt; flat sampled colors.
- frame(duration) equals frame(0): the loop is done in code.
© Lovis Odin · MIT · lovisdotio/motion2code
Similar IDE rules
All IDE rules for Frontend and UI →motion2code by other authors comes first.