Skip to content

Core Web Vitals: LCP, INP and CLS

Find what slows your main pages and fix LCP, INP and CLS at their causes.

  • Free, no sign-up
  • 2 to 3 hours with an agent
  • By Devvrat Hans
  • Version 1.0, updated Oct 26, 2026

1Your site and stack

Optional. The prompt adapts as you type; leave a field blank and the agent works it out.

2Copy it into your agent

core-web-vitals.md62 lines, about 871 tokens

Paste into any coding agent: Claude Code, Cursor, Codex, Copilot, Windsurf or Cline.

# Core Web Vitals: LCP, INP and CLS

Core Web Vitals measure how fast the production site shows its main content (LCP, good under 2.5 seconds), how quickly it responds to clicks and typing (INP, good under 200 milliseconds) and how stable it is while loading (CLS, good under 0.1). They affect search ranking and every launch visitor's first impression. Find the causes on the main pages and fix them in the code.

Site: not given. Find the production URL in the project config, or ask me.

## Ground rules

1. Read before you write. Explore the parts of the codebase this job touches and tell me what is already in place.
2. Plan, then stop. Give me a numbered plan: what you will change, in which files, and why. Wait for my approval before editing anything.
3. Fix things at their source (the shared layout, the config, the generator), not with one-off patches page by page.
4. Keep the project's conventions: its framework APIs, file layout, naming and code style. Add no new dependency without asking.
5. Where something is already done well, say so and leave it alone.

## You will not

- Edit `.env` files, secrets or API keys, or print their values.
- Deploy, push, merge or publish anything.
- Delete data, or run migrations or scripts against a production database.
- Add tracking, third-party scripts or links to any site I did not ask for.
- Change copy, design or behaviour that this job does not need.
- Remove features or third-party tools without asking.
- Change the visual design.

## Your stack

- Framework: Work out the framework, router and build output from the project files (package.json, lockfiles, framework config) before planning, and say which you found.
- Host: Work out where the site is hosted from the config files (vercel.json, netlify.toml, wrangler config, Dockerfile, fly.toml) and say which you found.

## Steps

### 1. Measure first

For the homepage, pricing and one main product page, work out the LCP element, what blocks it, the heaviest scripts, and what shifts during load, from the code and a local production build (the framework's build output, Lighthouse if available). Ask me for field data from Search Console or analytics if I have it.

### 2. LCP

Make the LCP element load first: server-render it, preload its image or font, give the image `fetchpriority="high"` and the right size, cut render-blocking CSS and scripts in the head, and reduce server response time with caching.

### 3. INP

Find long tasks on interaction: heavy event handlers, large client bundles hydrating at once, third-party scripts. Split code, defer non-critical scripts, move heavy work off the main thread or to the server, and give instant visual feedback on clicks.

### 4. CLS

Reserve space for images, videos, embeds, ads and banners (width and height or aspect-ratio), load web fonts with `font-display: swap` and size-matched fallbacks, and never insert content above what the user is reading.

## Done means

- [ ] The LCP element, slow scripts and layout shifts of the main pages are identified.
- [ ] The LCP element is server-rendered, prioritised and sized.
- [ ] Long interaction tasks are split or deferred, and third-party scripts do not block.
- [ ] Images, embeds and fonts no longer shift the layout.

## Report back

When you finish, give me:

- what you changed, file by file;
- anything you skipped, and why;
- anything I must do by hand (DNS records, dashboards, accounts, deploys);
- how to check each change on the live site.

One-line version

For agents that can read a URL. It fetches this prompt with your settings applied.

Read https://abacklaunch.com/prompts/core-web-vitals.md and follow it for this project.

3Check the result

When the changes are live, run these free checks. Add your site URL above and each one opens already running on it.

This prompt will not

  • Edit .env files, secrets or API keys, or print their values.
  • Deploy, push, merge or publish anything.
  • Delete data, or run migrations or scripts against a production database.
  • Add tracking, third-party scripts or links to any site I did not ask for.
  • Change copy, design or behaviour that this job does not need.
  • Remove features or third-party tools without asking.
  • Change the visual design.

It reads your code first, shows you a plan, and waits for your approval before it changes anything.

What you get

  • The cause of slow LCP, INP and CLS on your main pages
  • Fixes in the code, not just settings
  • Before and after numbers where they can be measured

How to use this prompt

  1. 1

    Describe your stack

    Add your site, framework and host. The prompt adapts; blank fields are left for the agent to work out.

  2. 2

    Paste it into your agent

    Open your project in Claude Code, Cursor, Codex, Copilot, Windsurf or Cline, and paste the prompt or the one-line version.

  3. 3

    Approve the plan

    The agent reads your code, shows you a plan with the files it will touch, and waits. Change anything you disagree with.

  4. 4

    Check the result

    When the changes are live, run the free checks below on your site to confirm each fix.

What the agent does

Core Web Vitals measure how fast the production site shows its main content (LCP, good under 2.5 seconds), how quickly it responds to clicks and typing (INP, good under 200 milliseconds) and how stable it is while loading (CLS, good under 0.1). They affect search ranking and every launch visitor's first impression. Find the causes on the main pages and fix them in the code.

  1. 1. Measure first

    For the homepage, pricing and one main product page, work out the LCP element, what blocks it, the heaviest scripts, and what shifts during load, from the code and a local production build (the framework's build output, Lighthouse if available). Ask me for field data from Search Console or analytics if I have it.

  2. 2. LCP

    Make the LCP element load first: server-render it, preload its image or font, give the image fetchpriority="high" and the right size, cut render-blocking CSS and scripts in the head, and reduce server response time with caching.

  3. 3. INP

    Find long tasks on interaction: heavy event handlers, large client bundles hydrating at once, third-party scripts. Split code, defer non-critical scripts, move heavy work off the main thread or to the server, and give instant visual feedback on clicks.

  4. 4. CLS

    Reserve space for images, videos, embeds, ads and banners (width and height or aspect-ratio), load web fonts with font-display: swap and size-matched fallbacks, and never insert content above what the user is reading.

Done means

  • The LCP element, slow scripts and layout shifts of the main pages are identified.
  • The LCP element is server-rendered, prioritised and sized.
  • Long interaction tasks are split or deferred, and third-party scripts do not block.
  • Images, embeds and fonts no longer shift the layout.

Questions

Do Core Web Vitals affect rankings?

They are part of Google's page experience signals. They rarely beat relevance, but between similar pages they help, and they always affect whether visitors stay.

Why is my lab score different from real users?

Lab tests use one device and network. Field data from real visitors (Search Console, the Chrome UX Report) is what Google uses. Fix the causes and both improve.

What replaced First Input Delay?

Interaction to Next Paint (INP) replaced FID in March 2024. It measures every interaction, not only the first.

Does this prompt add links to Aback Launch to my site?

No. Nothing in the prompt mentions Aback Launch or asks your agent to link to us. The only exception is an optional badge step, which stays off unless you tick it. Some prompt libraries slip their own link into your codebase by default; we think that should always be your choice.

Which coding agents does it work with?

Claude Code, Cursor, Codex, GitHub Copilot, Windsurf, Cline, and any agent that can read your project and edit files. You can copy it as a plain prompt, save it as a Claude Code skill or a Cursor rule, or add it to AGENTS.md.

Is it safe to run on my real codebase?

The prompt makes the agent read first, show a plan and wait for your approval, and it forbids touching secrets, deploying and deleting data. Still review the changes and run your tests before you deploy, as with any change.

Changelog

  • v1.0First version.

Launch your startup on Aback Launch

Get a launch page that search engines and AI assistants can read, a place in the weekly launch list, and a review by a real person. Free to join.