fixing-motion-performance

Audit and fix CSS and JavaScript animation performance issues like layout thrashing and jank.

1|Updated Aug 31, 2026
One-click install
npx skills add https://github.com/gagandeepgill/puzzle-game --skill fixing-motion-performance-gagandeepgill
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fixing-motion-performance
Source: https://github.com/gagandeepgill/puzzle-game/tree/main/.claude/skills/fixing-motion-performance
Command: npx skills add https://github.com/gagandeepgill/puzzle-game --skill fixing-motion-performance-gagandeepgill

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? UI animations often stutter or jank because they trigger expensive layout and paint work instead of cheap compositor updates. This Skill provides a prioritized rule set for diagnosing and fixing animation performance problems in CSS, WAAPI, Motion, rAF, and GSAP code. ## Core Features & Use Cases - Prioritized Rule Set: Nine ranked categories covering never-patterns, mechanism choice, measurement, scroll, paint, layers, blur, view transitions, and tool boundaries. - File Review Mode: Point it at a file to get violations quoted line-by-line, a one-sentence explanation of why each matters, and a concrete code-level fix. - Common Fix Patterns: Includes before/after examples for layout thrashing, scroll-linked motion via scroll-timeline, and FLIP-style measurement batching. - Use Case: A React component animates a panel's width and stutters on low-end devices. Run a review to get the exact violation flagged and a transform-based replacement that stays on the compositor. ## Quick Start Ask the assistant to review your animation file with the fixing-motion-performance rules, for example by saying: review animations.js for motion performance violations and suggest fixes.

Frequently Asked Questions about fixing-motion-performance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix layout thrashing in JavaScript animations?▼

Layout thrashing is fixed by batching all DOM reads before writes and animating transform instead of layout properties. The FLIP pattern measures the element's position once, applies the change, then animates the delta via transform so no continuous layout occurs.

What CSS properties are safe to animate for performance?▼

Transform and opacity are the safe defaults because they run on the compositor without triggering layout or paint. Animating width, height, position, filters, or gradients forces layout or paint work and is acceptable only on small, isolated surfaces.

How do I implement scroll-linked animations without jank?▼

Use CSS Scroll or View Timelines (animation-timeline: view()) instead of listening to scroll events or polling scrollTop. Pair this with IntersectionObserver to pause off-screen animations so they consume no frame budget.

Does this skill work with GSAP or Motion animations?▼

Yes, the rules apply within whatever animation system the code already uses, including GSAP, Motion, WAAPI, and rAF. It explicitly does not migrate or rewrite animation libraries unless requested, and never mixes APIs within one component.

Why does animating blur cause performance problems?▼

Blur is a paint-heavy filter that must be recomputed every frame, so continuous blur animation stalls the main thread. Keep blur under 8px, use it only for short one-time effects on small surfaces, and prefer opacity or translate instead.

When should I use will-change for animations?▼

Use will-change temporarily and surgically, only around the actual animation window, since compositor motion requires layer promotion that is never automatic. Avoid promoting many or large layers, and validate layer behavior with browser tooling when performance matters.