claude-imagemagick-plugin
CLAUDE.md1 starsChanged 5 months agoApache-2.0View on GitHub
A Claude Code plugin providing ImageMagick/GraphicsMagick expertise. Modeled on plugins/example-plugin from the official plugins repo. - Smoke test: scripts/verify-recipes.sh runs every documented command against the test-images/ fixtures. The command list is hand-maintained — when you add or edit a command in SKILL.md or references/*.md, add/update the matching line there. Run PDF/PS cases with nix shell nixpkgs#ghostscript --command scripts/verify-recipes.sh. - Validate JSON: python3 -m json.tool .claude-plugin/plugin.json - Load locally: claude --plugin-dir /home/bittermang/Developments/claude-imagemagick-plugin, then check the skills appear in /help and that…
In this repository4 other files it gives its agents.
- imagemagickSkill
- img-compareSkill
- img-optimizeSkill
- imgSkill
The file
We split this CLAUDE.md into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is 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.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
IM7 syntax first: All examples use magick (never bare convert).
- Distinctive: line 51
Verify documented commands against the real binary before committing — this machine has ImageMagick 7.1.2 Q16-HDRI (Nix).
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md 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.
Files
claude-imagemagick-plugin
A Claude Code plugin providing ImageMagick/GraphicsMagick expertise. Modeled on
plugins/example-plugin
from the official plugins repo.
Structure
.claude-plugin/
plugin.json # plugin metadata (name: "imagemagick")
marketplace.json # makes this repo installable via /plugin marketplace add
skills/
imagemagick/ # model-invoked: auto-activates on image-manipulation requests
SKILL.md # command model, quick reference, pitfalls — keep SMALL
references/ # loaded on demand, not on activation — put depth here
geometry.md # resize/crop geometry grammar
recipes.md # multi-step patterns (watermark, GIF, PDF, web-optimize)
gm-and-im6.md # GraphicsMagick + ImageMagick 6 compatibility
img/ # user-invoked: /img <natural-language task>
SKILL.md
img-compare/ img-optimize/ # more user-invoked commands
agents/ # subagents (photo-batch, image-auditor) — frontmatter
# supports skills: to preload the imagemagick skill
hooks/
hooks.json # PostToolUse matcher wiring (auto-discovered; no plugin.json key needed)
identify-image.sh # read-only sanity check: identify images produced by Bash commands
TODO.md # roadmap — check here before adding featuresConventions
- Skill format:
skills/<name>/SKILL.mdonly. Do not add acommands/directory — that layout is legacy per the example-plugin. - Model-invoked skills need
descriptionfrontmatter written as trigger conditions: quoted phrases a user would actually say ("resize an image", "convert PNG to WebP"). This field is the entire activation mechanism — be generous with trigger phrases. - SKILL.md stays small;
references/holds depth. SKILL.md is injected into context whenever the skill activates; reference files are read only when needed. New deep-dive content goes inreferences/, with a one-line pointer from SKILL.md. - IM7 syntax first. All examples use
magick(never bareconvert). GM/IM6 differences live only ingm-and-im6.md. - Safety is a content requirement: any documented command that can destroy user files (
mogrify, in-place edits, JPEG alpha-drop) must carry its warning inline, next to the command. - Quote shell-metacharacter geometry flags in every example:
-resize '800x600>'.
Testing changes
- Smoke test:
scripts/verify-recipes.shruns every documented command against thetest-images/fixtures. The command list is hand-maintained — when you add or edit a command in SKILL.md orreferences/*.md, add/update the matching line there. Run PDF/PS cases withnix shell nixpkgs#ghostscript --command scripts/verify-recipes.sh. - Validate JSON:
python3 -m json.tool .claude-plugin/plugin.json - Load locally:
claude --plugin-dir /home/bittermang/Developments/claude-imagemagick-plugin, then check the skills appear in/helpand that/imgworks. - Trigger-test the model-invoked skill with a natural request ("convert test.png to webp") and confirm it activates. Same pattern routing-tests agents: grep the
stream-jsonoutput for theAgenttool_use. - Headless test runs (
claude -p …) must pass--model haiku(don't spend expensive-model budget on routing tests — and a description that routes on Haiku is more robust anyway) and--permission-mode acceptEdits(this machine defaults to plan mode, which stalls-pruns at plan approval). Keep--max-turnssmall. - Hook (
hooks/identify-image.sh) testing: unit-test by piping a JSON payload ({"tool_input":{"command":"…"},"cwd":"…"}) to the script and checking the emitted JSON — the smoke test does this for six cases. For end-to-end:--plugin-dirdoes load plugin hooks, but--permission-mode acceptEditsdoes not auto-approve Bash, so the tested command never runs — add--allowedTools "Bash"to let it execute (do not use--permission-mode bypassPermissions; the auto-mode classifier blocks headless bypass loops). PostToolUse hooks do not emithook_started/hook_responseevents intostream-json(only SessionStart does), so confirm firing with a side-effect (a marker file), not by grepping the transcript. - Verify documented commands against the real binary before committing — this machine has ImageMagick 7.1.2 Q16-HDRI (Nix). GraphicsMagick is not installed, but
gm-and-im6.mdclaims can be (and were, v0.2: GM 1.3.47 Q8) verified vianix shell nixpkgs#graphicsmagick.
Upstream references
- Command-line options: https://imagemagick.org/command-line-options/
- Usage examples: https://imagemagick.org/examples/
- GraphicsMagick: http://www.graphicsmagick.org/utilities.html
Note: third-party script collections (e.g. fmwconcepts) carry restrictive licenses —
do not reference, vendor, or port them in plugin content. Effects ship as original
IM7 implementations in skills/imagemagick/scripts/, verified locally.
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
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.

