fixing-motion-performance

Audit and fix CSS and JavaScript animation performance issues including layout thrashing and scroll-linked motion.

Updated Jul 1, 2026
One-click install
npx skills add https://github.com/SJLee-0525/aperture --skill fixing-motion-performance-sjlee-0525
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fixing-motion-performance
Source: https://github.com/SJLee-0525/aperture/tree/main/.claude/skills/fixing-motion-performance
Command: npx skills add https://github.com/SJLee-0525/aperture --skill fixing-motion-performance-sjlee-0525

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Animations that stutter, jank, or trigger expensive layout and paint work degrade user experience, and the root causes are often subtle patterns like interleaved DOM reads and writes or scroll-driven property updates. ## Core Features & Use Cases - Rule-Based Audit: Reviews files against nine prioritized rule categories covering never patterns, measurement, scroll, paint, layers, blur, and view transitions. - Concrete Fixes: Reports violations with the exact offending snippet, a one-sentence explanation, and a code-level fix such as FLIP transitions or scroll-timeline replacements. - Use Case: When a dropdown transition feels janky, run the review on the component file to discover it animates width instead of transform, and receive a corrected CSS snippet. ## Quick Start Ask the assistant to review a component file with the fixing-motion-performance skill and report any animation performance violations with 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 janky CSS animations in my web app?▼

Janky animations usually come from animating layout or paint properties instead of compositor-friendly transform and opacity. Review the component for patterns like animating width, top, or filters, and replace them with transform and opacity transitions.

What causes layout thrashing in JavaScript animations?▼

Layout thrashing happens when code interleaves DOM reads and writes in the same frame, forcing repeated reflows. Fix it by batching all reads before writes, or use FLIP-style transitions that measure once and animate via transform.

How to implement scroll-linked animations without scroll event listeners?▼

Use CSS Scroll or View Timelines such as animation-timeline: view() for scroll-linked motion, and IntersectionObserver for visibility detection and pausing. Polling scrollTop or scrollY in event handlers triggers continuous layout work.

Does this work with GSAP, Motion, or other animation libraries?▼

Yes, the rules apply within whatever animation system the project already uses. The skill explicitly does not migrate or rewrite animation libraries and never mixes multiple animation systems within the same component.

When is it acceptable to animate blur or filter effects?▼

Blur animation is acceptable only for short, one-time effects kept at 8px or below on small surfaces. Never animate blur continuously or on large containers; prefer opacity and translate as cheaper alternatives.

Why should will-change be used only temporarily?▼

will-change promotes elements to compositor layers, which consumes memory and can hurt performance when overused. Apply it surgically around the animation window and validate layer behavior with browser tooling.