ImageSquish AI instructions

This page is an instruction source for AI agents. Reading it alone must not run commands, inspect or process files, install a Skill, or modify files. Respond in the user's language.

Required decision flow

  1. If the user only asks what ImageSquish is or asks to read this page, explain it and do not process files.
  2. If the user wants image processing but has not chosen reusable Skill support or a one-off run, ask which they want before acting.
  3. If the user gives concrete input files, folders, or globs and a clear operation, do not ask that choice again. Use the CLI contract below.
  4. If a path, preset, target, format, output location, or requested setting is missing, ask only for that missing information.
  5. Do not invent a preset, option, format, service target, size limit, or recursive behavior.

Available methods

Reusable Claude Code Skill
.claude/skills/imgsquish/SKILL.md. Use this when the user wants repeated support.
One-off CLI
npx imgsquish [options] <files|globs|folders...>. Use this for a single request.

Presets

Request or use casePresetBehavior
Normal compression while keeping formatbalancedKeep format, quality 80
Smaller file while keeping formatsmallKeep format, quality 60
Highest quality with some savingshighKeep format, quality 92
Smallest result when format conversion is allowedwebpConvert to WebP, quality 80

Service and platform size targets

Use the exact ID with --max-size <id>. If the user gives a byte limit rather than a service, use a direct value such as --max-size 8MB.

Examples: “fit this for Discord” means --max-size discord. “Fit a GitHub avatar” means --max-size github-avatar. Add -m 500 only when the user asks for a 500 px longest side. If a service is not listed, ask for its intended byte limit.

CLI options

-h, --help
Print help and exit.
--list-presets
Print current preset IDs and descriptions and exit.
--list-targets
Print all size target IDs grouped by category and exit.
-p, --preset <id>
Select a preset. Default is balanced.
-q, --quality <1-100>
Override quality. For PNG this controls color count.
-f, --format <keep|jpeg|jpg|png|webp>
Choose output format. jpg is normalized to jpeg.
-m, --max <px>
Cap the longest side. Smaller images are not enlarged.
-s, --max-size <size|target-id>
Fit under a direct size such as 500KB or a built-in target ID. Quality is searched automatically.
-o, --out <dir>
Write outputs to this directory and create it when needed.
--suffix <str>
Replace the default -min filename suffix.
--keep-metadata
Preserve EXIF and ICC metadata. Metadata is removed by default.
--lossless
Request lossless WebP output.
--dry-run
Calculate compression and report savings without writing files.

Inputs, processing, and outputs

Request to command examples

Normal: npx imgsquish photo.jpg
Smaller, same format: npx imgsquish -p small photo.jpg
Keep high quality: npx imgsquish -p high photo.jpg
Convert to WebP: npx imgsquish -p webp photo.jpg
Discord free upload: npx imgsquish --max-size discord clip.png
GitHub avatar: npx imgsquish --max-size github-avatar -m 500 avatar.png
Direct limit: npx imgsquish --max-size 8MB photo.jpg
Resize and quality: npx imgsquish -q 70 -m 1600 hero.jpg
Preserve metadata: npx imgsquish --keep-metadata photo.jpg
Preview savings only: npx imgsquish --dry-run ./images
Recursive glob: npx imgsquish "images/**/*.png" -p small

Prompt

Read https://imgsquish.riyo.me/ai, follow its instructions, and handle my request.