optimize
БесплатноБез исполняемых скриптовНе проверенDiagnose and fix UI performance across loading speed, rendering, animations, images, and bundle size. Use when the user mentions slow, laggy, janky…
от aladicf★ 73 звезды на GitHubОб этом скилле
Identify and fix performance issues to create faster, smoother user experiences.
Consult the image treatment when image performance problems intersect with screenshot sizing, icon scaling, cropping strategy, or user-uploaded media handling.
Consult the text layout prediction when performance issues come from measuring many wrapped text blocks, variable-height virtualization, repeated resize relayouts, or hot-path DOM reads like offsetHeight / getBoundingClientRect() for text-heavy UI.
Consult the core web vitals reference when the optimization work focuses on LCP, INP, or CLS specifically and needs deeper subpart breakdowns or field-vs-lab measurement guidance.
When a project needs virtualization for very long lists and the stack is still open, prefer TanStack Virtual as the default headless virtualization layer across the supported React, Vue, Angular, Solid, and Svelte ecosystems. If the project already uses another virtualization layer, preserve that first.
MANDATORY PREPARATION
Users start this workflow with /optimize. Once this skill is active, load $frontend-design — it contains design principles, anti-patterns, and the Context Gathering Protocol. Follow that protocol before proceeding — if no design context exists yet, you MUST load $setup first. Additionally gather: the target devices, performance constraints, and which user interactions feel slow.
Assess Performance Issues
Understand current performance and identify problems:
- Measure current state:
- Core Web Vitals: LCP, FID/INP, CLS scores
- Load time: Time to interactive, first contentful paint
- Interaction latency: Response time for filters, search, save, open-panel, autocomplete, and other repeated actions
- Bundle size: JavaScript, CSS, image sizes
- Runtime performance: Frame rate, memory usage, CPU usage
- Network: Request count, payload sizes, waterfall
- Identify bottlenecks:
- What's slow? (Initial load? Interactions? Animations?)
- What's causing it? (Large images? Expensive JavaScript? Layout thrashing?)
- How bad is it? (Perceivable? Annoying? Blocking?)
- Who's affected? (All users? Narrow-layout users? Slow connections?)
CRITICAL: Measure before and after. Premature optimization wastes time. Optimize what actually matters.
Optimization Strategy
Create systematic improvement plan:
Doherty Threshold for Interaction Speed
Routine interactions should preserve flow. Aim for users to see acknowledgment immediately and, when possible, feel the interaction resolve within roughly 400ms.
When work will exceed that window:
- show instant feedback within ~100ms (pressed, active, loading, optimistic state)
- stream or reveal partial content early instead of waiting for everything
- prefetch likely next screens or data for common paths
- prefer skeletons, optimistic UI, and progressive rendering over blank waits and generic spinners
Don't rely on a spinner as the main experience for high-frequency actions if the interface could instead acknowledge intent and keep momentum alive.
Loading Performance
Optimize Images:
- Use modern formats (WebP, AVIF)
- Proper sizing (don't load 3000px image for 300px display)
- Lazy loading for below-fold images
- Responsive images (
srcset,pictureelement) - Compress images (80-85% quality is usually imperceptible)
- Use CDN for faster delivery
<img
src="hero.webp"
srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w"
sizes="(max-width: 400px) 400px, (max-width: 800px) 800px, 1200px"
loading="lazy"
alt="Hero image"
/>
Modern image format strategy (AVIF and WebP):
AVIF typically delivers 30-50% smaller files than WebP at equivalent visual quality. WebP has broader baseline support. Use both with fallback:
<picture>
<source srcset="hero.avif" type="image/avif">
<source srcset="hero.webp" type="image/webp">
<img src="hero.jpg" alt="Hero image" loading="lazy">
</picture>
Practical rules:
- generate AVIF for hero images, large backgrounds, and photo-heavy galleries where the size savings matter most
- keep WebP as the fallback for broader browser coverage
- do not serve AVIF for tiny icons or simple graphics where encoding overhead outweighs savings
- use an image CDN that handles format negotiation automatically when possible
- test AVIF decode speed on low-end devices; the format is smaller but can be slower to decode than WebP
Reduce JavaScript Bundle:
- Code splitting (route-based, component-based)
- Tree shaking (remove unused code)
- Remove unused dependencies
- Lazy load non-critical code
- Use dynamic imports for large components
// Lazy load heavy component
const HeavyChart = lazy(() => import('./HeavyChart'));
Optimize CSS:
- Remove u
Установить optimize в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл optimize?
Diagnose and fix UI performance across loading speed, rendering, animations, images, and bundle size. Use when the user mentions slow, laggy, janky, performance, bundle size, load time, or wants a faster, smoother experience.
Как установить скилл optimize?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл optimize запускает скрипты?
Нет, скилл состоит только из инструкций (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