optimize

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

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

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 Measurement: Assesses Core Web Vitals (LCP, FID/INP, CLS), bundle size, runtime frame rates, and network waterfalls before and after changes. - Loading & Bundle Optimization: Applies image optimization (WebP/AVIF, srcset, lazy loading), code splitting, tree shaking, font subsetting, and critical CSS strategies. - Rendering & Animation Fixes: Eliminates layout thrashing, enforces GPU-accelerated transform/opacity animations, and applies React-specific techniques like memo, useMemo, and list virtualization. - Use Case: A user reports their React dashboard feels sluggish on mobile. The Skill measures Core Web Vitals, identifies a 2MB JavaScript bundle and unoptimized hero images, then applies route-based code splitting and responsive images, verifying improvement with before/after Lighthouse scores. ## Quick Start Ask the assistant to diagnose why your page feels slow and optimize its loading speed, bundle size, and animations.

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 hero images and preloading key resources for LCP under 2.5s, breaking up long JavaScript tasks for INP under 200ms, and setting explicit image dimensions with aspect-ratio to keep CLS under 0.1. Measure with Lighthouse before and after each change.

How to reduce JavaScript bundle size in a React app?

Reduce bundle size with route-based and component-based code splitting, tree shaking to remove unused code, and dynamic imports for heavy components like lazy(() => import('./HeavyChart')). Use webpack-bundle-analyzer to identify the largest dependencies 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 only transform and opacity for GPU acceleration, target 16ms per frame, and use requestAnimationFrame for JavaScript-driven animations.

What is layout thrashing and how do I avoid it?

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

When should I not use lazy loading for images?

Never lazy load above-the-fold content such as hero images, since it delays the Largest Contentful Paint and hurts perceived speed. Reserve lazy loading for below-fold images and always use responsive srcset with modern formats like WebP or AVIF.