Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计提醒

performance-and-web-vitals性能和网络生命力

Agent Skill

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

总安装

652

周安装

28

GitHub Stars

6

下载量

228
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:performance-and-web-vitals(性能和网络生命力)
来源仓库:https://github.com/dembrandt/dembrandt-skills
仓库路径:skills/performance-and-web-vitals
安装命令:
npx skills add https://github.com/dembrandt/dembrandt-skills --skill performance-and-web-vitals
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/dembrandt/dembrandt-skills --skill performance-and-web-vitals

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态或代码变更进行整理。
  • 可结合来源仓库和原始 README 继续核验具体用法。
  • 安装前建议确认权限范围、维护状态及是否会触发联网或文件读写。
  • 注意避免对生产环境造成影响。

SKILL.md

Performance and Web Vitals

Run a Lighthouse Audit

# CLI audit — outputs JSON and HTML report
npx lighthouse https://example.com --output html --output-path ./lighthouse-report.html

# Headless, useful in CI
npx lighthouse https://example.com --chrome-flags="--headless" --output json --output-path ./report.json

# Audit specific categories only
npx lighthouse https://example.com --only-categories=performance,accessibility,seo

Or open Chrome DevTools → Lighthouse tab → Analyse page load.

Target scores:

CategoryTarget
Performance≥ 90
Accessibility100
Best Practices≥ 95
SEO≥ 95

Core Web Vitals

LCP — Largest Contentful Paint

*How fast does the main content appear?*

Target: ≤ 2.5s

LCP measures when the largest visible element (hero image, heading, video poster) renders. It is the user's perception of "did the page load?"

Common causes and fixes:

CauseFix
Unoptimised hero imageUse WebP/AVIF, correct size, fetchpriority="high"
Image not preloaded<link rel="preload" as="image" href="hero.webp">
Render-blocking CSS/JSDefer non-critical JS, inline critical CSS
Slow server responseCDN, caching headers, edge delivery
Web font blocking renderfont-display: swap or optional
<!-- Preload LCP image -->
<link rel="preload" as="image" href="hero.webp" fetchpriority="high">

<!-- LCP image: no lazy loading -->
<img src="hero.webp" alt="..." fetchpriority="high" width="1200" height="600">

Never use loading="lazy" on the LCP image — it delays the most important render.


CLS — Cumulative Layout Shift

*Does content jump around while loading?*

Target: ≤ 0.1

CLS measures unexpected layout shifts — content moving after it has rendered. Caused by images without dimensions, late-loading ads, fonts swapping, or dynamic content injected above existing content.

Common causes and fixes:

CauseFix
Images without width/heightAlways set width and height on <img>
Web font swapUse font-display: optional or preload fonts
Dynamic content above foldReserve space with min-height on containers
Late-loading ads or embedsReserve fixed dimensions for ad slots
Animations that shift layoutAnimate transform only, never top/left/width/height
<!-- Always include dimensions -->
<img src="product.jpg" width="400" height="300" alt="...">
/* Reserve space for dynamic content */
.ad-slot { min-height: 250px; }

/* Animate transform, not layout properties */
.slide-in { transform: translateY(0); transition: transform 300ms; }

INP — Interaction to Next Paint

*How quickly does the page respond to user input?*

Target: ≤ 200ms

INP measures the delay between a user interaction (click, tap, keyboard) and the next visual update. High INP makes the UI feel sluggish or frozen.

Common causes and fixes:

CauseFix
Heavy JS on main threadBreak into smaller tasks, use requestIdleCallback
Large event handlersDebounce/throttle scroll and resize handlers
Synchronous DOM updatesBatch DOM writes with requestAnimationFrame
Third-party scripts blockingLoad third-party scripts with async or defer
React re-rendersMemoize with useMemo, useCallback, React.memo

Images

Images are the single biggest performance lever on most pages.

<!-- Modern formats with fallback -->
<picture>
  <source srcset="image.avif" type="image/avif">
  <source srcset="image.webp" type="image/webp">
  <img src="image.jpg" width="800" height="600" alt="..." loading="lazy">
</picture>

<!-- Responsive images -->
<img
  srcset="image-400.webp 400w, image-800.webp 800w, image-1200.webp 1200w"
  sizes="(max-width: 600px) 100vw, 50vw"
  src="image-800.webp"
  alt="..."
  width="800"
  height="600"
  loading="lazy"
>

Rules:

  • Always set width and height — prevents CLS
  • Use loading="lazy" below the fold, never on LCP image
  • Serve WebP or AVIF — typically 30–50% smaller than JPEG
  • Size images to their display size — do not serve 2000px image for a 400px slot
  • Use a CDN with automatic format conversion where possible

Fonts

Web fonts block rendering if not handled correctly.

<!-- Preconnect to font origin -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

<!-- Preload critical font file -->
<link rel="preload" href="/fonts/brand.woff2" as="font" type="font/woff2" crossorigin>
@font-face {
  font-family: 'Brand';
  src: url('/fonts/brand.woff2') format('woff2');
  font-display: swap;     /* show fallback immediately, swap when loaded */
  /* font-display: optional; — never swap, use fallback if not cached */
}
  • font-display: swap — good for headings, acceptable CLS
  • font-display: optional — zero CLS, font only used if cached (best for body text)
  • Subset fonts to the characters actually used — reduces file size by 60–80%

JavaScript

<!-- Defer non-critical scripts -->
<script src="analytics.js" defer></script>
<script src="chat-widget.js" async></script>

<!-- Module scripts are deferred by default -->
<script type="module" src="app.js"></script>
  • defer: executes after HTML parsed, in order — use for most scripts
  • async: executes as soon as downloaded, out of order — use for independent scripts (analytics)
  • Never block the main thread with synchronous <script> in <head>

Lighthouse CI (automated audits)

Run Lighthouse in CI to catch regressions before deployment.

# Install
npm install -g @lhci/cli

# Run
lhci autorun --upload.target=temporary-public-storage
# .lighthouserc.json
{
  "ci": {
    "assert": {
      "assertions": {
        "categories:performance": ["warn", { "minScore": 0.9 }],
        "categories:accessibility": ["error", { "minScore": 1.0 }],
        "categories:seo": ["warn", { "minScore": 0.95 }]
      }
    }
  }
}

Review Checklist

  • Lighthouse performance score ≥ 90
  • Lighthouse accessibility score = 100
  • LCP ≤ 2.5s — LCP image preloaded, no loading="lazy" on it
  • CLS ≤ 0.1 — all images have width and height, no layout-shifting animations
  • INP ≤ 200ms — no heavy synchronous JS on main thread
  • Images served as WebP or AVIF with correct dimensions
  • loading="lazy" on all below-fold images
  • Web fonts use font-display: swap or optional
  • Non-critical JS loaded with defer or async
  • Lighthouse CI configured to catch regressions in deployment pipeline

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.91%
按下载量换算86

Claude

28.31%
按下载量换算65

Cursor

18.7%
按下载量换算43

Gemini CLI

9.61%
按下载量换算22

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills