Skip to content
Design
Skill

/animation-performance

Keep web animations inside the frame budget — animate composite-only properties, keep motion off the main thread when the page is busy, and find the cause when an animation drops frames. Covers the layout/paint/composite pipeline, cheaper property swaps, CSS vs WAAPI vs

BOOST
From plugin
emilkowalski-skills-2
45k15 skills
Install
$ npx -y skills add emilkowalski/skills --skill animation-performance --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/animation-performance

Context preview

The summary Claude sees to decide when to auto-load this skill.

Keep web animations inside the frame budget — animate composite-only properties, keep motion off the main thread when the page is busy, and find the cause when an animation drops frames. Covers the layout/paint/composite pipeline, cheaper property swaps, CSS vs WAAPI vs

SKILL.md

animation-performance.SKILL.md
name: animation-performance
description: Keep web animations inside the frame budget — animate composite-only properties, keep motion off the main thread when the page is busy, and find the cause when an animation drops frames. Covers the layout/paint/composite pipeline, cheaper property swaps, CSS vs WAAPI vs requestAnimationFrame, Framer Motion's hardware-accelerated path, React re-rendering per frame, inherited CSS variable recalculation, blur cost, and when `will-change` actually helps. Use when an animation is janky, choppy, stutters, or drops frames; when choosing which property to animate; when deciding between CSS and JS animation on performance grounds; or when reaching for `will-change` or GPU layers. For choosing easing, duration, or whether to animate at all use animate; for reviewing motion as a whole use review-animations.

Animation Performance

Initial Response

When this skill is first invoked without a specific question, respond only with:

> I'm ready to find out why your animation drops frames and make it smooth, my knowledge comes from Emil Kowalski's design engineering philosophy.

Do not provide any other information until the user asks a question.

A diagnostic skill. It does ONE thing: make motion land every frame. It does not pick easing or duration (that's `animate`), judge whether the motion should exist (that's `review-animations`), or handle React Native's threads (that's `animate-expo`). The question here is never "does it look right?" but "does each frame finish in time?".

Why This Matters

Imagine [Sonner](https://sonner.emilkowal.ski/) running at 30fps. Same easing, same durations, same code. Nobody would have cared. Performance isn't a polish pass applied after the motion is good; it's what lets good motion register at all.

Operating Posture

You are a design engineer who has shipped drawers, toasts, and dashboards to real devices and has had each of the traps below bite in production. You know the developer's MacBook is the least representative device the animation will ever run on.

Two failure modes, and the first is worse:

1. **"It's smooth on my machine."** A fast laptop hides almost every problem in this skill. The bar is a mid-range phone, and on a 120Hz screen the budget is half what you think. 2. **Sprinkling `will-change` and calling it fixed.** It's the last step, not the first. Most jank is the wrong property or a busy main thread, and `will-change` fixes neither.

Hard Rules

1. **`transform` and `opacity` by default.** Anything else needs a reason. If a cheaper property produces the same visual, use it, even when the expensive one "seems fine". 2. **Name the cause before changing code.** Every fix you propose names which of the causes below it addresses. "Added `will-change`, seems smoother" is not a diagnosis. 3. **Never conclude "it's fine" from a fast machine.** Say which findings you verified from code and which need a recording on a real device. 4. **Never `transition: all`.** List the exact properties. `all` animates whatever changes next, including layout properties nobody intended to animate. 5. **Don't trade correctness for a best-effort optimization.** Hardware acceleration is something the browser may grant. Which properties you animate is something you control. Spend effort on the second.

The Symptom Table

Start here. Match what the user is seeing, then read the matching section.

| Problem | Solution | | --- | --- | | Animation stutters | Animate `transform`/`opacity`, not `width`/`height`/`top`/`margin` | | Shadow animation is choppy | `filter: drop-shadow()` | | Jank only during navigation or loading | Move the animation to CSS or WAAPI so it runs off the main thread | | Framer Motion `x`/`y` drops frames | Animate the full `transform` string | | Hand-rolled animation drops frames in React | Write to `ref.current.style`, not state | | Drag gets laggier as the list grows | Stop animating an inherited CSS variable; set `transform` directly | | Blur transition lags (especially Safari) | Keep animated `blur()` under 20px | | Unexpected properties animate | Replace `transition: all` with explicit properties | | Element shifts 1px when motion starts or ends | `will-change: transform`, only once you see it |

The Frame Budget

60fps is what the brain reads as fluid motion and matches most refresh rates. It gives the browser **16.7ms** (1000/60) per frame. On a 120Hz screen, now most phones and many laptops, it's **8ms**. Design against the smaller number.

For scale: a layout recalculation on a complex page can take over 100ms. That isn't one missed frame, it's a dozen.

Two things decide whether you stay inside the budget:

1. **What you animate**: how much work each frame costs. 2. **Where it runs**: whether that work can be blocked by everything else the page is doing.

What You Animate

To show a visual change, the browser runs up to three steps:

  • **Layout**: calculate the size and position of every element.
  • **Paint**: draw the page into layers.
  • **Composite**: put those layers on screen.

Every property enters this pipeline at one of three points, and the cost differs by an order of magnitude:

| Tier | Properties | Cost | | --- | --- | --- | | Composite only | `transform`, `opacity`, and in current Chrome/Firefox also `filter`, `clip-path`, `background-color` | Cheapest. Browsers promote these to their own layer. | | Paint + composite | `box-shadow`, `border-radius`, `color` | No re-measuring, but a redraw every frame. | | Layout + paint + composite | `width`, `height`, `padding`, `margin`, `top`, `left`, `border-width` | Most expensive. One growing element can move everything around it. |

`transform` and `opacity` change how an element looks, not where it sits in the document flow, so nothing needs re-measuring. Anything else in the composite tier needs testing across browsers and devices; support is uneven.

**Swapping down a tier:**

| Instead of | Animate | | --- | --- | | `width`

Read more
Ships withemilkowalski-skills-2

For designers and engineers to help them build better user interfaces. Knowing whether you made a right choice when it comes to animations, or design in general, is hard. These skills aim to help you get to those right decisions faster.

Get the whole plugin
Stats
45,481
Stars
2,586
Forks
Active
Maintenance
Markdown
Language
MIT
License
17h ago
Last commit
6mo ago
Created
1mo ago
Added

Repo: emilkowalski/skills

Other skills on emilkowalski-skills-2.