跳到正文
Skillpedia
SEO75k · #2845

filename-quality

它能做什么

这项技能检查网站或项目中的图片文件名,并建议更清晰的名称。适用于希望图片搜索效果更好、素材文件夹更整洁的网站所有者和开发者。

适用场景

  • ✓当你的图片文件名类似 IMG_4532.jpg 或 image1.jpg 的时候。
  • ✓当你希望图片在图片搜索中更容易被找到的时候。
  • ✓当团队很难在大型素材文件夹中找到图片的时候。

技能链接

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

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“请检查我的图片文件名,并建议更好的名称。”

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

工作原理

智能体会扫描代码和素材文件夹中的图片引用,找出自动生成或不清楚的名称。它会建议使用小写、用连字符分隔、并能描述图片内容的名称。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Use descriptive image filenames

Google explicitly recommends descriptive filenames in its Image SEO best practices. A file named red-leather-wallet.jpg gives search engines context about the image content, improving discoverability in image search. Generic filenames waste this SEO signal. Descriptive names also help developers maintain large asset libraries without opening every file to identify its content.

Quick Reference

  • Use descriptive, hyphen-separated filenames: hero-homepage-team-collaboration.jpg
  • Avoid generic names like image1.jpg, photo.png, or camera defaults like IMG_4532.jpg
  • Use lowercase only—avoid uppercase letters and spaces which can cause URL encoding issues
  • Google uses filenames as a relevance signal for image search results

Check

Scan all image file references in this codebase (<img src>, CSS url(), import statements, and public/assets directories). Identify filenames that: 1) Use auto-generated names (e.g., IMG_1234.jpg, DSC_0056.png, screenshot-2024-01-01.png). 2) Use meaningless names (e.g., image1.jpg, photo.png, pic.jpg). 3) Contain spaces (e.g., 'my photo.jpg'). 4) Use underscores as word separators (e.g., hero_image.jpg instead of hero-image.jpg). 5) Mix uppercase and lowercase letters. Report each problematic filename with its path.

Fix

Rename image files with descriptive, SEO-friendly names: 1) Replace generic names with descriptive ones reflecting the content (e.g., rename IMG_1234.jpg to blue-running-shoes-side-view.jpg). 2) Use lowercase letters only. 3) Replace spaces and underscores with hyphens. 4) Keep names concise but meaningful—3 to 5 words is ideal. 5) Update all references to the renamed file in HTML, CSS, and JavaScript. For large-scale renames, provide a migration script that reads old paths, generates new names, and updates all references.

Explain

Explain why descriptive filenames matter for image SEO. Google explicitly states it uses filename as a signal for image search ranking. A filename like product-red-leather-wallet.jpg gives Google context about the image before it even analyses the pixels. Generic filenames (image1.jpg, photo.png) provide no signal. Additionally, descriptive filenames improve developer experience—team members can understand what an asset is without opening it.

Code Review

Review image assets, markup, and delivery configuration related to Use descriptive image filenames. 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/filename-quality

常见问题

文件名为什么对搜索重要?

这项技能指出,Google 建议使用描述性文件名,作为图片搜索的上下文信号。

推荐什么命名格式?

小写单词,用连字符分隔,例如 hero-homepage-team-collaboration.jpg。

空格和下划线怎么办?

这项技能会标记空格和下划线,并建议改用连字符作为单词分隔符。

详情

作者的原始描述

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

repo: thedaviddias/Front-End-Checklist

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能