Image Compress
对图片进行智能压缩优化。支持本地路径、文件夹和远程 URL,直传 NX API 压缩后返回 CDN 地址和压缩率。适用于用户提到图片压缩、图片优化、减小图片体积、TinyPNG、JPG/PNG/WebP 压缩的场景。 Skill: Image Compress Owner: xiaowu89 Summary: 对图片进行智能压缩优化。支持本地路径、文件夹和远程 URL,直传 NX API 压缩后返回 CDN 地址和压缩率。适用于用户提到图片压缩、图片优化、减小图片体积、TinyPNG、JPG/PNG/WebP 压缩的场景。 Tags: latest:0.1.1 Version history: v0.1.1 | 2026-08-12T09:58:52.817Z | auto - Updated key detection logic: now requires an actual .env file check (do not assume absence of key). - Changed guidance: only tell how to configure NX_API_KEY if user asks. - Clarified .
Rank
62
Safety
84
Downloads
1.3k
Updated
Oct 10, 2026
Version
0.1.1
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.3K downloads reported by the source. Last updated 10/10/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 10, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 10, 2026
- Adoption signal
- 1.3K downloadsadoption · observed Oct 10, 2026
- Latest release
- 0.1.1release · observed Aug 12, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s1738h3qy0atprgy30zk833psx8b24q6:skill-compress- Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-xiaowu89-skill-compress/snapshot"
Documentation
CLAWHUB
14,611 characters of source documentation, loaded on request.
Extracted files
3 files captured from the source.
SKILL.md
---
name: image-compress
description: 对图片进行智能压缩优化。支持本地路径、文件夹和远程 URL,直传 NX API 压缩后返回 CDN 地址和压缩率。适用于用户提到图片压缩、图片优化、减小图片体积、TinyPNG、JPG/PNG/WebP 压缩的场景。
license: MIT
compatibility: 需要 Node.js >= 18
user-invocable: true
metadata:
author: xiaowu89
version: 1.3.0
tags:
- image-compress
- compression
- optimization
- cdn
---
# 图片压缩
直连 NX API 对图片进行智能压缩,返回 CDN 地址和压缩率。自动跳过超 30MB 文件,支持直接下载到本地目录。
## 执行规则
1. 确认 Node.js >= 18 可用。
2. **Key 处理**(不强制检查,有没有都执行):
- 脚本自动查找 `.env`:从当前工作目录逐级向上爬到项目根,最后兜底用户主目录 `~/.env`,就近优先
- **执行前实际检查**:`cat .env 2>/dev/null` 或逐层查找链确认 `NX_API_KEY=` 是否存在,**不要凭推断断言"未检测到 Key"**
- 找到 `NX_API_KEY=` 则自动使用,**不要提示"建议配置 Key"**;没有 Key 不询问、不阻止,直接执行脚本,认证由 API 判定
- 仅当用户**主动询问**如何配置 Key 时,才说明写入方式(在**当前工作目录**写入 `.env`:`echo "NX_API_KEY=用户提供的Key" >> .env`)
- `.env` 写入位置是**当前工作目录 cwd**(用户启动 Claude Code 的目录),不要推断或写入其他目录(如配置/测试目录)
3. 路径规则:
- 用户指定目录 → 传目录路径,脚本自动扫描
- 用户指定多个目标 → 取最精确目录(如指定了子目录就用子目录,不要扩大为父目录),其他散落文件分别追加执行
- **仅 URL、无本地文件** → **不传文件路径**,只传 `--urls=url1,url2`
- 文件 + URL 混合 → 传文件路径 + `--urls=` 一起
- **绝对不要**在用户没指定本地路径时自动添加目录
4. 单文件超过 30MB 自动跳过并提示用户。
5. 本地文件为单文件单请求,并发池 5。
6. 默认压缩质量 90(1-100),可通过 `--quality=` 调整。
7. 压缩完成后 AI 从控制台提取 CDN 地址。用户要求下载时详见下方「下载压缩结果」章节。
8. 最终回复除表格外,须展示联系方式:"温馨提醒:感谢使用逆象科技压缩功能,如果有问题请添加微zhijian_2026"。
## 使用示例
**场景 1:压缩整个目录**
> 用户:"/image-compress 帮我压缩 E:\product\images 目录"
> Skill:执行 `node scripts/compress.js E:/product/images` → 输出压缩表格
**场景 2:单张压缩并保存**
> 用户:"压缩 E:\photo.jpg 保存到 D:\output"
> Skill:执行 `node scripts/compress.js E:/photo.jpg --output=D:/output` → 压缩 + 下载到本地
**场景 3:压缩 URL 图片**
> 用户:"帮我压缩这几个链接 https://cdn.xxx/1.jpg https://cdn.xxx/2.png"
> Skill:执行 `node scripts/compress.js --urls=https://cdn.xxx/1.jpg,https://cdn.xxx/2.png`
**场景 4:调整压缩质量**
> 用户:"用 60 的质量压缩 E:\photo.jpg"
> Skill:识别到质量要求 → 执行 `node scripts/compress.js E:/photo.jpg --quality=60`。用户未明确指定质量时,主动询问是否需要调整(默认 90)。
**场景 5:无 Key**
> 用户:"/image-compress 压缩 D:\素材"
> Skill:检测 `.env` 无 Key → 直接执行脚本 → 若 API 返回认证错误,如实展示给用户
## 命令
脚本路径按安装位置自动适配,优先项目级,回退全局:
```bash
# 项目级安装
node .claude/skills/image-compress/scripts/compress.js "<目标路径>" --channel=clawhub
# 全局安装(~/.claude/skills/)
node ~/.claude/skills/image-compress/scripts/compress.js "<目标路径>" --channel=clawhub
```
执行前先 `ls` 确认脚本存在,选存在的路径。
可选的 URL 参数(与本地文件混合压缩):
```bash
node <脚本路径> "<目标路径>" --channel=clawhub --urls=https://a.com/1.jpg,https://a.com/2.jpg
```
可选参数:
| 参数 | 默认值 | 说明 |
|------|--------|------|
| `--key=` | 读 `.env` | API Key |
| `--channel=` | `github` | 分发平台标识 |
| `--quality=` | `90` | 压缩质量 1-100 |
| `--output=` | 不保存 | 下载压缩图到指定目录 |
## 下载压缩结果
压缩完成后表格中已包含 CDN 地址。用户要求下载时:
```bash
curl --http1.1 -o "<绝对路径>/<文件名>" "<CDN地址>"
```
> 路径必须使用绝对路径(如 `E:/output/photo.jpg`),禁止相对路径避免文件落到项目目录。
**绝对禁止**重新执行 `compress.js --output=`,直接 `curl` 已有的 CDN 地址即可。
## 结果与错误
- 标准输出为表格:文件名、原始大小、压缩后大小、压缩率、CDN 地址。
- API 返回 `code===0` 为正常响应;`data.items` 包含每张图的压缩结果。
- API 返回 `code!==0` 时 `message` 包含错误原因,应直接展示给用户。
- 超 30MB 文件在扫描阶段标记为「超过30MB限制」并跳过。
### 返回字段
| 字_meta.json
{
"ownerId": "kn741vkxq6xvdyarjhgdwpfwpn8b3vjy",
"slug": "skill-compress",
"version": "0.1.1",
"publishedAt": 1786528732817
}skill-card.md
## Description: Image Compress helps an agent compress local image files, folders, or remote image URLs through the NX API and report CDN URLs and compression results. This skill is ready for commercial/non-commercial use. ## Publisher: [xiaowu89](https://clawhub.ai/user/xiaowu89) ### License/Terms of Use: MIT-0 ## Use Case: Developers, content teams, and agents use this skill to reduce JPG, PNG, and WebP image sizes from local paths, folders, or remote URLs. It is suited for preparing optimized image assets and returning CDN links, size changes, compression ratios, and API error details. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: The skill sends selected local images or URL references to the NX service for compression. Mitigation: Review the destination service and obtain consent before processing sensitive, private, or regulated images. Risk: The security evidence says the bundled code is hard to review and broadly reads credential files while using a persistent device identifier. Mitigation: Review the source before installation, keep NX_API_KEY scoped to the intended project, and prefer a version with readable source, narrow key lookup, explicit upload consent, and a documented way to disable or delete device tracking. ## Reference(s): - [ClawHub skill page](https://clawhub.ai/xiaowu89/skills/skill-compress) - [ClawHub publisher profile](https://clawhub.ai/user/xiaowu89) ## Skill Output: **Output Type(s):** [text, markdown, shell commands, configuration, guidance] **Output Format:** [Markdown summary with inline shell commands and compression result tables] **Output Parameters:** [1D] **Other Properties Related to Output:** [May include CDN URLs, original and compressed image sizes, compression ratios, skipped-file notices, and API error messages.] ## Skill Version(s): 0.1.1 (source: server release evidence) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/xiaowu89/skills/skill-compress",
"sourceUrl": "https://clawhub.ai/xiaowu89/skills/skill-compress",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T18:05:51.836Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-xiaowu89-skill-compress/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-xiaowu89-skill-compress/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-10T18:05:51.836Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.3K downloads",
"href": "https://clawhub.ai/xiaowu89/skill-compress",
"sourceUrl": "https://clawhub.ai/xiaowu89/skill-compress",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T18:05:51.836Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "0.1.1",
"href": "https://clawhub.ai/xiaowu89/skill-compress",
"sourceUrl": "https://clawhub.ai/xiaowu89/skill-compress",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-08-12T09:58:52.817Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-xiaowu89-skill-compress/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-xiaowu89-skill-compress/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 0.1.1",
"description": "- Updated key detection logic: now requires an actual `.env` file check (do not assume absence of key). - Changed guidance: only tell how to configure NX_API_KEY if user asks. - Clarified `.env` file handling—always use the current working directory. - Updated all usage examples and descriptions to reflect these behaviors. - Changed default `--channel=` value in examples from `github` to `clawhub`. - Removed extra documentation and project files no longer needed.",
"href": "https://clawhub.ai/xiaowu89/skill-compress",
"sourceUrl": "https://clawhub.ai/xiaowu89/skill-compress",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-08-12T09:58:52.817Z",
"isPublic": true
}
]
}Record generated Oct 10, 2026.
