◉ANTIGRAVITY LABJP
Articles/Integrations
⬡ Integrations/2026-05-01Advanced

Antigravity × Lighthouse CI: Catching Web Performance Regressions Automatically— Budgets, PR Comments, and Progressive Blocking

Wire Antigravity's AI to Lighthouse CI inside GitHub Actions and stop performance regressions before they reach production. This guide covers budget design, PR comments, progressive blocking, RUM integration, and cost controls — all in a shape that holds up in real teams.

antigravity476lighthouse-ciperformance14github-actions9ci-cd16premium16

✦ Premium Article

import RelatedArticles from "@/components/RelatedArticles";

"After the release, the first paint somehow felt heavier" — anyone who has run a web product for long enough has lived this moment. I have, on sites I run myself. Watching Lighthouse scores by hand never lasts as a habit, and the result is a quiet backslide where Largest Contentful Paint creeps up by a few hundred milliseconds a month and nobody notices. By the time the CrUX report or your real-user monitoring dashboard surfaces the trend, you're trying to remember which release out of the last six was the actual culprit.

This guide builds a pipeline that combines Antigravity's AI with Lighthouse CI on GitHub Actions to structurally prevent that drift. We don't stop at running Lighthouse and writing the result to a dashboard. We let the AI read the delta and the PR diff, then write back a comment with hypotheses about the cause and a concrete next step. We also close the loop back to production by feeding RUM data into the budget, so the lab numbers and the field numbers stay in conversation.

Why "we just noticed it got slow" is unacceptable

Performance regressions are nasty precisely because nothing breaks. They never show up as a red CI light, users rarely report them, and yet bounce and exit rates quietly degrade. I once shipped a PR that swapped a hero image from WebP to PNG. No one caught it on review. A week later, CrUX field data was the first to surface the problem, and by then four other releases had landed on top of it. Untangling which change actually caused the regression took an afternoon I did not have.

You cannot solve this by "being careful." There are too many surfaces to watch — image formats, third-party scripts, font swaps, hydration costs, route bundle sizes, the new dependency someone added "just for this one feature" — and human attention does not scale across all of them. The realistic answer is to encode a budget into CI and stop the build when it is exceeded.

The reason to add Antigravity's AI on top is that bare numbers leave the reviewer asking "okay, but what do I do about it?". A red CI with a 300 ms TBT increase tells the reviewer exactly nothing about which file or dependency caused the increase. Hand the AI the diff and the metrics, and let it write the hypothesis and the next move into the PR comment. Reviews start moving again, and the bot becomes something the team trusts rather than something they route around.

There is also a quieter benefit that becomes apparent only after a few months of running this: the AI comments themselves form a corpus. When a new engineer joins the team and asks "why do we always argue about font preloading?", you can point them at six months of PR comments where the bot explained the same regression mechanism and the team's response. The comment thread becomes institutional memory.

The big picture — Antigravity, Lighthouse CI, and GitHub Actions

This pipeline has three layers. Naming the responsibilities up front saves you from confusion later.

  • Lighthouse CI runs Lighthouse three times against the preview deployment and collects metrics. The median is what we use, to keep flakiness down. Lighthouse CI is also what enforces the pass/fail decision — there is no AI in this layer at all.
  • Performance Budget is the set of thresholds. Declared in lighthouserc.js as things like "LCP under 2,500 ms" and "TBT under 200 ms." This file is the contract between the team and the bot, and it lives in version control like any other contract.
  • Antigravity Agent reads the PR diff, the Lighthouse JSON, and the previous main numbers when the budget is exceeded, and writes a hypothesis plus a suggestion back as a PR comment. The agent never decides whether the build passes; it only explains.

The split that matters: Lighthouse decides, AI explains. If you let the AI also decide pass/fail, the pipeline becomes non-deterministic and trust in CI evaporates. The same PR can pass on Monday and fail on Tuesday with no code change, simply because the model felt different that day. That is the fastest way to make engineers ignore the bot.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦You can now block the slow drift of 'somehow it got slower after the last release' at the CI gate, instead of catching it in field data weeks later
✦You'll learn a production pattern where Antigravity's AI reads the Lighthouse delta and your PR diff to surface the most likely culprit — not just the numbers
✦You'll walk away with a Performance Budget, a GitHub Actions workflow, an AI comment template, and a RUM feedback loop you can drop into your own repo this weekend
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⬡ Integrations2026-11-03
Turning a Spreadsheet Chore into Apps Script: The First Request a Non-Engineer Can Hand to Antigravity
For non-engineers who want a weekly copy-and-paste routine handled by Apps Script: how to word the request to Antigravity, a script with a dry-run switch and a lock, when a FILTER formula is enough, why triggers drift within the hour, and a table for sorting out failures.
⬡ Integrations2026-10-17
When Antigravity's Browser Agent Stops at the Login Screen: Four Things to Check
The browser agent came back with only a sign-in page. Here are four checks, built on the fact that it runs in a separate Chrome profile, to get its login state sorted.
⬡ Integrations2026-09-05
Pointing GOOGLE_GEMINI_BASE_URL at Your Own Gateway Does Not Change Who Holds the Key
I pointed the Antigravity CLI at a gateway of my own and recorded exactly which credentials travelled with it. Authorization is dropped across a cross-origin redirect, but the API key header survives every hop. Here is the measurement, and how I moved the key off my laptop.