MCPInstall

reverse-engineer-animation

Reverse-engineers a UI animation from a screen recording. Extracts frames with ffmpeg, tracks motion per frame with OpenCV, fits easing and spring curves, annotates choreography (leads, lags, over-stretch), and emits CSS, Motion/Framer Motion, SwiftUI, React Native, or UIKit code plus a handoff motion spec. Use when the user shares or uploads a screen recording or video of a UI animation, or asks to "reverse engineer this animation", "recreate this animation", "match this easing", "extract the animation curve", "figure out the spring from this video", "copy this transition from a video", "how does this animation work", or "reproduce this motion". For designing new motion from scratch or reviewing motion code, use ui-animation instead.

Installs
104
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/mblode/agent-skills --skill reverse-engineer-animation
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads reverse-engineer-animation automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Reverse Engineer Animation

  • IS: measuring motion that already exists in a recording (extract frames, track per frame, fit curves, annotate choreography), then emitting code and a handoff spec that reproduce it.
  • IS NOT: designing new motion from scratch, or reviewing/debugging motion code. Route both to ui-animation.

Contents

  • Reference files
  • Dependencies
  • Workflow (extract, vision pass, track, fit, annotate, emit, validate)
  • Gotchas
  • Validation
  • Related skills

Reference files

FileRead when
references/measurement-guide.mdDeciding what to measure, eye vs script, reading metrics.json, choosing an ROI
references/curve-fitting.mdReading fit_curves.py output, spring vs bezier, judging fit error, asymmetric open/close
references/code-output.mdEmitting code for CSS, Motion/Framer Motion, SwiftUI, React Native, or UIKit
references/choreography.mdMulti-element / multi-phase motion: staggers, blur-before-move, per-edge settling

Dependencies

  • ffmpeg: frame extraction (brew install ffmpeg). Required for step 1.
  • Python: pip install opencv-python numpy scipy for tracking + curve fitting (step 4).

Extraction degrades gracefully: with only ffmpeg you can still extract frames and reason visually. Tracking and fitting need the Python packages.

Workflow

Copy and track this checklist:

Reverse-engineer progress:
- [ ] Step 1: Extract frames + contact sheet (per direction if open differs from close)
- [ ] Step 2: Vision pass: identify element, effects, phases
- [ ] Step 3: Decide precision (eye-only vs scripted)
- [ ] Step 4: Track motion and fit curves (if escalating)
- [ ] Step 5: Annotate choreography (delays, asymmetry)
- [ ] Step 6: Emit code for the target(s)
- [ ] Step 7: Validate against the recording

Step 1: Extract frames

Run python3 scripts/extract_frames.py <video> <outdir>. On a multi-second recording, trim to just the transition with --start SECONDS --duration SECONDS; extracting the whole clip floods the contact sheet and dilutes tracking. If the interaction has both an open and a close, trim two windows and run the whole pipeline once per direction. They are almost never mirror images, so one measurement cannot serve both.

Match --fps to the source: probe with ffprobe -v 0 -select_streams v -show_entries stream=avg_frame_rate <video> and never sample above the source rate (see Gotchas). Open the generated contact_sheet.png first; it shows the whole timeline at once.

Step 2: Vision pass

View the contact sheet and name, in order:

  • The element(s) that move.
  • Every effect present: translate, scale (often anisotropic), opacity, blur, corner radius, shadow, color. Use the property checklist in references/measurement-guide.md.
  • The phases (e.g. backdrop blurs in, element tucks under the notch, over-stretches, then settles per-edge). Note which property leads and which lags.

Step 3: Decide precision

  • Simple fade or linear slide: read timing off the contact sheet and skip to step 5.
  • Elastic, springy, or multi-property motion: escalate to step 4. Eyeballing a spring is unreliable.

Step 4: Track and fit

Run python3 scripts/track_motion.py <outdir> to produce metrics.json. Pass --bbox X,Y,W,H to restrict detection to one element when several move (one run per element). Then run python3 scripts/fit_curves.py <outdir>/metrics.json to get spring params, cubic-bezier, and a fit error per property. If you extracted with a non-default --fps, pass the same --fps to fit_curves.py: its default is 30 and a mismatch rescales every duration and stiffness (see Gotchas). Read references/curve-fitting.md to interpret the numbers and pick the model. High error on both models means multi-phase motion: split the timeline and fit each segment.

Step 5: Annotate choreography

Load references/choreography.md. Build the timing-offset table (when each property starts and settles). Those lead/lag gaps and the over-stretch carry more of the feel than any single curve.

Step 6: Emit code

Substitute the fitted parameters into the templates in references/code-output.md for the requested target. Keep movement on transform/opacity. Emit two transitions when open and close differ. Produce the consolidated handoff motion spec (timing table + curves + snippet) from references/code-output.md so the result can be implemented without the video.

Step 7: Validate

Run the Validation checks below. The exit criterion is comparison evidence, never "looks right".

Gotchas

  • fit_curves.py defaults to --fps 30. Extract at --fps 60 and fit at the default, and every duration_ms doubles (a 500 ms transition reports as 1000 ms) while fitted stiffness drops to a quarter. Always pass the extraction fps to the fit.
  • Sampling above the source frame rate duplicates frames: a 24 fps GIF extracted at --fps 60 yields runs of identical values in metrics.json that plateau the progress curve and inflate both fit errors. Probe the source rate first and match it.
  • Screen recordings drop frames under load, and iOS/QuickTime captures are variable-frame-rate. Consecutive identical metrics.json rows are duplicated frames, not a pause in the animation. If plateaus dominate, re-record at a steadier frame rate instead of chasing the fit.
  • Fitting one global curve to multi-phase motion fails with high error on both models. Split into phases and compose keyframes (references/curve-fitting.md).
  • Tracking only position misses blur/opacity, which usually lead the move by ~100 ms. That lead is where the polish lives.
  • Open and close are never mirror images (open slower and springier, close faster and flatter). Measure each direction as its own clip; never reuse the open curve reversed.
  • Reporting spring params without checking the fit error: a bad fit gives confident-looking but wrong numbers; treat error > 0.08 as suspect.
  • Emitting code that animates layout props (width, height, top, left): reproduce the motion on transform/opacity/filter (defer to ui-animation rules).
  • Re-reading a script to reconstruct its logic instead of running it: the scripts are the canonical, deterministic path.

Validation

  • Re-derive: play the emitted animation, screen-record it, run it back through extract_frames.py, and compare contact sheets side-by-side with the original.
  • Slow to 0.1x in DevTools to confirm phase order (lead/lag) and the over-stretch survive.
  • Confirm the emitted code only animates transform, opacity, and filter.
  • Sanity-check fitted spring overshoot/zeta against what you saw; a clear bounce must not fit as a flat ease.

Related skills

  • ui-animation: turn the extracted spec into production-grade, interruptible motion and apply its easing defaults and anti-pattern rules.

FAQ

What does the reverse-engineer-animation skill do?

Reverse-engineers a UI animation from a screen recording. Extracts frames with ffmpeg, tracks motion per frame with OpenCV, fits easing and spring curves, annotates choreography (leads, lags, over-stretch), and emits CSS, Motion/Framer Motion, SwiftUI, React Native, or UIKit code plus a handoff motion spec. Use when the user shares or uploads a screen recording or video of a UI animation, or asks to "reverse engineer this animation", "recreate this animation", "match this easing", "extract the animation curve", "figure out the spring from this video", "copy this transition from a video", "how does this animation work", or "reproduce this motion". For designing new motion from scratch or reviewing motion code, use ui-animation instead.

How do I install reverse-engineer-animation?

Run npx skills add https://github.com/mblode/agent-skills --skill reverse-engineer-animation in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/reverse-engineer-animation/ (personal) or .claude/skills/reverse-engineer-animation/ (project).

Which AI agents can use reverse-engineer-animation?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is reverse-engineer-animation safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains reverse-engineer-animation?

It is published by mblode in mblode/agent-skills. It has 104 recorded installs.

More from mblode/agent-skills

View all →

ui-animation

mblode/agent-skills

Builds, reviews, and measures UI motion, including springs, gestures, scroll effects, curve fitting from recordings, and sparse interface sound. Use when asked to "add animation", "match this easing", "reverse engineer this motion", "add a click sound", or find animation opportunities.

Frontend & Design10.5K installs

multi-tenant-architecture

mblode/agent-skills

Designs tenant isolation, hostname routing, custom-domain lifecycle, and plan limits on Cloudflare or Vercel. Use when asked to "isolate tenant data", "support custom domains", "build a white-label platform", or assess PSL registration. For general module structure use codebase-architecture; for SEO content use seo.

ui-design

mblode/agent-skills

Designs and builds React/Next/Tailwind UI, audits visual and interaction defects, and stress-tests components with worst-case data. Use when asked to "build a landing page", "extract our design system", "add dark mode", "make this responsive", "remove UI slop", "audit this component", "stress-test this component", "break this UI", or "show me the worst case".

Frontend & Design1.4K installs

typography-audit

mblode/agent-skills

Audits font loading, type scales, measure, spacing, OpenType, and rendered punctuation with 78 scoped rules. Use when asked to "audit typography", "fix the fonts", or "review my type system". For a new visual direction use ui-design Direction; for general UI defects use ui-design Audit.

agent-skills-creator

mblode/agent-skills

Creates and improves portable Agent Skills with a validator, routing scenarios, and evidence-based keep, cut, merge, or retire decisions. Use when asked to "write a skill", "update all skills", "audit my SKILL.md", "remove redundant instructions", or fix skill triggering.

AI & Agents965 installs

docs-writing

mblode/agent-skills

Writes and audits technical docs with Diataxis type gating, runnable examples, and 51 documentation rules. Use when asked to "review my docs", "write an API reference", or improve a documentation page. For a whole README use readme-creator; for agent instructions use agents-md.

Docs & Writing948 installs

Popular frontend & design skills

View category →

setup-matt-pocock-skills

mattpocock/skills

Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.

Frontend & Design1.1M installs

frontend-design

anthropics/skills

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

OfficialFrontend & Design1M installs

hyperframes-animation

heygen-com/hyperframes

All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.

prototype

mattpocock/skills

Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.

Frontend & Design999.2K installs

hyperframes-core

heygen-com/hyperframes

The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.

Frontend & Design930.5K installs

vercel-react-best-practices

vercel-labs/agent-skills

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

OfficialFrontend & Design843.1K installs