К основному содержанию
плагин

motion2code — плагин для Claude Code: что делает и как установить

Плагин motion2code для Claude Code пересобирает видео motion design в редактируемые SVG- и GSAP-анимации. Он сравнивает результат с исходником по кадрам.

MIT ★ 361 обновлён 2026-10-20

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add lovisdotio/motion2code
/plugin install motion2code@motion2code
Открыть на GitHub

Что делает motion2code

Плагин motion2code превращает ролик в редактируемую анимацию на inline SVG и одной GSAP timeline. Агент изучает видео, собирает кадры через study_video.py, определяет палитру и проверяет, замыкается ли цикл. Для записи экрана сайта он может собрать настоящую страницу с кнопками, клавиатурным управлением и ScrollTrigger.

Набор скриптов включает сравнение исходника с кодом, проверку разрыва цикла и детерминированного seek(t), а также покадровый рендер в MP4, GIF или PNG. Без Python 3.9+ и ffmpeg скрипты не запустятся; для открывающих браузер скриптов нужен Playwright. Установить его можно через uv run --with playwright python ... или через pip install playwright && python -m playwright install chromium.

Какие задачи решает

  • пересобрать motion design ролик в SVG и GSAP
  • сверить анимацию с исходным видео по кадрам
  • замкнуть цикл на исходном первом кадре
  • превратить запись интерфейса в интерактивный сайт
  • отрендерить анимацию в MP4, GIF или PNG

Примеры запросов агенту

  • Пересобери clip.mp4 в SVG- и GSAP-анимацию с зацикливанием.
  • Преврати запись экрана приложения в настоящий сайт с ScrollTrigger.
  • Проверь index.html командами python3 scripts/frame_diff.py clip.mp4 index.html -o diff/ и python3 scripts/check_anim.py index.html --runtime.

Как установить motion2code

Через маркетплейс плагинов

/plugin marketplace add lovisdotio/motion2code
/plugin install motion2code@motion2code

По шагам, с командами для каждой платформы: Плагины Claude Code: маркетплейсы, установка и как собрать свой

Вопросы о motion2code

Что делает motion2code?

Плагин пересобирает motion design видео в редактируемый inline SVG с анимацией через GSAP. Он изучает исходник, сравнивает кадры с результатом и проверяет цикл.

Что нужно для работы motion2code?

Нужны Python 3.9+ и ffmpeg. Скриптам, которые открывают браузер, нужен Playwright; его устанавливают через uv run --with playwright python ... или pip install playwright && python -m playwright install chromium.

Исходный текст

SKILL.md · MIT
# Motion2Code

A skill that teaches coding agents to rebuild a motion design video as clean, editable code: inline SVG shapes
animated by one GSAP timeline, seekable frame by frame, looping seamlessly, and checked side by side against the
source. For screen recordings of websites and apps it goes one step further and builds the real, interactive site
with GSAP ScrollTrigger. It works with Claude Code, Codex, Cursor, Copilot, Gemini and others.

**See them running live:** [fal-motion-in-code.vercel.app](https://fal-motion-in-code.vercel.app)

| | | |
|---|---|---|
| [![Think Big](gallery/think-big/poster.gif)](gallery/think-big/index.html) | [![Eye](gallery/eye/poster.gif)](gallery/eye/index.html) | [![Festival map](gallery/festival-map/poster.gif)](gallery/festival-map/index.html) |
| Kinetic type: a square grows into THINK, a bar wipes to BIG, the period becomes a sun. 10 s, 24 KB | Match cuts: an eye opens, its pupil becomes the O of LOOK, a grid of blinking eyes, SEE., NOTICE. 10 s, 40 KB | Festival site replay: the poster folds into a map, a stage card plays, day turns to night. 15 s, 52 KB, [real site](gallery/festival-map/site.html) |
| [![Weather radar](gallery/weather-radar/poster.gif)](gallery/weather-radar/index.html) | [![Sticker portfolio](gallery/sticker-portfolio/poster.gif)](gallery/sticker-portfolio/index.html) | [![Podcast player](gallery/podcast-player/poster.gif)](gallery/podcast-player/index.html) |
| Weather site replay: the slider drags rain bands across the map, TUE turns it sunny, WED strikes lightning. 15 s, 60 KB, [real site](gallery/weather-radar/site.html) | Portfolio replay: a sticker is dragged, the cat unfolds into a grid of cards, HI!, every sticker flies home. 15 s, 56 KB, [real site](gallery/sticker-portfolio/site.html) | Podcast page replay: PLAY, the waveform pulses, transcript bars light up, the cover bounces to the beat. 15 s, 36 KB, [real site](gallery/podcast-player/site.html) |

Each image links to its self-contained `index.html`. Every folder in [`gallery/`](gallery/) also has `compare.html`
(the source and the code side by side, synced frame by frame) and the source clip at 480p. The source videos were
generated with MiniMax H3 Max on fal (fal.ai) and rebuilt by Claude Opus 5.5 with this skill.

## Why

![Source video and code, side by side](gallery/hero.gif)

Agents animate blind: they cannot watch the video. Asked to "recreate this clip", they write what they imagine:
the wrong beat at the wrong second, `power1.inOut` where the source snaps and overshoots, colors from memory, words
spelled the way the model misspelled them, and an animation that jumps when it loops. Some quietly embed the
video or trace its frames instead of rebuilding it. This skill closes those gaps:

- **Look before coding.** `study_video.py` turns the clip into what an agent can see: a frame every 0.25 s, the
  frames around every hard change, a contact sheet, the exact flat palette, and whether the source loops.
- **One clock, one contract.** A single GSAP timeline drives everything and the page exposes
  `window.anim.seek(t)`, so any moment can be rendered, compared and tested deterministically.
- **Proof, not "looks right".** `frame_diff.py` puts the source and the code side by side at any time, down to
  every frame of a transition, with a score to rank the worst moments. `compare.html` does the same live.
- **The loop is done in code.** Even when the video does not loop, the last moment returns to the exact opening
  frame; `check_anim.py` measures the seam.
- **Exact frames out.** `render_anim.py` renders through `seek(t)`, frame by frame, so proof videos and GIFs never
  drop or double frames.
- **Vectors at any size.** The source is a 1080p video; the code renders sharp at 4K, 8K, 16K or 32K, weighs tens of
  kilobytes, and stays editable: recolor, retime or rewrite a word in a text editor.
- **Real sites from fake ones.** A video model's "screen recording" becomes a working page: real scroll with
  ScrollTrigger, real buttons, keyboard and mobile support.

## Install

**Claude Code** (plugin marketplace):

```bash
claude plugin marketplace add lovisdotio/motion2code
```

```bash
claude plugin install motion2code@motion2code
```

Or copy the skill: `cp -R skills/motion2code ~/.claude/skills/`.

**Codex, Cursor, Gemini CLI, Copilot and about 70 other agents** (via [skills](https://github.com/vercel-labs/skills)):

```bash
npx skills add lovisdotio/motion2code
```

Or install by hand:
- **Codex:** copy `skills/motion2code` to `~/.agents/skills/`.
- **Cursor:** copy it to `~/.cursor/skills/`, plus the rule in `adapters/cursor/`.
- **Copilot:** `gh skill install lovisdotio/motion2code motion2code`, plus `adapters/copilot/`.
- **Gemini CLI:** `gemini extensions install https://github.com/lovisdotio/motion2code`.
- **Hermes:** copy it to `~/.hermes/skills/`.

**claude.ai:** zip `skills/motion2code` and upload it under Settings > Capabilities > Skills.

**ChatGPT, Gemini Gems and other chat tools:** see [`adapters/`](adapters/).

The scripts need Python 3.9+, ffmpeg, and Playwright for the ones that open a browser
(`uv run --with playwright python ...`, or `pip install playwright && python -m playwright install chromium`).

## Use

Ask naturally: *"Rebuild clip.mp4 as an SVG + GSAP animation that loops"*, or *"turn this app screen recording into
a real site"*. For a full brief, fill in [`prompts/convert-video-prompt.md`](prompts/convert-video-prompt.md).
The agent studies the video, builds the page, then checks it:

```bash
python3 scripts/study_video.py clip.mp4 -o study/
python3 scripts/frame_diff.py clip.mp4 index.html -o diff/
python3 scripts/check_anim.py index.html --runtime
python3 scripts/render_anim.py index.html -o anim.mp4
python3 scripts/side_by_side.py clip.mp4 anim.mp4 -o side_by_side.mp4 --html index.html
```

What the scripts do:
- `study_video.py` saves frames every 0.25 s (named by time), the frames before and after each detected cut, a
  contact sheet, the palette and a loop score of the source in `study.json`.
- `palette.py` prints the exact flat colors of a video or image as hex with their share of the frame.
- `frame_diff.py` writes source | code image pairs at the given times (or every frame of a range), a sheet of all
  pairs, and a difference score per time with the worst five.
- `check_anim.py` checks the page contract, the script allowlist and the absence of embedded raster or video; with
  `--runtime` it also opens the page headless and checks console errors, network requests, the loop seam, that
  `seek` is deterministic, and that the page autoplays.
- `render_anim.py` renders the page frame by frame through `anim.seek` to an mp4, a GIF poster or PNG frames,
  at any `--size`.
- `side_by_side.py` stacks the source and the render into one labelled proof video (landscape or portrait).

To view a gallery entry with its comparison, serve the folder (`python3 -m http.server -d gallery/eye`) and open
`http://127.0.0.1:8000/compare.html`.

## The page contract

```js
window.anim = { tl, duration, seek(t), play(from), pause() }   // seek(t) is a pure function of t
```

- `index.html?t=6.5` freezes at 6.5 s, `?external=1` waits to be driven, no parameter plays and loops.
- `<html data-ready="1">` once fonts are loaded and the first frame is drawn.
- Self-contained: inline SVG, GSAP 3 from cdnjs, flubber from jsdelivr only for morphs, Google Fonts. Nothing else.

## Hard rules

- Use only the given source video: never regenerate it, never embed it, never trace its frames.
- Text exactly as in the source prompt, even when the video misspells it.
- Flat shapes as SVG, colors sampled from the source.
- The GSAP timeline is the single clock.
- The loop is done in code: frame(duration) equals frame(0).
- Every moment is checked against the source, side by side.

## Repository

```text
skills/motion2code/   the skill: SKILL.md, references/, scripts/, templates/
gallery/              six rebuilt clips: index.html, compare.html, source.mp4 (480p), poster.gif, site.html
prompts/              fill-in conversion prompt and advice for source prompts
adapters/             prompts for tools without skill support
tests/                repository checks (every gallery page and template)
.claude-plugin/       Claude Code plugin + marketplace manifests
```

Contributing: see [AGENTS.md](AGENTS.md) for the rules every change must pass.

## License

MIT, Lovis Odin. The gallery source clips were generated with MiniMax H3 Max on fal and are included at 480p for
comparison only.

© Lovis Odin · MIT · lovisdotio/motion2code

Похожие плагины

Все плагины по теме «Фронтенд и UI» →
gsap Mindrally Задаёт агенту правила анимаций на GSAP: трансформы вместо left/top, stagger, таймлайны и ScrollTrigger. Описывает настройки для интерфейсов, которые дёргаются на слабом железе. CX Codex +1 815установок gsap-scrolltrigger greensock Скилл gsap-scrolltrigger обучает ИИ-агента писать анимации по скроллу с плагином ScrollTrigger от GreenSock: закреплять секции и связывать таймлайны с прокруткой через scrub. CX Codex +1 87 300установок cinematic-gsap-lenis-motion-system MengTo Скилл cinematic-gsap-lenis-motion-system для Claude Code настраивает кинематографичную анимацию интерфейса на GSAP, ScrollTrigger и Lenis. Добавляет плавный скролл и параллакс сайтам и портфолио. CX Codex +1 3 400установок awwwards-animations DevMartinese Скилл awwwards-animations для Claude Code: React-анимации уровня Awwwards и FWA — скролл, кастомные курсоры, переходы страниц, генеративная графика. Создаёт плавный 60fps-скролл и сложные эффекты. CX Codex +1 3 300установок cinematic-scroll-storytelling MengTo Скилл cinematic-scroll-storytelling настраивает плавную прокрутку и сценарную анимацию страниц через Lenis и GSAP ScrollTrigger. Пригодится при сборке редакционных лендингов, стопок карточек и кинетической типографики. CX Codex +1 2 700установок gsap-scrolltrigger-generate_animation Claude Design Skillstack Слэш-команда gsap-scrolltrigger-generate_animation вызывает generate_animation.py из скилла GSAP ScrollTrigger: собирает анимацию прокрутки, а недостающие данные спрашивает в интерактивном режиме. CX Codex +1 ★ 1 428звёзд репо

Из того же набора6

motion2code Правило motion2code для Claude Code собирает исходное видео в SVG-анимацию для index.html, compare.html и site.html. Запускается при работе с этими файлами. CX Codex +1 ★ 361звёзд репо motion2code Правило motion2code для Claude Code собирает анимационный ролик в виде SVG и кода GSAP. Оно запускается при работе с файлами индексов, сравнений, сайтов и SVG-графики. CX Codex +1 ★ 361звёзд репо convert-video-prompt Промпт convert-video-prompt для Claude Code пересобирает видео в SVG-анимацию внутри одного index.html. Он запускает проверку кадров и переходов. GP ChatGPT ★ 361звёзд репо source-video-prompt Промпт source-video-prompt для Claude Code описывает создание исходных роликов для переноса плоской анимации в код. Инструмент задаёт правила для генерации видео без теней, градиентов и сложных камер. GP ChatGPT ★ 361звёзд репо motion2code Скилл motion2code для Claude Code переносит анимацию из 2D-видео в чистый код с инлайновым SVG и шкалой GSAP. Включается при запросах воссоздать ролик, моушн-дизайн или скринкаст интерфейса в вебе. CX Codex +1 ★ 361звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой