image-asset-optimization
Skill11 starsChanged 10 days agoMITView on GitHub
Optimize image and media delivery when large visual assets affect loading speed, bandwidth, layout stability or mobile experience.
In this repository46 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- accessibility-automationSkill
- accessibility-reviewSkill
- accessible-componentsSkill
- accessible-motionSkill
- animation-performanceSkill
- anti-slop-uiSkill
- api-securitySkill
- authentication-sessionsSkill
- authorization-access-controlSkill
- component-engineeringSkill
- core-web-vitalsSkill
- design-directionSkill
- design-system-architectureSkill
- document-head-seoSkill
- font-performanceSkill
- forms-and-validationSkill
- frontend-architectureSkill
- gsap-fundamentalsSkill
- icon-engineeringSkill
- independent-reviewSkill
- interactive-storytellingSkill
- javascript-performanceSkill
- keyboard-focusSkill
- modern-cssSkill
- motion-design-systemsSkill
- network-cachingSkill
- performance-auditingSkill
- performance-testingSkill
- premium-landing-pagesSkill
- quickstart-onboardingSkill
- rendering-performanceSkill
- responsive-engineeringSkill
- screen-reader-testingSkill
- scrolltrigger-experiencesSkill
- secrets-configurationSkill
- secure-application-designSkill
- secure-input-outputSkill
- security-reviewSkill
- security-testingSkill
- semantic-accessibilitySkill
- visual-design-reviewSkill
- visual-reference-analysisSkill
- wcag-auditingSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 10 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill when images, video posters, icons or other media dominate transfer size or delay visible content.
- Distinctive: line 14
Use modern formats such as AVIF or WebP when browser support and the delivery pipeline allow.
- Distinctive: line 19
Use appropriately sized video posters and avoid autoplaying large media without a product requirement.
- Distinctive: line 24
Do not serve desktop-sized images to small viewports without a reason.
- Distinctive: line 25
Avoid CSS background images for meaningful content that needs text alternatives.
- Distinctive: line 26
Do not lazy-load the LCP image or other immediately visible critical content.
- Distinctive: line 27
Avoid preloading multiple competing image candidates.
- Distinctive: line 28
Keep image quality acceptable for the actual display size.
- Distinctive: line 29
Use descriptive alt text for informative images and empty alt for decorative images.
- Distinctive: line 30
Verify that optimization does not break cropping, art direction or responsive layout.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Image and Asset Optimization
Use this skill when images, video posters, icons or other media dominate transfer size or delay visible content.
Workflow
- Identify the LCP element and the largest assets in the network waterfall.
- Match intrinsic dimensions and responsive candidates to rendered size and device pixel ratio.
- Use modern formats such as AVIF or WebP when browser support and the delivery pipeline allow; retain suitable fallbacks.
- Provide responsive sources with srcset and sizes, or the framework's equivalent image component.
- Reserve layout space with width and height attributes or a stable aspect ratio.
- Prioritize the actual above-the-fold LCP image. Do not lazy-load it; consider fetchpriority="high" only when measurement confirms it is the LCP resource.
- Lazy-load below-the-fold images and defer non-critical media.
- Use appropriately sized video posters and avoid autoplaying large media without a product requirement.
- Re-test on constrained mobile bandwidth and inspect decoded memory as well as transfer bytes.
Engineering rules
- Do not serve desktop-sized images to small viewports without a reason.
- Avoid CSS background images for meaningful content that needs text alternatives.
- Do not lazy-load the LCP image or other immediately visible critical content.
- Avoid preloading multiple competing image candidates.
- Keep image quality acceptable for the actual display size.
- Use descriptive alt text for informative images and empty alt for decorative images.
- Verify that optimization does not break cropping, art direction or responsive layout.
Deliverables
List the asset, current and optimized dimensions/format/bytes, loading priority, responsive strategy, accessibility treatment and measured impact.
Common AI failure mode
Failure: An agent compresses images or switches formats but omits intrinsic dimensions, serves an oversized candidate, or lazy-loads the actual above-the-fold LCP image—then reports success from reduced file bytes alone.
Why it matters: The page can still shift while images decode, delay its largest visible content, or waste bandwidth and memory on mobile. A smaller file is not evidence of better user-perceived loading if layout stability and resource priority regress.
Prevention: Identify the actual LCP element and rendered dimensions from a representative viewport and network trace. Supply width/height or a stable aspect ratio, use srcset/sizes or the framework equivalent, and select a candidate appropriate to viewport and device pixel ratio. Do not lazy-load the LCP image; apply high priority only when measurement supports it. Lazy-load below-the-fold media, then compare bytes, decoded dimensions, LCP and CLS on constrained mobile conditions. Check art direction, cropping, alt text, and visual quality after optimization.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

