- name
SKILL.md
技能文件保留在发布者的仓库中。
在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add nucliweb/webperf-snippets --skill webperf-resources -a cursor -y在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add nucliweb/webperf-snippets --skill webperf-resources -a claude-code -y在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add nucliweb/webperf-snippets --skill webperf-resources -a codex -y在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add nucliweb/webperf-snippets --skill webperf-resources -a grok -y在 Grok Bot 聊天中发送复制的消息。Bot 会从 GitHub 获取这个 SKILL.md,并添加到你所有 Bot 共享的技能中。
Install this skill: https://github.com/nucliweb/webperf-snippets/tree/HEAD/.claude/skills/webperf-resources来自发布者
JavaScript snippets for measuring web performance in Chrome DevTools.
mcp__chrome-devtools__evaluate_script, passing the file instead of its code: sourcePath with the absolute path of scripts/<Name>.js in this skill, and format: "script", since a script runs by itself and is not a function. Read the object it returns. The scripts have no console output, so the returned object is the result: script, status and the metric data (value, rating, details, items, issues), as described in references/schema.md.status is "tracking", the script keeps observing the page. After the interactions, call the function named in getDataFn with another mcp__chrome-devtools__evaluate_script call, as an arrow function in function, for example () => getINP(), and read the object it returns.status is "error" or "unsupported", read error: the page may not have loaded yet, or the browser lacks the API.sourcePath and format need Chrome DevTools MCP 1.11.0 or later, and the server only reads files inside its workspace roots: the project, the temp folder and each --workspace=<folder> in its arguments. When it answers Access denied, as it does for a skill installed outside the project, such as in ~/.claude/skills/, read the file and pass its code in function, still with format: "script". A --workspace with the real folder of the skills makes the path work; the server follows symlinks, so a link to the folder is not enough.
Without Chrome DevTools MCP, run the same snippet with the webperf-snippets CLI, which loads the page in headless Chromium and prints the same result objects: npx webperf-snippets <url> --snippet <Name> --json, where <Name> is the script name without .js. It needs Playwright and Chromium (npm install --save-dev webperf-snippets playwright, then npx playwright install chromium), and tracking snippets take --interact-script <file> to drive the interactions.
scripts/Network-Bandwidth-Connection-Quality.js — Network bandwidth & connection qualityWhen the user asks about network performance, connection quality, or adaptive loading:
When implementing adaptive loading or the user asks "how to optimize for slow connections":
When the user asks about save-data or data-saving features:
When the user asks "optimize for mobile" or "slow connection users":
Use this decision tree to automatically run follow-up snippets based on results:
If effectiveType is "slow-2g" or "2g" → Very slow connection, recommend:
If effectiveType is "3g" → Moderate connection, recommend:
If effectiveType is "4g" or better → Good connection, recommend:
If save-data is enabled → User explicitly wants to save data, recommend:
If RTT > 300ms → High latency, recommend:
If downlink < 1 Mbps → Very limited bandwidth, recommend:
Based on Network Information API results, implement these strategies:
For slow-2g / 2g (< 50 Kbps): (effectiveType: "slow-2g" or "2g")
For 3g (50-700 Kbps): (effectiveType: "3g")
For 4g+ (> 700 Kbps): (effectiveType: "4g")
For save-data mode: (navigator.connection.saveData === true)
Adjust performance budgets based on connection quality:
slow-2g / 2g:
3g:
4g+:
Be aware of API limitations and fallbacks:
API not available:
API values are estimates:
Privacy considerations:
references/snippets.md — Descriptions and thresholds for each scriptreferences/schema.md — Return value schema for interpreting script outputIntelligent network quality analysis with adaptive loading strategies. Detects connection type (2g/3g/4g), bandwidth, RTT, and save-data mode, then automatically triggers appropriate optimization work
---name: webperf-resourcesdescription: Intelligent network quality analysis with adaptive loading strategies. Detects connection type (2g/3g/4g)…---# .claude/skills/webperf-resources/SKILL.md概览
Intelligent network quality analysis with adaptive loading strategies. Detects connection type (2g/3g/4g), bandwidth, RTT, and save-data mode, then automatically triggers appropriate optimization workflows. Includes decision trees that recommend image compression for slow connections, critical CSS inlining for high RTT, and save-data optimizations (disable autoplay, reduce quality). Features connection-aware performance budgets (500KB for 2g, 1.5MB for 3g, 3MB for 4g+) and adaptive loading implementation guides. Cross-skill integration with Loading (TTFB impact), Media (responsive images), and Core Web Vitals (connection impact on LCP/INP). Use when the user asks about slow connections, mobile optimization, save-data support, or adaptive loading strategies. Compatible with Chrome DevTools MCP.
常见问题
从发布者处下载 .claude/skills/webperf-resources/SKILL.md,或复制路径后打开仓库。PlugMCP 只收录该技能,不托管文件。
发布者将它存放在 https://github.com/nucliweb/webperf-snippets。
Claude、Cursor、Codex 和 Grok Build 可以读取你从发布者仓库添加的 SKILL.md。在聊天中发送技能的 GitHub 文件夹链接,Grok Bot 就会安装它。
If downlink > 10 Mbps → Good bandwidth, consider: