lighthouse-analysis-optimization: Auditing Web Pages with Lighthouse and Optionally Implementing Code Changes

Introduction

When frontend and full-stack engineers investigate slow first paint, layout shift, or unmet Core Web Vitals, they often have to context-switch between browser DevTools, the lighthouse command-line tool, and a pile of optimization checklists. If they also want to write the findings back into the repo, they have to manually cross-reference the report item by item and edit files accordingly. The Skill described below consolidates “run audit → generate report → decide whether to continue optimizing → checklist & code changes” into a single conversational workflow. It preferentially uses chrome-devtools-mcp and falls back to the Lighthouse CLI when MCP is unavailable.

What Is This

lighthouse-analysis-optimization is a community Skill on SkillHub, categorized under dev-programming (version 1.0.0, published by user_f8e4df6e). It performs Lighthouse performance analysis on any URL: by default it first produces an audit report, then uses AskQuestion to ask whether to proceed with optimization; if you choose to continue, it confirms the project scope, outputs an optimization checklist with file references, and modifies the code. The main workflow is defined in SKILL.md, and the details for each phase are documented in the reference files as described. The metadata specifies requires_api_key=false, so no additional API key is needed.

  • SkillHub page: https://www.skillhub.cn/skills/user_f8e4df6e/lighthouse-analysis-optimization
  • API coordinate: @user_f8e4df6e/lighthouse-analysis-optimization
  • Documentation page: https://api.skillhub.cn/user_f8e4df6e/lighthouse-analysis-optimization

Core Features

Based on the official description, the verified capabilities are as follows.

  1. Performance Audit: Runs Lighthouse analysis on a specified web page. Under the hood, chrome-devtools-mcp takes priority; when MCP is not present in the environment, it falls back to lighthouse CLI.
  2. Report-First by Default: The first round focuses on the audit results, making it easy to review issues and metrics under categories such as Performance and Accessibility (e.g., you can directly discuss LCP, CLS, or TTFB based on the report).
  3. Optional Deep Optimization: Via AskQuestion, it confirms whether to proceed. If you continue, it will confirm the project scope, produce an optimization checklist with file associations, and modify code within the agreed-upon scope.
  4. Phased Documentation: Complex steps are not crammed into a single prompt. Instead, SKILL.md defines the main flow, and reference files are consulted phase by phase, reducing the context load of any single conversation turn.

The official trigger scenarios (Use when): the user asks to run Lighthouse, analyze page performance, measure LCP/CLS/TTFB, or generate an optimization checklist for a specific URL.

Installation & Activation

The public documentation does not list separate installation commands for Cursor, Codex CLI, or Claude Code. When installing or referencing a community Skill from SkillHub in the corresponding client, please follow the instructions on the SkillHub page and the client’s current Skill installation guide.

The verified metadata below is useful for locating the Skill in SkillHub or in tools that support coordinate-based references:

名称: lighthouse-analysis-optimization
版本: 1.0.0
来源: community
分类: dev-programming
坐标: @user_f8e4df6e/lighthouse-analysis-optimization
requires_api_key: false

Once activated, the Agent executes according to SKILL.md. When a particular step requires finer-grained rules, it reads the reference files from the package phase by phase (the exact file names are subject to the Skill package contents).

Typical Usage

The steps below correspond to the main workflow described in the official documentation and can be reproduced with natural language in any Agent that supports this Skill.

  1. Provide the target URL and state that you want a performance analysis or Lighthouse audit (you can also specify metrics of interest such as LCP, CLS, or TTFB).
  2. Wait for the audit report: The Skill preferentially fetches results via chrome-devtools-mcp; if MCP is unavailable, it uses lighthouse CLI. Read the category scores and individual audit items in the report.
  3. Answer whether to continue with optimization: When AskQuestion appears, you can stop here if you only need the report. If you want changes landed in your codebase, choose to continue.
  4. Confirm the project scope: After you proceed, the Agent will align with you on the repo/directory boundaries for changes, avoiding unintended edits to unrelated files.
  5. Execute code changes per the checklist: An optimization checklist with file references is generated, and code is modified within the confirmed scope. The detailed steps follow SKILL.md and the phase-specific reference files.

Example prompt (semantics align with the official Use when; not bound to any specific client syntax):

请对 https://example.com 跑 Lighthouse,重点看 LCP 和 CLS,先给审计报告。

If you are satisfied with the report but still need code changes, you can explicitly state in the next turn that you want to continue optimizing and specify the project root directory or framework type.

Use Cases & Caveats

Who It’s For

  • Developers who want to quickly get a Lighthouse report in a conversation without manually switching to a terminal or DevTools.
  • Teams who want to go from a report all the way to “file-level checklist + code changes” and are comfortable with the Agent asking before acting.
  • Environments where chrome-devtools-mcp is already configured, which can take priority for a Chrome-consistent audit path. Even with only the CLI available, analysis can still be completed, but the environment must have a working lighthouse command-line tool installed.

Limitations & Notes

  • Report first, optimize second: It will not make sweeping repo changes without asking. If you only want to see the data, simply stop at the AskQuestion prompt.
  • Continued optimization depends on scope confirmation: Before code changes, the project scope is aligned. If the scope is unclear, you should first provide path or module details.
  • Documentation structure: Do not assume all rules live in a single system prompt. If you hit a sticking point, have the Agent proceed phase by phase per SKILL.md / reference files.
  • Statistics are subject to SkillHub: The community page shows a rating of 100000, 940 downloads, and 0 installs (at the time of retrieval). Install counts change over time—refer to the live page data.

Closing

lighthouse-analysis-optimization strings together Lighthouse auditing, an optional optimization checklist, and controlled code changes into a single Skill: report first, then ask, then modify code—compatible with both MCP and CLI audit backends. If you’re investigating performance for a URL or preparing an optimization checklist, you can open the official page on SkillHub to install or reference it:

https://www.skillhub.cn/skills/user_f8e4df6e/lighthouse-analysis-optimization

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye