page-weight
它能做什么
这个技能测量页面的总体积,包括它所有的文件,并提出让页面更轻的方法。它面向希望在较慢的手机网络上获得更快页面的网站构建者。
适用场景
- ✓你请智能体检查页面总体积有多大的时候。
- ✓页面下载了大量数据,而手机网络用户反映加载缓慢的时候。
- ✓你希望设定性能预算,防止页面体积随时间增长的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/page-weight/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的页面下载起来非常大。请帮我检查总体积,并告诉我该精简哪些内容吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会累加页面上所有资源的大小,并与目标进行对比。然后它会指出占比最大的部分,通常是图片和 JavaScript 包,并建议优化步骤。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Keep page weight under 1500KB
Page weight directly correlates with load time—a 1.5MB page takes 3-5 seconds on 4G mobile. Every 100KB reduction improves user experience, especially on slower networks.
Quick Reference
- Target under 500KB for optimal performance, max 1500KB
- Images typically account for 50-70% of page weight
- JavaScript bundles are often the second largest contributor
- Monitor with performance budgets in CI/CD
Check
Analyze the total page weight including all resources. Check if it's under 1500KB (ideally under 500KB).
Fix
Optimize this page to reduce its total weight through image optimization, code minification, and removing unnecessary resources.
Explain
Explain how page weight impacts loading time, especially on mobile networks, and affects user experience.
Code Review
Review the routes, assets, and loading behavior that affect Keep page weight under 1500KB. Flag exact files, requests, or rendering steps that add unnecessary network, CPU, or layout cost, and describe the measurement method used to confirm the issue.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/performance/page-weight
常见问题
页面体积的理想目标是多少?
这个技能建议在 500 KB 以下可获得最佳性能,1500 KB 为最大上限。
页面中什么占的空间最多?
这个技能说,图片通常占页面体积的 50% 到 70%,其次通常是 JavaScript 包。
如何防止页面再次变得臃肿?
可以。这个技能建议在构建或部署检查中使用性能预算进行监控。
详情
作者的原始描述
Use when auditing slow page loads, heavy assets, or rendering delays related to Keep page weight under 1500KB. Verify the actual bottleneck in DevTools, Lighthouse, or field data before recommending changes.
热度
- GitHub 星标
- 75k
- 排名
- #2967
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。