Search

PythonReactSEOPDF
OpenClaw

file-compression

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.

hexavi80 source installs☆ 0 Repository stars

Installation

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-compression

Inspect 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.

View source ↗Guides

Skill instructions

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:

python3 -m pip install -r {baseDir}/requirements.txt

Node install spec:

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:

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/...

Source information

Source
github
Repository
openclaw/skills
Path
skills/hexavi8/file-compression
Version
—
Commit
3471867dcf16021a6fa37d36b06701e5e83eb4dc
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

Extracted content

SKILL.md
# 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/...

Related skills

OpenClaw

dojo.md

edholofy

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...

OpenClaw

wps-macos-helper

lethehades

macOS WPS Office workflow helper skill for safer document preparation, conversion, export, and compatibility guidance