fixing-motion-performance

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

1|Updated Aug 17, 2025
One-click install
npx skills add https://github.com/ratnesh-maurya/mdconverter --skill fixing-motion-performance-ratnesh-maurya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fixing-motion-performance
Source: https://github.com/ratnesh-maurya/mdconverter/tree/main/.claude/skills/fixing-motion-performance
Command: npx skills add https://github.com/ratnesh-maurya/mdconverter --skill fixing-motion-performance-ratnesh-maurya

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? UI animations often stutter or jank because they trigger expensive layout and paint work, interleave DOM reads and writes, or poll scroll position. This Skill provides a prioritized rule set to audit animation code and apply concrete fixes that keep motion on the compositor. ## Core Features & Use Cases - Prioritized Rule Categories: Nine ranked categories covering never patterns, mechanism choice, measurement batching, scroll handling, paint, layers, blur and filters, view transitions, and tool boundaries. - File Review Mode: Review a specific file against all rules and report violations with the exact snippet, why it matters, and a code-level fix. - Concrete Fix Patterns: Includes before-and-after examples such as animating transform instead of width, using scroll-timeline instead of scroll listeners, and FLIP-style measurement batching. - Use Case: When a dropdown transition feels janky, run the review on the component to discover it animates width (triggering layout) and get a transform-based replacement that runs on the compositor. ## Quick Start Ask the assistant to review your animation file with the fixing-motion-performance rules, for example by saying: review my Header.tsx animation code for 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 janky CSS animations in my web app?

Janky CSS animations usually animate layout or paint properties like width, height, or top. Switch to transform and opacity, which run on the compositor, and avoid interleaving layout reads and writes in the same frame.

How to implement scroll-linked animations without performance issues?

Use CSS scroll-timeline or view-timeline for scroll-linked motion instead of listening to scroll events or polling scrollTop. Use IntersectionObserver to detect visibility and pause off-screen animations.

What is layout thrashing and how do I avoid it?

Layout thrashing happens when code interleaves DOM reads and writes in the same frame, forcing repeated layout calculations. Batch all reads first, then writes, or use FLIP-style transitions that measure once and animate via transform.

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

Yes, the rules apply within your existing animation stack, whether CSS, WAAPI, Motion, GSAP, or rAF. The skill explicitly does not migrate or rewrite animation libraries unless requested.

When should I avoid animating blur and filter effects?

Avoid animating blur continuously or on large surfaces, since it triggers expensive paint work. Keep blur animations small (8px or less), short, and one-time, and prefer opacity and translate instead.