web-performance-optimization

Diagnose and optimize website performance including Core Web Vitals, bundle size, and caching.

1|Updated Aug 4, 2026
One-click install
npx skills add https://github.com/Hamzaoui-Louai/LEAN-gym-dashboard-frontend --skill web-performance-optimization-hamzaoui-louai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: web-performance-optimization
Source: https://github.com/Hamzaoui-Louai/LEAN-gym-dashboard-frontend/tree/main/.opencode/skills/web-performance-optimization
Command: npx skills add https://github.com/Hamzaoui-Louai/LEAN-gym-dashboard-frontend --skill web-performance-optimization-hamzaoui-louai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Slow websites hurt user experience, SEO rankings, and conversion rates. This Skill provides a systematic workflow to measure, analyze, and fix performance issues such as slow loading times, oversized JavaScript bundles, unoptimized images, and poor Core Web Vitals scores. ## Core Features & Use Cases - Core Web Vitals Optimization: Diagnose and fix LCP, FID, and CLS issues with concrete code patterns for images, scripts, and layout stability. - Bundle Size Reduction: Analyze bundles with webpack-bundle-analyzer, replace heavy dependencies like moment.js, and implement code splitting and lazy loading. - Image & Caching Strategy: Convert images to WebP/AVIF, implement responsive images and lazy loading, and configure caching headers and CDN delivery. - Use Case: Your React app's Lighthouse score is 62 with a 4.2s LCP. Use this Skill to identify the 2.5MB hero image and 850KB bundle as culprits, apply the provided optimization patterns, and verify improvement to a 94 score. ## Quick Start Audit my website's performance and give me a prioritized optimization plan to improve Core Web Vitals and reduce bundle size.

Frequently Asked Questions about web-performance-optimization

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 targeting each metric: optimize hero images and preload critical resources for LCP, reduce JavaScript bundle size and defer non-critical scripts for FID, and set explicit width/height on images to prevent CLS. Measure with Lighthouse before and after each change.

How to reduce JavaScript bundle size in a React app?

Reduce bundle size by analyzing composition with webpack-bundle-analyzer, replacing heavy dependencies like moment.js with date-fns, importing only needed lodash functions, enabling tree shaking, and implementing route-based and component-level code splitting with dynamic imports.

What image formats should I use for web performance?

Use AVIF for the best compression, WebP as a widely supported fallback, and optimized JPEG as a final fallback via the picture element. Combine with responsive srcset images, explicit dimensions, and lazy loading for below-the-fold content.

Why is my website fast on desktop but slow on mobile?

Mobile slowness typically comes from slower CPUs and networks that amplify JavaScript execution and download costs. Test with Chrome DevTools throttling or Lighthouse with CPU slowdown, reduce main-thread work, and optimize for 3G/4G network conditions.

When should I not lazy load resources?

Do not lazy load above-the-fold critical resources such as hero images or essential scripts, as this delays LCP and harms perceived performance. Use eager loading with fetchpriority="high" for critical assets and reserve lazy loading for non-critical content.