跳到正文
Skillpedia
图片与图标75k · #3043

svg-optimization

它能做什么

这项技能清理来自设计工具的 SVG 图片文件。适用于希望网站图片文件更小的设计师和开发者。

适用场景

  • ✓当 SVG 文件因包含编辑器数据和注释而体积很大的时候。
  • ✓当网站加载的图片文件在发布前可以进一步缩小的时候。
  • ✓当你为网站准备标志或图标集的时候。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/svg-optimization/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/svg-optimization/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我把标志导出成了 SVG,文件很大。请帮我把它缩小,同时不影响观感。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会运行或推荐一个优化工具,去除文件中不需要的数据。图片看起来不变,但文件会变小。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Optimize SVG files

SVGs exported from design tools contain unnecessary metadata, comments, and redundant code—optimization removes this bloat, often cutting file size in half.

Quick Reference

  • SVGO can reduce SVG file size by 50-80%
  • Removes editor metadata, comments, and redundant attributes
  • Preserve viewBox and accessibility attributes
  • Integrate into build process for automatic optimization

Check

Check if SVG files are optimized by removing unnecessary metadata and formatting.

Fix

Optimize SVG files using SVGO or similar tools to reduce file size.

Explain

Explain how SVG optimization can reduce file sizes by 50-80% without quality loss.

Code Review

Review image assets, markup, and delivery configuration related to Optimize SVG files. Flag exact files or components where format choice, sizing, or loading behavior violates the rule, and describe how to confirm the fix in DevTools.


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

Rule page: https://frontendchecklist.io/rules/images/svg-optimization

常见问题

SVG 能缩小多少?

这项技能指出,优化通常可以将文件大小减少 50% 到 80%,具体取决于文件。

优化后图片会有不同吗?

这项技能力求保持相同外观,并且会保留 viewBox 和无障碍属性。

可以在构建时自动运行吗?

可以。这项技能建议把优化加入构建流程,使每次构建都自动执行。

详情

作者的原始描述

Use when reviewing image assets, markup, and CDN or build transforms related to Optimize SVG files. Check encoded size, rendered size, loading strategy, and above-the-fold impact together.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#3043
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能