cssmagic/agent-skills/convert-png-to-webp

Claude Code and agent skill by cssmagic/agent-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when converting PNG images in a directory tree to lossless WebP in place with `cwebp`, preserving original file timestamps, deleting the source PNG files only after successful conversion, and reporting the processed image count.

Install

npx vskill@latest install cssmagic/agent-skills/convert-png-to-webp

SKILL.md

The same SKILL.md was published earlier as cssmagic/agent-skills/convert-png-to-webp.

Convert PNG to WebP

Purpose

Convert PNG files inside one directory tree to same-location .webp files:

  • Convert PNG files to lossless WebP.
  • Preserve original modification time and, on macOS, creation time.
  • Delete each source PNG only after its WebP replacement is complete.
  • Report how many PNG files were processed.

Required Input

Each run needs one directory to process.

If the directory is missing or ambiguous, ask the user for the path before running commands.

Normalize ~ and relative paths to an absolute path before reporting or running the script.

Defaults

Treat PNG extensions case-insensitively.

Map each PNG to a same-directory, same-basename .webp file.

Do not overwrite existing .webp files unless the user explicitly allows overwrite behavior. If a mapped .webp already exists, report the exact PNG and WebP paths and stop before converting anything.

Reject symlinked PNG files before writing, because deleting a symlink after conversion is easy to misread.

Prerequisites

Use the official WebP CLI:

bash
command -v cwebp

The bundled script requires Python 3:

bash
command -v python3

On macOS, creation-time preservation requires:

bash
command -v GetFileInfo
command -v SetFile

If those macOS timestamp tools are unavailable, stop before converting anything.

Workflow

Set the directory from the user's provided path:

bash
dir="/absolute/path/to/directory"

Run the bundled script from this skill directory:

bash
python3 scripts/convert_png_to_webp.py "$dir"

Only pass --overwrite if the user explicitly permits replacing existing mapped WebP files:

bash
python3 scripts/convert_png_to_webp.py --overwrite "$dir"

The script performs preflight checks before writing:

  • required commands
  • directory existence
  • existing mapped WebP files
  • target path collisions, including case-insensitive collisions
  • symlinked PNG files

During conversion, the script writes a temporary WebP beside the source file, syncs timestamps, atomically moves it into place, and only then deletes the source PNG.

Reporting

Summarize with:

  • directory
  • PNG files found
  • converted WebP files
  • deleted original PNG files
  • failed files, if any
  • timestamp failure count
  • whether macOS creation times were synced

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
4
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/cssmagic/agent-skills/convert-png-to-webp/badge)](https://verified-skill.com/skills/cssmagic/agent-skills/convert-png-to-webp)

Something wrong with this skill or its page? Tell us.