webperf

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

WebPerf Snippets Toolkit

WebPerf 代码片段工具包

A collection of 47 JavaScript snippets for measuring and debugging web performance in Chrome DevTools. Each snippet runs in the browser console and outputs structured, color-coded results.
这是一套包含47个JavaScript代码片段的集合,用于在Chrome DevTools中测量和调试Web性能。每个代码片段都可在浏览器控制台中运行,并输出结构化、带颜色编码的结果。

Skills by Category

按类别划分的功能

SkillSnippetsUse when
webperf-core-web-vitals7Intelligent Core Web Vitals analysis with automated workflows and decision trees
webperf-loading28Intelligent loading performance analysis with automated workflows for TTFB investigation (DNS/connection/server breakdown), render-blocking detection, script performance deep dive (first vs third-party attribution), font optimization, and resource hints validation
webperf-interaction8Intelligent interaction performance analysis with automated workflows for INP debugging, scroll jank investigation, and main thread blocking
webperf-media3Intelligent media optimization with automated workflows for images, videos, and SVGs
webperf-resources1Intelligent network quality analysis with adaptive loading strategies
功能代码片段数量适用场景
webperf-core-web-vitals7基于自动化工作流和决策树的智能Core Web Vitals分析
webperf-loading28智能加载性能分析,包含TTFB排查(DNS/连接/服务器细分)、渲染阻塞检测、脚本性能深度分析(第一方/第三方归属)、字体优化和资源提示验证的自动化工作流
webperf-interaction8智能交互性能分析,包含INP调试、滚动卡顿排查和主线程阻塞分析的自动化工作流
webperf-media3智能媒体优化,包含图片、视频和SVG相关的自动化工作流
webperf-resources1智能网络质量分析,配合自适应加载策略

Quick Reference

快速参考

User saysSkill to use
"debug LCP", "slow LCP", "largest contentful paint"webperf-core-web-vitals
"check CLS", "layout shifts", "visual stability"webperf-core-web-vitals
"INP", "interaction latency", "responsiveness"webperf-core-web-vitals
"TTFB", "slow server", "time to first byte"webperf-loading
"FCP", "first contentful paint", "render blocking"webperf-loading
"font loading", "script loading", "resource hints", "service worker"webperf-loading
"jank", "scroll performance", "long tasks", "animation frames", "INP debug"webperf-interaction
"image audit", "lazy loading", "image optimization", "video audit"webperf-media
"network quality", "bandwidth", "connection type", "save-data"webperf-resources
用户话术对应使用的功能
"debug LCP", "slow LCP", "largest contentful paint"webperf-core-web-vitals
"check CLS", "layout shifts", "visual stability"webperf-core-web-vitals
"INP", "interaction latency", "responsiveness"webperf-core-web-vitals
"TTFB", "slow server", "time to first byte"webperf-loading
"FCP", "first contentful paint", "render blocking"webperf-loading
"font loading", "script loading", "resource hints", "service worker"webperf-loading
"jank", "scroll performance", "long tasks", "animation frames", "INP debug"webperf-interaction
"image audit", "lazy loading", "image optimization", "video audit"webperf-media
"network quality", "bandwidth", "connection type", "save-data"webperf-resources

Workflow

工作流程

  1. Identify the relevant skill based on the user's question (use Quick Reference above)
  2. Load the skill's skill.md to see available snippets and thresholds
  3. Execute with Chrome DevTools MCP:
    • mcp__chrome-devtools__navigate_page
      → navigate to target URL
    • mcp__chrome-devtools__evaluate_script
      → run the snippet
    • mcp__chrome-devtools__get_console_message
      → read results
  4. Interpret results using the thresholds defined in the skill
  5. Provide actionable recommendations based on findings
  1. 根据用户的问题识别相关功能(使用上方的快速参考表)
  2. 加载该功能对应的skill.md文件,查看可用的代码片段和阈值标准
  3. 借助Chrome DevTools MCP执行:
    • mcp__chrome-devtools__navigate_page
      → 跳转至目标URL
    • mcp__chrome-devtools__evaluate_script
      → 运行代码片段
    • mcp__chrome-devtools__get_console_message
      → 读取运行结果
  4. 使用功能中定义的阈值解读结果
  5. 基于分析发现提供可落地的优化建议