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.
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
SkillHub CLI
skillhub install hexavi8/file-compressionInspect the source and compatibility requirements, then follow its installation steps.
Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.
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/...
These signals come from indexed source analysis and may lag behind changes. Check the current source files.
# 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