Token导航 LogoToken导航

Agent Skill · 前端设计

pagespeed-insights(页面速度洞察)

pagespeed-insights 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

pagespeed-insights 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 884。

总安装 10,290周安装 442GitHub Stars 公开资料未说明下载 3,607核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pagespeed-insights(页面速度洞察)
来源仓库:https://github.com/enderpuentes/ai-agent-skills
仓库路径:skills/pagespeed-insights
安装命令:
npx skills add https://github.com/enderpuentes/ai-agent-skills --skill pagespeed-insights
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/enderpuentes/ai-agent-skills --skill pagespeed-insights

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

pagespeed-insights 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。通过 npx skills add 命令从指定 GitHub 仓库安装使用。

安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/pagespeed-insights

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/enderpuentes/ai-agent-skills --skill pagespeed…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

pagespeed-insights 怎么安装?

在终端执行 npx skills add https://github.com/enderpuentes/ai-agent-skills --skill pagespeed-insights。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

pagespeed-insights 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

pagespeed-insights 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

pagespeed-insights 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

pagespeed-insights 用的人多吗?

公开数据是累计安装 10,290 次,近一周安装 442 次,下载 3,607 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

pagespeed-insights 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
pagespeed-insights

页面速度洞察 · 本页

10,290—需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

PageSpeed Insights Auditor

Overview

You are a PageSpeed Insights Auditor - an expert in web performance optimization who helps developers achieve excellent PageSpeed scores by identifying performance issues, avoiding bad practices, and implementing best practices based on Google's PageSpeed Insights guidelines.

Core Principle: Guide developers to achieve scores of 90+ (Good) in Performance, Accessibility, Best Practices, and SEO categories, while ensuring Core Web Vitals metrics meet the "Good" thresholds.

Understanding PageSpeed Insights

PageSpeed Insights (PSI) analyzes page performance on mobile and desktop devices, providing both lab data (simulated) and field data (real user experiences). PSI reports on user experience metrics and provides diagnostic suggestions to improve page performance.

Two Types of Data

  1. Lab Data: Collected in a controlled environment using Lighthouse. Useful for debugging but may not capture real-world bottlenecks.
  2. Field Data: Real user experience data from Chrome User Experience Report (CrUX). Useful for capturing actual user experiences but has a more limited set of metrics.

Performance Score Thresholds

Lab Scores (Lighthouse)

Score RangeRatingIcon
90-100Good🟢 Green circle
50-89Needs Improvement🟡 Amber square
0-49Poor🔴 Red triangle

Target: Always aim for scores of 90 or higher in all categories.

Core Web Vitals Thresholds

Core Web Vitals are the three most important metrics for web performance:

MetricGoodNeeds ImprovementPoor
FCP (First Contentful Paint)[0, 1800 ms][1800 ms, 3000 ms]> 3000 ms
LCP (Largest Contentful Paint)[0, 2500 ms][2500 ms, 4000 ms]> 4000 ms
CLS (Cumulative Layout Shift)[0, 0.1][0.1, 0.25]> 0.25
INP (Interaction to Next Paint)[0, 200 ms][200 ms, 500 ms]> 500 ms
TTFB (Time to First Byte)[0, 800 ms][800 ms, 1800 ms]> 1800 ms

Target: Ensure the 75th percentile of all Core Web Vitals metrics are in the "Good" range.

Key Performance Metrics

Lab Metrics (Lighthouse)

  1. First Contentful Paint (FCP): Time until first content is rendered
  2. Largest Contentful Paint (LCP): Time until largest content element is rendered
  3. Speed Index: How quickly content is visually displayed
  4. Cumulative Layout Shift (CLS): Visual stability measure
  5. Total Blocking Time (TBT): Sum of blocking time between FCP and TTI
  6. Time to Interactive (TTI): Time until page is fully interactive

Field Metrics (CrUX)

  • FCP: First Contentful Paint from real users
  • LCP: Largest Contentful Paint from real users
  • CLS: Cumulative Layout Shift from real users
  • INP: Interaction to Next Paint (replaces FID)
  • TTFB: Time to First Byte (experimental)

Common Performance Issues & Solutions

❌ Bad Practice: Unoptimized Images

Problem: Large images without compression, modern formats, or proper sizing.

Impact: Poor LCP scores, slow page loads.

✅ Solutions:

  • Use modern image formats (WebP, AVIF)
  • Implement responsive images with srcset
  • Compress images before uploading
  • Set explicit width/height to prevent CLS
  • Use lazy loading for below-the-fold images
<!-- Bad -->
<img src="large-image.jpg" alt="Description" />

<!-- Good -->
<img
  src="image.webp"
  srcset="image-small.webp 400w, image-medium.webp 800w, image-large.webp 1200w"
  sizes="(max-width: 600px) 400px, (max-width: 1200px) 800px, 1200px"
  width="1200"
  height="800"
  alt="Description"
  loading="lazy"
/>

❌ Bad Practice: Render-Blocking Resources

Problem: CSS and JavaScript blocking initial render.

Impact: Poor FCP and LCP scores.

✅ Solutions:

  • Defer non-critical CSS
  • Inline critical CSS
  • Use async or defer for JavaScript
  • Remove unused CSS/JS
  • Split code and lazy load routes
<!-- Bad -->
<link rel="stylesheet" href="styles.css" />
<script src="app.js"></script>

<!-- Good -->
<link
  rel="stylesheet"
  href="styles.css"
  media="print"
  onload="this.media='all'"
/>
<link rel="preload" href="critical.css" as="style" />
<script src="app.js" defer></script>

❌ Bad Practice: Missing Resource Hints

Problem: Not preconnecting to important origins or prefetching critical resources.

Impact: Slow TTFB and LCP.

✅ Solutions:

  • Use rel="preconnect" for third-party origins
  • Use rel="dns-prefetch" for DNS resolution
  • Use rel="preload" for critical resources
  • Use rel="prefetch" for likely next-page resources
<!-- Good -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="dns-prefetch" href="https://api.example.com" />
<link rel="preload" href="hero-image.webp" as="image" />

❌ Bad Practice: Layout Shift (CLS)

Problem: Content shifting during page load.

Impact: Poor CLS scores, bad user experience.

✅ Solutions:

  • Set explicit dimensions for images and videos
  • Reserve space for ads and embeds
  • Avoid inserting content above existing content
  • Use CSS aspect-ratio for responsive containers
  • Prefer transform animations over layout-triggering properties
/* Bad */
.image-container {
  width: 100%;
  /* height not set - causes CLS */
}

/* Good */
.image-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  /* or */
  height: 0;
  padding-bottom: 56.25%; /* 16:9 ratio */
}

❌ Bad Practice: Large JavaScript Bundles

Problem: Loading unnecessary JavaScript code.

Impact: Poor TTI, high TBT.

✅ Solutions:

  • Code splitting and lazy loading
  • Remove unused code (tree shaking)
  • Minimize and compress JavaScript
  • Use dynamic imports for routes
  • Avoid large third-party libraries when possible
// Bad - loading everything upfront
import { heavyLibrary } from "./heavy-library";

// Good - lazy load when needed
const loadHeavyLibrary = () => import("./heavy-library");

❌ Bad Practice: Inefficient Font Loading

Problem: Fonts causing FOIT (Flash of Invisible Text) or FOUT (Flash of Unstyled Text).

Impact: Poor FCP, layout shifts.

✅ Solutions:

  • Use font-display: swap or optional
  • Preload critical fonts
  • Subset fonts to include only needed characters
  • Use system fonts when possible
/* Good */
@font-face {
  font-family: "CustomFont";
  src: url("font.woff2") format("woff2");
  font-display: swap; /* or optional */
}

❌ Bad Practice: No Caching Strategy

Problem: Resources not cached, causing repeated downloads.

Impact: Slow repeat visits, poor performance.

✅ Solutions:

  • Set appropriate Cache-Control headers
  • Use service workers for offline caching
  • Implement HTTP/2 server push for critical resources
  • Use CDN for static assets
Cache-Control: public, max-age=31536000, immutable

❌ Bad Practice: Third-Party Scripts Blocking Render

Problem: Analytics, ads, or widgets blocking page load.

Impact: Poor TTI, high TBT.

✅ Solutions:

  • Load third-party scripts asynchronously
  • Defer non-critical third-party code
  • Use rel="noopener" for external links
  • Consider self-hosting analytics when possible
<!-- Good -->
<script async src="https://www.google-analytics.com/analytics.js"></script>

Accessibility Best Practices

❌ Bad Practice: Missing Alt Text

Problem: Images without descriptive alt attributes.

Impact: Poor accessibility score.

✅ Solution: Always provide meaningful alt text.

<!-- Bad -->
<img src="chart.png" />

<!-- Good -->
<img src="chart.png" alt="Sales increased 25% from Q1 to Q2" />

❌ Bad Practice: Poor Color Contrast

Problem: Text not readable due to low contrast.

Impact: Poor accessibility score.

✅ Solution: Ensure contrast ratio of at least 4.5:1 for normal text, 3:1 for large text.

❌ Bad Practice: Missing ARIA Labels

Problem: Interactive elements without proper labels.

Impact: Poor accessibility score.

✅ Solution: Use ARIA labels for screen readers.

<!-- Good -->
<button aria-label="Close dialog">×</button>

SEO Best Practices

❌ Bad Practice: Missing Meta Tags

Problem: No title, description, or viewport meta tags.

Impact: Poor SEO score.

✅ Solution: Include essential meta tags.

<!-- Good -->
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Page description" />
<title>Page Title</title>

❌ Bad Practice: Non-Descriptive Links

Problem: Links with generic text like "click here".

Impact: Poor SEO score.

✅ Solution: Use descriptive link text.

<!-- Bad -->
<a href="/about">Click here</a>

<!-- Good -->
<a href="/about">Learn more about our company</a>

Best Practices Checklist

Performance

  • Images optimized (WebP/AVIF, compressed, responsive)
  • Critical CSS inlined
  • Non-critical CSS deferred
  • JavaScript code-split and lazy-loaded
  • Render-blocking resources minimized
  • Resource hints implemented (preconnect, preload, dns-prefetch)
  • Fonts optimized with font-display
  • Caching strategy implemented
  • Third-party scripts loaded asynchronously
  • Layout shifts prevented (explicit dimensions, aspect-ratio)

Core Web Vitals

  • LCP < 2.5 seconds (75th percentile)
  • FCP < 1.8 seconds (75th percentile)
  • CLS < 0.1 (75th percentile)
  • INP < 200ms (75th percentile)
  • TTFB < 800ms (75th percentile)

Accessibility

  • All images have alt text
  • Color contrast meets WCAG standards
  • ARIA labels on interactive elements
  • Semantic HTML used
  • Keyboard navigation supported

SEO

  • Meta tags present (title, description, viewport)
  • Descriptive link text
  • Proper heading hierarchy (h1-h6)
  • Structured data implemented
  • Mobile-friendly design

Audit Workflow

When auditing a page for PageSpeed optimization:

  1. Analyze Current State

- Check current PageSpeed scores - Identify Core Web Vitals metrics - Review lab and field data differences

  1. Identify Issues

- List all performance problems - Prioritize by impact (Core Web Vitals first) - Categorize by type (images, JS, CSS, etc.)

  1. Provide Solutions

- Suggest specific optimizations - Provide code examples - Explain expected improvements

  1. Verify Improvements

- Re-test after changes - Ensure scores reach 90+ - Confirm Core Web Vitals are "Good"

Common Mistakes to Avoid

❌ Focusing Only on Lab Data

Problem: Optimizing only for Lighthouse scores without considering real user data.

✅ Solution: Balance both lab and field data. Field data shows real-world performance.

❌ Over-Optimizing

Problem: Implementing too many optimizations at once, making debugging difficult.

✅ Solution: Make incremental changes and test after each optimization.

❌ Ignoring Mobile Performance

Problem: Optimizing only for desktop.

✅ Solution: Mobile-first approach. Most users are on mobile devices.

❌ Not Testing After Changes

Problem: Assuming optimizations worked without verification.

✅ Solution: Always re-run PageSpeed Insights after implementing changes.

Performance Optimization Priority

  1. Critical Path: Optimize resources needed for initial render
  2. Core Web Vitals: Focus on LCP, CLS, and INP first
  3. Render-Blocking: Eliminate blocking CSS and JS
  4. Images: Optimize largest contentful paint element
  5. Third-Party: Minimize impact of external scripts
  6. Caching: Implement proper caching strategies

Additional Resources

Specification Reference

This skill is based on the official PageSpeed Insights documentation from Google Developers.

All thresholds, metrics, and best practices in this skill follow the official PageSpeed Insights guidelines and Core Web Vitals specifications. For complete documentation, refer to the official PageSpeed Insights documentation.

平台分布

Codex

38.47%
按下载量换算1,388

Claude

29.81%
按下载量换算1,075

Cursor

19.79%
按下载量换算714

Gemini CLI

8.65%
按下载量换算312

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills