core-web-vitals-tuner
Core Web Vitals Tuner
Improve LCP, INP, and CLS systematically.
LCP Optimization (<2.5s)
Prioritized Fixes:
-
Optimize images (Biggest impact)
<!-- 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
<link rel="preload" as="image" href="/hero.webp" fetchpriority="high" /> -
Inline critical CSS
<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
import { debounce } from "lodash"; const handleSearch = debounce((query) => { fetchResults(query); }, 300); -
Use Web Workers for heavy tasks
const worker = new Worker("processor.js"); worker.postMessage(largeData); worker.onmessage = (e) => console.log(e.data); -
Code splitting
const HeavyComponent = lazy(() => import("./HeavyComponent"));
CLS Optimization (<0.1)
Fixes:
-
Reserve space for images/ads
<img src="banner.jpg" width="1200" height="600" /> -
Use CSS aspect-ratio
.video-container { aspect-ratio: 16 / 9; } -
Avoid injecting content above existing
.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
More from monkey1sai/openai-cli
multi-tenant-safety-checker
Ensures tenant isolation at query and policy level using Row Level Security, automated testing, and security audits. Prevents data leakage between tenants. Use for "multi-tenancy", "tenant isolation", "RLS", or "data security".
10modal-drawer-system
Implements accessible modals and drawers with focus trap, ESC to close, scroll lock, portal rendering, and ARIA attributes. Includes sample implementations for common use cases like edit forms, confirmations, and detail views. Use when building "modals", "dialogs", "drawers", "sidebars", or "overlays".
10eslint-prettier-config
Configures ESLint and Prettier for consistent code quality with TypeScript, React, and modern best practices. Use when users request "ESLint setup", "Prettier config", "linting configuration", "code formatting", or "lint rules".
9api-security-hardener
Hardens API security with rate limiting, input validation, authentication, and protection against common attacks. Use when users request "API security", "secure API", "rate limiting", "input validation", or "API protection".
9security-incident-playbook-generator
Creates response procedures for security incidents with containment steps, communication templates, and evidence collection. Use for "incident response", "security playbook", "breach response", or "IR plan".
9mermaid-diagram-generator
Creates Mermaid diagrams for flowcharts, sequence diagrams, ERDs, and architecture visualizations in markdown. Use when users request "Mermaid diagram", "flowchart", "sequence diagram", "ERD diagram", or "architecture diagram".
9