broken-images
What it does
This skill checks a project's image references for missing files and paths that will fail. It is for web developers and site owners who want images to load reliably.
When to use it
- ✓When visitors see broken picture icons on a page.
- ✓When an image path points to a file that is not in the project.
- ✓When images come from user data or outside links that may disappear.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/broken-images/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Scan my project for image paths that point to missing files and add fallbacks where needed.”
5 new skills a week. 1 minute to read.
How it works
The agent checks image source attributes and background images for missing files, fixes wrong paths, and adds an error handler that swaps in a fallback image when needed.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Fix broken images
A broken image shows an ugly placeholder icon, breaks visual layouts, and communicates that the site is poorly maintained. If the broken image is the Largest Contentful Paint element, it also harms LCP scores. On e-commerce sites, a missing product image can directly reduce purchase intent.
Quick Reference
- Broken images show an icon and console error—validate all
<img src>paths at build time - Use
onerrorhandlers to swap broken<img>elements to fallback images - Set
this.onerror=nullinside the handler to prevent infinite error loops - Test with DevTools Network tab blocked requests to verify fallback behaviour
Check
Scan all <img> src attributes and CSS background-image URLs in this codebase. Identify: 1) Any relative or absolute paths that point to files not present in the project. 2) Any <img> elements without an onerror handler or fallback mechanism. 3) Hardcoded external image URLs that may become unavailable. 4) Dynamic image paths constructed from user data without existence checks. Report each broken or potentially broken image with its file path and line number.
Fix
For each broken image: 1) Correct the file path if the image exists but the path is wrong. 2) Add the missing image asset if it was omitted. 3) For images that may fail at runtime, add an onerror handler: onerror="this.src='/images/fallback.png'; this.onerror=null;". 4) For React/Vue components, implement an onError callback that swaps the src to a placeholder. 5) For external images, consider downloading and self-hosting or using a CDN with fallback. Always set this.onerror=null to prevent infinite error loops.
Explain
Explain why broken images degrade user experience and how browsers handle them. A 404 response for an image shows the browser's broken-image icon, causes a console error, and—if the image is the LCP element—delays Core Web Vitals metrics. Search engines cannot index missing images, affecting image SEO. Monitoring image errors proactively prevents broken experiences from reaching users.
Code Review
Review image assets, markup, and delivery configuration related to Fix broken images. 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/broken-images
FAQ
Why do broken images matter beyond looks?
The skill says a broken image that is the main page image can harm loading scores.
What does the error handler do?
It swaps in a fallback image if the original fails to load, and it is set up so it does not loop.
How can I test the fallback?
The skill suggests blocking requests in the browser developer tools to see the fallback work.
Details
Original description by the author
Use when reviewing image assets, markup, and CDN or build transforms related to Fix broken images. Check encoded size, rendered size, loading strategy, and above-the-fold impact together.
Popularity
- GitHub stars
- 75k
- Ranking position
- #2760
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.