Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

fixing-motion-performance — Claude Code skill: how to install

Audits and fixes UI animation performance issues like layout thrashing, blur lag, and scroll jank. It optimizes CSS and JS motion without switching your animation libraries.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add ibelick/ui-skills --skill fixing-motion-performance -a claude-code
Open on GitHub

What fixing-motion-performance does

This skill audits animations built with CSS, WAAPI, Motion, rAF, or GSAP. It catches common bottlenecks: interleaving DOM reads and writes, animating layout properties on large surfaces, scroll polling, and infinite requestAnimationFrame loops. When reviewing a file, it points out the exact line, explains the issue in one sentence, and provides a ready-to-use code fix.

The guidelines prioritize composite properties like transform and opacity over paint or layout changes. Blur effects must stay at or below 8px and only serve short, non-continuous transitions. Crucially, the skill enforces existing tool boundaries and refuses to switch animation libraries unless you explicitly ask.

What it helps with

  • eliminate layout thrashing during element transitions
  • replace scroll event listeners with scroll timelines
  • batch DOM reads before writes using FLIP techniques
  • limit expensive blur filter animations to 8px

Example prompts for the agent

  • /fixing-motion-performance
  • /fixing-motion-performance src/components/Drawer.tsx
  • /fixing-motion-performance src/styles/animations.css

How to install fixing-motion-performance

1Skills CLI (Vercel)

npx skills add ibelick/ui-skills --skill fixing-motion-performance -a claude-code

2Manually: put the files in place

~/.claude/skills/fixing-motion-performance/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/fixing-motion-performance/

From the same set5

The whole set →

Similar

frontend-slides affaan-m Creates animation-rich HTML presentations from scratch or converts PPT/PPTX files into browser slides. Use it for talks, pitches, workshops, and internal decks. Claude Code CX Codex Cursor +1 5,400installs web-design-engineer ConardLi Directs your coding agent to craft polished web interfaces in HTML, CSS, JavaScript, and React. Useful for building dashboards, UI prototypes, slide decks, and animations. Claude Code CX Codex Cursor +1 8,700installs frontend-design-direction affaan-m Sets a product-specific direction for web UI and helps check hierarchy, content states, responsive behavior, accessibility, and rendered results. Claude Code CX Codex Cursor +1 5,300installs liquid-glass-design affaan-m A skill that feeds your coding agent the iOS 26 Liquid Glass patterns for SwiftUI, UIKit and WidgetKit. Useful when you're building or porting an app to iOS 26+. Claude Code CX Codex Cursor +1 5,200installs stitch::generate-design official google-labs-code Turns a text prompt or an image into a finished UI screen through Stitch MCP, then edits it with targeted prompts. Claude Code CX Codex Cursor +1 10,700installs accessibility affaan-m Designs and audits user interfaces to WCAG 2.2 Level AA across Web, iOS, and Android. It guides the model through semantic roles, focus states, and screen readers. Claude Code CX Codex Cursor +1 5,000installs frontend-design official anthropics This skill guides intentional visual design for new interfaces and redesigns. Use it when a generic generated UI is not enough. Claude Code Claude.ai 1,025,790installs design-taste-frontend Leonxlnx This skill directs the design of public pages and work screens, then checks the result in a browser through screenshots. Use it when an interface feels generic or unfinished. Claude Code CX Codex Cursor +1 673,100installs

Questions about fixing-motion-performance

How do I install fixing-motion-performance in Claude Code?

Run npx skills add ibelick/ui-skills --skill fixing-motion-performance -a claude-code in your terminal.

What does fixing-motion-performance do?

It reviews code for animation performance defects such as layout thrashing, unstopped rAF loops, and heavy filters. The skill then supplies actionable code fixes for your existing stack.

Does this skill migrate my animation library?

No. It strictly operates within your existing tools and applies fixes without rewriting your animation stack unless you request a migration.

Source text

SKILL.md · MIT
---
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-performance`
  Apply 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

```css
/* 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(); }
```

```js
// 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

© ibelick · MIT · ibelick/ui-skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor