svg-book-illustrator

Generates print-ready SVG diagrams for book chapters and formal articles from Markdown content.

636|91|Updated Jan 7, 2026
One-click install
npx skills add https://github.com/cat-xierluo/legal-skills --skill svg-book-illustrator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: svg-book-illustrator
Source: https://github.com/cat-xierluo/legal-skills/tree/main/skills/svg-book-illustrator
Command: npx skills add https://github.com/cat-xierluo/legal-skills --skill svg-book-illustrator

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Creating consistent, print-quality technical illustrations (architecture diagrams, flowcharts, hierarchy charts) for books and formal articles is slow and error-prone, and hand-drawn SVG often fails print constraints like font size, contrast, and canvas sizing. This Skill analyzes chapter Markdown, plans illustrations, and generates standards-compliant SVG figures that render correctly in Markdown/Obsidian and survive print production.

Core Features & Use Cases

  • 13 layout templates: flow, layer, matrix, hub, tree, cycle, radar, skill-card, timeline-lane, matrix-grid, three-col, plus two combination templates, each with parameterized Python generators.
  • Four-gate review workflow: density checks, figure-text consistency review, text-width/coordinate calculation, and multimodal visual inspection after controlled-font rendering to PNG.
  • Manuscript consistency scanning: a read-only scanner audits existing inline SVGs across a book repository for padding, arrow placement, marker, syntax, identity, and sidecar-cache violations.
  • Use Case: Given a book chapter Markdown file, the Skill inserts figure placeholders, generates SVG diagrams with unique figure IDs, embeds them with captions, extracts them to files, and exports 300-600 DPI PNGs for the publisher.

Quick Start

Run the svg-book-illustrator skill on my chapter file chapter03.md to plan, generate, and embed print-ready SVG diagrams.

Frequently Asked Questions about svg-book-illustrator

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

FAQPage Schema
How do I generate SVG diagrams for a book chapter automatically?

Point the Skill at a chapter Markdown file; it scans for architecture, flow, comparison, and hierarchy descriptions, inserts figure placeholders, then generates SVG from 13 layout templates. Parameterized Python generators like gen-radar.py and gen-timeline-lane.py handle geometry-heavy diagrams.

What diagram types does this SVG illustration tool support?

It supports flow, layer, matrix, hub, tree, cycle, radar, skill-card, timeline-lane, matrix-grid, and three-col templates plus flow+matrix and flow+hub combinations. Bar, line, and pie charts are explicitly out of scope.

Can I convert the generated SVG figures to high-resolution PNG for print?

Yes. Use scripts/render_svg.py for quick librsvg previews or scripts/svg2png.js for 300-1200 DPI export via Puppeteer. Both load a shared external CSS for controlled fonts; bare rsvg-convert output is not accepted as verification evidence.

Why do my SVG diagrams fail the producer contract tests?

Common failures include style blocks, inline style attributes, embedded font-family, background rectangles, non-720px canvas widths, and missing or duplicate data-figure-id values. Run the unittest suite in scripts/tests to identify the exact violated rule.

Does the skill check existing manuscripts for SVG problems?

Yes. scripts/scan_consistency.py audits all inline SVGs in a book repository against 19 rules covering padding, arrow placement, markers, syntax, figure identity, and sidecar cache sync. It only reports findings and never modifies the manuscript.