Figure Studio
Unified four-mode visual engineering skill. Mode 1 (Pure Vector SVG) is the primary default engine covering ~75% of all technical and academic diagram needs. Load only the single mode manual matched by the router below so context stays focused and rules never collide.
Resolve this skill root as <SKILL> (typically ~/.agents/skills/figure-studio or your host's installed skills directory).
1. Mode Router (Pick Exactly One Primary Mode)
Evaluate the user's request top-to-bottom and commit to one mode before reading its manual:
| Priority | User Intent / Signal | Mode | Manual to Read (Load ONLY This One) |
|---|---|---|---|
| Default (Primary) | System/software architecture, open-source README hero diagram, company technical RFC, algorithm pipeline, multi-agent framework, conceptual comparison, capability taxonomy, sequence/state/ERD/layer/flow diagrams where text accuracy and crisp layout matter | Mode 1: Publication Vector SVG | references/mode-vector-svg.md |
| Conditional A | Figure explicitly requires photorealistic/3D/organic/physical subjects SVG cannot draw well (robots, 3D point clouds, molecules, hardware scenes, physical environments) OR user explicitly requests an AI image-model conceptual poster / artistic hero teaser | Mode 2: Generative Hybrid & Concept | references/mode-hybrid-image.md |
| Conditional B | Quantitative data plots driven by real datasets or experimental tables (multi-series line/ablation curves, heatmaps, box/violin/scatter plots, load-test latency percentiles, multi-panel experimental plots) | Mode 3: Publication Data Plots | references/mode-data-plots.md |
| Conditional C | User supplies a local codebase, SQL schema, Docker Compose, Kubernetes YAML, OpenAPI spec, Mermaid block, or legacy .drawio file to map/redraw OR explicitly asks for an editable .drawio deliverable for teammates to drag-edit | Mode 4: Source Extract & Draw.io Bridge | references/mode-source-drawio.md |
Routing Reinforcement Rules
- When in doubt between Mode 1 and Mode 2: Default to Mode 1. Never route text-heavy architectures, Chinese engineering RFCs, or exact protocol topologies to full raster image generation. If a technical figure needs 1–3 concrete 3D/physical visuals alongside crisp text and arrows, choose Mode 2 (Hybrid Composite: vector skeleton + cutout assets) rather than Full Concept raster generation.
- When Mode 4 extracts a topology: Default output is still a Mode 1 publication SVG + 2x PNG (clean redraw, never ugly auto-layout pass-through). Emit
.drawioonly when the user explicitly asks for.drawio. - Architecture + compact result inset: When architecture or methodology is the primary subject and the figure includes only a compact quantitative inset (e.g., a small summary bar or threshold curve from user-supplied points), stay in Mode 1 and draw the inset inline in SVG. Route to Mode 3 when plotting quantitative data is the main subject.
2. Universal Non-Negotiable Guardrails (All Modes)
- Sans-Serif Typography Only: Use
'Inter', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serifacross all diagrams and plots. Never use serif faces (Times,Georgia,SimSun,Songti, Computer Modern, genericserif). - Grounded 3-Step Dual Crisp Palettes (Rich Depth, Zero Red-Brick Slop): Pure
#FFFFFFcanvas with crisp 3-step tonal contrast (white card interiors + clean light zone tints + grounded medium-dark structural borders & selective solid focal anchors in cool/warm hues) using one official palette per figure:- Crisp Sapphire (engineering architectures, open-source READMEs, technical RFCs): Neutral Slate
#52657D(#F5F7FA), Primary Sapphire#1E5AA8(#F0F6FE/#D8E8FC), Secondary Pine Emerald#177A5A(#EFFAF5/#CEEFE0), Accent Warm Amber#C27018(#FEF7EC/#FBE7C6), Restrained Signal Rose Garnet#C2383B(#FEF2F2outline/arrow only), Optional Indigo#5E43B3(#F5F2FD). - Journal Bright (academic Figure 1s, conceptual comparisons, data plots, slides): Light Slate
#566578(#F7F8FA), Primary Cerulean#1864A8(#F3F8FD/#D9ECFA), Secondary Botanical Green#16825B(#F2FBF7/#D1F0E3), Accent Marigold#CC7712(#FFF9EE/#FDEAC7), Restrained Signal Soft Coral#CA3E34(#FFF3F2outline/arrow only), Optional Orchid#6C46B8(#F7F3FD). - Surgical Restraint Law: Keep outer zones to Neutral Slate +
1primary hue + at most1–2functional hues (never4–5rainbow columns or cross-hue nested cards); keep solid fills earned (<= 4focal mechanism headers in Sapphire/Emerald + rich solid bars inside micro-visuals); never use wide solid alarm-red/orange bricks, heavy pink/peach panels, electric UI blues (#2563EB/#1D4ED8/#0000FF), or washed-out low-contrast pastel outlines.
- Crisp Sapphire (engineering architectures, open-source READMEs, technical RFCs): Neutral Slate
- Zero Fabrication & Zero Leakage: Every component, metric, formula, and connection must faithfully represent the user's specification or parsed source files. Never invent experimental numbers, never add placeholder filler prose, and never leak skill metadata (palette names, mode labels, debug coordinates) or raw ASCII arrows (
->) onto the canvas. - Typography, Copy Budget & Structural Cleanliness: No Chinese full stop
。on big titles, no middle-dot·concatenation in prose/labels (SI compound units likeΩ·cm²are exempt), zero descriptive filler prose or stacked grey subtext inside cards (module name + at most 1 concise role phrase; never repeat links/env vars already shown on arrows), max2levels of container nesting, and minimum legible text size>= 11.5px(>= 12pxfor READMEs,>= 13pxfor single-column papers/slides). - Mandatory Dual Verification & Refinement Discipline: Never deliver an unaudited file. Every mode enforces both a deterministic script audit and 1:1 multimodal visual inspection of the rendered image:
- Vector & Code Modes (Mode 1, Mode 2 Hybrid Composite SVG, Mode 3, Mode 4): Execute at least 2 targeted polish rounds driven by 1:1 visual inspection (re-running the strict audit script each round). Hard defects (
errorCount > 0, invalid XML, typos, wrong arrow directions, disconnected islands, missing source nodes) have zero tolerance — keep refining up to 6 rounds; only if hard defects persist after 6 rounds should you restructure the layout or report a blocker. - Full Raster Concept Generation (Mode 2 Full Concept): Do not re-roll a genuinely clean, defect-free image; if spelling errors, meta-label leaks, or structural flaws appear, refine up to 3 attempts, then fall back to Hybrid Composite (zero-text artwork + crisp SVG labels) if text garbling persists.
- Vector & Code Modes (Mode 1, Mode 2 Hybrid Composite SVG, Mode 3, Mode 4): Execute at least 2 targeted polish rounds driven by 1:1 visual inspection (re-running the strict audit script each round). Hard defects (
3. Quick Script Index (Invoked Inside Mode Workflows)
| Script | Mode | Purpose |
|---|---|---|
scripts/select_archetype.py | 1, 2 | Offline lookup across 28 diverse spatial archetypes (hub-loop, top-down planes, layered stack, split-track, zoom, pipeline) |
scripts/brand_icons.py | 1, 4 | Fetch genuine official brand & cloud SVG marks (auto viewBox normalization, non-destructive manifest merge, --inject, --no-global-cache) |
scripts/audit_vector.mjs | 1, 2, 4 | Strict XML parser + isolated headless Chrome 2x PNG render + real DOM geometry, overlap, connector, typography & visual-restraint audit |
scripts/prepare_asset.py | 2 | Border flood-fill cutout (preserving inner highlights), tight-crop, edge halo scoring & fail-fast --inject |
scripts/audit_raster.py | 2 | Check raster image dimensions, aspect ratio, border margin safety, and luminance contrast |
scripts/plot_kit.py & scripts/audit_plot.py | 3 | Shared Crisp Sapphire / Journal Bright sans-serif Matplotlib styling (`lang="en" |
scripts/extract_topology.py | 4 | Parse SQL, Kubernetes YAML, Docker Compose, OpenAPI JSON/YAML, Mermaid (.mmd/.md), or legacy .drawio into normalized topology.json |
scripts/emit_drawio.py & scripts/audit_drawio.py | 4 | Group-aware .drawio XML compiler + structural, container-overlap, node-occlusion & shared-port verification + blocking PNG export |
4. Standard Deliverable Contract
Report concisely at completion:
- Primary deliverable paths (e.g.,
<name>.svg+<name>.png, or<name>.drawiowhen explicitly requested) - Mode and palette (
Crisp SapphireorJournal Bright) chosen (1 line) - Verification summary: automated audit result (
0 errors, warning count) + polish rounds completed and concrete visual fixes applied - For Mode 3/4: explicit data provenance or source-to-diagram fidelity ledger noting any intentional simplifications