agentleFS
MarkusBittermanMarkusBitterman/claude-imagemagick-plugin/CLAUDE.md

claude-imagemagick-plugin

CLAUDE.md0 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…

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
  1. Very specific:

    IM7 syntax first: All examples use magick (never bare convert).

    line 36
  2. Distinctive:

    Verify documented commands against the real binary before committing — this machine has ImageMagick 7.1.2 Q16-HDRI (Nix).

    line 51

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 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.

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

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 features

Conventions

  • Skill format: skills/<name>/SKILL.md only. Do not add a commands/ directory — that layout is legacy per the example-plugin.
  • Model-invoked skills need description frontmatter 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 in references/, with a one-line pointer from SKILL.md.
  • IM7 syntax first. All examples use magick (never bare convert). GM/IM6 differences live only in gm-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.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 /img works.
  • 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-json output for the Agent tool_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 -p runs at plan approval). Keep --max-turns small.
  • 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-dir does load plugin hooks, but --permission-mode acceptEdits does 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 emit hook_started/hook_response events into stream-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.md claims can be (and were, v0.2: GM 1.3.47 Q8) verified via nix shell nixpkgs#graphicsmagick.

Upstream references

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.

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.