fixing-motion-performance

Reviews UI animation code against rendering performance rules and reports violations with fixes.

4|Updated Sep 30, 2024
One-click install
npx skills add https://github.com/okm321/dotfiles --skill fixing-motion-performance-okm321
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fixing-motion-performance
Source: https://github.com/okm321/dotfiles/tree/main/claude/skills/fixing-motion-performance
Command: npx skills add https://github.com/okm321/dotfiles --skill fixing-motion-performance-okm321

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 for diagnosing and fixing animation performance issues in CSS, WAAPI, Motion, rAF, and GSAP code. ## Core Features & Use Cases - Rule-Based Review: Checks code against nine prioritized categories covering never patterns, measurement, scroll, paint, layers, blur, view transitions, and tool boundaries. - Actionable Violation Reports: Quotes the exact offending line, explains why it matters, and suggests a concrete code-level fix. - Stack-Agnostic Constraints: Applies rules within the existing animation system without migrating or rewriting libraries. - 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 approach instead. ## Quick Start Ask the assistant to review your animation file with /fixing-motion-performance followed by the file path to get violations and 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 transform and opacity. Review the code against rules that flag layout thrashing, scroll-event-driven motion, and paint-heavy properties, then switch to compositor-friendly transforms.

What CSS properties are safe to animate for performance?▼

Transform and opacity are the safest properties because they only require compositing. Animating layout properties like width or position, or paint properties like gradients and filters, triggers expensive rendering work and should be limited to small, isolated surfaces.

How should I implement scroll-linked animations without hurting performance?▼

Use Scroll or View Timelines when available, and IntersectionObserver for visibility detection and pausing off-screen animations. Avoid polling scrollTop or scrollY in scroll events, which forces continuous layout or paint work.

Does this work with GSAP, Motion, and requestAnimationFrame?▼

Yes, the rules apply within your existing animation stack including CSS, WAAPI, Motion, rAF, and GSAP. It does not migrate or rewrite animation libraries, and it avoids mixing multiple animation systems that each measure or mutate layout.

When should I avoid animating blur or filters?▼

Avoid animating blur continuously or on large surfaces, and keep blur values at 8px or below for short one-time effects. Prefer opacity and translate before reaching for blur, since filter animation triggers expensive paint work.