Introduction

What is PS Guard?

PS Guard is a Lighthouse-based performance guard that enforces Web Vitals thresholds in CI/CD pipelines and local development. It audits your pages against configurable limits for LCP, CLS, INP, TTFB, and FCP — failing the build if any metric exceeds the threshold.

Unlike running Lighthouse manually, PS Guard integrates directly into your workflow. It supports single URL audits, full sitemap crawling, HTML report generation, and provides actionable hints when metrics fail.

The Problem

Performance regressions are easy to introduce and hard to catch. A single unoptimized image, a render-blocking script, or a layout shift can silently degrade your Core Web Vitals:

  • LCP creeps above 2.5s after adding a hero image without preload
  • CLS jumps when a dynamic banner loads without reserved space
  • INP degrades after adding heavy event handlers
  • TTFB increases when server-side rendering becomes too complex
  • FCP slows down due to render-blocking CSS or fonts

PS Guard catches these regressions automatically before they reach production.

Use Cases

  • CI/CD pipelines — fail builds when performance degrades
  • Pre-deploy checks — audit staging before promoting to production
  • Sitemap auditing — validate all pages meet thresholds
  • Performance dashboards — export JSON for monitoring tools
  • Local development — catch regressions before committing

Key Features

  • Lighthouse-powered auditing with Chrome headless
  • 5 Core Web Vitals: LCP, CLS, INP, TTFB, FCP
  • Sitemap support with recursive sitemap index parsing
  • Self-contained HTML reports with score bars and collapsible details
  • Built-in presets for Next.js, landing pages, and marketing sites
  • Actionable fix hints when thresholds fail
  • JSON output for dashboards and CI integration
PS Guard requires Chrome/Chromium installed on the machine. In CI environments, use browser-actions/setup-chrome@v1 or similar.