Design 1,262 installs

baoyu-compress-image

by jimliu/baoyu-skills

Compresses images to WebP (default) or PNG with automatic tool selection. Use when user asks to "compress image", "optimize image", "convert to webp", or…

Skill content

Compresses images to WebP or PNG with automatic tool selection based on system availability.

- Supports WebP (default), PNG, and JPEG output formats with configurable quality (0–100, default 80)

- Automatically selects best available compression tool: sips, cwebp, ImageMagick, or Sharp

- Processes single files or directories recursively with options to keep originals or replace in-place

- Customizable via EXTEND.md configuration files at project, user home, or XDG config locations

Image Compressor

Compresses images using best available tool (sips → cwebp → ImageMagick → Sharp).

Script Directory

Scripts in scripts/ subdirectory. {baseDir} = this SKILL.md's directory path. Resolve ${BUN_X} runtime: if bun installed → bun; if npx available → npx -y bun; else suggest installing bun. Replace {baseDir} and ${BUN_X} with actual values.

Script
Purpose

scripts/main.ts
Image compression CLI

Preferences (EXTEND.md)

Check EXTEND.md in priority order - the first one found wins: