moai-domain-svg-infographic

Generate accessible SVG technical infographics via numeric layout and render verified 2x PNGs.

1.2k|222|Updated Sep 16, 2025
One-click install
npx skills add https://github.com/modu-ai/moai-adk --skill moai-domain-svg-infographic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-domain-svg-infographic
Source: https://github.com/modu-ai/moai-adk/tree/main/internal/template/templates/.claude/skills/moai-domain-svg-infographic
Command: npx skills add https://github.com/modu-ai/moai-adk --skill moai-domain-svg-infographic

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Hand-drawn SVG diagrams drift into a render-fix loop where coordinates are nudged by eye, CJK labels overflow their boxes, and the output lacks accessible names. This Skill replaces guesswork with a computed box table, deterministic linting, and verified PNG rendering.

Core Features & Use Cases

  • Numeric layout pass: Build a box table with grid, containment, and connector formulas before writing any SVG markup, choosing from four archetypes (architecture stack, flow, comparison, hierarchy).
  • Deterministic lint and render: Run check-svg.mjs for structural errors and accessibility contract violations (SVG060-SVG064), then render a 2x PNG via headless Chromium with browser version disclosure and PNG header verification.
  • CJK-first text budgeting: Compute per-line character capacity so Korean, Japanese, and Chinese labels fit their containers without truncation or per-language font shrinking.
  • Use Case: Produce a slide-ready architecture diagram with Korean labels: set the four output dials, compute the layout table, author the SVG, lint it clean, and deliver a verified 1600x900 PNG.

Quick Start

Create an SVG architecture infographic of my system with Korean labels and render it as a 2x PNG for my slides.

Frequently Asked Questions about moai-domain-svg-infographic

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

FAQPage Schema
How do I create an SVG architecture diagram with precise layout?

Build a box table first with id, x, y, w, h per element, then derive every other coordinate from grid and containment formulas. Pick one of four archetypes (stack, flow, comparison, hierarchy), run the containment checks, and only then author the SVG markup.

When should I use SVG instead of mermaid for diagrams?

Use SVG when the deliverable is an image file for slides, email, or offline reading, when pixel-level control is required, or when CJK labels must wrap at exact widths. Keep mermaid for markdown-embedded diagrams that change often or use standard types like flowcharts and sequence diagrams.

How do I render an SVG to PNG with headless Chromium?

Run node scripts/render.mjs diagram.svg --out diagram.png, which renders at 2x scale by default. The script resolves a Chromium executable from CHROME_PATH or platform locations, reports the browser version, and verifies the PNG header dimensions against the target.

Does SVG text fitting work for Korean and Japanese labels?

Yes, the skill budgets CJK text at full-width advance (1.00em per glyph), so a line holds roughly 60% of the Latin character count. Set a CJK-first font stack and rewrite labels to fit the computed capacity rather than truncating or shrinking fonts.

Why does my SVG diagram fail the accessibility lint checks?

Failures SVG060-SVG064 mean the accessible contract is incomplete: missing role="img", no aria-labelledby, a title that is not the first child, a missing desc, or unprefixed title/desc ids. Every informative diagram needs all four elements with per-diagram prefixed ids.

What happens if Node or a headless browser is not installed?

Authoring the editable SVG always works. Without Node, use the manual checklist in references/authoring.md and report it as a manual check; without a browser, deliver the SVG alone and state plainly that no PNG was produced.