optimize

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

Updated Feb 22, 2026
One-click install
npx skills add https://github.com/metang/imganalyzer --skill optimize-metang
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: optimize
Source: https://github.com/metang/imganalyzer/tree/main/.agents/skills/optimize
Command: npx skills add https://github.com/metang/imganalyzer --skill optimize-metang

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 - Performance Assessment: Measures Core Web Vitals (LCP, FID/INP, CLS), load time, bundle size, and runtime metrics before optimizing. - Loading & Network Optimization: Covers image optimization (WebP/AVIF, srcset, lazy loading), code splitting, tree shaking, font subsetting, and caching strategies. - Rendering & Animation Fixes: Addresses layout thrashing, paint/composite costs, GPU-accelerated animations, virtual scrolling, and React-specific memoization patterns. - Use Case: A React app's dashboard feels sluggish on mobile. Use this Skill to measure Core Web Vitals, identify a 2MB JavaScript bundle and unoptimized hero images as bottlenecks, then apply code splitting and responsive images to hit LCP under 2.5s. ## Quick Start Analyze my web app's performance and fix whatever is making the pages load slowly and animations feel janky.

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 through hero image compression and critical CSS inlining, reducing INP by breaking up long JavaScript tasks, and fixing CLS by setting explicit image dimensions and aspect-ratio. Measure with Lighthouse before and after each change.

How to reduce JavaScript bundle size in a React app?▼

Reduce bundle size with route-based code splitting, dynamic imports for heavy components, tree shaking to remove unused code, and removing unused dependencies. Use webpack-bundle-analyzer to identify the largest contributors first.

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

Janky animations usually come from animating layout properties like width, height, top, or left, which trigger expensive reflows. Animate transform and opacity instead, since these are GPU-accelerated and skip layout and paint stages.

What is layout thrashing and how do I avoid it?▼

Layout thrashing happens when JavaScript alternates between reading layout properties and writing styles, forcing repeated reflows. Fix it by batching all reads first, then performing all writes together in a separate pass.

When should I use lazy loading for images?▼

Use lazy loading for below-the-fold images so they load only when approaching the viewport, reducing initial page weight. Never lazy load above-the-fold or hero images, since that delays LCP and hurts perceived performance.