- 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/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)…---# 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.
常見問題
從發布者下載 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: