image-compress

图片压缩检查规则。当添加或修改 README 引用的图片时自动触发。检查图片是否超过 100KB,超出则压缩。推荐使用 avif/webp 格式。触发场景:添加新图片到仓库、更新 README 中的截图、发版前检查。

11 stars

Best use case

image-compress is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

图片压缩检查规则。当添加或修改 README 引用的图片时自动触发。检查图片是否超过 100KB,超出则压缩。推荐使用 avif/webp 格式。触发场景:添加新图片到仓库、更新 README 中的截图、发版前检查。

Teams using image-compress should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/image-compress/SKILL.md --create-dirs "https://raw.githubusercontent.com/congwa/mobile-agent/main/.windsurf/skills/image-compress/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/image-compress/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How image-compress Compares

Feature / Agentimage-compressStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

图片压缩检查规则。当添加或修改 README 引用的图片时自动触发。检查图片是否超过 100KB,超出则压缩。推荐使用 avif/webp 格式。触发场景:添加新图片到仓库、更新 README 中的截图、发版前检查。

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Image Compress

README 引用的图片不得超过 **100KB**。

## 检查规则

1. 扫描 README.md 中所有 `![](path)` 引用的图片文件
2. 检查每个文件大小,超过 100KB 的必须压缩
3. 推荐格式优先级:**avif > webp > png > jpg**

## 检查命令

```bash
# 查找 docs/ 和 images/ 下超过 100KB 的图片
find docs/ images/ -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" -o -name "*.webp" -o -name "*.avif" -o -name "*.gif" \) -size +100k
```

## 压缩方式

### macOS 内置 sips(png/jpg)

```bash
# 缩小尺寸(保持宽度 1200px 以内)
sips --resampleWidth 1200 image.png

# 转为 jpg 并降低质量
sips -s format jpeg -s formatOptions 80 image.png --out image.jpg
```

### ffmpeg(推荐,支持 avif/webp)

```bash
# png → avif(推荐,体积最小)
ffmpeg -i input.png -c:v libaom-av1 -crf 30 -still-picture 1 output.avif

# png → webp
ffmpeg -i input.png -quality 80 output.webp

# 批量转换
for f in docs/screenshots/*.png; do
  ffmpeg -i "$f" -c:v libaom-av1 -crf 30 -still-picture 1 "${f%.png}.avif"
done
```

### 使用 scripts/check_compress.sh

```bash
bash .windsurf/skills/image-compress/scripts/check_compress.sh
```

## 压缩后

1. 更新 README.md 中的图片路径(扩展名可能变化)
2. 删除旧的大图片文件
3. 确认所有图片 < 100KB

Related Skills

readme-images

11
from congwa/mobile-agent

Handle README.md image references for GitHub and Gitee platforms. Use when writing or converting README.md files that contain images, ensuring correct image paths for each platform. GitHub READMEs use Qiniu cloud URLs (via qiniu-upload skill), Gitee READMEs use local relative image paths.

web-design-guidelines

11
from congwa/mobile-agent

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

vercel-react-best-practices

11
from congwa/mobile-agent

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

ui-ux-pro-max

11
from congwa/mobile-agent

Comprehensive design guide for web and mobile applications. Contains 67 styles, 96 color palettes, 57 font pairings, 99 UX guidelines, and 25 chart types across 13 technology stacks. Searchable database with priority-based recommendations.

theme-factory

11
from congwa/mobile-agent

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

tailwindcss

11
from congwa/mobile-agent

Tailwind CSS v4 utility-first styling patterns including responsive design, dark mode, and custom configuration. Use when styling with Tailwind, adding utility classes, configuring Tailwind, setting up dark mode, or customizing the theme.

skill-creator

11
from congwa/mobile-agent

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.

run-tests

11
from congwa/mobile-agent

后端代码测试验证规则。此技能在以下情况下自动触发: - 任何后端代码修改(backend/ 目录下的 .py 文件) - 新增功能开发 - Bug 修复 - 代码重构 核心原则: 1. 后端代码修改必须有对应的测试用例 2. 修改业务逻辑时必须同步更新相关测试用例 3. 测试全部通过才算功能完成 触发关键词:后端、backend、python、测试、test、pytest、功能、feature、修复、fix、实现、修改、完成、验证 alwaysApply: true

release

11
from congwa/mobile-agent

发版流程 - 仔细阅读上个版本到现在版本的内容,把更改功能放到项目CHANGELOG.md目录下,处理README图片引用,然后提交且推送所有源码到GitHub和Gitee双平台,再之后打tag 触发条件:用户要求发版、发布、release、打tag

qiniu-upload

11
from congwa/mobile-agent

Upload images to Qiniu Cloud (七牛云) via local PicList/PicGo service and return the public access URL. Use when the user needs to upload images, screenshots, or any picture files to Qiniu cloud storage, get image hosting URLs, or publish images to http://qiniu.biomed168.com/pic/.

mobile-automation

11
from congwa/mobile-agent

Mobile MCP + 飞书 MCP 双协作自动化测试专家。

frontend-design

11
from congwa/mobile-agent

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.