# Core Web Vitals

Optimize Core Web Vitals (LCP, INP, CLS) for better page experience using field and lab...

- Repository: https://github.com/addyosmani/web-quality-skills (3022 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-08-24
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add addyosmani/web-quality-skills --skill core-web-vitals -g -a claude-code -y`
Codex: `npx skills add addyosmani/web-quality-skills --skill core-web-vitals -g -a codex -y`
Cursor: `npx skills add addyosmani/web-quality-skills --skill core-web-vitals -g -a cursor -y`
Gemini CLI: `npx skills add addyosmani/web-quality-skills --skill core-web-vitals -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add addyosmani/web-quality-skills`

## Description

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".

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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](../performance/references/MEASUREMENT.md). Prefer this sequence:

1. Check page-level CrUX p75 data, with a clearly labeled origin fallback when page data is unavailable.
2. Record a browser performance trace under stated conditions. With Chrome DevTools MCP, trace summaries can include CrUX alongside the observed lab metrics.
3. Analyze only the insights associated with the failing metric, then inspect the implicated code and resources.
4. 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**
```html
<!-- ❌ Blocks rendering -->
<link rel="stylesheet" href="/all-styles.css">

The rest: https://github.com/addyosmani/web-quality-skills/blob/HEAD/skills/core-web-vitals/SKILL.md
