# rendering-svg-precision

rendering-svg-precision — a rule for Claude Code that reduces SVG coordinate precision to one decimal place. Applies when creating icons or editing graphics.

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 1064 repo stars
- Author: jarrodwatts
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/jarrodwatts/claude-code-config/tree/HEAD/skills/vercel-react-best-practices/rules/rendering-svg-precision.md
- Updated: 2026-01-21
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/rendering-svg-precision

## What it 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.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/rules/rendering-svg-precision.md` — The paths frontmatter field limits the files

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### Cursor

**Manually: put the files in place**
- File: `.cursor/rules/rendering-svg-precision.mdc` — Frontmatter: description, globs, alwaysApply

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/rendering-svg-precision.instructions.md` — The applyTo field sets which files it applies to

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/rendering-svg-precision.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/rendering-svg-precision.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/jarrodwatts/claude-code-config/tree/HEAD/skills/vercel-react-best-practices/rules/rendering-svg-precision.md

## When to use it
- 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
- Optimize all SVG files in `icons/` to one decimal place
- Run `svgo` on `logo.svg` with precision 1
- Create `arrow.svg` with rounded coordinates

## Similar
- [svg-precision-skill](https://affpapa.org/en/nevibecode/skills/svg-precision-skill.md) — skill · 306 installs
- [svg-path-draw](https://affpapa.org/en/nevibecode/rules/svg-path-draw.md) — rule · ★ 78316 repo stars
- [svg-tracer](https://affpapa.org/en/nevibecode/mcp/svg-tracer.md) — MCP server · ★ 81 repo stars
- [Image to SVG](https://affpapa.org/en/nevibecode/mcp/image-to-svg.md) — MCP server · ★ 11 repo stars
- [create-svg-illustrations](https://affpapa.org/en/nevibecode/skills/create-svg-illustrations.md) — skill · 211 installs
- [rendering-animate-svg-wrapper](https://affpapa.org/en/nevibecode/rules/rendering-animate-svg-wrapper.md) — rule · ★ 7191 repo stars

From the same set: [jarrodwatts/claude-code-config](https://affpapa.org/en/nevibecode/by/jarrodwatts/claude-code-config.md) — 20 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
