fixing-motion-performance

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

3|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/langgenius/due-date-hq-jwl --skill fixing-motion-performance-langgenius
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fixing-motion-performance
Source: https://github.com/langgenius/due-date-hq-jwl/tree/main/.claude/skills/fixing-motion-performance
Command: npx skills add https://github.com/langgenius/due-date-hq-jwl --skill fixing-motion-performance-langgenius

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? UI 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 style mutation. ## Core Features & Use Cases - Rule-Based Animation Audit: Reviews CSS, WAAPI, Motion, rAF, and GSAP code against prioritized rules covering layout thrashing, compositor properties, scroll-linked motion, paint, layers, and blur effects. - Concrete Fix Suggestions: 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 transition snippet. ## Quick Start Ask the assistant to review your animation code with the fixing-motion-performance skill, for example by pointing it at a component file whose transitions stutter.

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?

Batch all DOM reads before any writes so layout is computed once per frame. For layout-like movement, use the FLIP technique: measure the initial position, apply the change, measure again, then animate the difference with transform.

How to implement scroll-linked animations without jank?

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

Which CSS properties are safe to animate for performance?

Transform and opacity are compositor-only properties and are the default safe choices. Animating layout properties like width or paint-heavy properties like filters forces expensive recalculation and should be limited to small, isolated surfaces.

Why does animating blur cause performance problems?

Blur is a paint-heavy filter that must be recomputed every frame, making continuous blur animation expensive. 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 in CSS?

Use will-change temporarily and surgically to promote an element to its own compositor layer before an animation. Avoid applying it broadly, since many or large promoted layers consume memory and can hurt performance.

Does this skill migrate animation libraries like GSAP to Motion?

No, the skill explicitly does not migrate or rewrite animation libraries unless requested. It applies performance rules within the existing animation system and avoids mixing APIs within the same component.