agentleFS
MarkusBittermanMarkusBitterman/claude-imagemagick-plugin/skills/img-optimize/SKILL.md

img-optimize

Skill1 starsChanged 5 months agoApache-2.0View on GitHub

Batch web-optimize images into a new directory with a before/after size report (e.g. /img-optimize assets/*.png for the web)

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never optimize in place: Write to an optimized/ directory (create it first) or a user-specified destination, preserving filenames.

    line 15
  2. Distinctive:

    Default strategy, unless the user specified a format:

    line 16
  3. Very specific:

    Keep-format requests → JPEG: -strip -interlace Plane -sampling-factor 4:2:0 -quality 85.

    line 19
  4. Very specific:

    Verify every output opens (magick identify optimized/*) and spot-check the largest one visually with Read if quality was reduced.

    line 26

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/img-optimize — batch web optimization with a size report

The user wants images optimized: $ARGUMENTS

Instructions

  1. Consult the imagemagick skill — especially references/formats.md (encoder choices) and references/recipes.md (web-optimization stanzas). Resolve the inputs with Glob; run magick identify over them to see formats, dimensions, and alpha before choosing a strategy.
  2. Never optimize in place. Write to an optimized/ directory (create it first) or a user-specified destination, preserving filenames.
  3. Default strategy, unless the user specified a format:
    • Photographic JPEG/PNG without alpha → WebP: magick in -quality 80 out.webp
    • PNG with alpha (UI, logos) → lossless WebP: -define webp:lossless=true
    • Keep-format requests → JPEG: -strip -interlace Plane -sampling-factor 4:2:0 -quality 85; PNG: png8: only when the color count allows it without visible banding
    • Cap oversized dimensions only if the user mentioned a display size: -resize '1600x1600>' (quote the >)
  4. Iterate with a shell loop (not mogrify), collecting sizes:
    mkdir -p optimized
    for f in *.jpg; do magick "$f" -strip -quality 85 "optimized/${f%.*}.webp"; done
  5. Verify every output opens (magick identify optimized/*) and spot-check the largest one visually with Read if quality was reduced.
  6. Report a table: per file, before size → after size and percent saved (du -b or stat -c%s), plus a totals row. Flag any file that got bigger (it happens — already-optimized inputs) and recommend keeping the original for those.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.