AGENT SKILL

image-pipeline

Image optimization — compress, convert WebP/AVIF, resize, describe. Single-file atomic edits, batch processing, metadata extraction.

使用场景图像与多媒体
License 许可
Apache-2.0
最近更新
2026-11-10
Stars
★ 0
Forks
0

01 前言 Front Matter

name
image-pipeline
triggers
compress, convert WebP/AVIF, resize, describe
changelog
docs/ciclos/cycle28-20260816.md
description
Image optimization — compress, convert WebP/AVIF, resize, describe. Single-file atomic edits, batch processing, metadata extraction.
token_budget
2947

03 SKILL.md 正文

When to Use

Image optimization — compress, convert WebP/AVIF, resize, describe. Single-file atomic edits, batch processing, metadata extraction. NOT: visual regression (visual-testing) · LLM image description of UI screens (vision-analyze) · page screenshot capture (visual-testing).

Pipeline Stages

Input → [Validate] → [Transform] → [Optimize] → [Verify] → Output
Stage Tools Purpose
Validate file, identify (ImageMagick) MIME, dimensions, corruption check
Transform magick convert, cwebp, avifenc Resize, format convert, color space
Optimize mozjpeg, oxipng, svgo Lossless/lossy compression
Verify compare (SSIM/PSNR), identify Quality gates, regression detection

Hard Rules

  • Match format: WebP (lossy photo) / AVIF (high crunch) / PNG (lossless) / SVG (vector)
  • Preserve aspect ratio: no upscale beyond source
  • Strip EXIF metadata unless describe needs it
  • Responsive width units only; no hardcoded w/h px
  • Quality gate: SSIM/PSNR >= 0.95 vs source; reject on regression

Output

IMG-PIPELINE:<file> STATUS:<ok|warn|error> FORMAT:<fmt> SIZE:<before->after> RATIO:<pct> CHANGES:<n>

Anti-Patterns

Upscaling beyond source | hardpx width on responsive | metadata not stripped | lossy on SVG | no SSIM gate | missing alt-text

Anti-Rationalization

Rationalization Red Flag Verification
"WebP sin fallback" Solo WebP sin <picture> srcset <picture> AVIF→WebP→PNG + srcset + fallback verify
"Describir imágenes con inventado" alt inventado sin metadata Strip EXIF unless needed; describe desde metadata + SSIM≥0.95
"Batch sin atomic edits" Batch sobrescribe sin verify Single-file atomic + compare SSIM/PSNR ≥0.95 gate

Red Flags

  • Doing work without checking output format → STOP, re-read skill
  • Second occurrence of same rationalization → force RED zone

Verification

  • Output matches skill ## Output contract + file:line citaton
  • cross-ref-check.ps1 → SKILL.md OK

Cross-Refs: visual-testing | vision-analyze | web-quality-audit | performance

Verification

  • Output: response matches the ## Output contract format exactly
  • token_budget: total tokens within frontmatter token_budget
  • frontmatter: name, description, triggers, token_budget present and stable
  • cross-refs: each referenced skill exists
  • anti-patterns: none of the listed anti-patterns reintroduced

See reference.md for extended details, examples, and detailed patterns.

04 同仓库更多 Skills