CommunityImagegithub.com

academic-drawio-figures

End-to-end workflow, empirical Prose-to-Figure Playbook calibrated on 30 landmark systems papers across 10 top venues (`419` figs, `213` design figs, `118` visually audited — 10-archetype `U1–U10` Decision Matrix + 5 Text–Figure Bidirectional Synchronization Laws), v11 native explanatory mechanism primitives (`58` `add_*` methods: multi-party RPC sequence lifelines, Baseline-vs-Ours contrast frames + status badges, Gantt & discrete-time swimlane timelines + latency span/dimension bars, addressable virtual→physical slot rails + mapping links + zoom lenses, annotated SQL/DSL code snippets, editable split-color tree/radix/operator DAGs & lifecycle FSMs, live ring buffers, 4-direction curly braces, inline legends & phase strips), Anti-Box-itis visual grammar (borderless pictorial icon tiles, open dashed split stages, bold block stage arrows, curved labeled Bezier feedback loops, 3-layer stacked worker containers, tokenized slot queues, straddling bridge banners, native clouds/multi-docs/ch

What is academic-drawio-figures?

academic-drawio-figures is a Gemini CLI agent skill that end-to-end workflow, empirical Prose-to-Figure Playbook calibrated on 30 landmark systems papers across 10 top venues (`419` figs, `213` design figs, `118` visually audited — 10-archetype `U1–U10` Decision Matrix + 5 Text–Figure Bidirectional Synchronization Laws), v11 native explanatory mechanism primitives (`58` `add_*` methods: multi-party RPC sequence lifelines, Baseline-vs-Ours contrast frames + status badges, Gantt & discrete-time swimlane timelines + latency span/dimension bars, addressable virtual→physical slot rails + mapping links + zoom lenses, annotated SQL/DSL code snippets, editable split-color tree/radix/operator DAGs & lifecycle FSMs, live ring buffers, 4-direction curly braces, inline legends & phase strips), Anti-Box-itis visual grammar (borderless pictorial icon tiles, open dashed split stages, bold block stage arrows, curved labeled Bezier feedback loops, 3-layer stacked worker containers, tokenized slot queues, straddling bridge banners, native clouds/multi-docs/ch.

Works with~Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/Destroyertubu/academic-drawio-figures/tree/HEAD

Installed? Explore more Image skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Academic Figures & Experimental Plots (Top-Conference Strict 2-Hue Harmony, Prose-to-Figure, Mechanism-Rich, Anti-Box-itis & Unified-Theme Standard — v12)

Design and export editable .drawio XML architecture & mechanism diagrams AND zero-contrast-shock Matplotlib experimental evaluation plots as 100% pure-vector LaTeX PDFs (0 raster /Image XObjects) that look genuinely indistinguishable from published OSDI, SOSP, NSDI, FAST, SIGMOD, VLDB, ICDE, ISCA, ASPLOS, EuroSys, SIGCOMM, NeurIPS, and MLSys papers (DistServe, Sarathi-Serve, AlpaServe, SGLang, Mooncake, Splitwise, ServerlessLLM, MegaScale, LoongServe, CacheGen, Alpa, SkyPilot, Orca, SpotServe, vAttention, ClickHouse, FastLanes, LeCo, TiDB, PolarDB-IMCI, CacheLib, Kangaroo, Tectonic, Pond, Midas, Caladan, Demikernel, Firecracker, PDX, Starling, HiState, PolarKV, RetroInfer, Fangorn, Photon, Flink 2.0).

Backed by:


Core Philosophy: The 10 Top-Conference Figure Laws (v12)

Before drawing anything, inspect prose-to-figure-playbook.md, color-themes.md, examples/theme_gallery.png, design-laws-and-palette.md, exp-plot-standards.md, icon-catalog.md, and examples/ (especially ex3, ex4, and ex5). Always enforce these 10 laws:

  1. Choose the Visual Archetype From Your Prose FIRST & Synchronize Bidirectionally (v11!):
    • Never blindly default to a box-and-arrow overview! Across 30 landmark systems papers, > 60% of the most cited design figures are Mechanism Figures — not static architecture boxes.
    • Match the citing paragraph's explanatory verb to the 10-Archetype Decision Matrix (U1–U10) in references/prose-to-figure-playbook.md:
      • U1 Layered/Disaggregated Overview (24/30) → add_split_stage, add_stacked_container, add_icon_tile, add_block_arrow, add_bridge_banner, add_curly_brace(direction="right")
      • U2 Baseline-vs-Ours Contrast (18/30) → add_contrast_pair + add_status_badge (check/cross/warn/halt/prune)
      • U3 Physical Byte/Page Layout & Pointer Mapping (15/30) → add_slot_rail, add_mapping_links, upgraded add_memory_strip(pointers=, top_pins=, tag_colors=, wavy_end=), add_zoom_callout, add_phase_strip
      • U4 Execution Gantt / Discrete-Time State Swimlane (14/30) → add_timeline_lanes + add_span_bracket + vertical add_curly_brace
      • U5 Annotated Empirical Diagnostic (§1–§3, 12/30) → exp_plot_toolkit.py (regime bands, delta arrows, callouts)
      • U6 Parallelism / SIMD / Per-Hop Hardware Datapath (11/30) → add_dimension_bar, add_matrix_grid, add_zoom_callout, add_cube
      • U7 Dynamic Tree / Radix Trie / Operator DAG / FSM (11/30) → add_tree_dag (two-tone split sharded nodes + new/hit/evicted states), add_state_machine
      • U8 Multi-Party RPC / Migration / 2PC Sequence (9/30, +twin R/W) → add_sequence_diagram + add_ring_buffer + add_legend
      • U9 Annotated Code / SQL / DSL-to-Plan (9/30) → add_code_snippet (<= 10 lines, highlighted lines + right leader annotations) + add_tree_dag
      • U10 Macro-to-Micro Zoom-In Projection Lens (8/30) → add_zoom_callout(style="trapezoid"|"dashed_rays")
    • Enforce the 5 Text–Figure Bidirectional Synchronization Laws: (i) 1-to-1 ❶–❺ step badges, (§N) roadmap tags & (I)–(III) phase strips echoed verbatim in prose; (ii) 1 concrete worked running example (A_d/C_p1, V0→P2, LSN 299) instead of abstract Req_i; (iii) explicit control-vs-data wire coding + add_legend; (iv) dual-mode Overview (4–22 words) or 3-part Mechanism caption (Scope + Visual Key + Takeaway); (v) neutral baselines vs. focal novelty tinting + ✓/✗ verdicts.
  2. One Figure = One Core Concept (Split Overloaded Mega-Figures!):
    • Never cram 4–6 unrelated mechanisms into one giant overcrowded canvas.
    • Keep each diagram focused on 1 primary message (typically 6–14 primary actors; <= 18 for compact multi-stage platforms like ex3; <= 2–3 tightly coupled panels). Split overloaded mega-figures into crisp single-column (~400–440 px) or compact spanning (~820–860 px) figures placed beside the exact paragraphs that explain them.
  3. Logical Subfigure Grids & Bottom-Aligned Subcaptions ((a), (b) ALWAYS Below!):
    • Arrange multi-panel figures on clean, symmetrical grids: 1×2 (ex4, ex5), 1×3, 2×1 (add_contrast_pair(orientation="vertical")), or 2×2.
    • Subfigure titles (a) ..., (b) ..., (c) ... MUST sit centered BELOW each subfigure (add_subcaption(...)), matching ACM / PVLDB / USENIX / IEEE conventions. Never put (a)/(b)/(c) captions at the top of panels!
  4. Strict <= 2-Hue Single-Diagram Discipline + Whole-Paper Theme Lock (v12 — NEVER Mix Red+Yellow+Blue+Green!):
    • Lock ONE curated theme across the entire paper via set_paper_theme("<name>") (or env ACADEMIC_FIG_THEME=<name>) from scripts/palette_themes.py — choosing among 6 curated academic themes: morandi_sigmod (Default), nordic_slate, editorial_nature, botanical_earth, mineral_vermeer, and okabe_calm (examples/theme_gallery.png, references/color-themes.md).
    • CRITICAL SEPARATION (v12): The 12 families per theme exist for multi-series Matplotlib evaluation plots (get_series_cycle(n)). A single Draw.io diagram MUST NEVER mix >= 3 chromatic hue sectors (e.g., never paint red + yellow + blue + green in one figure!). Instead, call FP = get_figure_palette("steel_coral") (or "teal_amber", "blue_amber", "blue_teal", "indigo_amber", "mono_blue", "mono_teal"):
      • 75–85% Neutral Canvas: white, warm stone (stone_lt), soft slate (slate_lt/slate_bg), charcoal ink (ink), and neutral rules (rule_dk/stroke). Keep hardware rail titles and (a)/(b) subcaptions strictly neutral charcoal (ink)!
      • 1 Primary Hue Tonal Ladder (pri_lt → pri_mid → pri_ln → pri_dk): differentiate hot/main/compute/Ours stages via lightness within ONE hue instead of inventing a new color per tier.
      • At Most 1 Restrained Accent Hue (acc_* / alt_*): reserve strictly for contrast/bottleneck/eviction/cold/focal innovation (e.g., coral/red sharing the single warm red_coral sector).
    • Enforced automatically by Gate #13 hue_clutter_warning (distinct_hue_sectors > 2 → FAIL) alongside vivid_color_warning. Ban vivid web/Tailwind neon colors, giant dark monolith boxes, and shadow=1.
  5. Break Box Monotony ("Anti-Box-itis") — Pictorial Tiles & Native Draw.io Idioms:
    • NEVER wrap every actor, modality, storage backend, or queue in uniform rectangular boxes or tiny 18–20 px icon-well add_icon_card grids! Cap add_icon_card <= 50% of actors and keep box_like_ratio <= 0.72 (enforced by box_monotony_warning).
    • Combine borderless add_icon_tile(...) inside headerless add_split_stage(...), 3-tier connectors (add_block_arrow, solid add_edge, curved dashed feedback add_edge(..., curved=True)), 3-layer add_stacked_container(...) + add_ellipsis(...), tokenized add_slot_queue(...) + add_callout_label(...), straddling add_bridge_banner(...), native add_cloud/add_multi_doc/add_chevron_flow/add_cylinder/add_cube, AND the 15 new v11 mechanism primitives (ex3, ex4, ex5).
  6. Authentic Enclosing Structures, Domain Data Visuals & Controlled Nesting (NO Forced Polygon Circus!):
    • Combine 1–2 levels of clean controlled nesting (add_split_stage, add_stacked_container, add_contrast_pair, add_titled_group for explicit swimlanes/contrasts, add_dashed_group, add_zone, add_hardware_rail, 4-direction add_curly_brace) with concrete data visuals (add_struct_table, add_memory_strip, add_slot_rail, add_matrix_grid, add_tree_dag, add_state_machine, add_ring_buffer, add_code_snippet, add_operator_node, add_pill, add_accent_callout, add_status_badge). Keep decorative polygons <= 2 per figure.
  7. Rich, Dual-Scale Morandi Duotone Iconography (111 Icons Across 9 Categories — v11!):
    • Draw from 111 handcrafted 32×32 pure-vector high-silhouette Morandi duotone icons in scripts/icon_library.py (full directory in references/icon-catalog.md, specimen sheet in examples/icon_gallery.png), spanning 9 categories:
      • Multimodal Media (9): audio_note, audio_wave, video_cam, video_film, image_frame, pdf_doc, table_grid, table_analytics, text_corpus
      • Cloud & Container Infra (14, +4 v11): container_cube, k8s_pod, cloud_upload, catalog_list, db_search, worker_pool, shared_mem, gpu_card, mps_slices, object_bucket, microvm_sandbox, raft_consensus, spot_preempt, multi_cloud
      • Dataflow & Queues (9, +1 v11): slot_queue, ring_buffer, dataframe, scheduler_dag, batch_stack, backpressure, prefetch_pipe, shard_balance, thread_pool
      • Hardware & Compute (14, +4 v11): gpu, gpu_cluster, cpu, cpu_ram, ram, tensor_core, server_node, cluster_nodes, network_nic, pcie_bus, nvlink_fabric, cxl_switch, simd_lanes, os_kernel
      • Storage & Indexes (19, +7 v11): database, nvme, nvme_coral, ssd_card, cloud_store, table_col, btree_index, hnsw_graph, buffer_pool, wal_log, compress_zip, cache_sram, lsm_tree, bloom_filter, hash_table, page_table, key_value, disk_hdd, checkpoint_snap
      • AI & LLM Runtime (13, +2 v11): transformer, attention_head, kv_cache, lora_adapter, moe_router, vector_embed, llm_prompt, ssm_state, quant_bits, ai_sparkle, model_weights, token_seq, radix_tree
      • Clients & Streams (7): user, users_multi, query_sql, terminal, stream_events, queue_fifo, file
      • Operators & Control (14, +3 v11): switch, funnel, merge_join, scissors, gear, scheduler, compiler_ir, bolt, recycle, udf_code, shuffle_mesh, live_migrate, fsm_automaton, evict_trash
      • Verify & Metrics (12, +1 v11): shield, check_cert, lock, epoch_fence, target, magnifier, gauge_perf, alert, clock, chart_mini, telemetry_pulse, profiler_trace
    • Bold 1.6–1.9 px contours + Morandi duotone fills read crisply at BOTH 28–44 px borderless tiles AND 16–22 px inline card/lifeline/header slots, synced across all 6 themes × 12 accents (7,992 SVGs verified). Never substitute wrong metaphors!
  8. Empirically Calibrated Container-to-Text Proportions & True Printed Legibility:
    • Calibrated on 21 SIGMOD/VLDB papers (n = 577 leaf boxes): printed median 6.01 pt (66%–78% of 9pt body) with snug vertical fill 67%–86%.
    • Always compute printed_pt = font_px × (slot_pt / canvas_W) (recommend_typography(canvas_w, slot) & fit_box_height(...)): prefer compact spanning canvases 820–860 px (title 10.8–11.5 px, body 9.6–10.4 px, subcaption 11.0 px) so compiled PDF text ALWAYS prints at 5.6–7.0 pt (enforced by tiny_font_warning, bloated_container_warning, cramped_container_warning).
  9. Strict Architecture Text Budget, Code Budget & Focal Hierarchy ("Structure in Figure, Numbers in Eval, Proofs in Text!"):
    • Calibrated on 18 SIGMOD/VLDB arch figures (n = 186 boxes): median 3.0 words/box (1–2 lines) and 71 words/fig (ex4 = 36, ex3 = 50, ex5 = 75), < 2% bullet lists or micro-timings.
    • KEEP: Component role + (§N), 1 core mechanism/symbol, 1 concrete worked example (A_d, V0→P2, SELECT ...).
    • CUT: ❌ Bullet lists (•), ❌ eval benchmark timings/speedups (11.9μs, −55.4%), ❌ bloated code blocks (> 10 lines), ❌ multi-sentence prose callouts! Enforced automatically by verbose_box_warning, bullet_list_warning, text_overload_warning, and code_snippet_overload_warning.
  10. Whole-Paper Unified Plot Palette, 4-Channel Emphasis, Cross-Figure Harmony Audit & 0-Raster Provenance:
    • Use exp_plot_toolkit.py + palette_themes.py + exp-plot-standards.md so Matplotlib plots share the exact same active theme and 6-stop tonal ramps (EXP_PALETTE, 12-hue get_series_cycle(n)), 4-channel emphasis (Hue/Sat + heavy solid lw=2.0 + borderless delta callouts + 1:1 physical inches 7.0 in with frameon=False top legends), and locked method-color registry.
    • Run audit_paper_color_harmony(pdf_paths, theme_name) across ALL figure PDFs to verify contrast_shock_warning == False, 0 neon outliers, and fitz_images == 0 AND raw /Subtype /Image == 0, with every number verbatim to verified CSV/JSON.

Standard 7-Step Workflow (v11)

Step 0 — Prose-to-Figure Archetype Selection (NEW in v11 — ALWAYS DO FIRST!)

  1. Read the exact citing paragraph(s) of the manuscript and consult references/prose-to-figure-playbook.md.
  2. Classify the paragraph's explanatory intent into U1–U10 (Overview, Contrast, Memory/Page Map, Gantt/State Timeline, Empirical Diagnostic, Hardware Datapath/Latency, Tree/DAG/FSM, RPC Sequence/Twin Path, Code-to-Plan, or Zoom Lens).
  3. Lock the 5 Bidirectional Sync elements before drawing: (a) step badges (❶–❺) or (§N) tags matching prose, (b) 1 concrete running example, (c) control-vs-data visual key (add_legend), (d) Mode A or 3-part Mode B caption draft, and (e) neutral baseline vs. highlighted novelty tier.

Step 1 — Reference, Showcases & Icon Selection

  1. Inspect examples/ex3_multimodal_platform_arch.png (macro platform), examples/ex4_protocol_and_memory_map.png (RPC sequence + memory/zoom/latency), examples/ex5_timeline_and_code_dag.png (contrast Gantt + SQL-to-DAG + FSM), examples/icon_gallery.png (111 icons across 9 categories), and examples/theme_gallery.png (or run python3 ~/.gemini/config/skills/academic-drawio-figures/scripts/drawio_toolkit.py --list-icons).
  2. Optionally fetch benchmark figures on new venues via fetch_ref_papers.py --out /tmp/ref_papers --preset sigmod-vldb.

Step 2 — Scope Split, Subfigure Grid & Semantic-Role → v11-Primitive Plan

Before writing coordinates:

  1. Decide whether to split: Keep <= 14 logical actors per figure (<= 18 for compact multi-stage platforms); split overloaded mega-figures into focused single-column or symmetric multi-panel diagrams.
  2. Pick a symmetric layout (1×2, 1×3, 2×1, 2×2, or left-to-right stage architecture) and reserve 22–26 px at the bottom of each subfigure for add_subcaption(...).
  3. Map every semantic role to its exact v11 primitive & calibrated font scale (recommend_typography(canvas_w, slot) + fit_box_height(...)):
    • Protocol / RPC / Live-Migration / 2PC (U8) → add_sequence_diagram(...), add_span_bracket(...), add_ring_buffer(...), add_legend(...)
    • Baseline-vs-Ours Contrast & Verdicts (U2) → add_contrast_pair(...), add_status_badge(kind="check"|"cross"|"warn"|"halt"|"prune")
    • Execution Gantt / Discrete-Time State Swimlane (U4) → add_timeline_lanes(discrete_grid=False|True), add_span_bracket(...), add_curly_brace(direction="right"|"left")
    • Virtual→Physical Slot Mapping, Wire Bitfields & Zoom (U3/U10) → add_slot_rail(...) + add_mapping_links(...), add_zoom_callout(style="trapezoid"|"dashed_rays"), upgraded add_memory_strip(pointers=, top_pins=, tag_colors=, wavy_end=), add_dimension_bar(...), add_phase_strip(...)
    • Annotated SQL/DSL Code, Trees, Sharded DAGs & FSMs (U7/U9) → add_code_snippet(...) (<= 10 lines), add_tree_dag(...) (supports split two-tone nodes & new/hit/evicted states), add_state_machine(...)
    • Macro Overview & Anti-Box-itis Idioms (U1) → add_split_stage(...), add_icon_tile(...), add_actor_node(...), add_block_arrow(...), add_edge(..., curved=True, dashed=True, edge_label=...), add_stacked_container(...), add_ellipsis(...), add_slot_queue(...) + add_callout_label(...), add_bridge_banner(...), add_cloud, add_multi_doc, add_chevron_flow, add_hardware_rail, add_titled_group (swimlanes/contrasts only), add_icon_card (cap <= 50% of actors), add_struct_table, add_matrix_grid, add_cylinder, add_cube, add_accent_callout

Step 3 — Author Parametric Generator with drawio_toolkit.py

Write a clean Python generator importing drawio_toolkit.py:

  • Produces uncompressed native <mxfile> XML (.drawio) editable in Draw.io Desktop, VS Code, and diagrams.net (including v11 native splitRect/doubleCircle/zoomWedge/codeSnippet, mxgraph.arrows2.arrow, curved=1 edges, shape=cloud, mxgraph.flowchart.multi-document).
  • Runs automated geometry + v12 13-gate academic quality auditing (validate_drawio + audit_academic_quality: 0 OOB, 0 unintended overlaps, 0 edge-crossing-shape hits [including Bezier sampling & ancestor-safe nested slot routing], plus all 13 warning gates == False: vivid_color_warning, hue_clutter_warning [<= 2 hue sectors], subcaption_position_warning, polygon_overuse_warning, complexity_warning, tiny_font_warning, bloated_container_warning, cramped_container_warning, verbose_box_warning, bullet_list_warning, text_overload_warning, box_monotony_warning, and code_snippet_overload_warning).
  • Renders 2× Retina PNG previews (preview_<name>.png) first without overwriting existing manuscript .pdf figures.

Step 4 — Mandatory Visual Gate (Inspect PNGs Before PDF Export!)

Open every preview_<name>.png with read_file and verify:

  • Archetype Accuracy & Prose Sync (v11): Does the visual structure genuinely match the citing prose (U1–U10), with 1-to-1 step/section anchors, a concrete worked example, clear control-vs-data coding, and readable <= 10-line code snippets?
  • Anti-Box-itis & Visual Rhythm: Does it pass box_monotony_warning == False and code_snippet_overload_warning == False with varied semantic shapes?
  • Dual-Scale Icon Richness & Metaphor Accuracy: Exact 111-icon domain pictograms at 28–44 px borderless tiles or 16–22 px inline module/lifeline/header slots, theme-harmonized via set_paper_theme(...).
  • Subfigure Layout & Bottom Captions: Symmetric panels with (a) ..., (b) ... centered below each panel.
  • Zero Defects & Verbatim Provenance: Zero clipping, overlaps, or crossing wires; every metric/symbol matches .tex and CSV/JSON verbatim.

Step 5 — Export Tightly Cropped 100% Pure-Vector PDFs

python3 ~/.gemini/config/skills/academic-drawio-figures/scripts/drawio_toolkit.py \
  --validate-and-export path/to/figure.drawio \
  --png path/to/preview_figure.png \
  --pdf path/to/figure.pdf

Hard pass criteria (enforced automatically): pages == 1, tight MediaBox, fitz_images == 0 AND raw /Subtype /Image == 0, and clean 13-gate academic_quality audit (hue_clutter_warning == False).

Step 6 — LaTeX Integration & Compiled Page Verification

Embed single-column figures at 0.96–1.00\columnwidth and two-column spanning figures at 0.90–0.96\textwidth, recompile (pdflatex/tectonic/latexmk), verify exact page budget and 0 errors, and visually inspect the rendered 150-DPI PDF pages via read_file.


Playbook, Prompt Templates, Catalogs & Reusable Assets (v11)

Related Skills