Claude Skills Guide

Claude Code for Imgix Image Optimization Workflow

Imgix is a real-time image processing service that transforms images on the fly through URL parameters. When combined with Claude Code’s automation capabilities, you can build powerful workflows that automate image optimization, generate responsive image sets, and enforce performance standards across your entire image pipeline. This guide shows you how to create Claude skills that handle Imgix integration smoothly.

Understanding Imgix URL Structure

Before building Claude skills, you need to understand how Imgix generates transformed images. An Imgix URL consists of three parts: the base URL, the source path, and the query parameters for transformations.

https://your-source.imgix.net/image-name.jpg?w=800&h=600&fit=crop&auto=format,compress

The key parameters include:

Claude can generate these URLs programmatically based on your requirements, making it ideal for batch processing and systematic optimization.

Building a Claude Skill for Imgix URL Generation

Create a skill that generates Imgix URLs based on specifications. Save this as skills/imgix-url-generator.md:

---
name: imgix-url-generator
description: Generate Imgix URLs with optimal parameters for image transformation
---

You are an Imgix URL generator. Given source information and transformation parameters, generate optimized Imgix URLs.

## URL Generation Rules

1. Always include `auto=format,compress` for automatic format selection and compression
2. Use `fit=crop` with `crop=faces` when both width and height are specified
3. Set quality to 75 by default, adjust based on use case
4. URL-encode special characters in the image path

## Output Format

Provide the generated URL and explain the parameters used.

This skill gives Claude context for generating URLs correctly every time.

Automating Responsive Image Generation

One of the most practical Imgix workflows is generating responsive image srcsets. Create a skill that generates complete responsive image markup:

---
name: responsive-imgix-images
description: Generate responsive img tags with Imgix srcset for multiple breakpoints
---

Generate responsive image HTML using Imgix for the following specifications:

1. Base image path (from Imgix source)
2. Required breakpoints: 320w, 640w, 960w, 1280w, 1920w
3. Default to WebP with JPEG fallback via Imgix auto parameter
4. Include appropriate sizes attribute based on layout

Output complete HTML with:
- src attribute for fallback
- srcset with all breakpoint URLs
- sizes attribute for proper browser selection
- alt text and optional loading="lazy"

When you provide an image path like /products/hero-banner.jpg, Claude generates:

<img
  src="https://cdn.yoursite.imgix.net/products/hero-banner.jpg?w=1280&auto=format,compress"
  srcset="
    https://cdn.yoursite.imgix.net/products/hero-banner.jpg?w=320&auto=format,compress 320w,
    https://cdn.yoursite.imgix.net/products/hero-banner.jpg?w=640&auto=format,compress 640w,
    https://cdn.yoursite.imgix.net/products/hero-banner.jpg?w=960&auto=format,compress 960w,
    https://cdn.yoursite.imgix.net/products/hero-banner.jpg?w=1280&auto=format,compress 1280w,
    https://cdn.yoursite.imgix.net/products/hero-banner.jpg?w=1920&auto=format,compress 1920w
  "
  sizes="(max-width: 640px) 100vw, (max-width: 1280px) 50vw, 33vw"
  alt="Product hero banner"
  loading="lazy"
>

This approach ensures browsers load the optimal image size for each viewport, dramatically reducing bandwidth and improving Core Web Vitals.

Batch Processing Images with Claude

For large-scale image optimization, create a skill that processes multiple images:

---
name: imgix-batch-processor
description: Process multiple images through Imgix with consistent optimization settings
---

Process images through Imgix with the following optimization profiles:

- **fast**: w=800, q=60, auto=format,compress
- **balanced**: w=1200, q=75, auto=format,compress,enhance
- **quality**: w=1920, q=85, auto=format,compress,enhance

For each image, generate:
1. Optimized URL
2. Thumbnail variant (w=300, h=300, fit=crop)
3. Social media variants (og:image: 1200x630, twitter: 1024x512)

Output as a JSON configuration file ready for use in your application.

Implementing Smart Image Caching

Imgix provides excellent caching, but you can optimize further with proper cache headers and URL strategies. Create a skill that adds cache-busting parameters correctly:

---
name: imgix-cache-optimize
description: Generate Imgix URLs with optimal caching strategies
---

Generate Imgix URLs with these caching optimizations:

1. Use `fm=webp` or `fm=avif` for modern formats (with `auto=format` as fallback)
2. Add `dpr=1` for standard displays, allow client-side DPR adjustment
3. Use `expire` parameter for long-term cached assets (seconds from now)
4. Generate versioned URLs for assets that update infrequently

For versioning, use format: `?v={hash}&w={width}&auto=format,compress`

This ensures your images cache effectively at the CDN edge while allowing updates when necessary.

Best Practices for Imgix with Claude

When building Imgix workflows with Claude Code, follow these actionable guidelines:

Always use automatic format selection. The auto=format parameter detects browser support and serves WebP, AVIF, or JPEG accordingly. Combined with auto=compress, you get optimal file sizes without manual tuning.

Implement progressive loading. Generate low-quality image placeholders (LQIP) using w=20&q=10 for immediate visual feedback while the full image loads. This dramatically improves perceived performance.

Use focal point cropping intelligently. When cropping images, specify crop=faces or crop=edges to maintain visual interest. Claude can analyze images and suggest appropriate focal points.

Monitor with Imgix analytics. Add Claude skills that query Imgix statistics weekly and report on image performance, popular transformations, and potential optimization opportunities.

Version static assets. For images that rarely change (logos, icons, hero backgrounds), append a version hash to enable infinite caching. This offloads traffic from your origin and speeds up page loads.

Putting It All Together

The real power of Claude Code with Imgix comes from combining these patterns. A complete workflow might:

  1. Scan your image directory and catalog existing images
  2. Generate responsive srcsets for each image
  3. Create HTML components with lazy loading
  4. Produce a JSON manifest of all image URLs
  5. Validate that generated URLs are accessible

This automation eliminates manual URL crafting, ensures consistency across your image pipeline, and lets you focus on creative and strategic work rather than repetitive parameter tuning.

Start with the URL generator skill, then add responsive image generation, and finally layer in batch processing as your needs grow. Claude handles the complexity, Imgix delivers the performance.

Built by theluckystrike — More at zovo.one