{"id":"8286c1be-8081-42bf-acb2-47687095c103","entityType":"agent","slug":"clawhub-xiaowu89-skill-compress","name":"Image Compress","canonicalUrl":"https://www.xpersona.co/agent/clawhub-xiaowu89-skill-compress","canonicalPath":"/agent/clawhub-xiaowu89-skill-compress","generatedAt":"2026-10-10T21:44:11.184Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-10T18:05:51.836Z","emptyReason":null},"description":"对图片进行智能压缩优化。支持本地路径、文件夹和远程 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 .","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.3K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s1738h3qy0atprgy30zk833psx8b24q6:skill-compress","sourceUrl":"https://clawhub.ai/xiaowu89/skill-compress","homepage":"https://clawhub.ai/xiaowu89/skills/skill-compress","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/xiaowu89/skill-compress","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/xiaowu89/skills/skill-compress","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":62,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"对图片进行智能压缩优化。支持本地路径、文件夹和远程 URL，直传 NX API 压缩后返回 CDN 地址和压缩率。适用于用户提到图片压缩、图片优化、减小图片体积、TinyPNG、JPG/PNG/WebP 压缩的场景。 Skill: Image Compress Owner: xiaowu89 Summary: 对图片进"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T18:05:51.836Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T18:05:51.836Z","emptyReason":null},"stars":null,"forks":null,"downloads":1304,"packageName":null,"latestVersion":"0.1.1","tractionLabel":"1.3K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T18:05:51.835Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T18:05:51.836Z","lastCrawledAt":"2026-10-10T18:05:51.835Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T18:05:51.835Z","lastVerifiedAt":null,"highlights":[{"version":"0.1.1","createdAt":"2026-08-12T09:58:52.817Z","changelog":"- 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.","fileCount":4,"zipByteSize":11431},{"version":"0.1.0","createdAt":"2026-08-06T13:22:05.025Z","changelog":"- Initial public release of image-compress skill. - Provides intelligent image compression via NX API for local files, folders, and remote URLs. - Returns CDN addresses and compression ratios; skips files over 30MB. - Supports mixed compression (local/URL), adjustable quality, and direct download. - Node.js >=18 required; automatically handles .env and API Key logic. - Displays contact info after job completion for user support.","fileCount":7,"zipByteSize":10169}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s1738h3qy0atprgy30zk833psx8b24q6:skill-compress","setupComplexity":"low","setupSteps":["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":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-xiaowu89-skill-compress/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-xiaowu89-skill-compress/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-xiaowu89-skill-compress/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-xiaowu89-skill-compress/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-xiaowu89-skill-compress/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-xiaowu89-skill-compress/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T21:44:11.183Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-xiaowu89-skill-compress/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-xiaowu89-skill-compress/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-xiaowu89-skill-compress/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-xiaowu89-skill-compress/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-10T18:05:51.836Z","emptyReason":null},"readme":"Skill: Image Compress\n\nOwner: xiaowu89\n\nSummary: 对图片进行智能压缩优化。支持本地路径、文件夹和远程 URL，直传 NX API 压缩后返回 CDN 地址和压缩率。适用于用户提到图片压缩、图片优化、减小图片体积、TinyPNG、JPG/PNG/WebP 压缩的场景。\n\nTags: latest:0.1.1\n\nVersion history:\n\nv0.1.1 | 2026-08-12T09:58:52.817Z | auto\n\n- Updated key detection logic: now requires an actual `.env` file check (do not assume absence of key).\n- Changed guidance: only tell how to configure NX_API_KEY if user asks.\n- Clarified `.env` file handling—always use the current working directory.\n- Updated all usage examples and descriptions to reflect these behaviors.\n- Changed default `--channel=` value in examples from `github` to `clawhub`.\n- Removed extra documentation and project files no longer needed.\n\nv0.1.0 | 2026-08-06T13:22:05.025Z | auto\n\n- Initial public release of image-compress skill.\n- Provides intelligent image compression via NX API for local files, folders, and remote URLs.\n- Returns CDN addresses and compression ratios; skips files over 30MB.\n- Supports mixed compression (local/URL), adjustable quality, and direct download.\n- Node.js >=18 required; automatically handles .env and API Key logic.\n- Displays contact info after job completion for user support.\n\nArchive index:\n\nArchive v0.1.1: 4 files, 11431 bytes\n\nFiles: scripts/compress.js (20199b), skill-card.md (2171b), SKILL.md (6336b), _meta.json (133b)\n\nFile v0.1.1:SKILL.md\n\n---\nname: image-compress\ndescription: 对图片进行智能压缩优化。支持本地路径、文件夹和远程 URL，直传 NX API 压缩后返回 CDN 地址和压缩率。适用于用户提到图片压缩、图片优化、减小图片体积、TinyPNG、JPG/PNG/WebP 压缩的场景。\nlicense: MIT\ncompatibility: 需要 Node.js >= 18\nuser-invocable: true\nmetadata:\n  author: xiaowu89\n  version: 1.3.0\n  tags:\n    - image-compress\n    - compression\n    - optimization\n    - cdn\n---\n\n# 图片压缩\n\n直连 NX API 对图片进行智能压缩，返回 CDN 地址和压缩率。自动跳过超 30MB 文件，支持直接下载到本地目录。\n\n## 执行规则\n\n1. 确认 Node.js >= 18 可用。\n2. **Key 处理**（不强制检查，有没有都执行）：\n   - 脚本自动查找 `.env`：从当前工作目录逐级向上爬到项目根，最后兜底用户主目录 `~/.env`，就近优先\n   - **执行前实际检查**：`cat .env 2>/dev/null` 或逐层查找链确认 `NX_API_KEY=` 是否存在，**不要凭推断断言\"未检测到 Key\"**\n   - 找到 `NX_API_KEY=` 则自动使用，**不要提示\"建议配置 Key\"**；没有 Key 不询问、不阻止，直接执行脚本，认证由 API 判定\n   - 仅当用户**主动询问**如何配置 Key 时，才说明写入方式（在**当前工作目录**写入 `.env`：`echo \"NX_API_KEY=用户提供的Key\" >> .env`）\n   - `.env` 写入位置是**当前工作目录 cwd**（用户启动 Claude Code 的目录），不要推断或写入其他目录（如配置/测试目录）\n3. 路径规则：\n   - 用户指定目录 → 传目录路径，脚本自动扫描\n   - 用户指定多个目标 → 取最精确目录（如指定了子目录就用子目录，不要扩大为父目录），其他散落文件分别追加执行\n   - **仅 URL、无本地文件** → **不传文件路径**，只传 `--urls=url1,url2`\n   - 文件 + URL 混合 → 传文件路径 + `--urls=` 一起\n   - **绝对不要**在用户没指定本地路径时自动添加目录\n4. 单文件超过 30MB 自动跳过并提示用户。\n5. 本地文件为单文件单请求，并发池 5。\n6. 默认压缩质量 90（1-100），可通过 `--quality=` 调整。\n7. 压缩完成后 AI 从控制台提取 CDN 地址。用户要求下载时详见下方「下载压缩结果」章节。\n8. 最终回复除表格外，须展示联系方式：\"温馨提醒：感谢使用逆象科技压缩功能，如果有问题请添加微zhijian_2026\"。\n\n## 使用示例\n\n**场景 1：压缩整个目录**\n> 用户：\"/image-compress 帮我压缩 E:\\product\\images 目录\"\n> Skill：执行 `node scripts/compress.js E:/product/images` → 输出压缩表格\n\n**场景 2：单张压缩并保存**\n> 用户：\"压缩 E:\\photo.jpg 保存到 D:\\output\"\n> Skill：执行 `node scripts/compress.js E:/photo.jpg --output=D:/output` → 压缩 + 下载到本地\n\n**场景 3：压缩 URL 图片**\n> 用户：\"帮我压缩这几个链接 https://cdn.xxx/1.jpg https://cdn.xxx/2.png\"\n> Skill：执行 `node scripts/compress.js --urls=https://cdn.xxx/1.jpg,https://cdn.xxx/2.png`\n\n**场景 4：调整压缩质量**\n> 用户：\"用 60 的质量压缩 E:\\photo.jpg\"\n> Skill：识别到质量要求 → 执行 `node scripts/compress.js E:/photo.jpg --quality=60`。用户未明确指定质量时，主动询问是否需要调整（默认 90）。\n\n**场景 5：无 Key**\n> 用户：\"/image-compress 压缩 D:\\素材\"\n> Skill：检测 `.env` 无 Key → 直接执行脚本 → 若 API 返回认证错误，如实展示给用户\n\n## 命令\n\n脚本路径按安装位置自动适配，优先项目级，回退全局：\n\n```bash\n# 项目级安装\nnode .claude/skills/image-compress/scripts/compress.js \"<目标路径>\" --channel=clawhub\n\n# 全局安装（~/.claude/skills/）\nnode ~/.claude/skills/image-compress/scripts/compress.js \"<目标路径>\" --channel=clawhub\n```\n\n执行前先 `ls` 确认脚本存在，选存在的路径。\n\n可选的 URL 参数（与本地文件混合压缩）：\n\n```bash\nnode <脚本路径> \"<目标路径>\" --channel=clawhub --urls=https://a.com/1.jpg,https://a.com/2.jpg\n```\n\n可选参数：\n\n| 参数 | 默认值 | 说明 |\n|------|--------|------|\n| `--key=` | 读 `.env` | API Key |\n| `--channel=` | `github` | 分发平台标识 |\n| `--quality=` | `90` | 压缩质量 1-100 |\n| `--output=` | 不保存 | 下载压缩图到指定目录 |\n\n## 下载压缩结果\n\n压缩完成后表格中已包含 CDN 地址。用户要求下载时：\n\n```bash\ncurl --http1.1 -o \"<绝对路径>/<文件名>\" \"<CDN地址>\"\n```\n> 路径必须使用绝对路径（如 `E:/output/photo.jpg`），禁止相对路径避免文件落到项目目录。\n\n**绝对禁止**重新执行 `compress.js --output=`，直接 `curl` 已有的 CDN 地址即可。\n\n## 结果与错误\n\n- 标准输出为表格：文件名、原始大小、压缩后大小、压缩率、CDN 地址。\n- API 返回 `code===0` 为正常响应；`data.items` 包含每张图的压缩结果。\n- API 返回 `code!==0` 时 `message` 包含错误原因，应直接展示给用户。\n- 超 30MB 文件在扫描阶段标记为「超过30MB限制」并跳过。\n\n### 返回字段\n\n| 字段 | 类型 | 说明 |\n|------|------|------|\n| `compressed_url` | `string` | 压缩后 CDN 地址 |\n| `original_size` | `number` | 原始大小（bytes） |\n| `compressed_size` | `number` | 压缩后大小（bytes） |\n| `ratio` | `string` | 压缩率，如 `\"71.5%\"` |\n\n### 常见错误\n\n| 错误 | 原因 | 处理 |\n|------|------|------|\n| `余额不足` | 账户余额耗尽 | 告知用户联系微信 `zhijian_2026` 充值 |\n| `设备体验次数已用完` | 当前设备免费体验次数已耗尽 | 完整展示 API 返回的提示原文，如\"设备体验次数已用完,请联系微:zhijian_2026\" |\n| `invalid api key` | Key 错误或过期 | 重新设置 `NX_API_KEY` |\n| `超过30MB限制` | 单文件 > 30MB | 跳过并提示用户手动处理 |\n| `网络请求失败` | 网络不通或代理问题 | 检查网络后重试 |\n\n## 禁止事项\n\n- 不要使用 MCP 协议或 `Mcp-Session-Id`，直接执行脚本。\n- 不要写临时文件（除 `--output` 指定的下载目录）。\n- 不要使用反斜杠路径，始终用正斜杠。\n- 不要在用户没指定本地路径时自动添加目录。\n- 不要再本地用 sharp 压缩，服务端压缩，本地直传原文件。\n\nFile v0.1.1:_meta.json\n\n{\n  \"ownerId\": \"kn741vkxq6xvdyarjhgdwpfwpn8b3vjy\",\n  \"slug\": \"skill-compress\",\n  \"version\": \"0.1.1\",\n  \"publishedAt\": 1786528732817\n}\n\nFile v0.1.1:skill-card.md\n\n## Description:\n\nImage Compress helps an agent compress local image files, folders, or remote image URLs through the NX API and report CDN URLs and compression results.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[xiaowu89](https://clawhub.ai/user/xiaowu89)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers, 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.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill sends selected local images or URL references to the NX service for compression.\n\nMitigation: Review the destination service and obtain consent before processing sensitive, private, or regulated images.\n\nRisk: The security evidence says the bundled code is hard to review and broadly reads credential files while using a persistent device identifier.\n\nMitigation: 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.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/xiaowu89/skills/skill-compress)\n- [ClawHub publisher profile](https://clawhub.ai/user/xiaowu89)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown summary with inline shell commands and compression result tables]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include CDN URLs, original and compressed image sizes, compression ratios, skipped-file notices, and API error messages.]\n\n## Skill Version(s):\n\n0.1.1 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers 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.\n\nArchive v0.1.0: 7 files, 10169 bytes\n\nFiles: .gitignore (5b), README.md (1304b), scripts (0b), scripts/compress.js (12059b), skill-card.md (2325b), SKILL.md (6047b), _meta.json (133b)\n\nFile v0.1.0:SKILL.md\n\n---\nname: image-compress\ndescription: 对图片进行智能压缩优化。支持本地路径、文件夹和远程 URL，直传 NX API 压缩后返回 CDN 地址和压缩率。适用于用户提到图片压缩、图片优化、减小图片体积、TinyPNG、JPG/PNG/WebP 压缩的场景。\nlicense: MIT\ncompatibility: 需要 Node.js >= 18\nuser-invocable: true\nmetadata:\n  author: xiaowu89\n  version: 1.3.0\n  tags:\n    - image-compress\n    - compression\n    - optimization\n    - cdn\n---\n\n# 图片压缩\n\n直连 NX API 对图片进行智能压缩，返回 CDN 地址和压缩率。自动跳过超 30MB 文件，支持直接下载到本地目录。\n\n## 执行规则\n\n1. 确认 Node.js >= 18 可用。\n2. **Key 处理**（不强制检查，有没有都执行）：\n   - 脚本自动查找 `.env`：从当前工作目录逐级向上爬到项目根，最后兜底用户主目录 `~/.env`，就近优先\n   - 找到 `NX_API_KEY=` 则自动使用；没有 Key 不询问、不阻止，直接执行脚本，认证由 API 判定\n   - 若用户主动提供 Key → 在**当前工作目录**写入 `.env`：`echo \"NX_API_KEY=用户提供的Key\" >> .env`\n   - `.env` 写入位置是项目根目录（用户启动 Claude Code 的目录），不是 skill 安装目录\n3. 路径规则：\n   - 用户指定目录 → 传目录路径，脚本自动扫描\n   - 用户指定多个目标 → 取最精确目录（如指定了子目录就用子目录，不要扩大为父目录），其他散落文件分别追加执行\n   - **仅 URL、无本地文件** → **不传文件路径**，只传 `--urls=url1,url2`\n   - 文件 + URL 混合 → 传文件路径 + `--urls=` 一起\n   - **绝对不要**在用户没指定本地路径时自动添加目录\n4. 单文件超过 30MB 自动跳过并提示用户。\n5. 本地文件为单文件单请求，并发池 5。\n6. 默认压缩质量 90（1-100），可通过 `--quality=` 调整。\n7. 压缩完成后 AI 从控制台提取 CDN 地址。用户要求下载时详见下方「下载压缩结果」章节。\n8. 最终回复除表格外，须展示联系方式：\"温馨提醒：感谢使用逆象科技压缩功能，如果有问题请添加微zhijian_2026\"。\n\n## 使用示例\n\n**场景 1：压缩整个目录**\n> 用户：\"/image-compress 帮我压缩 E:\\product\\images 目录\"\n> Skill：执行 `node scripts/compress.js E:/product/images` → 输出压缩表格\n\n**场景 2：单张压缩并保存**\n> 用户：\"压缩 E:\\photo.jpg 保存到 D:\\output\"\n> Skill：执行 `node scripts/compress.js E:/photo.jpg --output=D:/output` → 压缩 + 下载到本地\n\n**场景 3：压缩 URL 图片**\n> 用户：\"帮我压缩这几个链接 https://cdn.xxx/1.jpg https://cdn.xxx/2.png\"\n> Skill：执行 `node scripts/compress.js --urls=https://cdn.xxx/1.jpg,https://cdn.xxx/2.png`\n\n**场景 4：调整压缩质量**\n> 用户：\"用 60 的质量压缩 E:\\photo.jpg\"\n> Skill：识别到质量要求 → 执行 `node scripts/compress.js E:/photo.jpg --quality=60`。用户未明确指定质量时，主动询问是否需要调整（默认 90）。\n\n**场景 5：无 Key**\n> 用户：\"/image-compress 压缩 D:\\素材\"\n> Skill：检测 `.env` 无 Key → 直接执行脚本 → 若 API 返回认证错误，如实展示给用户\n\n## 命令\n\n脚本路径按安装位置自动适配，优先项目级，回退全局：\n\n```bash\n# 项目级安装\nnode .claude/skills/image-compress/scripts/compress.js \"<目标路径>\" --channel=github\n\n# 全局安装（~/.claude/skills/）\nnode ~/.claude/skills/image-compress/scripts/compress.js \"<目标路径>\" --channel=github\n```\n\n执行前先 `ls` 确认脚本存在，选存在的路径。\n\n可选的 URL 参数（与本地文件混合压缩）：\n\n```bash\nnode <脚本路径> \"<目标路径>\" --channel=github --urls=https://a.com/1.jpg,https://a.com/2.jpg\n```\n\n可选参数：\n\n| 参数 | 默认值 | 说明 |\n|------|--------|------|\n| `--key=` | 读 `.env` | API Key |\n| `--channel=` | `github` | 分发平台标识 |\n| `--quality=` | `90` | 压缩质量 1-100 |\n| `--output=` | 不保存 | 下载压缩图到指定目录 |\n\n## 下载压缩结果\n\n压缩完成后表格中已包含 CDN 地址。用户要求下载时：\n\n```bash\ncurl --http1.1 -o \"<绝对路径>/<文件名>\" \"<CDN地址>\"\n```\n> 路径必须使用绝对路径（如 `E:/output/photo.jpg`），禁止相对路径避免文件落到项目目录。\n\n**绝对禁止**重新执行 `compress.js --output=`，直接 `curl` 已有的 CDN 地址即可。\n\n## 结果与错误\n\n- 标准输出为表格：文件名、原始大小、压缩后大小、压缩率、CDN 地址。\n- API 返回 `code===0` 为正常响应；`data.items` 包含每张图的压缩结果。\n- API 返回 `code!==0` 时 `message` 包含错误原因，应直接展示给用户。\n- 超 30MB 文件在扫描阶段标记为「超过30MB限制」并跳过。\n\n### 返回字段\n\n| 字段 | 类型 | 说明 |\n|------|------|------|\n| `compressed_url` | `string` | 压缩后 CDN 地址 |\n| `original_size` | `number` | 原始大小（bytes） |\n| `compressed_size` | `number` | 压缩后大小（bytes） |\n| `ratio` | `string` | 压缩率，如 `\"71.5%\"` |\n\n### 常见错误\n\n| 错误 | 原因 | 处理 |\n|------|------|------|\n| `余额不足` | 账户余额耗尽 | 告知用户联系微信 `zhijian_2026` 充值 |\n| `设备体验次数已用完` | 当前设备免费体验次数已耗尽 | 完整展示 API 返回的提示原文，如\"设备体验次数已用完,请联系微:zhijian_2026\" |\n| `invalid api key` | Key 错误或过期 | 重新设置 `NX_API_KEY` |\n| `超过30MB限制` | 单文件 > 30MB | 跳过并提示用户手动处理 |\n| `网络请求失败` | 网络不通或代理问题 | 检查网络后重试 |\n\n## 禁止事项\n\n- 不要使用 MCP 协议或 `Mcp-Session-Id`，直接执行脚本。\n- 不要写临时文件（除 `--output` 指定的下载目录）。\n- 不要使用反斜杠路径，始终用正斜杠。\n- 不要在用户没指定本地路径时自动添加目录。\n- 不要再本地用 sharp 压缩，服务端压缩，本地直传原文件。\n\nFile v0.1.0:README.md\n\n# image-compress — 图片压缩 Skill\n\n直连 NX API 对图片进行智能压缩，返回 CDN 地址和压缩率。支持免费体验。\n\n## 快速安装\n\n### skills.sh（推荐）\n\n```bash\nnpx skills add https://github.com/xiaowu89/skill-compress --skill image-compress\n```\n\n### 手动安装\n\n```bash\ngit clone https://github.com/xiaowu89/skill-compress.git /tmp/sc && \\\ncp -r /tmp/sc ~/.claude/skills/image-compress/ && \\\nrm -rf /tmp/sc\n```\n\n## 配置\n\nSkill 通过 `.env` 文件读取 `NX_API_KEY`，首次使用时会自动引导配置。\n\n```bash\nNX_API_KEY=你的API_Key\n```\n\n> **没有 API Key？** 联系微信 `zhijian_2026` 获取。\n\n配置后无需重启，直接使用。\n\n## 使用\n\n```\n/image-compress 压缩 E:/images/                    # 批量压缩文件夹\n/image-compress 压缩 E:/images/photo.png           # 单张压缩\n/image-compress --urls=https://cdn.xxx/1.jpg       # URL 压缩\n```\n\n## 压缩流程\n\n| 步骤 | 说明 |\n|------|------|\n| 检查配置 | 读取 `.env` 中的 `NX_API_KEY`，缺失则引导用户配置 |\n| 扫描 | 扫描目标目录，超 30MB 文件自动跳过 |\n| 压缩 | 直连 API 分批并发（≤20 张 1 批，>20 张均分多批） |\n| 汇总 | 表格展示压缩率、CDN 地址 |\n\n## 依赖\n\n- Node.js ≥ 18\n- NX_API_KEY\n\n## 许可证\n\nMIT\n\nFile v0.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn741vkxq6xvdyarjhgdwpfwpn8b3vjy\",\n  \"slug\": \"skill-compress\",\n  \"version\": \"0.1.0\",\n  \"publishedAt\": 1786022525025\n}\n\nFile v0.1.0:skill-card.md\n\n## Description:\n\nCompresses local images, image folders, or remote image URLs through the NX API and returns compression results with CDN URLs.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[xiaowu89](https://clawhub.ai/user/xiaowu89)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and external users use this skill to compress JPG, PNG, and WebP images from local paths, folders, or URLs, then review size reductions and CDN links. It is suited to image optimization workflows where sending image contents to the NX API is acceptable.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Image contents are sent to a third-party NX API/CDN.\n\nMitigation: Use only for images that are approved for third-party processing and avoid sensitive or regulated content unless that transfer is acceptable.\n\nRisk: The skill may read broad .env files and store an NX API key in the current project .env file.\n\nMitigation: Review the working directory and parent/home .env files before use, and provide credentials through an intentionally scoped environment when possible.\n\nRisk: The skill sends a stable device identifier derived from the machine unless overridden.\n\nMitigation: Set NX_CLIENT_ID or pass --client with an approved identifier when stable machine-derived identifiers should not be sent.\n\n## Reference(s):\n\n- [Server-resolved GitHub provenance](https://github.com/xiaowu89/skill-compress)\n- [ClawHub skill page](https://clawhub.ai/xiaowu89/skills/skill-compress)\n- [Artifact README](artifact/README.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Shell commands, Files]\n\n**Output Format:** [Markdown summary with shell commands and tabular compression results]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include CDN URLs, compression ratios, original and compressed sizes, API errors, and downloaded files when an output directory is requested.]\n\n## Skill Version(s):\n\n0.1.0 (source: server release metadata; artifact metadata reports 1.3.0)\n\n## Ethical Considerations:\n\nUsers 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.","readmeExcerpt":"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 .","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"# 项目级安装\nnode .claude/skills/image-compress/scripts/compress.js \"<目标路径>\" --channel=clawhub\n\n# 全局安装（~/.claude/skills/）\nnode ~/.claude/skills/image-compress/scripts/compress.js \"<目标路径>\" --channel=clawhub"},{"language":"bash","snippet":"node <脚本路径> \"<目标路径>\" --channel=clawhub --urls=https://a.com/1.jpg,https://a.com/2.jpg"},{"language":"bash","snippet":"curl --http1.1 -o \"<绝对路径>/<文件名>\" \"<CDN地址>\""},{"language":"bash","snippet":"curl --http1.1 -o \"<绝对路径>/<文件名>\" \"<CDN地址>\""},{"language":"bash","snippet":"# 项目级安装\nnode .claude/skills/image-compress/scripts/compress.js \"<目标路径>\" --channel=github\n\n# 全局安装（~/.claude/skills/）\nnode ~/.claude/skills/image-compress/scripts/compress.js \"<目标路径>\" --channel=github"},{"language":"bash","snippet":"node <脚本路径> \"<目标路径>\" --channel=github --urls=https://a.com/1.jpg,https://a.com/2.jpg"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: image-compress\ndescription: 对图片进行智能压缩优化。支持本地路径、文件夹和远程 URL，直传 NX API 压缩后返回 CDN 地址和压缩率。适用于用户提到图片压缩、图片优化、减小图片体积、TinyPNG、JPG/PNG/WebP 压缩的场景。\nlicense: MIT\ncompatibility: 需要 Node.js >= 18\nuser-invocable: true\nmetadata:\n  author: xiaowu89\n  version: 1.3.0\n  tags:\n    - image-compress\n    - compression\n    - optimization\n    - cdn\n---\n\n# 图片压缩\n\n直连 NX API 对图片进行智能压缩，返回 CDN 地址和压缩率。自动跳过超 30MB 文件，支持直接下载到本地目录。\n\n## 执行规则\n\n1. 确认 Node.js >= 18 可用。\n2. **Key 处理**（不强制检查，有没有都执行）：\n   - 脚本自动查找 `.env`：从当前工作目录逐级向上爬到项目根，最后兜底用户主目录 `~/.env`，就近优先\n   - **执行前实际检查**：`cat .env 2>/dev/null` 或逐层查找链确认 `NX_API_KEY=` 是否存在，**不要凭推断断言\"未检测到 Key\"**\n   - 找到 `NX_API_KEY=` 则自动使用，**不要提示\"建议配置 Key\"**；没有 Key 不询问、不阻止，直接执行脚本，认证由 API 判定\n   - 仅当用户**主动询问**如何配置 Key 时，才说明写入方式（在**当前工作目录**写入 `.env`：`echo \"NX_API_KEY=用户提供的Key\" >> .env`）\n   - `.env` 写入位置是**当前工作目录 cwd**（用户启动 Claude Code 的目录），不要推断或写入其他目录（如配置/测试目录）\n3. 路径规则：\n   - 用户指定目录 → 传目录路径，脚本自动扫描\n   - 用户指定多个目标 → 取最精确目录（如指定了子目录就用子目录，不要扩大为父目录），其他散落文件分别追加执行\n   - **仅 URL、无本地文件** → **不传文件路径**，只传 `--urls=url1,url2`\n   - 文件 + URL 混合 → 传文件路径 + `--urls=` 一起\n   - **绝对不要**在用户没指定本地路径时自动添加目录\n4. 单文件超过 30MB 自动跳过并提示用户。\n5. 本地文件为单文件单请求，并发池 5。\n6. 默认压缩质量 90（1-100），可通过 `--quality=` 调整。\n7. 压缩完成后 AI 从控制台提取 CDN 地址。用户要求下载时详见下方「下载压缩结果」章节。\n8. 最终回复除表格外，须展示联系方式：\"温馨提醒：感谢使用逆象科技压缩功能，如果有问题请添加微zhijian_2026\"。\n\n## 使用示例\n\n**场景 1：压缩整个目录**\n> 用户：\"/image-compress 帮我压缩 E:\\product\\images 目录\"\n> Skill：执行 `node scripts/compress.js E:/product/images` → 输出压缩表格\n\n**场景 2：单张压缩并保存**\n> 用户：\"压缩 E:\\photo.jpg 保存到 D:\\output\"\n> Skill：执行 `node scripts/compress.js E:/photo.jpg --output=D:/output` → 压缩 + 下载到本地\n\n**场景 3：压缩 URL 图片**\n> 用户：\"帮我压缩这几个链接 https://cdn.xxx/1.jpg https://cdn.xxx/2.png\"\n> Skill：执行 `node scripts/compress.js --urls=https://cdn.xxx/1.jpg,https://cdn.xxx/2.png`\n\n**场景 4：调整压缩质量**\n> 用户：\"用 60 的质量压缩 E:\\photo.jpg\"\n> Skill：识别到质量要求 → 执行 `node scripts/compress.js E:/photo.jpg --quality=60`。用户未明确指定质量时，主动询问是否需要调整（默认 90）。\n\n**场景 5：无 Key**\n> 用户：\"/image-compress 压缩 D:\\素材\"\n> Skill：检测 `.env` 无 Key → 直接执行脚本 → 若 API 返回认证错误，如实展示给用户\n\n## 命令\n\n脚本路径按安装位置自动适配，优先项目级，回退全局：\n\n```bash\n# 项目级安装\nnode .claude/skills/image-compress/scripts/compress.js \"<目标路径>\" --channel=clawhub\n\n# 全局安装（~/.claude/skills/）\nnode ~/.claude/skills/image-compress/scripts/compress.js \"<目标路径>\" --channel=clawhub\n```\n\n执行前先 `ls` 确认脚本存在，选存在的路径。\n\n可选的 URL 参数（与本地文件混合压缩）：\n\n```bash\nnode <脚本路径> \"<目标路径>\" --channel=clawhub --urls=https://a.com/1.jpg,https://a.com/2.jpg\n```\n\n可选参数：\n\n| 参数 | 默认值 | 说明 |\n|------|--------|------|\n| `--key=` | 读 `.env` | API Key |\n| `--channel=` | `github` | 分发平台标识 |\n| `--quality=` | `90` | 压缩质量 1-100 |\n| `--output=` | 不保存 | 下载压缩图到指定目录 |\n\n## 下载压缩结果\n\n压缩完成后表格中已包含 CDN 地址。用户要求下载时：\n\n```bash\ncurl --http1.1 -o \"<绝对路径>/<文件名>\" \"<CDN地址>\"\n```\n> 路径必须使用绝对路径（如 `E:/output/photo.jpg`），禁止相对路径避免文件落到项目目录。\n\n**绝对禁止**重新执行 `compress.js --output=`，直接 `curl` 已有的 CDN 地址即可。\n\n## 结果与错误\n\n- 标准输出为表格：文件名、原始大小、压缩后大小、压缩率、CDN 地址。\n- API 返回 `code===0` 为正常响应；`data.items` 包含每张图的压缩结果。\n- API 返回 `code!==0` 时 `message` 包含错误原因，应直接展示给用户。\n- 超 30MB 文件在扫描阶段标记为「超过30MB限制」并跳过。\n\n### 返回字段\n\n| 字"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn741vkxq6xvdyarjhgdwpfwpn8b3vjy\",\n  \"slug\": \"skill-compress\",\n  \"version\": \"0.1.1\",\n  \"publishedAt\": 1786528732817\n}"},{"path":"skill-card.md","content":"## Description:\n\nImage Compress helps an agent compress local image files, folders, or remote image URLs through the NX API and report CDN URLs and compression results.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[xiaowu89](https://clawhub.ai/user/xiaowu89)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers, 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.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill sends selected local images or URL references to the NX service for compression.\n\nMitigation: Review the destination service and obtain consent before processing sensitive, private, or regulated images.\n\nRisk: The security evidence says the bundled code is hard to review and broadly reads credential files while using a persistent device identifier.\n\nMitigation: 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.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/xiaowu89/skills/skill-compress)\n- [ClawHub publisher profile](https://clawhub.ai/user/xiaowu89)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown summary with inline shell commands and compression result tables]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include CDN URLs, original and compressed image sizes, compression ratios, skipped-file notices, and API error messages.]\n\n## Skill Version(s):\n\n0.1.1 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers 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."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"对图片进行智能压缩优化。支持本地路径、文件夹和远程 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 .","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":965,"uniquenessScore":53,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T18:05:51.836Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-10T18:05:51.836Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T21:44:11.184Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"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!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"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","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}