From mblode-agent-skills
Designs, implements, reviews, and reverse-engineers UI motion: CSS transitions, keyframes, springs, gestures, framer-motion. Use for adding animations, making interfaces smooth, or extracting animation curves from recordings.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mblode-agent-skills:ui-animationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- **IS:** designing, implementing, reviewing, debugging UI motion (springs, gestures, drag, easing, CSS transitions, keyframes, framer-motion), and measuring motion from a recording (extract frames, track, fit curves) to emit code plus a handoff spec.
references/choreography.mdreferences/clip-path-techniques.mdreferences/code-output.mdreferences/component-patterns.mdreferences/contextual-animations.mdreferences/curve-fitting.mdreferences/decision-framework.mdreferences/gesture-drag.mdreferences/measurement-guide.mdreferences/performance-deep-dive.mdreferences/review-format.mdreferences/spring-animations.mdreferences/transition-recipes.mdscripts/extract_frames.pyscripts/fit_curves.pyscripts/track_motion.pyui-design), auditing a whole page's UI quality (use ui-audit), or named text-effect specs (use the external animate-text skill where installed).Canonical home for reverse-engineering motion from a recording: route "reverse engineer this animation" and "match this easing" here, not to a separate skill. If the input is a screen recording or video, you are MEASURING motion: follow the Reverse-engineer workflow. Otherwise (designing, implementing, reviewing) use the rules and Workflow below.
| File | Read when |
|---|---|
| references/decision-framework.md | Default: deciding whether/why to animate, picking easing character |
| references/spring-animations.md | Spring physics, framer-motion useSpring, configuring spring params |
| references/component-patterns.md | Buttons, popovers, tooltips, drawers, modals, toasts with animation |
| references/clip-path-techniques.md | clip-path for reveals, tabs, hold-to-delete, comparison sliders |
| references/gesture-drag.md | Drag, swipe-to-dismiss, momentum, pointer capture |
| references/performance-deep-dive.md | Jank, CSS vs JS, WAAPI, CSS variables trap, Framer Motion caveats |
| references/review-format.md | Reviewing animation code: ten standards (each with flag-on-sight triggers), Before/After/Why table, Block/Approve verdict |
| references/contextual-animations.md | Contextual icon swaps, word-level stagger entrances, fixed-offset exits |
| references/transition-recipes.md | Installing a CSS transition: card resize, badge, dropdown, modal, panel, page slide, icon swap, number pop-in, text swap, success, avatar hover, error shake |
| references/measurement-guide.md | Reverse-engineer: what to measure, eye vs script, reading metrics.json, choosing an ROI |
| references/curve-fitting.md | Reverse-engineer: reading fit_curves.py output, spring vs bezier, judging fit error, asymmetric open/close |
| references/code-output.md | Reverse-engineer: emitting code for CSS, Motion/Framer Motion, SwiftUI, React Native, UIKit |
| references/choreography.md | Reverse-engineer: multi-element/multi-phase motion: staggers, blur-before-move, per-edge settling |
requestAnimationFrame); under load CSS stays smooth while JS drops frames.@starting-style for DOM entry; fall back to a data-mounted attribute where unsupported.filter: blur(2px) hides rough crossfades between swapped content.transform and opacity only; they skip layout and paint.color, background-color, and opacity are acceptable.width, height, top, left); they trigger layout recalc every frame. (Exception: a deliberate container resize tween, see the card-resize recipe.)transition: all; it animates unintended properties and silently adopts future ones. List them explicitly.filter animation for core interactions; if unavoidable keep blur ≤ 20px (heavy blur is expensive, especially in Safari).<g> wrapper with transform-box: fill-box; transform-origin: center; without it they rotate/scale around the canvas origin.transform: scale() also scales children (icons, text, borders scale proportionally), unlike width/height: a feature for press feedback, but account for it when an inner element must stay fixed-size.[data-theme-switching] * { transition: none !important }), or every themed property animates at once.| Element | Duration | Easing |
|---|---|---|
| Button press feedback | 100-160ms | cubic-bezier(0.22, 1, 0.36, 1) |
| Tooltips, small popovers | 125-200ms | ease-out or enter curve |
| Dropdowns, selects | 150-250ms | cubic-bezier(0.22, 1, 0.36, 1) |
| Modals, drawers | 200-350ms | cubic-bezier(0.22, 1, 0.36, 1) |
| Move/slide on screen | 200-300ms | cubic-bezier(0.25, 1, 0.5, 1) |
| Page transitions | 250-400ms | enter or move curve |
| Simple hover (colour/opacity) | 200ms | ease |
| Illustrative/marketing | Up to 1000ms | Spring or custom |
Keep routine UI under 300ms; scale duration with distance (a full-screen slide can exceed 300ms, a 6px tooltip shift stays under 150ms).
Named curves
cubic-bezier(0.22, 1, 0.36, 1) for entrances and transform-based hovercubic-bezier(0.25, 1, 0.5, 1) for slides, drawers, panelscubic-bezier(0.32, 0.72, 0, 1)Avoid ease-in for UI: it starts slow, so the element lags the user's action and feels sluggish. Prefer custom curves from easing.dev over built-in ease/ease-out, whose gentle acceleration reads soft, not decisive.
Match the UI element first, then pick the recipe from references/transition-recipes.md:
| UI pattern | Recipe |
|---|---|
| Trigger + floating dot/count | Notification badge |
| Trigger + anchored surface | Menu dropdown |
| Centred surface on top of page | Modal dialog |
| Panel sliding into existing container | Panel reveal |
| List ↔ detail or wizard steps | Page side-by-side slides |
| Element dimension changes | Card resize |
| Text updating in place | Text state swap |
| Two icons in same slot | Icon swap |
| Number updating | Number pop-in |
| Confirmation / success moment | Success celebration |
| Hovering item in horizontal stack | Avatar group hover |
| Form validation error | Error state shake |
Prefer lower-overhead transitions (CSS-only) unless the design requires JS orchestration.
transform-origin at the trigger point for popovers; keep center for modals (app-level state, not an anchored trigger).scale(0.85-0.9). Never scale(0): nothing appears from nothing.prefers-reduced-motion: reduce path: disable transform/keyframe motion, keep instant state changes or opacity-only fades. All recipes include the guard.@media (hover: hover) and (pointer: fine), or touch devices replay hover on tap. Tailwind v4 hover: utilities apply this automatically; skip the manual query there.IntersectionObserver; they burn GPU even when invisible.will-change only during heavy motion and only for transform/opacity; remove it after. Each promotion costs compositor memory; permanent promotion across many elements is worse than none.transform directly on the moving element.x/y values are the default for axis movement and drag (they bypass React re-renders). Use a full transform string only when one owner must combine multiple transform functions or interop with non-Motion code.High-signal failures not covered above:
x/y with a handwritten transform on one element: both write transform, so one clobbers the other. Pick one transform owner.Copy and track:
Animation progress:
- [ ] Step 1: Decide whether the interaction should animate
- [ ] Step 2: Choose purpose, easing, and duration
- [ ] Step 3: Pick the implementation style
- [ ] Step 4: Load the relevant component or technique reference
- [ ] Step 5: Validate timing, interruption, and device behavior
Produce evidence for each check (DevTools observations, not "looks fine"):
width, height, top, left) and transition: all.transform-origin issues invisible at full speed.prefers-reduced-motion: reduce (DevTools Rendering panel) and confirm every animation has a reduced path.will-change is toggled around animations, not permanently set, and looping animations pause off-screen.Use this branch to measure an existing animation from a screen recording, then emit code and a handoff spec that reproduce it. The scripts under scripts/ are the canonical, deterministic path; run them rather than reconstructing their logic.
Dependencies: ffmpeg for frame extraction (brew install ffmpeg); Python with pip install opencv-python numpy scipy for tracking and curve fitting. Degrades gracefully: with only ffmpeg you can extract frames and reason visually; tracking and fitting need the Python packages.
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
python3 scripts/extract_frames.py <video> <outdir>. Trim to just the transition with --start/--duration; if the interaction has both an open and a close, trim two windows and run the pipeline once per direction (they are almost never mirror images). Match --fps to the source (probe with ffprobe), never sampling above the source rate. Open contact_sheet.png first.references/measurement-guide.md.python3 scripts/track_motion.py <outdir> for metrics.json (pass --bbox X,Y,W,H to isolate one element), then python3 scripts/fit_curves.py <outdir>/metrics.json for spring params, cubic-bezier, and per-property fit error. Pass the same --fps you extracted with. Read references/curve-fitting.md to pick the model; high error on both means multi-phase motion (split and fit each segment).references/choreography.md. Build the timing-offset table (when each property starts and settles); lead/lag gaps and over-stretch carry more feel than any single curve.references/code-output.md for the target. Keep movement on transform/opacity. Emit two transitions when open and close differ, plus the consolidated handoff spec so it can be implemented without the video.extract_frames.py, and compare contact sheets side by side. Slow to 0.1x to confirm phase order and over-stretch survive. Confirm the code only animates transform, opacity, and filter.Reverse-engineer gotchas:
fit_curves.py defaults to --fps 30: extract at 60 but fit at the default and every duration_ms doubles while fitted stiffness drops to a quarter. Always pass the extraction fps to the fit.metrics.json. Probe and match the source rate.error above 0.08 as suspect.ui-design: visual direction, palettes, typography; settle the visual system before tuning motion.ui-audit: page/feature-level UI quality audit; its motion findings route back here for fixes.animate-text skill where installed: curated named text effects (typewriter, line reveal, stagger builds) with exact JSON specs.npx claudepluginhub mblode/agent-skillsApplies animation principles (Disney, Material, UI physics) with guidance on timing, easing, choreography, and performance. Useful for microinteractions, transitions, scroll animations, and loading states.
Applies animation principles like easing, durations, stagger, and sequencing to UI motion for natural, performant interactions. Supports accessibility and low-power devices.
Applies Disney's 12 animation principles to UI motion design. Use when improving animation quality, designing micro-interactions, creating easing curves, or making transitions feel natural and purposeful.