跳到正文
cccskills
免费在 GitHub 公开中文介绍

image-file-size

按用途检查网站图片文件大小,列出超标图片与压缩目标,区分容量问题和显示尺寸不匹配,并协助调整压缩、格式及不同设备的图片分发。

原文查看原文说明

Use when auditing the image pipeline, static assets in `public/`, CMS-managed media, or image CDN transforms. Separate file-size problems from dimension mismatches so you can tell whether the issue is compression, format choice, or responsive delivery.

AI 评分80分/ 100查看安装方法

适用场景

  • 列出超标图片及压缩目标
  • 检查 CMS 中管理的图片
  • 减小首屏主图与缩略图文件
  • 向移动设备提供较小图片

中文介绍

功能

image-file-size 按用途检查网站图片文件大小,报告超出参考值的图片,并列出路径、当前大小与压缩目标。检查参考值包括照片 200KB、首屏主图或全宽图片 400KB、宽度不足 200px 的缩略图 30KB。它区分文件大小问题与显示尺寸不匹配,整理应从压缩、格式转换还是按屏幕尺寸分发入手修改。

适用场景

适合统一检查 public/ 中的静态图片、CMS 管理的图片,以及图片 CDN 的转换流程。也可用于确认是否直接分发上传原图,或仍向移动设备发送大图片。

使用示例

  • “找出文件过大的图片,按用途给出压缩目标。”
  • “通过转换为 WebP、AVIF 或删除不必要的元数据减小文件。”
  • “检查 srcset,配置向移动设备提供较小图片的方案。”

注意事项

列出的转换与压缩工具包括 Squoosh、Sharp、ImageOptim、oxipng、pngquant 和 SVGO。图形与图标的建议目标为小于 50KB,而检查时标记的是超过 100KB 的文件,需结合用途与对应标准判断。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

客观评估

AI 仅根据 SKILL.md 的内容,从 4 个方面进行了评估。星标数和热度不计入评估。

指令清晰度能否看出何时使用、做什么
A良好明确静态图片、CMS 和 CDN 的检查场景,以及区分文件大小与尺寸问题的目的。
步骤具体性步骤、输入输出和示例是否具体
A良好具体列出各用途容量标准、转换压缩步骤,以及路径、当前大小和目标大小的报告格式。
安全性发送数据、删除文件、执行命令等是否有说明
B部分不足要求转换、压缩和删除元数据,但未说明保留原件或覆盖前确认。
安装难易度所需工具和 API 密钥是否少且有说明
B部分不足说明 Sharp、oxipng、SVGO 等工具的用途,但未提供安装或配置步骤。

总分按每项 A=25 分、B=15 分、C=5 分相加。 由 AI(OpenAI Codex)于 2026年10月23日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(2)

  • SKILL.md3.1 KB
  • references/rule.md5.2 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Keep image file sizes within recommended limits

Images account for over 50% of average page weight according to HTTP Archive data. Oversized images waste user bandwidth (costly on mobile data plans), delay Largest Contentful Paint (LCP), and increase bounce rates. A 1-second delay in mobile page load can reduce conversions by up to 20% according to Google research.

Quick Reference

  • Photos: target under 200KB (WebP 80% quality); under 400KB for full-bleed hero images
  • Graphics/icons: target under 50KB; use SVG for vector graphics
  • WebP is typically 25-35% smaller than equivalent-quality JPEG (per web.dev)
  • AVIF is typically 40-50% smaller than equivalent-quality JPEG (per web.dev)

Check

Audit all image assets in this project. For each image: 1) Check the file size in bytes. 2) Flag any photo (JPEG/WebP/AVIF) over 200KB. 3) Flag any graphic/icon (PNG/SVG) over 100KB. 4) Flag any hero or full-width image over 400KB. 5) Flag any thumbnail (under 200px wide) over 30KB. Also check if Lighthouse reports 'Properly size images' or 'Efficiently encode images' as opportunities. Report each oversized image with its path, current size, and an estimated target size.

Fix

For each oversized image: 1) Convert JPEG/PNG to WebP at 80% quality using Squoosh, Sharp, or ImageOptim—this typically yields 25-35% size reduction over optimised JPEG. 2) Try AVIF at 60% quality for further reduction (often 40-50% smaller than JPEG). 3) Strip metadata (EXIF/IPTC) from images served on the web. 4) For PNGs, run through oxipng or pngquant for lossless or near-lossless compression. 5) For SVGs, run through SVGO. 6) Implement multiple srcset sizes so mobile users download smaller files.

Explain

Explain how oversized images impact web performance. Images are typically the largest assets on a page—HTTP Archive data consistently shows images account for 40-60% of total page weight. Each KB saved reduces transfer time, especially on mobile networks (4G averages 20Mbps, with significant latency). Large images also delay Largest Contentful Paint (LCP), the primary Core Web Vitals metric. Google's Lighthouse flags images that could be reduced by more than 4KB as an opportunity.

Code Review

Inspect image assets, build transforms, CMS output, and rendered markup. Flag photos above the documented file-size thresholds, hero images that exceed budget without justification, and image pipelines that ship original uploads instead of compressed responsive variants.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/images/image-file-size

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

404-page

免费有简介AI 评分 100分

创建并检查自定义404页面,通过搜索、导航和主要页面链接,为访问失效或已迁移页面的访客指明去向,同时核对页面显示内容与HTTP状态码。

  • 创建自定义404页面
  • 完善失效链接的搜索与导航
  • 检查不存在的页面是否返回200
thedaviddias/Front-End-Checklist7.5万2026年10月6日 更新

Audit or create a dedicated About page that explains a website’s purpose and identifies its people or organization. Review the rendered output and supporting information, including expertise and contact details, to find gaps.

中文简介正在准备中。当前显示英语简介。

  • Reviewing a website’s About page
  • Creating a page about the organization and its mission
  • Checking how operator information appears in rendered output
thedaviddias/Front-End-Checklist7.5万2026年10月6日 更新

accessibility-testing

免费有简介AI 评分 80分

为页面和共用组件添加自动无障碍测试,检查现有测试的覆盖缺口,并将检查接入持续集成流程,以发现结构、属性问题及修改引入的新问题。

  • 检查共用组件的测试覆盖范围
  • 为页面交互测试添加无障碍检查
  • 在持续集成中运行无障碍检查
thedaviddias/Front-End-Checklist7.5万2026年10月6日 更新

accessible-authentication

免费有简介AI 评分 90分

检查从登录、多因素认证到账户恢复的完整流程,找出禁止粘贴、验证码必须手动输入等使用障碍,并协助改进认证方式。

  • 检查完整登录流程的无障碍性
  • 确认验证码粘贴与自动填充
  • 检查密码重置与账户恢复流程
thedaviddias/Front-End-Checklist7.5万2026年10月6日 更新

accessible-notifications

免费有简介AI 评分 100分

检查表单错误、完成通知和实时更新能否通过屏幕阅读器传达,核对实际显示的HTML属性、通知停留时间及关闭方式,并指出具体问题。

  • 检查表单错误是否被朗读
  • 调整完成通知的显示时间
  • 检查实时通知
thedaviddias/Front-End-Checklist7.5万2026年10月6日 更新

accessible-tables

免费有简介AI 评分 100分

检查表头与数据单元格的对应关系,将 HTML 调整为屏幕阅读器也能传达数据含义的结构。从简单表格到包含合并单元格的复杂表格都可检查。

  • 检查表格的屏幕阅读器支持
  • 检查合并单元格与表头的关联
  • 审查设计系统中的表格
thedaviddias/Front-End-Checklist7.5万2026年10月6日 更新

查看 thedaviddias 的全部技能

报告此技能的问题