Skip to main content
skill CX Codex

image-optimization · aj-geddes — Claude Code skill: shrink images for the web

A skill that walks your agent through compressing images and picking modern formats. Useful before a deploy, when pages drag on mobile networks.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add aj-geddes/useful-ai-prompts --skill image-optimization -a claude-code
Open on GitHub

What image-optimization does

The skill covers format choice by job. JPEG for photos with lossy compression, PNG for icons and screenshots, SVG for simple graphics. WebP gets its own section: better size than JPEG or PNG, with a <picture> fallback for older browsers.

There is a short starting example with convert, optipng and cwebp, and four deeper guides live in the references/ directory: compression and formats, responsive images, the optimization process, monitoring. Your agent opens the file it needs and applies the steps to your project.

Nothing runs on its own here, and the skill does not check whether the tools exist. If ImageMagick, PNGQuant or cwebp are missing from the machine, the example commands fail — worth checking your environment before asking the agent to touch assets.

What it helps with

  • compress photos for the web without visible quality loss
  • pick a format for icons, screenshots and logos
  • move images to WebP with a fallback for older browsers
  • set up responsive images at several sizes per screen
  • sweep asset folders before shipping to production

Example prompts for the agent

  • go through public/images and tell me what to compress and convert
  • pick a format and command for the logo and icons in assets/
  • show me how to set up responsive images for a product card

How to install image-optimization

1Skills CLI (Vercel)

npx skills add aj-geddes/useful-ai-prompts --skill image-optimization -a claude-code

2Manually: put the files in place

~/.claude/skills/image-optimization/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/image-optimization/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about image-optimization

How do I install image-optimization in Claude?

Run npx skills add aj-geddes/useful-ai-prompts --skill image-optimization -a claude-code. The skill file then lands at ~/.claude/skills/image-optimization/SKILL.md.

What does image-optimization do?

It guides the agent through choosing an image format and compression method for the web, and through serving responsive images at different screen sizes.

Does the skill need external tools?

The examples use ImageMagick, PNGQuant, OptiPNG and cwebp. The skill does not install them, so check that the tool you need is present.

Source text

SKILL.md · MIT
---
name: image-optimization
description: >
  Optimize images for web to reduce file size without sacrificing quality. Use
  compression, modern formats, and responsive techniques for faster loading.
---

# Image Optimization

## Table of Contents

- [Overview](#overview)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Reference Guides](#reference-guides)
- [Best Practices](#best-practices)

## Overview

Images typically comprise 50% of page weight. Optimization dramatically improves performance, especially on mobile networks.

## When to Use

- Website optimization
- Responsive image implementation
- Performance improvement
- Mobile experience enhancement
- Before deployment

## Quick Start

Minimal working example:

```yaml
Format Selection:

JPEG:
  Best for: Photographs, complex images
  Compression: Lossy (quality 70-85)
  Size: ~50-70% reduction
  Tools: ImageMagick, TinyJPEG
  Command: convert image.jpg -quality 75 optimized.jpg

PNG:
  Best for: Icons, screenshots, transparent images
  Compression: Lossless
  Size: 10-30% reduction
  Tools: PNGQuant, OptiPNG
  Command: optipng -o3 image.png

WebP:
  Best for: Modern browsers (90% support)
  Compression: 25-35% better than JPEG/PNG
  Fallback: Use <picture> element
  Tools: cwebp
  Command: cwebp -q 75 image.jpg -o image.webp

SVG:
  Best for: Icons, logos, simple graphics
// ... (see reference guides for full implementation)
```

## Reference Guides

Detailed implementations in the `references/` directory:

| Guide | Contents |
|---|---|
| [Image Compression & Formats](references/image-compression-formats.md) | Image Compression & Formats |
| [Responsive Images](references/responsive-images.md) | Responsive Images |
| [Optimization Process](references/optimization-process.md) | Optimization Process |
| [Monitoring & Best Practices](references/monitoring-best-practices.md) | Monitoring & Best Practices |

## Best Practices

### ✅ DO

- Follow established patterns and conventions
- Write clean, maintainable code
- Add appropriate documentation
- Test thoroughly before deploying

### ❌ DON'T

- Skip testing or validation
- Ignore error handling
- Hard-code configuration values

© aj-geddes · MIT · aj-geddes/useful-ai-prompts

Similar skills

Everything for Frontend and UI →

image-optimization by other authors comes first.

From the same set118

gitlab-cicd-pipeline A skill that steers your agent through writing .gitlab-ci.yml: stages, jobs, caching, artifacts, Kubernetes deploys. Useful when a pipeline needs building or reworking. CX Codex +1 664installs websocket-implementation A coding skill that walks you through building a WebSocket server: connection management, message routing, and Redis-based scaling. CX Codex +1 663installs project-estimation A skill that helps the agent estimate project scope, timeline and resources. Useful when you need a budget or a plan you can defend. CX Codex +1 659installs log-analysis A skill that helps the agent read application and system logs: spot errors, recurring patterns and the root cause of a failure. Useful when a service breaks and you need answers. CX Codex +1 657installs requirements-gathering Walks your agent through collecting and documenting stakeholder requirements before development starts. Useful at project kickoff and feature planning. CX Codex +1 655installs ruby-rails-application Guides building Ruby on Rails applications with Active Record models, RESTful controllers, and JWT authentication. Best for structuring Rails APIs and managing database schemas. CX Codex +1 655installs api-rate-limiting Guides the implementation of token bucket and sliding window rate limiting. Protects APIs from brute force attacks and traffic surges using Redis or Flask. CX Codex +1 640installs information-architecture Structures content, sitemaps, and taxonomies for web apps and documentation hubs. It guides your AI agent through a four-stage process from card sorting to tree testing. CX Codex +1 634installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor