refactor: add openclaw metadata and rename SKILL_DIR to baseDir across all skills

This commit is contained in:
Jim Liu 宝玉
2026-03-08 19:22:24 -05:00
parent 93efa5aeb1
commit 154ccfe3ff
17 changed files with 182 additions and 85 deletions
+14 -6
View File
@@ -1,6 +1,14 @@
---
name: baoyu-compress-image
description: 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.
version: 1.56.1
metadata:
openclaw:
homepage: https://github.com/JimLiu/baoyu-skills#baoyu-compress-image
requires:
anyBins:
- bun
- npx
---
# Image Compressor
@@ -9,7 +17,7 @@ Compresses images using best available tool (sips → cwebp → ImageMagick →
## Script Directory
Scripts in `scripts/` subdirectory. `${SKILL_DIR}` = 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 `${SKILL_DIR}` and `${BUN_X}` with actual values.
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 |
|--------|---------|
@@ -52,7 +60,7 @@ if (Test-Path "$HOME/.baoyu-skills/baoyu-compress-image/EXTEND.md") { "user" }
## Usage
```bash
${BUN_X} ${SKILL_DIR}/scripts/main.ts <input> [options]
${BUN_X} {baseDir}/scripts/main.ts <input> [options]
```
## Options
@@ -71,16 +79,16 @@ ${BUN_X} ${SKILL_DIR}/scripts/main.ts <input> [options]
```bash
# Single file → WebP (replaces original)
${BUN_X} ${SKILL_DIR}/scripts/main.ts image.png
${BUN_X} {baseDir}/scripts/main.ts image.png
# Keep PNG format
${BUN_X} ${SKILL_DIR}/scripts/main.ts image.png -f png --keep
${BUN_X} {baseDir}/scripts/main.ts image.png -f png --keep
# Directory recursive
${BUN_X} ${SKILL_DIR}/scripts/main.ts ./images/ -r -q 75
${BUN_X} {baseDir}/scripts/main.ts ./images/ -r -q 75
# JSON output
${BUN_X} ${SKILL_DIR}/scripts/main.ts image.png --json
${BUN_X} {baseDir}/scripts/main.ts image.png --json
```
**Output**: