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.

antigravity370lighthouse-ciperformance11github-actions9ci-cd10premium14

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-06-17
Feeding axe-core Findings to an Antigravity Agent: An Accessibility Fix Loop in CI
Detect accessibility violations with axe-core, hand them to an Antigravity agent as fixable tasks, and wire detection, triage, fixing, and re-verification into a single CI loop. Includes a diff gate that blocks only new violations and a scoping design that keeps the agent from breaking screen readers.
Integrations2026-06-13
Running the Antigravity CLI (agy) Headless in CI: Working Around the Non-TTY stdout Problem
Run agy -p inside GitHub Actions or cron and the output you saw locally can vanish, while the exit code still returns 0. Here is how non-TTY detection causes it, plus a robust setup using a pseudo-TTY, defensive text parsing, and API-key auth so you always capture the result.
Integrations2026-03-27
Automate GitHub Pull Request Reviews with Antigravity: A Practical Guide
Learn how to automate GitHub Pull Request code reviews using Antigravity's AI agents. From environment setup to workflow design, this step-by-step guide covers everything you need.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →