---
name: "sharp-image-processing-pipeline"
description: "Resize, crop, transcode, and optimize raster images at extreme speed with libvips Sharp."
metadata:
  author: "Lovell Fuller"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "resize image with sharp"
  - "convert png to webp sharp"
  - "compress jpeg image sharp"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Sharp High-Speed Image Processing Pipeline

Processes high-volume image assets in Node.js using Sharp: resizing (cover, contain), format transcoding (AVIF, WebP), metadata stripping, progressive JPEG encoding, and color quantization.

## When to Invoke
Invoke this skill whenever you need to:
- resize image with sharp
- convert png to webp sharp
- compress jpeg image sharp

## Execution SOP & Rules
1. Process images via streams or buffers: sharp(inputBuffer).resize(800, 600, { fit: 'inside' }).webp({ quality: 80 }).toBuffer().
2. Strip private metadata using .withMetadata({ orientation: undefined }) or omitting .withMetadata() entirely.
3. Use .toFormat('avif', { effort: 4, quality: 75 }) for maximum compression efficiency.
4. Handle animated GIFs/WebPs with sharp(buffer, { animated: true }).

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
