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.
npx skills add patricio0312rev/skills --skill core-web-vitals-tuner -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/core-web-vitals-tuner/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/core-web-vitals-tuner/
1Skills CLI (Vercel)
npx skills add patricio0312rev/skills --skill core-web-vitals-tuner -a codex2Manually: put the files in place
.agents/skills/core-web-vitals-tuner/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add patricio0312rev/skills --skill core-web-vitals-tuner -a cursor2Manually: put the files in place
.cursor/skills/core-web-vitals-tuner/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install patricio0312rev/skills core-web-vitals-tuner2Manually: put the files in place
.github/skills/core-web-vitals-tuner/SKILL.md1Skills CLI (Vercel)
npx skills add patricio0312rev/skills --skill core-web-vitals-tuner -a gemini-cli2Platform CLI
gemini skills install https://github.com/patricio0312rev/skills --path performance/core-web-vitals-tunerManually: put the files in place
.devin/skills/core-web-vitals-tuner/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add patricio0312rev/skills --skill core-web-vitals-tuner -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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