---
title: "Pagespeed-optimizer fixes site code until Lighthouse scores reach 90"
id: "story-103"
canonical_url: "https://emergent.fm/stories/103"
markdown_url: "https://emergent.fm/stories/103/article.md"
published_at: "2026-11-22T10:33:33.920Z"
modified_at: "2026-11-22T10:33:33.920Z"
topic: "agent_skills"
trust_label: "Reported"
publisher: "Emergent.FM"
---

# Pagespeed-optimizer fixes site code until Lighthouse scores reach 90

## Key points

- The pagespeed-optimizer skill uses PageSpeed Insights or Lighthouse to fix site code until Performance, Accessibility, Best Practices, and SEO all score at least 90.
- For local sites, the agent builds the production version, fixes Total Blocking Time and Largest Contentful Paint first, and re-runs project tests and lint.
- The script requires Node.js 18 or higher, Google Chrome for local mode, and an optional PageSpeed Insights API key to avoid HTTP 429 quota errors.

## Pagespeed-optimizer targets and setup

- Target score: At least 90 in Performance, Accessibility, Best Practices, and SEO
- Runtime requirement: Node.js 18 or higher
- Local mode browser: Google Chrome
- Public URL API key: Optional PSI_API_KEY to avoid HTTP 429 quota errors
- Score variance: About 5 points between runs

For local sites, the agent builds the production version, maps failing audits to files, and re-runs project tests and lint.

The pagespeed-optimizer skill measures a URL with PageSpeed Insights or Lighthouse and fixes code until Performance, Accessibility, Best Practices, and SEO all score at least 90.

For local sites, the agent builds the production version, maps failing audits to files, fixes Total Blocking Time and Largest Contentful Paint first, and re-runs project tests and lint.

The README says the agent will not remove features like analytics or chat without asking, and will not serve Lighthouse a different page to game the score.

## Score variance and setup

The README notes that scores vary by about 5 points between runs and that local runs differ from real PageSpeed Insights results.

This matters to web builders using SKILL.md coding agents like Claude Code, Cursor, or Codex who want to automate Lighthouse fixes.

Add .pagespeed/ to your .gitignore and export a PSI_API_KEY before starting your agent if you plan to test public URLs.

- **Requirements:** The measurement script requires Node.js 18 or higher, Google Chrome for local mode, and an optional PageSpeed Insights API key to avoid HTTP 429 quota errors.

## Source

- <https://github.com/tuthuongvo/pagespeed-optimizer-skills>

Canonical page: <https://emergent.fm/stories/103>
