Skip to main content
skill CX Codex

core-web-vitals-tuner — Claude Code skill: setup and features

Provides step-by-step code patterns to improve LCP, INP, and CLS scores. Helps tune frontend performance for Core Web Vitals audits.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add patricio0312rev/skills --skill core-web-vitals-tuner -a claude-code
Open on GitHub

What core-web-vitals-tuner does

The skill standardizes frontend performance fixes across three Core Web Vitals targets: LCP under 2.5s, INP under 200ms, and CLS under 0.1.

It provides concrete code snippets for common bottlenecks. For LCP, the instructions inject srcset, sizes, and fetchpriority="high" on hero images, alongside asset preloading and critical CSS inlining. For INP, it advises debounce wrappers, code splitting via lazy(), and background processing with Web Workers. For CLS, it enforces explicit image dimensions and the CSS aspect-ratio property.

The skill acts as an advisory checklist and does not execute browser benchmarks on its own. You need an external runner like Lighthouse CI or the web-vitals package to verify real scores.

What it helps with

  • speed up hero image loading to satisfy LCP targets
  • lower interaction delays using debouncing and Web Workers
  • stop layout shifts with explicit dimensions and aspect-ratio
  • add production monitoring with the web-vitals package

Example prompts for the agent

  • Optimize the hero banner markup to bring LCP under 2.5s
  • Fix layout shifts in the banner container using aspect-ratio
  • Offload heavy search processing to a Web Worker to reduce INP

How to install core-web-vitals-tuner

1Skills CLI (Vercel)

npx skills add patricio0312rev/skills --skill core-web-vitals-tuner -a claude-code

2Manually: put the files in place

~/.claude/skills/core-web-vitals-tuner/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/core-web-vitals-tuner/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about core-web-vitals-tuner

How to install core-web-vitals-tuner in Claude Code?

Run npx skills add patricio0312rev/skills --skill core-web-vitals-tuner -a claude-code. The file will be written to ~/.claude/skills/core-web-vitals-tuner/SKILL.md.

What performance metrics does this skill address?

It targets three Core Web Vitals: Largest Contentful Paint under 2.5s, Interaction to Next Paint under 200ms, and Cumulative Layout Shift under 0.1.

How do you verify performance gains?

The skill suggests testing with npm run lighthouse -- --url=https://example.com or importing getCLS, getFID, and getLCP from the web-vitals package.

Source text

SKILL.md · MIT
---
name: core-web-vitals-tuner
description: Systematically improves Largest Contentful Paint (LCP), Interaction to Next Paint (INP), and Cumulative Layout Shift (CLS) with prioritized fixes and verification. Use for "Core Web Vitals", "performance", "LCP", "INP", or "CLS".
---

# Core Web Vitals Tuner

Improve LCP, INP, and CLS systematically.

## LCP Optimization (<2.5s)

**Prioritized Fixes:**

1. **Optimize images** (Biggest impact)

   ```html
   <!-- Before -->
   <img src="hero.jpg" />

   <!-- After -->
   <img
     src="hero.jpg"
     srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w"
     sizes="(max-width: 600px) 400px, (max-width: 1200px) 800px, 1200px"
     loading="eager"
     fetchpriority="high"
   />
   ```

2. **Preload LCP resource**

   ```html
   <link rel="preload" as="image" href="/hero.webp" fetchpriority="high" />
   ```

3. **Inline critical CSS**

   ```html
   <style>
     /* Above-the-fold styles */
     .hero {
       display: flex;
       height: 100vh;
     }
   </style>
   ```

4. **Use CDN**
   - Serve images from CloudFront/Cloudflare
   - Enable HTTP/2 or HTTP/3

## INP Optimization (<200ms)

**Fixes:**

1. **Debounce expensive interactions**

   ```typescript
   import { debounce } from "lodash";

   const handleSearch = debounce((query) => {
     fetchResults(query);
   }, 300);
   ```

2. **Use Web Workers for heavy tasks**

   ```typescript
   const worker = new Worker("processor.js");
   worker.postMessage(largeData);
   worker.onmessage = (e) => console.log(e.data);
   ```

3. **Code splitting**
   ```typescript
   const HeavyComponent = lazy(() => import("./HeavyComponent"));
   ```

## CLS Optimization (<0.1)

**Fixes:**

1. **Reserve space for images/ads**

   ```html
   <img src="banner.jpg" width="1200" height="600" />
   ```

2. **Use CSS aspect-ratio**

   ```css
   .video-container {
     aspect-ratio: 16 / 9;
   }
   ```

3. **Avoid injecting content above existing**
   ```css
   .notification {
     position: fixed;
     top: 0;
   }
   ```

## Verification

```bash
# Lighthouse CI
npm run lighthouse -- --url=https://example.com

# Web Vitals in production
import { getCLS, getFID, getLCP } from 'web-vitals';

getCLS(console.log);
getFID(console.log);
getLCP(console.log);
```

## Output Checklist

- [ ] LCP optimized (<2.5s)
- [ ] INP optimized (<200ms)
- [ ] CLS optimized (<0.1)
- [ ] Monitoring in place
- [ ] Performance regression tests
      ENDFILE

© patricio0312rev · MIT · patricio0312rev/skills

Similar skills

All skills for Frontend and UI →

From the same set42

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor