ts-figure-svg

Convert AI-generated figure candidates into editable, audited, publication-grade SVG vector graphics.

1.1k|19|Updated Jun 18, 2026
One-click install
npx skills add https://github.com/Spark-To-Paper-Skills/spark-to-paper-skills --skill ts-figure-svg-spark-to-paper-skills
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ts-figure-svg
Source: https://github.com/Spark-To-Paper-Skills/spark-to-paper-skills/tree/main/skills/ts-figure-svg
Command: npx skills add https://github.com/Spark-To-Paper-Skills/spark-to-paper-skills --skill ts-figure-svg-spark-to-paper-skills

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Image models produce raster PNGs of paper figures that are not editable, often contain fabricated labels or wrong topology, and cannot be fixed or restyled. This Skill turns a generated figure candidate into a native SVG where every label is live text and every element traces back to the paper's actual method, then verifies it on the compiled PDF page. ## Core Features & Use Cases - Two-stage figure pipeline: Runs the official PaperBanana engine (Retriever→Planner→Stylist→Visualizer→Critic) to generate candidate PNGs, then extracts the design language into a style sheet and redraws the figure from the paper's facts as real SVG elements. - Measured repair loop: audit_svg.py checks structure and geometry without a renderer — catching overflow, text overlap, stroke-scaled arrowheads, dangling connectors, font fallback risks, and traced path-soup — across at least four rounds with per-round snapshots. - Page-level acceptance: Converts SVG to vector PDF with font embedding verified via pdffonts and pdfimages, measures the smallest rendered word in points, and validates a fresh rebuild against the baseline. - Use Case: You have a LaTeX paper with a placeholder figure. Use this Skill to generate candidates from your method section, pick one, and receive an editable SVG plus embedded vector PDF that passes machine-checked integrity gates. ## Quick Start Set up the PaperBanana engine with your OpenRouter API key, then ask the assistant to turn the placeholder figure in your paper's LaTeX source into an editable SVG figure.

Frequently Asked Questions about ts-figure-svg

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

FAQPage Schema
How do I turn an AI-generated figure into an editable SVG?

Generate candidate PNGs with the PaperBanana pipeline, extract the chosen image's design language into a style sheet, then redraw the figure from the paper's facts as real SVG rect, path, and text elements. Never auto-trace pixels, which produces thousands of uneditable paths.

How do I validate an SVG figure for publication quality?

Run audit_svg.py, which checks structure and geometry using Adobe Times metrics without needing a renderer. It flags canvas overflow, text overlap, stroke-scaled arrowheads, dangling connectors, sub-legible fonts, and traced path-soup, exiting nonzero on any error.

What tools convert SVG to PDF while keeping text editable?

rsvg-convert is preferred, followed by headless Chrome, Inkscape, and cairosvg as fallbacks. The result is rejected unless pdffonts shows embedded fonts, because exporters that outline glyphs produce PDFs where labels are no longer live text.

Why does my SVG text render in the wrong color or font?

A presentation attribute like fill on a text element loses to any stylesheet rule, so a global text fill rule silently overrides it. Use CSS classes instead, and avoid glyphs outside the Times repertoire, which trigger silent font fallback in the exported PDF.

What are the limitations of image-model-generated paper figures?

Generated figures invent sequential links, fabricate numbers, and garble labels, so they cannot be used directly. This Skill borrows only the visual style from the PNG while redrawing all content from the paper's actual method text.