agentleFS
tentacle-protentacle-pro/skills/baoyu-compress-image/SKILL.md

baoyu-compress-image

Skill4 starsChanged 9 months agoCC0-1.0View on GitHub

Compresses images to JPEG/WebP/PNG using an automated multi-platform CLI (sips, cwebp, sharp). Washed for Obsidian Creator Vault: defaults to JPEG at 65 quality (for <1MB output), and auto-archives original files.

  • Installs packages

9 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use baoyu-format-markdown and baoyu-url-to-markdown.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ideaccoSkill

    baoyu-format-markdown

    Formats plain text or markdown files with frontmatter, titles, summaries, headings, bold, lists, and code blocks. Use when user asks to "format markdown", "beautify article", "add formatting", or improve article layout. Outputs to {filename}-formatted.md.

    Also in 6 projects that use this

  • xfstudioSkill

    baoyu-url-to-markdown

    Fetch any URL and convert to markdown using Chrome CDP. Supports two modes - auto-capture on page load, or wait for user signal (for pages requiring login). Use when user wants to save a webpage as markdown.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Clean Vault: When run in default mode (replace), it doesn't clutter your Assets/ with _original files.

    line 12
  2. Very specific:

    Dependency Sandboxing: All runtime is wrapped through bun and isolated inside .agents/skills.

    line 13
  3. Very specific:

    Run the script using bun from the root of the vault.

    line 42

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

baoyu-compress-image

Auto-compresses images using the best available CLI tool on the system (sips, cwebp, convert, or sharp).

This has been specifically adapted for the Obsidian Creator Vault:

  • Fast Web-focused: Defaults to generating .jpg with 65 quality (perfect for most platform limits < 1MB).
  • Clean Vault: When run in default mode (replace), it doesn't clutter your Assets/ with _original files. Instead, it backs up the original unmodified file to Archive/Original-Images/.
  • Dependency Sandboxing: All runtime is wrapped through bun and isolated inside .agents/skills.

Installation & System Requirements

This script automatically detects your OS and uses the fastest and highest quality image engine it can find in this order:

  1. macOS sips (Built-in, Highly Recommended)
    macOS ships with sips natively. No installation required.
    (Under the hood: sips -s format jpeg -s formatOptions 65 <input> --out <output>)
  2. cwebp (Best for webp targets)
    • macOS: brew install webp
    • Ubuntu/Debian: sudo apt install webp
  3. ImageMagick (convert)
    • macOS: brew install imagemagick
    • Linux: sudo apt install imagemagick
  4. sharp (Node.js fallback for Windows / Non-Native Envs)
    Automatically installed when you run the local bun install command. The sharp engine handles compression via libvips without needing external binaries.

First Time Setup (TS Environment):

cd .agents/skills/baoyu-compress-image
bun install

Usage

Run the script using bun from the root of the vault.

bun .agents/skills/baoyu-compress-image/scripts/main.ts <input> [options]

Options

OptionShortDescriptionDefault
<input>Input target (File or directory)Required
--output-oStrict output file pathSame dir as input
--format-fOutput format (jpeg, webp, png)jpeg
--quality-qQuality Level 0-10065
--keep-kKeep original file in-place (don't archive it)false
--recursive-rProcess directories recursivelyfalse

Examples & Workflows

1. Compress a generated AI image for publishing (Default)

bun .agents/skills/baoyu-compress-image/scripts/main.ts Assets/cover-draft.png

Effect: It creates Assets/cover-draft.jpg and safely moves cover-draft.png out of the way into Archive/Original-Images/.

2. Compress an image but keep it as WebP format

bun .agents/skills/baoyu-compress-image/scripts/main.ts Assets/screenshot.png -f webp

3. Test different quality manually and keep the original there

bun .agents/skills/baoyu-compress-image/scripts/main.ts Assets/photo.png -q 80 --keep

4. Batch-compress an entire directory

bun .agents/skills/baoyu-compress-image/scripts/main.ts "00 Inbox/" -r

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.