svg-optimization
它能做什么
这项技能清理来自设计工具的 SVG 图片文件。适用于希望网站图片文件更小的设计师和开发者。
适用场景
- ✓当 SVG 文件因包含编辑器数据和注释而体积很大的时候。
- ✓当网站加载的图片文件在发布前可以进一步缩小的时候。
- ✓当你为网站准备标志或图标集的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/svg-optimization/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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.
热度
- GitHub 星标
- 75k
- 排名
- #3043
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。