Skip to main content
rule CX Codex

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/rendering-svg-precision.md
Open on GitHub

What 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 svgo across the project

Example prompts for the agent

  • Optimize all SVG files in icons/ to one decimal place
  • Run svgo on logo.svg with precision 1
  • Create arrow.svg with rounded coordinates

How to install rendering-svg-precision

Manually: put the files in place

.claude/rules/rendering-svg-precision.md

The paths frontmatter field limits the files

Step 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.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set20

The whole set →
interview interview runs a long question-and-answer session about a plan file and writes the finished spec back to the same path. CX Codex +1 ★ 1,064repo stars js-cache-property-access js-cache-property-access guides Claude Code to store deep object properties and array bounds in local variables before executing JavaScript loops. CX Codex +1 ★ 1,064repo stars js-set-map-lookups The js-set-map-lookups rule recommends using a Set when code repeatedly checks array membership. It applies to repeated lookups, such as filtering items by ID. CX Codex +1 ★ 1,064repo stars rendering-activity rendering-activity — a Claude rule that tells the agent to keep costly React components inside <Activity> so hiding them does not throw away state. CX Codex +1 ★ 1,064repo stars _template _template — a rule-file scaffold with fields for its title and impact, plus sections for contrasting incorrect and correct code. CX Codex +1 ★ 1,064repo stars async-parallel async-parallel — a Claude rule that sends independent async calls through Promise.all() instead of awaiting them one by one. Useful when a handler piles up sequential awaits. CX Codex +1 ★ 1,064repo stars rerender-derived-state The rerender-derived-state rule favors derived boolean state over continuously changing values, reducing React re-renders. It fits responsive UI logic. CX Codex +1 ★ 1,064repo stars js-combine-iterations js-combine-iterations tells the Claude agent to replace several filter or map passes over the same array with one loop that fills the results as it goes. CX Codex +1 ★ 1,064repo stars

Project sponsors

Companies that keep this analytics open