rendering-svg-precision — Claude Code rule: SVG optimization
rendering-svg-precision — a rule for Claude Code that reduces SVG coordinate precision to one decimal place. Applies when creating icons or editing graphics.
no license ★ 1,064 updated 2026-01-21
.claude/rules/rendering-svg-precision.mdWhat rendering-svg-precision does
The rule teaches the agent to round SVG path coordinates to a reasonable precision: M 10.3 20.8 instead of M 10.293847 20.847362. File size drops two to three times without visible quality loss.
Optimal precision depends on the viewBox, but one decimal place is enough for most icons. The rule suggests automation via svgo --precision=1 --multipass.
The rule triggers when the project generates SVG or edits existing files. For a handful of icons, running svgo manually is simpler.
What it helps with
- reduce SVG file size without manual coordinate editing
- round excessive precision in
<path d="...">elements - automate SVG optimization with
svgoacross the project
Example prompts for the agent
- Optimize all SVG files in
icons/to one decimal place - Run
svgoonlogo.svgwith precision 1 - Create
arrow.svgwith rounded coordinates
How to install rendering-svg-precision
Manually: put the files in place
.claude/rules/rendering-svg-precision.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/rendering-svg-precision.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/rendering-svg-precision.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/rendering-svg-precision.mdManually: put the files in place
.clinerules/rendering-svg-precision.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about rendering-svg-precision
How to install rendering-svg-precision in Claude Code?
Place the rule file in .claude/rules/rendering-svg-precision.md at the project root.
What does rendering-svg-precision do?
The rule teaches the agent to reduce SVG coordinate precision to one decimal place, decreasing file size. Automation is possible with npx svgo --precision=1 --multipass.
Which SVG files work well with one decimal place?
Most icons and UI elements. If the viewBox is very large or sub-pixel precision is needed, two decimal places may be required.