Agent skill
core-web-vitals-tuner
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".
Install this agent skill to your Project
npx add-skill https://github.com/patricio0312rev/skills/tree/main/performance/core-web-vitals-tuner
SKILL.md
Core Web Vitals Tuner
Improve LCP, INP, and CLS systematically.
LCP Optimization (<2.5s)
Prioritized Fixes:
-
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" /> -
Preload LCP resource
html<link rel="preload" as="image" href="/hero.webp" fetchpriority="high" /> -
Inline critical CSS
html<style> /* Above-the-fold styles */ .hero { display: flex; height: 100vh; } </style> -
Use CDN
- Serve images from CloudFront/Cloudflare
- Enable HTTP/2 or HTTP/3
INP Optimization (<200ms)
Fixes:
-
Debounce expensive interactions
typescriptimport { debounce } from "lodash"; const handleSearch = debounce((query) => { fetchResults(query); }, 300); -
Use Web Workers for heavy tasks
typescriptconst worker = new Worker("processor.js"); worker.postMessage(largeData); worker.onmessage = (e) => console.log(e.data); -
Code splitting
typescriptconst HeavyComponent = lazy(() => import("./HeavyComponent"));
CLS Optimization (<0.1)
Fixes:
-
Reserve space for images/ads
html<img src="banner.jpg" width="1200" height="600" /> -
Use CSS aspect-ratio
css.video-container { aspect-ratio: 16 / 9; } -
Avoid injecting content above existing
css.notification { position: fixed; top: 0; }
Verification
# 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
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
rate-limiting-abuse-protection
Implements rate limiting and abuse prevention with per-route policies, IP/user-based limits, sliding windows, safe error responses, and observability. Use when adding "rate limiting", "API protection", "abuse prevention", or "DDoS protection".
rbac-permissions-builder
Implements role-based access control with permission matrix, route guards, policy functions, and UI permission hints. Provides middleware/guards, helper utilities, test suggestions, and permission checking patterns. Use when building "RBAC", "permissions", "access control", or "authorization".
websocket-realtime-builder
Implements real-time features using WebSockets with Socket.io, rooms, authentication, and reconnection handling. Use when users request "real-time updates", "WebSocket", "Socket.io", "live chat", or "push notifications".
webhook-receiver-hardener
Secures webhook receivers with signature verification, retry handling, deduplication, idempotency keys, and error responses. Provides verification code, dedupe storage strategy, runbook for incidents. Use when implementing "webhooks", "webhook security", "event receivers", or "third-party integrations".
auth-module-builder
Implements secure authentication patterns including login/registration, session management, JWT tokens, password hashing, cookie settings, and CSRF protection. Provides auth routes, middleware, security configurations, and threat model documentation. Use when building "authentication", "login system", "JWT auth", or "session management".
rest-to-graphql-migrator
Migrates REST APIs to GraphQL incrementally with schema stitching, REST datasources, and gradual endpoint migration. Use when users request "migrate to GraphQL", "REST to GraphQL", "GraphQL wrapper", or "API modernization".
Didn't find tool you were looking for?