一键导入
image-optimize
Optimize PNG and JPEG images locally using pngquant and mozjpeg/jpegtran — TinyPNG-level compression without API keys.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Optimize PNG and JPEG images locally using pngquant and mozjpeg/jpegtran — TinyPNG-level compression without API keys.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | image-optimize |
| description | Optimize PNG and JPEG images locally using pngquant and mozjpeg/jpegtran — TinyPNG-level compression without API keys. |
| version | 1.0.0 |
Compress PNG and JPEG images locally. Achieves 60–80% size reduction with no visible quality loss.
brew install pngquant mozjpeg
Verify:
pngquant --version # 3.0.3+
/opt/homebrew/opt/mozjpeg/bin/jpegtran -version
# Single file, overwrite in place
pngquant --quality=75-90 --speed=1 --force --output image.png image.png
# All PNGs in a directory
for f in /path/to/dir/*.png; do
before=$(stat -f%z "$f")
pngquant --quality=75-90 --speed=1 --force --output "$f" "$f"
after=$(stat -f%z "$f")
pct=$(( (before - after) * 100 / before ))
echo "$f: $(( before/1024 ))KB → $(( after/1024 ))KB (-${pct}%)"
done
| Use case | --quality |
|---|---|
| Blog covers, hero images | 75-90 |
| Product/portfolio (high quality) | 85-95 |
| Thumbnails, icons | 65-80 |
JPEGTRAN=/opt/homebrew/opt/mozjpeg/bin/jpegtran
# Single file
$JPEGTRAN -copy none -optimize -progressive -outfile output.jpg input.jpg
# All JPEGs in a directory, overwrite in place
for f in /path/to/dir/*.jpg /path/to/dir/*.jpeg; do
[ -f "$f" ] || continue
before=$(stat -f%z "$f")
$JPEGTRAN -copy none -optimize -progressive -outfile "$f.tmp" "$f" && mv "$f.tmp" "$f"
after=$(stat -f%z "$f")
pct=$(( (before - after) * 100 / before ))
echo "$f: $(( before/1024 ))KB → $(( after/1024 ))KB (-${pct}%)"
done
#!/bin/bash
# Usage: optimize-images.sh /path/to/dir
DIR="${1:-.}"
JPEGTRAN=/opt/homebrew/opt/mozjpeg/bin/jpegtran
total_before=0; total_after=0
for f in "$DIR"/*.png "$DIR"/*.PNG; do
[ -f "$f" ] || continue
before=$(stat -f%z "$f")
pngquant --quality=75-90 --speed=1 --force --output "$f" "$f"
after=$(stat -f%z "$f")
total_before=$((total_before + before))
total_after=$((total_after + after))
echo "PNG $f: $(( before/1024 ))KB → $(( after/1024 ))KB (-$(( (before-after)*100/before ))%)"
done
for f in "$DIR"/*.jpg "$DIR"/*.jpeg "$DIR"/*.JPG "$DIR"/*.JPEG; do
[ -f "$f" ] || continue
before=$(stat -f%z "$f")
$JPEGTRAN -copy none -optimize -progressive -outfile "$f.tmp" "$f" && mv "$f.tmp" "$f"
after=$(stat -f%z "$f")
total_before=$((total_before + before))
total_after=$((total_after + after))
echo "JPEG $f: $(( before/1024 ))KB → $(( after/1024 ))KB (-$(( (before-after)*100/before ))%)"
done
if [ $total_before -gt 0 ]; then
echo ""
echo "Total: $(( total_before/1024 ))KB → $(( total_after/1024 ))KB (-$(( (total_before-total_after)*100/total_before ))%)"
fi
| Format | Average reduction |
|---|---|
| PNG (pngquant lossy) | 60–75% |
| JPEG (jpegtran lossless) | 5–20% |
| JPEG (cjpeg lossy) | 30–60% |
--output equals input — use --force flag.stat -f%z gives file size in bytes (Linux uses stat -c%s).Analyze prompt cache hit rates, estimate cost savings from cached system prompts and memories, and recommend improvements to caching strategy. Use when checking cache performance, investigating high token costs, optimizing cache hit rates, or diagnosing slow cache warmup.
Manage Serena memories and session context — load, save, refresh, inspect, and clear project knowledge
Initialize Claude Code optimization for a new project — detect stack, create memories, generate constitution, configure settings
Reduce token usage by selecting a planning strategy, loading Serena memories, enforcing symbol-first exploration, and reporting savings. Use when starting a non-trivial task, asking to reduce token costs, requesting efficient execution, or wanting optimized Claude Code workflows.
Search the web for latest Claude API changes, compare findings to existing documentation, and apply targeted updates to keep prompts and configs current. Use when docs are outdated, after a Claude API update, to refresh system prompts, or to validate documentation accuracy.
Close the loop on a skill/prompt/convention library: mine recurring review feedback into rules, fold them back into the generator, and gate every change through a three-tier evaluation (deterministic lint + trigger accuracy + LLM judge) that converges instead of drifting. Use when a correction keeps recurring across skills/PRs, when adding or revising skills warrants a quality gate, or when asked to "harden the skill library", "run the eval", "lint skills", or "close the loop". Composes with your existing execution, memory, and governance layers.