agentleFS
ViviBeriViviBeri/webcraft-pro/skills/image-asset-optimization/SKILL.md

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.

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
  1. Distinctive:

    Use this skill when images, video posters, icons or other media dominate transfer size or delay visible content.

    line 8
  2. Distinctive:

    Use modern formats such as AVIF or WebP when browser support and the delivery pipeline allow.

    line 14
  3. Distinctive:

    Use appropriately sized video posters and avoid autoplaying large media without a product requirement.

    line 19
  4. Distinctive:

    Do not serve desktop-sized images to small viewports without a reason.

    line 24
  5. Distinctive:

    Avoid CSS background images for meaningful content that needs text alternatives.

    line 25
  6. Distinctive:

    Do not lazy-load the LCP image or other immediately visible critical content.

    line 26
  7. Distinctive:

    Avoid preloading multiple competing image candidates.

    line 27
  8. Distinctive:

    Keep image quality acceptable for the actual display size.

    line 28
  9. Distinctive:

    Use descriptive alt text for informative images and empty alt for decorative images.

    line 29
  10. Distinctive:

    Verify that optimization does not break cropping, art direction or responsive layout.

    line 30

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Image and Asset Optimization

Use this skill when images, video posters, icons or other media dominate transfer size or delay visible content.

Workflow

  1. Identify the LCP element and the largest assets in the network waterfall.
  2. Match intrinsic dimensions and responsive candidates to rendered size and device pixel ratio.
  3. Use modern formats such as AVIF or WebP when browser support and the delivery pipeline allow; retain suitable fallbacks.
  4. Provide responsive sources with srcset and sizes, or the framework's equivalent image component.
  5. Reserve layout space with width and height attributes or a stable aspect ratio.
  6. 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.
  7. Lazy-load below-the-fold images and defer non-critical media.
  8. Use appropriately sized video posters and avoid autoplaying large media without a product requirement.
  9. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.