optimize

Diagnoses and fixes UI performance issues across loading, rendering, animations, images, and bundle size.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/po4yka/blog --skill optimize-po4yka
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimize
Source: https://github.com/po4yka/blog/tree/main/.agents/skills/optimize
Command: npx skills add https://github.com/po4yka/blog --skill optimize-po4yka

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Slow load times, janky animations, and bloated bundles degrade user experience, and this Skill provides a systematic workflow to measure, diagnose, and fix frontend performance issues. ## Core Features & Use Cases - Measurement-First Diagnosis: Assesses Core Web Vitals (LCP, INP, CLS), bundle size, runtime frame rates, and network waterfalls before making changes. - Targeted Optimization Strategies: Covers image optimization (WebP/AVIF, srcset, lazy loading), JavaScript bundle reduction (code splitting, tree shaking), CSS and font optimization, and GPU-accelerated animations. - Framework-Specific Guidance: Includes React patterns like memo, useMemo, useCallback, list virtualization, and route-based code splitting. - Use Case: A React app's dashboard feels sluggish on mobile. Use this Skill to profile the page, identify a 2MB hero image and layout thrashing in a scroll handler, then apply responsive images and batched DOM writes to hit 60fps. ## Quick Start Ask the assistant to analyze your page's performance and fix the slowest loading and rendering bottlenecks.

Frequently Asked Questions about optimize

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I improve Core Web Vitals scores on my website?

Improve Core Web Vitals by optimizing LCP with hero image compression and critical CSS inlining, reducing INP by breaking up long JavaScript tasks, and fixing CLS by setting explicit dimensions on images and reserving space for dynamic content.

How to reduce JavaScript bundle size in a React app?

Reduce bundle size with route-based and component-based code splitting, tree shaking unused code, removing unused dependencies, and lazy loading heavy components via dynamic imports like lazy(() => import('./HeavyChart')).

What is the best image format for web performance?

Modern formats like WebP and AVIF offer the best compression for web images. Combine them with responsive srcset attributes, proper sizing, lazy loading for below-fold images, and 80-85% quality compression.

Why are my CSS animations laggy and how do I fix them?

Laggy animations usually animate layout properties like width, height, top, or left, which trigger expensive reflows. Animate transform and opacity instead, since these are GPU-accelerated and avoid layout recalculation.

When should I avoid using will-change in CSS?

Avoid applying will-change broadly because each use creates a new compositor layer that consumes memory. Reserve it for known expensive animations only, and remove it after the animation completes.

Should I lazy load images above the fold?

No, lazy loading above-fold content delays the Largest Contentful Paint and hurts perceived performance. Only lazy load below-fold images, and preload or prioritize critical hero images instead.