image-optimization

image-optimization is a skill for Claude Code from secondsky/claude-skills. It costs 40 tokens per session (504 once invoked), scanned A, original, MIT.

Guidance for preparing website images with modern formats, screen-specific sizes, and lazy loading. Lazy loading means waiting to fetch an image until it is close to being viewed.

In plain words
What is it for?
Use it to choose formats such as WebP or AVIF, write responsive image markup, add placeholders, and build an image-processing step with Sharp.
Why use it?
It helps prevent oversized images from slowing pages or using unnecessary network data.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the image-optimization plugin — 1 skill shipped together

Good fit Use it to choose formats such as WebP or AVIF, write responsive image markup, add placeholders, and build an image-processing step with Sharp.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/secondsky/claude-skills/image-optimization
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add secondsky/claude-skills --skill image-optimization
Clone the repo
git clone --depth 1 https://github.com/secondsky/claude-skills

Made for: Claude Code.

Or install image-optimization, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for image-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/secondsky/claude-skills/image-optimization/github.svg)](https://agentmods.dev/skills/secondsky/claude-skills/image-optimization)
Your own site
<a href="https://agentmods.dev/skills/secondsky/claude-skills/image-optimization"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/image-optimization/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for image-optimization

Your own site · 80×15
<a href="https://agentmods.dev/skills/secondsky/claude-skills/image-optimization"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/image-optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 504 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 15 Sept 2026
  • Snyk pass 14 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.00504
Opus 5.5 $0.00016 $0.00202
Sonnet 5.5 $0.00008 $0.00101
Haiku 4.5 $0.00004 $0.00050

Measured 8d ago against content hash 286ee5708766, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

image-optimization scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/image-optimization/skills/image-optimization/SKILL.md · 82 lines

What it actually says

Image Optimization

Optimize images for web performance with modern formats and responsive techniques.

Format Selection

Format Best For Compression
JPEG Photos Lossy, 50-70% reduction
PNG Icons, transparency Lossless, 10-30%
WebP Modern browsers 25-35% better than JPEG
AVIF Next-gen 50% better than JPEG
SVG Logos, icons Vector, scalable

Responsive Images

<picture>
  <source srcset="image.avif" type="image/avif">
  <source srcset="image.webp" type="image/webp">
  <img
    src="image.jpg"
    srcset="image-400.jpg 400w, image-800.jpg 800w, image-1200.jpg 1200w"
    sizes="(max-width: 600px) 100vw, 50vw"
    alt="Description"
    loading="lazy"
    decoding="async"
  >
</picture>

Lazy Loading

<!-- Native lazy loading -->
<img src="image.jpg" loading="lazy" alt="Description">

<!-- With blur placeholder -->
<img
  src="placeholder-blur.jpg"
  data-src="image.jpg"
  class="lazy"
  alt="Description"
>

Build Pipeline (Sharp)

const sharp = require('sharp');

async function optimizeImage(input, output) {
  await sharp(input)
    .resize(1200, null, { withoutEnlargement: true })
    .webp({ quality: 80 })
    .toFile(output);
}

Performance Targets

Asset Type Target Size
Hero image <200KB
Thumbnail <30KB
Total images <500KB

Optimization Checklist

  • Use WebP with JPEG fallback
  • Implement responsive srcset
  • Enable lazy loading for below-fold
  • Compress at quality 70-85
  • Serve from CDN
  • Set proper cache headers
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 82 lines · 40 tokens per session scan A 286ee5708766

Subscribe to this mod's changes

image-optimization is a skill published in the GitHub repository secondsky/claude-skills (257 stars, last pushed 8d ago), licensed MIT. It adds 40 tokens to every session and 504 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-22.

Related

image-optimization compared with skills from other repositories

image-optimization next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
image-optimizationsecondsky/claude-skillsSkill2578d agoMITA40Claude Code
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill101kyesterdayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill395ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill330k2d agoMITA21Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill14kyesterdayCC0-1.0A113Claude Code, Codex
next-cache-components-adoptionvercel/next.jsSkill144kyesterdayMITA95Claude Code