svg-precision

Generates SVG code from strict JSON scene graphs with validation and PNG previews.

4|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/k97/dock-tile --skill svg-precision-k97
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: svg-precision
Source: https://github.com/k97/dock-tile/tree/main/.claude/skills/svg-precision
Command: npx skills add https://github.com/k97/dock-tile --skill svg-precision-k97

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires CairoSVG, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill solves the inconsistency and structural errors often found in AI-generated SVGs by enforcing a strict, deterministic JSON-to-SVG pipeline.

Core Features & Use Cases

  • Deterministic Generation: Converts structured JSON scene graphs into valid, clean SVG code.
  • Validation & Rendering: Provides built-in tools to validate SVG structure and generate PNG previews for visual verification.
  • Use Case: Ideal for creating technical diagrams, UI mockups, or custom icons that must maintain exact dimensions and cross-viewer compatibility.

Quick Start

Use the svg-precision skill to build an SVG from the provided scene graph spec.json and save it as output.svg.

Frequently Asked Questions about svg-precision

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate structurally valid SVG files from JSON specifications?

To generate structurally valid SVG files from JSON specifications, you can use a deterministic JSON-to-SVG pipeline that converts structured scene graphs into clean SVG code. This enforces strict coordinate control and cross-viewer compatibility for technical drawing and UI mockups.

Why does my AI-generated SVG render incorrectly across different viewers?

AI-generated SVGs often render incorrectly across different viewers due to structural inconsistencies and non-deterministic code generation. Using a strict JSON-to-SVG pipeline validates the SVG structure to ensure visual accuracy and cross-viewer compatibility.

Do I need CairoSVG to render and validate SVG files?

Yes, you need CairoSVG to render and validate SVG files within this workflow. CairoSVG is required to generate PNG previews for visual verification and to execute the build and diffing logic alongside Python.

What is the best way to create technical diagrams with exact coordinate control?

The best way to create technical diagrams with exact coordinate control is by defining strict JSON scene graph specifications that are deterministically converted into valid SVG code, ensuring exact dimensions and structural correctness for precise rendering.

Can I generate PNG previews to visually verify my SVG structure?

Yes, you can generate PNG previews to visually verify your SVG structure. The pipeline includes built-in validation and rendering tools that utilize CairoSVG to render SVG files into PNG previews for visual verification.