fixing-motion-performance
- Use it when:
- Animations stutter or transitions jank, or you're adding scroll-linked motion, blur or animated layout.
- It does:
- Applies nine groups of rules in priority order, from never interleaving layout reads and writes to staying inside your animation library.
- You get:
- Animation work within the rules, or for a file, a report quoting each violation with why it matters and a suggested code-level fix.
- Won't:
- Switch or rewrite your animation library unless asked; it works within CSS, WAAPI, Motion, requestAnimationFrame or GSAP.
TL;DR
The skill sorts what an animation changes by the rendering work it causes: composite (transform and opacity), paint (color, borders, gradients, masks, images, filters) and layout (size, position, flow, grid and flex). It keeps motion on the least expensive work that fits, defaulting to transform and opacity. Its rules: never interleave layout reads and writes in one frame, drive animation from scroll events, or run a requestAnimationFrame loop without a stop condition; measure once, then animate with transform, as in FLIP (measure where an element starts and ends, then animate the difference); use Scroll or View Timelines and IntersectionObserver instead of polling scroll position, and pause animations off-screen; animate paint only on small, isolated elements, and never animate inherited CSS variables; use will-change only briefly; keep blur at 8px or less and never animate it continuously; save view transitions for navigation. It prefers a cheaper technique over removing motion. Called alone, it applies the rules to animation work for the rest of the conversation; called with a file, it reviews that file and reports what to change. For any non-default choice it states the constraint that justifies it, such as surface size, duration or interaction.
Summarizes the skill at 00db7d6.
npx skills add https://github.com/ibelick/ui-skills --skill fixing-motion-performance skills.sh pageSource on GitHubAll skills from ibelick/ui-skills
- Total Downloads
- 28,500 on skills.sh, Nov 9, 2026
- Repo stars
- 10,844 ibelick/ui-skills
- First seen
- Jan 22, 2026 on skills.sh
Weekly values
| Week to | Installs |
|---|---|
| Sep 21 | 688 |
| Sep 28 | 661 |
| Oct 5 | 561 |
| Oct 12 | 588 |
| Oct 19 | 845 |
| Oct 26 | 1,317 |
| Nov 2 | 827 |
| Nov 9 | 840 |
| Category |
Taste for interfaces that don't look generated: direction, motion and accessibility. Everything for building software: planning, coding, debugging, design, frameworks, cloud, agents and skills. |
|---|---|
| Type |
Knowledge and rules the agent applies while it works: best practices, design principles, API references. |
| Effect |
Adds no side effects of its own. It shapes how the agent thinks, writes or reviews. Guidelines and routers are always effect:none, even when the task they support edits code. |
| Needs |
Instructions only. Works in any agent that supports skills. |
| Publisher |
Everyone else. Unverified vendor claims default to community. |
| Topics |
SKILL.md
From ibelick/ui-skills at 00db7d6. Checked daily, last changed Nov 6, 2026.
Frontmatter
name: fixing-motion-performance
description: Audit and fix animation performance issues including layout thrashing, compositor properties, scroll-linked motion, and blur effects. Use when animations stutter, transitions jank, or reviewing CSS/JS animation performance.fixing-motion-performance
Fix animation performance issues.
how to use
-
/fixing-motion-performanceApply these constraints to any UI animation work in this conversation. -
/fixing-motion-performance <file>Review the file against all rules below and report:- violations (quote the exact line or snippet)
- why it matters (one short sentence)
- a concrete fix (code-level suggestion)
Do not migrate animation libraries unless explicitly requested. Apply rules within the existing stack.
when to apply
Reference these guidelines when:
- adding or changing UI animations (CSS, WAAPI, Motion, rAF, GSAP)
- refactoring janky interactions or transitions
- implementing scroll-linked motion or reveal-on-scroll
- animating layout, filters, masks, gradients, or CSS variables
- reviewing components that use will-change, transforms, or measurement
rendering steps glossary
- composite: transform, opacity
- paint: color, borders, gradients, masks, images, filters
- layout: size, position, flow, grid, flex
rule categories by priority
| priority | category | impact |
|---|---|---|
| 1 | never patterns | critical |
| 2 | choose the mechanism | critical |
| 3 | measurement | high |
| 4 | scroll | high |
| 5 | paint | medium-high |
| 6 | layers | medium |
| 7 | blur and filters | medium |
| 8 | view transitions | low |
| 9 | tool boundaries | critical |
quick reference
1. never patterns (critical)
- do not interleave layout reads and writes in the same frame
- do not animate layout continuously on large or meaningful surfaces
- do not drive animation from scrollTop, scrollY, or scroll events
- no requestAnimationFrame loops without a stop condition
- do not mix multiple animation systems that each measure or mutate layout
2. choose the mechanism (critical)
- default to transform and opacity for motion
- use JS-driven animation only when interaction requires it
- paint or layout animation is acceptable only on small, isolated surfaces
- one-shot effects are acceptable more often than continuous motion
- prefer downgrading technique over removing motion entirely
3. measurement (high)
- measure once, then animate via transform or opacity
- batch all DOM reads before writes
- do not read layout repeatedly during an animation
- prefer FLIP-style transitions for layout-like effects
- prefer approaches that batch measurement and writes
4. scroll (high)
- prefer Scroll or View Timelines for scroll-linked motion when available
- use IntersectionObserver for visibility and pausing
- do not poll scroll position for animation
- pause or stop animations when off-screen
- scroll-linked motion must not trigger continuous layout or paint on large surfaces
5. paint (medium-high)
- paint-triggering animation is allowed only on small, isolated elements
- do not animate paint-heavy properties on large containers
- do not animate CSS variables for transform, opacity, or position
- do not animate inherited CSS variables
- scope animated CSS variables locally and avoid inheritance
6. layers (medium)
- compositor motion requires layer promotion, never assume it
- use will-change temporarily and surgically
- avoid many or large promoted layers
- validate layer behavior with tooling when performance matters
7. blur and filters (medium)
- keep blur animation small (<=8px)
- use blur only for short, one-time effects
- never animate blur continuously
- never animate blur on large surfaces
- prefer opacity and translate before blur
8. view transitions (low)
- use view transitions only for navigation-level changes
- avoid view transitions for interaction-heavy UI
- avoid view transitions when interruption or cancellation is required
- treat size changes as potentially layout-triggering
9. tool boundaries (critical)
- do not migrate or rewrite animation libraries unless explicitly requested
- apply these rules within the existing animation system
- never partially migrate APIs or mix styles within the same component
common fixes
/* layout thrashing: animate transform instead of width */
/* before */ .panel { transition: width 0.3s; }
/* after */ .panel { transition: transform 0.3s; }
/* scroll-linked: use scroll-timeline instead of JS */
/* before */ window.addEventListener('scroll', () => el.style.opacity = scrollY / 500)
/* after */ .reveal { animation: fade-in linear; animation-timeline: view(); }
// measurement: batch reads before writes (FLIP)
// before — layout thrash
el.style.left = el.getBoundingClientRect().left + 10 + 'px';
// after — measure once, animate via transform
const first = el.getBoundingClientRect();
el.classList.add('moved');
const last = el.getBoundingClientRect();
el.style.transform = `translateX(${first.left - last.left}px)`;
requestAnimationFrame(() => { el.style.transition = 'transform 0.3s'; el.style.transform = ''; });
review guidance
- enforce critical rules first (never patterns, tool boundaries)
- choose the least expensive rendering work that matches the intent
- for any non-default choice, state the constraint that justifies it (surface size, duration, or interaction requirement)
- when reviewing, prefer actionable notes and concrete alternatives over theory