dojo.md
University for AI agents. 92 courses, 4400+ scenarios, any model via OpenRouter. Auto-training loops generate per-model SKILL.md documents. Works with Claude Code, OpenClaw, Cursor, Windsurf. No fine-tuning req...
Compress files to reduce storage and transfer size. Use this skill when users ask to shrink PDFs or images, optimize upload/share size, or balance quality and size. Supports PDF compression and image compression with Python-first workflows plus Node.js fallback when Python dependencies are unavailable.
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
SkillHub CLI
skillhub install hexavi8/file-compression打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。
将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。
Compress files with Python-first workflows and Node.js fallback workflows.
.pdf
.jpg, .jpeg, .png, .webp
Required binaries:
python3 (recommended >= 3.8)node
gs (Ghostscript, required for PDF Ghostscript paths)Python install spec:
python3 -m pip install -r {baseDir}/requirements.txt
Node install spec:
cd {baseDir}
npm install
Ghostscript install examples:
brew install ghostscript
sudo apt-get update && sudo apt-get install -y ghostscript
Safety note:
PDF (scripts/compress_pdf.py):
--preset screen|ebook|printer|prepress
--strategy auto|ghostscript|pikepdf
--remove-metadata
--no-linearize
--overwrite
PDF Node (scripts/compress_pdf_node.mjs):
--preset screen|ebook|printer|prepress
Image (scripts/compress_image.py):
--quality <1-100>
--format keep|jpeg|png|webp
--max-width <n>
--max-height <n>
--strategy auto|pillow|node
--overwrite
Image Node (scripts/compress_image_node.mjs):
--quality <1-100>
--format keep|jpeg|png|webp
--max-width <n>
--max-height <n>
PDF default:
python {baseDir}/scripts/compress_pdf.py in.pdf out.pdf
PDF aggressive:
python {baseDir}/scripts/compress_pdf.py in.pdf out.pdf --preset screen --strategy ghostscript
PDF with pikepdf:
python {baseDir}/scripts/...
这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。
# File Compression
Compress files with Python-first workflows and Node.js fallback workflows.
## Supported File Types
- PDF: `.pdf`
- Image: `.jpg`, `.jpeg`, `.png`, `.webp`
## What This Skill Can Do
- Compress PDF with preset quality levels.
- Compress image with quality/resize/format controls.
- Switch backend automatically when dependencies are missing.
- Detect bad compression results and retry with better strategy.
## Installation Spec (Before Running)
Required binaries:
- `python3` (recommended `>= 3.8`)
- `node`
- `gs` (Ghostscript, required for PDF Ghostscript paths)
Python install spec:
```bash
python3 -m pip install -r {baseDir}/requirements.txt
```
Node install spec:
```bash
cd {baseDir}
npm install
```
Ghostscript install examples:
- macOS: `brew install ghostscript`
- Ubuntu/Debian: `sudo apt-get update && sudo apt-get install -y ghostscript`
Safety note:
- Explain to the user before each install command that third-party packages are being installed.
- If installation fails, report the failing command and switch to available fallback backend.
## CLI Options Cheat Sheet
PDF (`scripts/compress_pdf.py`):
- `--preset screen|ebook|printer|prepress`
- `--strategy auto|ghostscript|pikepdf`
- `--remove-metadata`
- `--no-linearize`
- `--overwrite`
PDF Node (`scripts/compress_pdf_node.mjs`):
- `--preset screen|ebook|printer|prepress`
Image (`scripts/compress_image.py`):
- `--quality <1-100>`
- `--format keep|jpeg|png|webp`
- `--max-width <n>`
- `--max-height <n>`
- `--strategy auto|pillow|node`
- `--overwrite`
Image Node (`scripts/compress_image_node.mjs`):
- `--quality <1-100>`
- `--format keep|jpeg|png|webp`
- `--max-width <n>`
- `--max-height <n>`
## Example Set (Python + Node)
PDF default:
```bash
python {baseDir}/scripts/compress_pdf.py in.pdf out.pdf
```
PDF aggressive:
```bash
python {baseDir}/scripts/compress_pdf.py in.pdf out.pdf --preset screen --strategy ghostscript
```
PDF with pikepdf:
```bash
python {baseDir}/scripts/...University for AI agents. 92 courses, 4400+ scenarios, any model via OpenRouter. Auto-training loops generate per-model SKILL.md documents. Works with Claude Code, OpenClaw, Cursor, Windsurf. No fine-tuning req...
macOS WPS Office workflow helper skill for safer document preparation, conversion, export, and compatibility guidance
A股分析技能
A2A4B2B Skill for OpenClaw