fixing-motion-performance

Review and fix UI animation code against rendering performance rules.

Updated Jul 17, 2026
One-click install
npx skills add https://github.com/usmangurowa/socialmocks --skill fixing-motion-performance-usmangurowa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fixing-motion-performance
Source: https://github.com/usmangurowa/socialmocks/tree/main/.agents/skills/fixing-motion-performance
Command: npx skills add https://github.com/usmangurowa/socialmocks --skill fixing-motion-performance-usmangurowa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? UI animations often cause jank because they trigger expensive layout or paint work in the browser rendering pipeline. This Skill provides a prioritized rule set to detect and fix animation performance problems in CSS, WAAPI, Motion, rAF, and GSAP code. ## Core Features & Use Cases - Rule-based review: Checks animation code against nine prioritized rule categories, from critical never-patterns (layout thrashing, scroll-driven animation) to layer and blur guidance. - File-level audits: Pass a file path to receive violations with quoted snippets, impact explanations, and concrete code-level fixes. - Stack-agnostic constraints: Applies rules within the existing animation system without migrating libraries or mixing APIs. - Use Case: A developer notices a scroll-linked reveal animation stutters on mobile. Running this Skill on the component flags the scrollTop polling loop and recommends an IntersectionObserver or Scroll Timeline replacement. ## Quick Start Ask the assistant to review your animation file with the fixing-motion-performance skill, for example by pointing it at the component that contains the janky transition.

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 transform and opacity. Review the component against the rule set, replace layout-driven motion with transforms, and batch any DOM measurement before writes.

How to make scroll-linked animations performant?

Scroll-linked animations should use Scroll or View Timelines when available, or IntersectionObserver for visibility and pausing. Never poll scrollTop or scrollY in scroll events, and pause animations when elements leave the viewport.

Which CSS properties are safe to animate for 60fps?

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

Does this work with GSAP, Motion, and requestAnimationFrame?

Yes, the rules apply within your existing animation system, whether CSS, WAAPI, Motion, rAF, or GSAP. The Skill does not migrate or rewrite libraries; it enforces performance constraints inside whichever stack the code already uses.

Why does animating blur cause performance issues?

Blur is a paint-heavy filter that the browser must recompute 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 for animations?

Use will-change temporarily and surgically to promote an element to its own compositor layer before an animation. Avoid promoting many or large layers, and validate layer behavior with browser tooling since promotion is never automatic.