Performs comprehensive web performance audits, diagnoses bottlenecks, and provides targeted fixes for server, rendering, hero element, JavaScript, and layout...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install afrexai-web-performance-engine或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install afrexai-web-performance-engine⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/afrexai-web-performance-engine/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
Complete web performance optimization system. Audit, diagnose, fix, and monitor — no external tools required (but integrates with Lighthouse, WebPageTest, Chrome DevTools when available).
Run these checks in order. Stop when you find the bottleneck tier.
Tier 1 — Critical (blocks rendering):
Tier 2 — Important (affects experience):
Tier 3 — Polish (competitive edge):
audit:
url: ""
device: "mobile" # mobile | desktop | both
connection: "4G" # 3G | 4G | fiber
region: "" # closest to target users
scores:
performance: null # 0-100
fcp_ms: null
lcp_ms: null
tbt_ms: null
cls: null
inp_ms: null
ttfb_ms: null
page_weight:
total_kb: null
html_kb: null
css_kb: null
js_kb: null
images_kb: null
fonts_kb: null
other_kb: null
requests:
total: null
by_type: {}
third_party_count: null
third_party_kb: null
If no Lighthouse/DevTools available, use web-based tools:
web_fetch "https://pagespeed.web.dev/analysis?url={encoded_url}" — Google's free toolweb_search "webpagetest {url}" — find cached resultsweb_search "site:{domain} core web vitals" — find CrUX data for obvious issues: render-blocking CSS/JS, missing preloads, no meta viewportDNS → TCP → TLS → TTFB → HTML Parse → CSSOM → Render Tree → FCP → LCP
↓
JS Download → Parse → Execute → INP
Bottleneck Decision Tree:
High TTFB (>800ms)?
├─ YES → Phase 3A: Server optimization
└─ NO → High FCP (>1.8s)?
├─ YES → Phase 3B: Render-blocking resources
└─ NO → High LCP (>2.5s)?
├─ YES → Phase 3C: Hero element optimization
└─ NO → High TBT (>200ms)?
├─ YES → Phase 3D: JavaScript optimization
└─ NO → High CLS (>0.1)?
├─ YES → Phase 3E: Layout stability
└─ NO → High INP (>200ms)?
├─ YES → Phase 3F: Interaction optimization
└─ NO → ✅ Performance is good!
Rate each resource by impact:
| Factor | Weight | Score 1 | Score 3 | Score 5 | |--------|--------|---------|---------|---------| | Size (KB) | 3x | <10 | 10-100 | >100 | | Render-blocking | 5x | No | Partial | Full | | Above-fold impact | 4x | None | Indirect | Direct | | Cacheable | 2x | Long cache | Short cache | No cache | | Compressible | 2x | Already done | Possible | Not compressed |
Priority = Sum(Factor × Weight). Fix highest scores first.
Quick wins:
# CDN: If no CDN, this is #1 priority
# Check: curl -sI {url} | grep -i 'x-cache\|cf-cache\|x-cdn'
# Compression: Must have brotli or gzip
# Check: curl -sI -H "Accept-Encoding: br,gzip" {url} | grep -i content-encoding
# HTTP/2 or HTTP/3
# Check: curl -sI --http2 {url} | head -1
Server-side checklist:
Cache headers template:
# Static assets (CSS, JS, images, fonts)
Cache-Control: public, max-age=31536000, immutable
# HTML pages
Cache-Control: public, max-age=0, must-revalidate
# API responses
Cache-Control: private, max-age=60, stale-while-revalidate=300
CSS optimization:
<!-- BEFORE: Render-blocking -->
<link rel="stylesheet" href="styles.css">
<!-- AFTER: Critical CSS inline + async load -->
<style>/* Critical above-fold CSS here (< 14KB) */</style>
<link rel="preload" href="styles.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="styles.css"></noscript>
Rules:
@import (creates sequential loading)JavaScript optimization:
<!-- BEFORE: Render-blocking -->
<script src="app.js"></script>
<!-- AFTER: Non-blocking -->
<script src="app.js" defer></script>
<!-- OR: Independent scripts -->
<script src="analytics.js" async></script>
Rules:
defer for app scripts (maintains order, runs after parse)async for independent scripts (analytics, ads) in without defer/asyncLCP element types and fixes:
| LCP Element | Fix | |------------|-----| | | Preload + responsive + modern format | | poster | Preload poster image | | CSS background-image | Preload + inline critical CSS | | Text block | Preload font + font-display: optional |
Image optimization checklist:
<!-- Optimal hero image -->
<link rel="preload" as="image" href="hero.webp"
imagesrcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w"
imagesizes="100vw">
<img src="hero.webp"
srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w"
sizes="100vw"
width="1200" height="600"
alt="Hero description"
fetchpriority="high"
decoding="async">
Image format decision:
Photo/complex image? → WebP (25-35% smaller than JPEG)
→ AVIF (50% smaller, but slower encode)
Simple graphic/logo? → SVG (scalable, tiny)
→ PNG only if transparency needed
Animation? → WebM/MP4 video (not GIF — 90% smaller)
Image size targets: | Viewport | Max width | Target KB | |----------|-----------|-----------| | Mobile | 400px | < 50KB | | Tablet | 800px | < 100KB | | Desktop | 1200px | < 150KB | | Hero/banner | 1600px | < 200KB |
Bundle analysis approach:
web_fetch the page, count tagsCommon JS bloat and replacements:
| Library | Size | Alternative | Size | |---------|------|-------------|------| | moment.js | 67KB | date-fns | 2-10KB | | lodash (full) | 71KB | lodash-es (tree-shake) | 2-5KB | | jQuery | 87KB | vanilla JS | 0KB | | animate.css | 80KB | CSS animations | 1-2KB | | chart.js | 60KB | lightweight-charts | 40KB |
Code splitting rules:
const Chart = lazy(() => import('./Chart'))Long task breaking:
// BEFORE: Blocks main thread 200ms+
function processLargeList(items) {
items.forEach(item => heavyComputation(item));
}
...安装 Web Performance Engine 后,可以对 AI 说这些话来触发它
Help me get started with Web Performance Engine
Explains what Web Performance Engine does, walks through the setup, and runs a quick demo based on your current project
Use Web Performance Engine to performs comprehensive web performance audits, diagnoses bottleneck...
Invokes Web Performance Engine with the right parameters and returns the result directly in the conversation
What can I do with Web Performance Engine in my developer & devops workflow?
Lists the top use cases for Web Performance Engine, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/afrexai-web-performance-engine/ 目录(个人级,所有项目可用),或 .claude/skills/afrexai-web-performance-engine/(项目级)。重启 AI 客户端后,用 /afrexai-web-performance-engine 主动调用,或让 AI 根据上下文自动发现并使用。
Web Performance Engine 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Web Performance Engine 可免费安装使用。请查阅仓库了解许可证信息。
Performs comprehensive web performance audits, diagnoses bottlenecks, and provides targeted fixes for server, rendering, hero element, JavaScript, and layout...
Web Performance Engine 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Web Performance Engine
Identifies repetitive steps in your workflow and sets up Web Performance Engine to handle them automatically