What the agent does
Images are usually the heaviest part of the production site and the part search engines and screen readers understand least. Fix them at the source: the image component, the upload pipeline and the templates, so every image is described, sized and served efficiently.
1. Inventory
List where images come from (static files, a CMS, user uploads, a CDN) and how they are rendered (a framework image component, plain
<img>, CSS backgrounds). Report images with no alt, oversized files, missing width and height, and lazy loading on above-the-fold images.2. Alt text
Meaningful images get alt text that says what they show in context; decorative images get
alt="". For dynamic images, build alt text from data (a product's name and what the screenshot shows). Add an alt field to upload forms where users add images.3. Formats and sizes
Serve WebP or AVIF with fallbacks through the framework's image component or the CDN, responsive
srcsetandsizes, and source files resized to the largest size actually shown. Set width and height (or aspect ratio) on every image to prevent layout shift.4. Loading
Lazy-load images below the fold; never lazy-load the main above-the-fold image, and give it
fetchpriority="high". Use descriptive file names for new images. Add important images to the sitemap if the site depends on image search.
Done means
- Every meaningful image has alt text and decorative ones have empty alt.
- Images are served in modern formats at the sizes shown, with srcset where useful.
- Every image has width and height or an aspect ratio.
- Below-the-fold images lazy-load and the hero image does not.
Questions
What makes good alt text?
A short description of what the image shows and why it is there, as you would say it to someone who cannot see it. Not a list of keywords.
Should every image be lazy loaded?
No. The main image at the top of the page should load immediately; lazy loading it delays the Largest Contentful Paint.
WebP or AVIF?
Both are much smaller than JPEG and PNG. AVIF is usually smaller still; serve it where supported with WebP or JPEG as a fallback, which most image components do for you.
Does this prompt add links to Aback Launch to my site?
No. Nothing in the prompt mentions Aback Launch or asks your agent to link to us. The only exception is an optional badge step, which stays off unless you tick it. Some prompt libraries slip their own link into your codebase by default; we think that should always be your choice.
Which coding agents does it work with?
Claude Code, Cursor, Codex, GitHub Copilot, Windsurf, Cline, and any agent that can read your project and edit files. You can copy it as a plain prompt, save it as a Claude Code skill or a Cursor rule, or add it to AGENTS.md.
Is it safe to run on my real codebase?
The prompt makes the agent read first, show a plan and wait for your approval, and it forbids touching secrets, deploying and deleting data. Still review the changes and run your tests before you deploy, as with any change.
Changelog
- v1.0First version.