baoyu-compress-image

仓库创建 2026年1月13日最近提交 24 天前SkillHot 收录 22 天前
▸ 精选理由

能自动沿用可用本地工具链进行无损/有损压缩,适合站点与发布流程的图片优化。

▸ 风险提示

会调用本地二进制工具或安装运行时依赖,需注意执行权限与外部下载安装。

这个 Skill 做什么

自动选择最佳工具(sips/cwebp/ImageMagick/Sharp)将图片压缩为 WebP 或 PNG,优化体积。

自动挑选最合适的工具(sips、cwebp、ImageMagick、Sharp)把图片压成 WebP(默认)或 PNG,最大限度缩小体积同时保留画质。适合想把图片优化到网页或应用里以提升加载速度、节省带宽时使用。特点是按环境自动选工具,无需你记命令行也能得到高效的压缩结果。

▸ 展开 SKILL.md 英文原文

Compresses images to WebP (default) or PNG with automatic tool selection. Use when user asks to "compress image", "optimize image", "convert to webp", or reduce image file size.

开发编程图片压缩WebP自动降级通用
2.4w
Stars
2.7k
Forks
22
仓库内 Skill
+1.1k
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/JimLiu/baoyu-skills/main/skills/baoyu-compress-image/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/JimLiu/baoyu-skills/main/skills/baoyu-compress-image/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Image Compressor

Compresses images using best available tool (sips → cwebp → ImageMagick → Sharp).

## Script Directory

Scripts in `scripts/` subdirectory. `{baseDir}` = this SKILL.md's directory path. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun. Replace `{baseDir}` and `${BUN_X}` with actual values.

| Script | Purpose |
|--------|---------|
| `scripts/main.ts` | Image compression CLI |

## Preferences (EXTEND.md)

Check EXTEND.md in priority order — the first one found wins:

| Priority | Path | Scope |
|----------|------|-------|
| 1 | `.baoyu-skills/baoyu-compress-image/EXTEND.md` | Project |
| 2 | `${XDG_CONF
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有