agentleFS
danielrosehilldanielrosehill/Claude-Image-Production-Plugin/skills/install-deps/SKILL.md

install-deps

Skill21 starsChanged 7 days agoMITView on GitHub

Provision the plugin's tools — system binaries via the host package manager, Python tools into a plugin-owned uv venv at <data-dir>/venv/. Idempotent doctor — run before any command reports a missing dep. Never touches system Python or fights PEP 668.

  • Pipes a download into a shell
  • Installs packages

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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:

    Ask before running. Fall back to system pip with --break-system-packages only if the user declines — prefer uv.

    line 44
  2. Very specific:

    If <VENV_DIR> doesn't exist:

    line 72
  3. Distinctive:

    If it exists, leave it.

    line 78
  4. Very specific:

    If cairosvg import fails at runtime with a libcairo error, prompt the user to install the system lib: sudo apt install libcairo2 (Linux) / …

    line 99
  5. Distinctive:

    After installs, re-run the detect commands and report a green/red status table per tool.

    line 103

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

Install Dependencies

Two surfaces:

  1. System binaries — required: ImageMagick, exiftool. Optional: libvips-tools, libheif-examples, oxipng, pngquant, jpegoptim, mozjpeg, libavif-bin, libjxl-tools, realesrgan-ncnn-vulkan, darktable-cli.
  2. Python tools — imagehash, Pillow (perceptual dedupe). Installed into a plugin-owned uv venv at <data-dir>/venv/.

The plugin invokes Python via <data-dir>/venv/bin/python, so the user's system Python stays untouched and PEP 668 / externally-managed-environment errors never occur.

Resolve paths

PLUGIN_DATA_DIR="${CLAUDE_USER_DATA:-${XDG_DATA_HOME:-$HOME/.local/share}/claude-plugins}/image-production"
VENV_DIR="$PLUGIN_DATA_DIR/venv"

Procedure

1. Detect host

uname -s
which apt-get apt brew dnf pacman 2>/dev/null
which uv 2>/dev/null

Record what's available; this drives which install commands you propose.

2. Ensure uv is available

uv is the only hard prerequisite for the Python side. If missing, propose:

curl -LsSf https://astral.sh/uv/install.sh | sh

Ask before running. Fall back to system pip with --break-system-packages only if the user declines — prefer uv.

3. Walk the system-binary matrix

ToolDetectRequired?Install (apt)Install (brew)
magick / convert / identifywhich magick || which convertrequiredsudo apt install imagemagickbrew install imagemagick
exiftoolwhich exiftoolrequiredsudo apt install libimage-exiftool-perlbrew install exiftool
fdupeswhich fdupesoptionalsudo apt install fdupesbrew install fdupes
vips / vipsthumbnailwhich vipsoptional (recommended >500 images)sudo apt install libvips-toolsbrew install vips
heif-convertwhich heif-convertoptionalsudo apt install libheif-examplesbrew install libheif
oxipngwhich oxipngoptionalsudo apt install oxipngbrew install oxipng
pngquantwhich pngquantoptionalsudo apt install pngquantbrew install pngquant
jpegoptimwhich jpegoptimoptionalsudo apt install jpegoptimbrew install jpegoptim
mozjpeg (cjpeg-mozjpeg)which cjpeg-mozjpegoptionalcargo install mozjpeg-cli (or binary)brew install mozjpeg
avifencwhich avifencoptionalsudo apt install libavif-binbrew install libavif
cjxl / djxlwhich cjxloptionalsudo apt install libjxl-toolsbrew install jpeg-xl
upscayl-binwhich upscayl-bin || ls /opt/Upscayl/resources/bin/upscayl-bin 2>/dev/nulloptionalinstall Upscayl from https://upscayl.org (deb / flatpak / appimage)install Upscayl from https://upscayl.org
realesrgan-ncnn-vulkan (fallback)which realesrgan-ncnn-vulkanoptionalbinary release from upstreambinary release from upstream
darktable-cliwhich darktable-clioptionalsudo apt install darktable (GUI + CLI)brew install darktable
img2pdfwhich img2pdfoptionaluv tool install img2pdf (or sudo apt install python3-img2pdf)pipx install img2pdf

For each: if missing, stage the install command tagged required/optional. Required tools that are missing block the install — surface that clearly.

realesrgan-ncnn-vulkan and mozjpeg are not in apt — for those, point the user at the upstream releases page rather than auto-downloading. Ask before placing binaries under ~/bin/.

4. Provision the venv

If <VENV_DIR> doesn't exist:

uv venv "$VENV_DIR" --python 3.11

If it exists, leave it.

5. Install Python packages into the venv

PackageRequired?Used by
Pillowrequireddedupe (perceptual), inspection
imagehashrequireddedupe (perceptual)
numpyrequired (Pillow/imagehash dep)dedupe
cairosvgoptionalsvg-to-raster (SVG → PNG/PDF). Needs system libcairo2 (preinstalled on most Linux/macOS).
vtraceroptionalvectorize (raster → SVG). Self-contained wheel (bundled Rust binary).

Stage:

source "$VENV_DIR/bin/activate"
uv pip install Pillow imagehash numpy
# Optional — only if user wants SVG conversion / vectorization:
uv pip install cairosvg vtracer

If cairosvg import fails at runtime with a libcairo error, prompt the user to install the system lib: sudo apt install libcairo2 (Linux) / brew install cairo (macOS).

6. Verify

After installs, re-run the detect commands and report a green/red status table per tool. Surface install commands the user still needs to run themselves (sudo, cargo).

Output

Single status report:

  • Required system bins: present / missing.
  • Optional system bins: present / missing (with one-line reason to install each).
  • Venv: provisioned at <VENV_DIR>, Python <version>.
  • Python packages: installed.

Refuse to mark "OK" if any required tool is missing.

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.