Core Web Vitals
Optimize Core Web Vitals (LCP, INP, CLS) for better page experience using field and lab...
Install
npx skills add addyosmani/web-quality-skills --skill core-web-vitals -g -a claude-code -y- Repository
- addyosmani/web-quality-skills3k
- Category
- Engineering
- Updated
- 2mo ago
- License
- MIT
- Context cost
- Mediumabout 2,347 tokens
- Runs scripts
- No, instructions only
What it does
Optimize Core Web Vitals (LCP, INP, CLS) for better page experience using field and lab evidence. Use when asked to "improve Core Web Vitals", "fix LCP", "reduce CLS", "optimize INP", "page experience optimization", or "fix layout shifts".
Core Web Vitals optimization
Targeted optimization for the three Core Web Vitals using field data to identify user impact and browser traces to diagnose causes.
Measure before optimizing
When a runnable URL is available, read the performance measurement workflow. Prefer this sequence:
- Check page-level CrUX p75 data, with a clearly labeled origin fallback when page data is unavailable.
- Record a browser performance trace under stated conditions. With Chrome DevTools MCP, trace summaries can include CrUX alongside the observed lab metrics.
- Analyze only the insights associated with the failing metric, then inspect the implicated code and resources.
- Re-run equivalent lab measurements after the fix. Do not claim an immediate field improvement; CrUX and first-party RUM need new user visits.
If only source code is available, identify likely causes but do not claim that LCP, INP, or CLS is failing without runtime evidence.
The three metrics
| Metric | Measures | Good | Needs work | Poor |
|---|---|---|---|---|
| LCP | Loading | ≤ 2.5s | 2.5s, 4s | > 4s |
| INP | Interactivity | ≤ 200ms | 200ms, 500ms | > 500ms |
| CLS | Visual Stability | ≤ 0.1 | 0.1, 0.25 | > 0.25 |
Google measures at the 75th percentile, 75% of page visits must meet "Good" thresholds.
LCP: Largest Contentful Paint
LCP measures when the largest visible content element renders. Usually this is:
- Hero image or video
- Large text block
- Background image
<svg>element
Common LCP issues
1. Slow server response (TTFB > 800ms)
Fix: CDN, caching, optimized backend, edge rendering
2. Render-blocking resources
<!-- ❌ Blocks rendering -->
<link rel="stylesheet" href="/all-styles.css">
