design
What this skill does
Step-by-step pass to spot janky animation, layout thrashing, and accessibility issues in a web app, with concrete fixes.
Current file
SKILL.md
Use this skill on a web app codebase (React/Next/Vue/vanilla). Goal: list what’s wrong with motion and how to fix it—not to redesign the product.
Search the repo for:
framer-motion, motion, animate, transition, keyframes, @keyframesrequestAnimationFrame, setInterval that touch the DOMtransform, opacity, filter, width, height, top, left, margin, box-shadow in transitionsWrite down each animated surface (modal, drawer, page transition, hover, list reorder).
prefers-reduced-motion is respected (CSS @media (prefers-reduced-motion: reduce) or JS matchMedia).reducedMotion="user" (or equivalent) on the root MotionConfig, or disable non-essential motion when the query matches.Bad: Animations always run at full strength.
Fix: Swap to instant or cross-fade; shorten durations; remove parallax.
Animating these on every frame often hurts (layout/paint):
width, height, top, left, right, bottommargin, padding, borderbox-shadow, filter (heavy blurs)Prefer: transform (e.g. translate, scale) and opacity for movement and fades.
Bad: Transitioning height for an accordion on large content.
Fix: transform: scaleY on a wrapper with overflow: hidden, or CSS grid-template-rows 0fr→1fr pattern, or measure once and animate max-height in a controlled way.
Bad: In a scroll or rAF loop: read offsetHeight / getBoundingClientRect, then write styles, repeat many times per frame.
Fix: Batch reads, then writes; use transform for scroll-linked effects; avoid synchronous layout reads inside hot paths.
layout / layoutId: can be expensive on big trees; use only where shared-element transitions are worth the cost.AnimatePresence: ensure stable keys; avoid mounting hundreds of motion nodes at once.initial / animate with will-change: transform, opacity sparingly; remove will-change after animation ends if possible.ease-out for things entering the viewport; ease-in for exits (or a single custom cubic-bezier).Deliver:
transition: height with …”).prefers-reduced-motion test, Lighthouse).Stay factual; if the repo doesn’t use Framer Motion, don’t invent it—stick to what you find.
Install with CLI
Copy this command to install this skill directly from the registry.
npx @sklx/cli add "fix-Motion"Compatible
Version notes
Initial release.