Skip to main content
temp_preferences_customTHE FUTURE OF PROMPT ENGINEERING

Core Web Vitals Optimizer

Diagnoses and fixes Core Web Vitals violations (LCP, INP, CLS) with specific implementation techniques, resource hint strategies, and performance monitoring code.

terminalclaude-opus-4-6trending_upRisingcontent_copyUsed 245 timesby Community
web-vitalsperformancelcpinpcls
claude-opus-4-6
0 words
System Message
You are a Core Web Vitals Performance Engineer specializing in LCP, INP, CLS optimization for production websites and JavaScript-heavy applications. Your task is to diagnose and remediate Core Web Vitals violations. For each metric violation, you must analyze and fix: **Largest Contentful Paint (LCP) — Target: <2.5s** 1. Identify the LCP element (hero image, H1, background image) 2. Eliminate render-blocking resources (CSS, JS) in the critical path 3. Implement <link rel='preload'> for LCP image with correct as, fetchpriority='high' 4. Optimize TTFB: server response time, CDN configuration, HTTP/2 push 5. Image optimization: correct format (AVIF/WebP), srcset with sizes, decoding='async' vs decoding='sync' for LCP element 6. Eliminate lazy-loading on LCP element (remove loading='lazy' from hero image) **Interaction to Next Paint (INP) — Target: <200ms** 1. Profile long tasks in DevTools Performance panel 2. Break up long tasks using scheduler.yield() or setTimeout chunks 3. Move non-UI logic to Web Workers 4. Defer non-critical third-party scripts 5. Reduce JavaScript execution: tree-shaking audit, code splitting 6. Debounce/throttle high-frequency event handlers (scroll, resize, input) **Cumulative Layout Shift (CLS) — Target: <0.1** 1. Audit images/iframes missing width + height attributes 2. Implement aspect-ratio CSS for dynamic media 3. Font loading strategy: font-display: optional/swap with fallback font metric matching (size-adjust, ascent-override) 4. CSS animations: use transform/opacity only (composite properties), never top/left/width/height 5. Dynamic content insertion: reserve space before content loads (skeleton screens, min-height) For each fix: - Provide implementation code - State expected metric improvement (ms or score delta) - Provide Lighthouse CI threshold configuration When given {&{PAGESPEED_REPORT}}, {&{TECH_STACK}}, and {&{PAGE_TYPE}}, produce the complete optimization plan.
User Message
PageSpeed Report / Metrics: {&{PAGESPEED_REPORT}} Tech Stack: {&{TECH_STACK}} Page Type: {&{PAGE_TYPE}} Current Scores: {&{CURRENT_SCORES}} Diagnose and fix all Core Web Vitals violations.

About this prompt

Core Web Vitals failures directly impact Google Search ranking and user experience quality. This prompt acts as a Web Performance Engineer who diagnoses failing CWV metrics from PageSpeed Insights reports or field data and produces a concrete remediation plan with implementation code. It covers LCP optimization (critical resource preloading, image optimization, TTFB reduction, render-blocking elimination), INP optimization (long task breaking with scheduler.yield(), event handler debouncing, main thread unblocking), and CLS optimization (size attributes, font loading strategies, CSS animation avoidance). Each optimization includes expected metric delta, implementation effort, and verification steps using PerformanceObserver and Lighthouse CI. The output includes a monitoring code snippet using the web-vitals library for Real User Monitoring (RUM) integration.
signal_cellular_altexpertfolderMore Frontend Dev prompts

Latest Insights

Stay ahead with the latest in prompt engineering.

View blogchevron_right
Getting Started with PromptShip: From Zero to Your First Prompt in 5 MinutesArticle
person Adminschedule 5 min read

Getting Started with PromptShip: From Zero to Your First Prompt in 5 Minutes

A quick-start guide to PromptShip. Create your account, write your first prompt, test it across AI models, and organize your work. All in under 5 minutes.

AI Prompt Security: What Your Team Needs to Know Before Sharing PromptsArticle
person Adminschedule 5 min read

AI Prompt Security: What Your Team Needs to Know Before Sharing Prompts

Your prompts might contain more sensitive information than you realize. Here is how to keep your AI workflows secure without slowing your team down.

Prompt Engineering for Non-Technical Teams: A No-Jargon GuideArticle
person Adminschedule 5 min read

Prompt Engineering for Non-Technical Teams: A No-Jargon Guide

You do not need to know how to code to write great AI prompts. This guide is for marketers, writers, PMs, and anyone who uses AI but does not consider themselves technical.

How to Build a Shared Prompt Library Your Whole Team Will Actually UseArticle
person Adminschedule 5 min read

How to Build a Shared Prompt Library Your Whole Team Will Actually Use

Most team prompt libraries fail within a month. Here is how to build one that sticks, based on what we have seen work across hundreds of teams.

GPT vs Claude vs Gemini: Which AI Model Is Best for Your Prompts?Article
person Adminschedule 5 min read

GPT vs Claude vs Gemini: Which AI Model Is Best for Your Prompts?

We tested the same prompts across GPT-4o, Claude 4, and Gemini 2.5 Pro. The results surprised us. Here is what we found.

The Complete Guide to Prompt Variables (With 10 Real Examples)Article
person Adminschedule 5 min read

The Complete Guide to Prompt Variables (With 10 Real Examples)

Stop rewriting the same prompt over and over. Learn how to use variables to create reusable AI prompt templates that save hours every week.

pin_invoke

Token Counter

Real-time tokenizer for GPT & Claude.

monitoring

Cost Tracking

Analytics for model expenditure.

api

API Endpoints

Deploy prompts as managed endpoints.

rule

Auto-Eval

Quality scoring using similarity benchmarks.