reverse-engineer-animation
Reverse-engineers a UI animation from a screen recording — extracts frames, tracks motion per frame, fits easing and spring curves, annotates choreography, and emits CSS, Motion/Framer Motion, SwiftUI, React Native, or UIKit code. 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".
What this skill does
# Reverse Engineer Animation Measure motion that already exists in a recording, then reproduce it. This is the forensic counterpart to the `ui-animation` skill (which prescribes how motion *should* be designed). ## Reference files | File | Read when | |------|-----------| | [references/measurement-guide.md](references/measurement-guide.md) | Deciding what to measure, eye vs script, reading `metrics.json`, choosing an ROI | | [references/curve-fitting.md](references/curve-fitting.md) | Reading `fit_curves.py` output, spring vs bezier, judging fit error, asymmetric open/close | | [references/code-output.md](references/code-output.md) | Emitting code for CSS, Motion/Framer Motion, SwiftUI, React Native, or UIKit | | [references/choreography.md](references/choreography.md) | Multi-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` — tracking + curve fitting (steps 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: ```text Reverse-engineer progress: - [ ] Step 1: Extract frames + contact sheet - [ ] 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>` (add `--fps N` for very slow clips). 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. Open the generated `contact_sheet.png` first — it shows the whole window 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>` → `metrics.json`. Pass `--bbox X,Y,W,H` to isolate one element when several move (one bbox per element). Then **run** `python3 scripts/fit_curves.py <outdir>/metrics.json` → spring params, cubic-bezier, and a fit error per property. 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 See Validation below. ## Asymmetric open/close Open and close are almost never mirror images — open tends to be slower and springier, close faster and flatter. Measure each **direction separately** (record or trim two clips and run the pipeline on each). Report two curves; never reuse the open curve reversed. ## Anti-patterns - Fitting one global curve to multi-phase motion — split into phases and compose keyframes. - Tracking only position and ignoring blur/opacity — those usually *lead* the move and are where the polish lives. - Assuming symmetric open/close — measure both directions. - Reporting spring params without checking the fit error — a bad fit gives confident-looking but wrong numbers. - Emitting code that animates layout props (`width`, `height`, `top`, `left`) — reproduce the motion on `transform`/`opacity` (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.
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.