Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计提醒

webperf-resourcesWebperf 资源

Agent Skill

webperf-resources 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,423

周安装

103

GitHub Stars

1,409

下载量

849
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/nucliweb/webperf-snippets --skill webperf-resources

简介

webperf-resources 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。

  • 适用于根据关键词或任务场景从来源仓库中获取 Web 性能相关资源。
  • 通过 npx skills add 命令安装,需结合原始 README 确认具体用法。
  • 安装前建议确认权限范围、维护状态及是否触发联网或文件读写操作。
  • 可结合来源仓库进一步核验功能细节和使用限制。

SKILL.md

WebPerf: Resources & Network

JavaScript snippets for measuring web performance in Chrome DevTools. Execute with mcp__chrome-devtools__evaluate_script, capture output with mcp__chrome-devtools__get_console_message.

Scripts

  • scripts/Network-Bandwidth-Connection-Quality.js — Network Bandwidth & Connection Quality

Common Workflows

Network Quality Assessment

When the user asks about network performance, connection quality, or adaptive loading:

  1. Network-Bandwidth-Connection-Quality.js - Analyze network bandwidth, effective connection type, RTT, downlink, save-data mode

Adaptive Loading Strategy

When implementing adaptive loading or the user asks "how to optimize for slow connections":

  1. Network-Bandwidth-Connection-Quality.js - Detect connection quality
  2. Cross-reference with webperf-loading skill:

- TTFB.js (measure server response on slow connections) - Find-render-blocking-resources.js (identify heavy resources to defer) - Resource-Hints-Validation.js (optimize preconnect for slow networks)

  1. Cross-reference with webperf-media skill:

- Image-Element-Audit.js (implement responsive images based on connection) - Video-Element-Audit.js (adjust video quality based on connection)

Save-Data Mode Detection

When the user asks about save-data or data-saving features:

  1. Network-Bandwidth-Connection-Quality.js - Check if save-data is enabled
  2. If save-data is enabled, recommend:

- Reducing image quality - Disabling autoplay videos - Deferring non-critical resources - Using low-res thumbnails

Mobile/Slow Connection Optimization

When the user asks "optimize for mobile" or "slow connection users":

  1. Network-Bandwidth-Connection-Quality.js - Assess connection type
  2. Cross-reference with webperf-loading skill:

- TTFB.js (critical for slow connections) - Find-render-blocking-resources.js (minimize blocking on slow networks) - Critical-CSS-Detection.js (inline critical CSS to reduce RTT) - Prefetch-Resource-Validation.js (avoid excessive prefetch on slow connections)

Decision Tree

Use this decision tree to automatically run follow-up snippets based on results:

After Network-Bandwidth-Connection-Quality.js

  • If effectiveType is "slow-2g" or "2g" → Very slow connection, recommend:

1. Run webperf-loading:Critical-CSS-Detection.js (inline critical CSS) 2. Run webperf-media:Image-Element-Audit.js (implement aggressive lazy loading) 3. Run webperf-loading:Prefetch-Resource-Validation.js (remove prefetch to save bandwidth) 4. Run webperf-core-web-vitals:LCP.js (LCP is heavily impacted by slow connections) 5. Recommend minimal resource strategy

  • If effectiveType is "3g" → Moderate connection, recommend:

1. Run webperf-loading:Find-render-blocking-resources.js (minimize blocking) 2. Run webperf-media:Image-Element-Audit.js (responsive images) 3. Run webperf-loading:Resource-Hints-Validation.js (optimize preconnect) 4. Run webperf-core-web-vitals:INP.js (high latency can impact interaction responsiveness) 5. Implement adaptive image quality

  • If effectiveType is "4g" or better → Good connection, recommend:

1. Standard optimization practices 2. Consider strategic prefetch for navigation 3. Higher quality media is acceptable

  • If save-data is enabled → User explicitly wants to save data, recommend:

1. Reduce image quality aggressively 2. Disable autoplay videos 3. Defer non-critical resources 4. Remove prefetch/preload hints 5. Show "high quality" toggle option

  • If RTT > 300ms → High latency, recommend:

1. Run webperf-loading:TTFB.js (latency impacts TTFB) 2. Run webperf-loading:TTFB-Sub-Parts.js (break down latency components) 3. Run webperf-loading:Resource-Hints-Validation.js (preconnect critical for high RTT) 4. Run webperf-loading:Service-Worker-Analysis.js (caching is critical for high latency) 5. Minimize number of origins 6. Use HTTP/2 or HTTP/3 for multiplexing

  • If downlink < 1 Mbps → Very limited bandwidth, recommend:

1. Run webperf-media:Image-Element-Audit.js (aggressive compression) 2. Run webperf-media:Video-Element-Audit.js (disable autoplay) 3. Run webperf-loading:Prefetch-Resource-Validation.js (remove prefetch) 4. Implement bandwidth-aware loading

  • If downlink > 10 Mbps → Good bandwidth, consider:

- Higher quality media - Strategic prefetch - Preloading next-page resources

Adaptive Loading Implementation Guide

Based on Network Information API results, implement these strategies:

For slow-2g / 2g (< 50 Kbps): (effectiveType: "slow-2g" or "2g")

  • Serve low-res images (quality: 30-40)
  • Disable autoplay videos
  • Remove all prefetch hints
  • Inline all critical CSS
  • Defer all non-critical JavaScript
  • Use system fonts (no webfonts)
  • Aggressive lazy loading (load on scroll + buffer)

For 3g (50-700 Kbps): (effectiveType: "3g")

  • Serve medium-res images (quality: 60-70)
  • Disable autoplay videos
  • Limited prefetch (critical only)
  • Inline critical CSS only
  • Defer non-critical JavaScript
  • Preload 1-2 critical fonts
  • Standard lazy loading

For 4g+ (> 700 Kbps): (effectiveType: "4g")

  • Serve high-res images (quality: 80-90)
  • Allow autoplay videos (muted)
  • Strategic prefetch for navigation
  • Standard CSS loading and JavaScript loading
  • Preload critical fonts
  • Standard lazy loading

For save-data mode: (navigator.connection.saveData === true)

  • Override connection type, treat as worse than actual
  • Show "Load high quality" toggle
  • Disable autoplay entirely
  • Minimal images, minimal quality
  • No prefetch, no preload (except critical)

Performance Budget by Connection Type

Adjust performance budgets based on connection quality:

slow-2g / 2g:

  • Total page weight: < 500KB
  • Images: < 200KB total
  • JavaScript: < 100KB total
  • No videos

3g:

  • Total page weight: < 1.5MB
  • Images: < 800KB total
  • JavaScript: < 300KB total
  • Videos: < 3MB (only if critical)

4g+:

  • Total page weight: < 3MB
  • Images: < 2MB total
  • JavaScript: < 1MB total
  • Videos: < 10MB

Network Information API Limitations

Be aware of API limitations and fallbacks:

API not available:

  • Safari does not support Network Information API
  • Fallback: Use TTFB as proxy for connection quality
  • Fallback: Device detection (mobile = assume slow)
  • Fallback: User preference toggle

API values are estimates:

  • effectiveType is based on recent observations
  • Values can change during session
  • Re-check periodically for long sessions

Privacy considerations:

  • Some browsers limit precision for privacy
  • Values may be rounded or capped
  • Consider user privacy when making decisions

References

  • references/snippets.md — Descriptions and thresholds for each script
  • references/schema.md — Return value schema for interpreting script output

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.43%
按下载量换算309

Claude

27.38%
按下载量换算232

Cursor

20.06%
按下载量换算170

Gemini CLI

9.22%
按下载量换算78

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

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

来源信息

继续浏览同类 Skills