Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

SVGO

$ svgo Community Low Risk
SVGO · AI & Media · MIT · macos / linux / windows

SVGO (svgo) strips redundant XML metadata, comments, hidden elements, and path precision from SVG files using a configurable plugin pipeline (svgo.config.mjs). It supports single-file (-o), directory (-rf), string (-s), and stdout (-o -) modes with --quiet and --no-color.

FCRS-1.0 Score
86 /100
Good
Medium Confidence
Zero-Friction Install
brew install svgo
CLI vs MCP Decision CLI Only

Optimizing SVG icons locally with svgo and inspecting diffs via -o - requires zero MCP round-trips.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 20 / 25

Non-interactive CLI with -o - stdout preview, --quiet, --no-color, and --show-plugins introspection, though lacks JSON output and --dry-run.

  • Supports -o -, -q/--quiet, --no-color, and --show-plugins
  • No JSON summary or --dry-run
Trust & Safety 21 / 25

Easy non-destructive -o - / -o <out> usage, though omitting -o mutates files in-place and aggressive plugins can alter SVG IDs used by CSS/JS.

  • Overwrites input SVG in-place when -o is omitted
Setup & Portability 14 / 15

Available via Homebrew, global npm, or zero-install npx svgo across all platforms.

  • Available via brew install svgo, npm, and npx
Utility & Efficiency 14 / 15

De-facto standard SVG optimizer supporting recursive folders (-rf), --multipass, and --pretty formatting.

  • Handles single files, stdin, strings, and recursive directories
Maintenance & Lineage 9 / 10

Actively maintained MIT project (svg/svgo) used across major frontend toolchains.

  • Official svg/svgo GitHub repository under MIT
Docs & Verifiability 8 / 10

Clean svgo.dev documentation and svgo --help / --show-plugins introspection.

  • Official documentation at svgo.dev

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; reads optional local svgo.config.mjs project config.

Side Effects
Read-Only Local Write
Cost & Quotas

Free MIT open-source Node.js CLI.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# SVGO Agent Rules
- Pass `-o <output>` (or `-o -` for stdout preview) because omitting `-o` overwrites the input SVG in place.
- Check `viewBox` preservation (`removeViewBox` is disabled in modern `preset-default`, but verify custom `svgo.config.mjs` files).

Agent-Ready Command Recipes

Safe Read-Only Queries

Preview optimized SVG on stdout without writing disk
svgo -q -i icon.svg -o -

Runs the optimization pipeline and prints minified SVG XML to stdout (-o -) without altering icon.svg.

List all available SVGO optimization plugins
svgo --show-plugins

Enumerates built-in SVGO plugin names for composing a deterministic svgo.config.mjs.

Controlled Writes & Previews

Optimize a folder of SVGs into a clean output directory
svgo -rf src/icons -o dist/icons --multipass

Recursively minifies SVGs from src/icons into dist/icons using multi-pass optimization.

Strengths for Agents

  • + svgo -q -i file.svg -o - previews exact minified SVG output on stdout without writing disk.
  • + --show-plugins makes plugin capabilities directly discoverable by agents.

Caveats & Pitfalls

  • ! Omitting -o overwrites input files in place.
  • ! Default ID minification (cleanupIds) can break inline SVGs referenced by external CSS or use tags.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI