fixing-motion-performance

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

Updated Aug 8, 2026
One-click install
npx skills add https://github.com/wolfstar-project/code-zero --skill fixing-motion-performance-wolfstar-project
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fixing-motion-performance
Source: https://github.com/wolfstar-project/code-zero/tree/main/.agents/skills/fixing-motion-performance
Command: npx skills add https://github.com/wolfstar-project/code-zero --skill fixing-motion-performance-wolfstar-project

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Animations that stutter, jank, or trigger expensive layout and paint work degrade user experience, and diagnosing the root cause requires deep knowledge of the browser rendering pipeline. This Skill provides a prioritized rule set for auditing and fixing animation performance problems in CSS, WAAPI, Motion, rAF, and GSAP code. ## Core Features & Use Cases - Prioritized Rule Categories: Nine ranked rule groups covering never patterns, mechanism choice, measurement batching, scroll-linked motion, paint, layers, blur and filters, view transitions, and tool boundaries. - File Review Mode: Review a specific file against all rules and receive violations with quoted snippets, impact explanations, and concrete code-level fixes. - Common Fix Patterns: Ready-made before/after examples for layout thrashing, scroll-driven animation, and FLIP-style measurement batching. - Use Case: A developer notices a dropdown transition janks on scroll. They run the review on the component file and learn the animation interpolates width (triggering layout) instead of transform, and get the exact corrected CSS. ## Quick Start Ask the assistant to review your animation file against the fixing-motion-performance rules and report violations with concrete 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 layout thrashing in JavaScript animations?▼

Batch all DOM reads before writes and animate via transform instead of layout properties. Use the FLIP technique: measure the initial position, apply the change, measure again, then invert with a transform and animate to identity.

How to implement scroll-linked animations without jank?▼

Use CSS Scroll or View Timelines (animation-timeline: view()) instead of scroll event listeners or polling scrollY. Pair with IntersectionObserver to pause off-screen animations and avoid triggering continuous layout or paint.

Which CSS properties are safe to animate for performance?▼

Transform and opacity are compositor-only properties and safe for continuous motion. Properties affecting layout (width, height, position) or paint (colors, gradients, filters) should only animate on small, isolated surfaces.

Does this work with GSAP, Motion, and WAAPI animations?▼

Yes, the rules apply within your existing animation stack including CSS, WAAPI, Motion, rAF, and GSAP. The Skill explicitly avoids migrating or rewriting animation libraries and never mixes multiple systems that each measure or mutate layout.

Why does animating blur cause performance problems?▼

Blur is a paint-heavy filter that forces expensive re-rendering each frame. Keep blur animation under 8px, use it only for short one-time effects, never animate it continuously or on large surfaces, and prefer opacity and translate instead.

When should I avoid using view transitions?▼

Avoid view transitions for interaction-heavy UI or when interruption and cancellation are required. Reserve them for navigation-level changes, and treat size changes within transitions as potentially layout-triggering.