cssmagic/agent-skills/sync-image-as-webp
Claude Code and agent skill by cssmagic/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when syncing a source directory to a target directory, converting PNG files to lossless WebP using `cwebp`, copying all non-PNG files unchanged, preserving the directory structure, and syncing creation and modification timestamps (if possible).
Install
npx vskill@latest install cssmagic/agent-skills/sync-image-as-webpSKILL.md
The same SKILL.md was published earlier as cssmagic/agent-skills/sync-image-as-webp.
Sync Image As WebP
Purpose
Convert a source directory into a target directory while preserving structure:
- Convert PNG files to same-name
.webpusing lossless WebP. - Copy all non-PNG files unchanged.
- Sync empty directories.
- Sync target file creation time and modification time from source files.
- Verify file, directory, timestamp, and item-count differences.
Required Inputs
Each run needs:
- Source directory
- Target directory
If either directory is missing or ambiguous, ask the user for the missing path before running commands.
Do not infer a target directory from the source directory unless the user explicitly asks for that behavior.
After paths are known, normalize ~ and relative paths to absolute paths before reporting or running destructive-looking operations.
Defaults
Use these mappings:
- Source PNG file -> target
.webp - Source non-PNG file -> target same filename
- Source directory -> target same relative directory
Treat PNG extensions case-insensitively.
Never delete files.
Do not overwrite existing mapped target files unless the user explicitly allows overwrite behavior.
Reject the run before writing if multiple source files map to the same target path.
Reject the run before writing if the target directory is inside the source directory.
Prerequisites
Prefer the official WebP CLI:
The bundled script requires Python 3:
On macOS, creation-time syncing uses:
If creation-time syncing is unavailable, continue the run and tell the user in the final report that only modification times were synced.
Workflow
Set source and target directories from the user's provided paths:
Run the bundled script from this skill directory:
Only pass --overwrite if the user explicitly permits replacing existing mapped target files:
The script performs preflight checks before writing:
- target path collisions, including case-insensitive collisions
- existing mapped target files, unless
--overwriteis used - target directory nested inside source directory
- target directory paths that already exist as files
Verification
The script verifies and reports:
- expected target files exist
- PNG conversion and copy command failures
- modification-time parity
- macOS creation-time parity when available
- source and target directory differences
- target-only files
Reporting
Summarize with:
- source directory
- target directory
- PNG converted count
- non-PNG copied count
- directories created count if relevant
- missing target count
- timestamp diff counts
- command failure count
- whether creation times were synced
- any source-only or target-only directories/files
If creation times were not synced, explicitly tell the user that only modification times were preserved.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/sync-image-as-webp/SKILL.md
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
[](https://verified-skill.com/skills/cssmagic/agent-skills/sync-image-as-webp)