emil-performance
БесплатноБез исполняемых скриптовНе проверенRules for making UI fast — virtualization, transition specificity, GPU compositing, preloading, lazy loading, layout-shift prevention, and keeping animation…
от freekmurze★ 1 019 звёзд на GitHubОб этом скилле
Interface Performance
Fast UI is mostly about work you don't do: don't render DOM nodes nobody can see, don't make the browser watch properties that never change, don't animate what the GPU can't composite, don't fetch at request time what you could build at build time, and don't move layout after the user has started reading it. Most jank is self-inflicted — the fix is usually deleting or deferring work, not adding cleverness.
All CSS below is written as plain CSS for clarity. When implementing, match the project's existing styling system (Tailwind, CSS Modules, styled-components, etc.) rather than imposing a new one.
Core Principles
1. Transition only what changes — never transition: all
With transition: all (or Tailwind's bare transition class, which compiles to transition-property: all), every style change becomes a candidate animation: the browser must track the entire style object, properties you never meant to tween (padding, shadow, colors) start tweening whenever they change, and the engine loses the optimizations a narrow, known property list allows.
/* Do — name each property that actually animates */
.menu-trigger {
transition-property: translate, opacity;
transition-duration: 120ms;
transition-timing-function: ease-out;
}
/* Don't — a shorthand that watches everything */
.menu-trigger {
transition: all 120ms ease-out;
}
// Do — the property list is explicit
<a className="transition-[translate,opacity] duration-100 ease-out">
// Don't — bare `transition` is `transition-property: all` in disguise
<a className="transition duration-100 ease-out">
Tailwind note: transition-transform expands to the whole transform family (transform, translate, scale, rotate), so reach for it when only transforms move. Mixing in non-transform properties? Use the arbitrary-value form, e.g. transition-[opacity,filter,scale].
2. Animate only compositor-friendly properties
- Animate
transformandopacity; avoid animatingheight,width,padding,margin(they trigger layout). blur()filters above 20px are expensive, especially in Safari. Keep blurs subtle and off frequently-animating elements.- Pause looping animations when off-screen (principle 8).
3. Use will-change sparingly, and only where it helps
By default the browser waits until motion actually begins before lifting an element onto a dedicated compositor layer, and that just-in-time layer creation occasionally eats the opening frame — a tiny hitch right as movement starts. will-change requests the layer up front so the element is already composited when the animation fires. The hint only matters for properties the compositor owns; declaring it for layout-bound properties is a no-op.
/* Sensible — the panel slides, so promote its transform ahead of time */
.slide-panel { will-change: transform; }
/* Sensible — a slide paired with a fade */
.slide-panel { will-change: transform, opacity; }
/* Wrong — `all` defeats the point of the hint */
.slide-panel { will-change: all; }
/* Useless — these run through layout and paint regardless */
.slide-panel { will-change: height, color; }
| Rendering path | Properties | Does will-change pay off? |
|---|---|---|
| Compositor | opacity, transform, filter (blur, brightness), clip-path |
Yes — pre-promotion smooths the first frame |
| Paint | color, background, border |
No |
| Layout | width, height, top/left, margin |
No |
Browsers have gotten good at managing layers themselves, so treat this as a targeted fix: reach for it after you've observed a first-frame hiccup (Safari is the usual offender), never as routine seasoning. Each promoted layer holds GPU memory, so a page peppered with will-change pays real cost for stutters it never had.
4. Virtualize long lists
Don't render hundreds of DOM nodes when only a handful are visible:
import { useVirtualizer } from '@tanstack/react-virtual';
function VirtualList({ items }) {
const parentRef = useRef(null);
const virtualizer = useVirtualizer({
count: items.length,
getScrollElement: () => parentRef.current,
estimateSize: () => 50,
});
return (
<div ref={parentRef} style={{ height: '400px', overflow: 'auto' }}>
<div style={{ height: virtualizer.getTotalSize() }}>
{virtualizer.getVirtualItems().map((virtualItem) => (
<div
key={virtualItem.key}
style={{
position: 'absolute',
top: virtualItem.start,
height: virtualItem.size,
}}
>
{items[virtualItem.index]}
</div>
))}
</div>
</div>
);
}
5. Keep animation out of React's render cycle
State updates per frame are a re-render storm. Drive frame-by-frame values through refs and direct DOM writes:
// Bad — causes re-render on every frame
const [position, setPosition] = useState(0);
// Good — re
Установить emil-performance в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл emil-performance?
Rules for making UI fast — virtualization, transition specificity, GPU compositing, preloading, lazy loading, layout-shift prevention, and keeping animation out of React renders. Use when building or reviewing UI that renders long lists, animates, loads fonts/images/video, switches themes, or feels janky or slow. Triggers on: performance, slow, janky, lag, stutter, fps, frame drops, virtualization, virtual list, infinite scroll, long list, re-render, re-render storm, transition all, will-change, GPU, compositing, layout shift, CLS, layout thrash, reflow, preload, prefetch, lazy loading, loading=lazy, image optimization, video, font loading, FOUT, skeleton, perceived performance, IntersectionObserver, static generation, SSG, theme switch, blur filter, CSS variables, Framer Motion performance.
Как установить скилл emil-performance?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл emil-performance запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic