name: image-processing description: Validate SVG inputs and convert svg/png/jpg/jpeg/webp inputs to png/webp/jpg
Image Processing
Translate a user’s natural-language request into a safe invocation of the image-processing CLI.
Contract
Prereqs:
- Run inside a git work tree (recommended; enables stable
out/paths). image-processingavailable onPATH(install viabrew install nils-cli).- No external image binaries required for standard use.
Inputs:
- Natural-language user intent (assistant translates into a command).
- Exactly one operation:
convert:--in <path>+--to png|webp|jpg+--out <file>; acceptssvg|png|jpg|jpeg|webpinputssvg-validate: exactly one--in <path>+--out <file.svg>
- Optional sizing for raster convert output:
--width/--height. - Optional output controls:
--overwrite,--dry-run,--json,--report.
Outputs:
- One requested output file per successful non-dry-run invocation.
- Optional artifacts under
out/image-processing/runs/<run_id>/:summary.json(when--jsonor--reportis used)report.md(when--reportis used)
- Assistant response (outside the script) must include:
- Output file/folder paths as clickable markdown file links
- A suggested “next time” prompt to repeat the same task
Exit codes:
0: success1: failure2: usage error
Failure modes:
- Missing required tool (
image-processingbinary). - Invalid or ambiguous flags (missing required params, unsupported combinations).
- Output already exists without
--overwrite. - Invalid convert contract:
- missing
--in/--to/--out - repeated
--in --outextension mismatch vs--to(.jpegis valid for--to jpg)- unsupported target format
- unsupported input format
- invalid
--width/--heightvalues
- missing
- Invalid
svg-validatecontract:- missing or repeated
--in - missing
--out - convert-only flags like
--to/--width/--height
- missing or repeated
Guidance
Preferences (optional; honor when provided)
- Operation:
convertorsvg-validate. - Target format (for
convert):png/webp/jpg. - Raster sizing (for
convert):--width,--height. - Reproducibility/audit flags:
--dry-run,--json,--report,--overwrite. - Output extension detail (for
--to jpg):.jpgor.jpeg. - JPG background behavior: transparent pixels are flattened onto white.
Policies (must-follow per request)
If underspecified enough to block a valid
image-processingcommand: ask must-have questions first- Follow the blocking-question format in
skills/workflows/conversation/requirements-gap-scan/SKILL.md. - Ask 1-5 "Need to know" questions with explicit defaults.
- Do not run commands until the user answers or explicitly approves assumptions.
- Follow the blocking-question format in
Single entrypoint (do not bypass)
- Only run:
image-processing(fromPATH; install viabrew install nils-cli) - Do not call ImageMagick binaries directly unless debugging the
image-processingCLI itself.
- Only run:
Contract gate (exactly one operation path)
convert: require exactly one--in, plus--toand--out.convert: acceptsvg|png|jpg|jpeg|webpinputs; require--outextension to match--to(.jpegallowed for--to jpg).svg-validate: require exactly one--inand--out; forbid--to/--width/--height.
Completion response (fixed)
- After a successful run, respond using:
skills/tools/media/image-processing/references/ASSISTANT_RESPONSE_TEMPLATE.md
- Include clickable markdown file links and a one-sentence “next prompt” that repeats the same task with concrete paths/options.
- After a successful run, respond using:
References
skills/tools/media/image-processing/references/IMAGE_PROCESSING_GUIDE.mdskills/tools/media/image-processing/references/ASSISTANT_RESPONSE_TEMPLATE.md