Structural Diagram Generation: Creating Vector Figures for Papers Using Graphviz DOT

Preface

System architecture diagrams, business flow charts, traceability chains, and technology roadmaps in papers are often manually arranged in Word or drawing software for a long time. Changing a version often requires rearranging connection lines. Exporting them as bitmaps and inserting them into documents results in blurry edges when zoomed in, and it is also difficult to retain editable source code during peer review revisions.

Below is an introduction to the “Structural Diagram Generation” (坐标 @user_8d26dabd/academic-figure-gen) Agent Skill on SkillHub. It embeds Graphviz DOT templates, academic color schemes, and DOCX insertion workflows into SKILL.md, allowing the Agent to follow a fixed workflow to generate DOT from descriptions, render vector graphics, and insert the diagrams into Word according to the documentation within the skill. Statistical charts should use academic-chart-gen from the same publisher; this Skill is only responsible for conceptual structural diagrams.

What is this

Structural Diagram Generation (package name academic-figure-gen, current SkillHub version 2.0.9) is an academic paper illustration generation Skill based on Graphviz DOT. The source is SkillHub community, category design-media, published by user_8d26dabd (page notes author Liu Nan). The SkillHub page shows a rating of 100000 and 1847 downloads; the tag is requires_api_key=false, meaning no API Key is required to install this Skill itself.

It solves the problem of quickly producing editable vector illustrations within an Agent session using five pre-configured DOT templates and three sets of peer-review-oriented color schemes, with optional insertion into DOCX files according to academic writing habits via python-docx.

Core Functions

The capabilities written in the skill’s SKILL.md and the package’s README.md are as follows. After installation, the Agent will execute according to these referenced documents.

Five Diagram Templates

DOT source code templates are provided in references/dot-templates.md, with placeholders as {{PLACEHOLDER}}:

No. Template Typical Usage
1 Layered Architecture Diagram System architecture, network layering
2 Business Flow Diagram Approvals, operational steps
3 Process Traceability Diagram Manufacturing traceability, quality chains
4 Technology Evolution Roadmap Technology evolution, version iteration
5 Data Flow Diagram System interaction, interface design

Three Academic Color Schemes

references/color-schemes.md describes three schemes: Academic Dark Blue (default), Colorblind-Friendly (stated as validated via CUD in README), and Grayscale Print-Safe. The skill emphasizes colorblind-friendliness and grayscale print compatibility to facilitate peer review and printing.

Rendering and DOCX Integration

  • Rendering depends on local Graphviz (documentation requires minimum 2.44+, recommends 7.0+), commonly used command is dot -Tpng.
  • references/docx-integration.md explains using python-docx and Pillow to insert PNGs into Word: width approximately 11 cm centered, figure captions in 10.5pt Song typeface, numbering and “reverse insertion” to prevent drift, etc.

Division of Labor with Adjacent Skills

The routing table within the skill is explicit:

  • Architecture diagrams / Flowcharts / Traceability diagrams / Roadmaps / Data flow diagrams → This Skill.
  • Bar charts, scatter plots, and other real data statistical charts → academic-chart-gen.
  • Only supports Graphviz DOT; does not support DrawIO or Mermaid.

Usage Boundaries

SKILL.md requires that illustrations be based on real system descriptions provided by the user; fabricating architectures for non-existent methods is prohibited. Conceptual diagrams and experimental data diagrams must be separated. Outputs must be labeled “AI-generated schematic diagram,” and the user is responsible for the authenticity of the content.

Installation and Activation

1. Install SkillHub CLI (if not already installed)

Check or install according to the SkillHub Installation Documentation:

command -v skillhub && skillhub --version

If not installed, run the full installation script (the recommended method in the documentation):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

2. Install this Skill to the current Agent’s skills directory

Must use --dir to point to the skills directory recognized by the current client; otherwise, defaulting to ./skills/ may result in it not being loaded. The installation command shown in official search results is:

skillhub install academic-figure-gen --namespace user_8d26dabd --dir <your skills directory>

Common paths (from the same installation documentation):

  • Cursor: ~/.cursor/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project
  • Claude Code: ~/.claude/skills/

You can also send the following prompt to an AI that supports Skills to let it complete the installation according to the documentation:

Please install `@user_8d26dabd/academic-figure-gen` based on https://skillhub.cn/install/skillhub.md.

After installation, restart or refresh the Agent so that SKILL.md enters the skill list. Trigger words include “academic illustration,” “architecture diagram,” “flowchart,” “Graphviz,” “insert this diagram into Word,” etc. (see skill frontmatter).

3. Local Rendering and DOCX Dependencies (required for actual illustration production)

Graphviz and Python dependencies are not automatically installed with the Skill package. You need to install them yourself according to references/graphviz-setup.md and references/docx-integration.md, for example:

dot -V
pip install python-docx Pillow

Typical Usage

The reproducible workflow given in the package’s README.md is as follows. After enabling this Skill, the Agent will also guide you to select templates in dot-templates.md, replace placeholders, and render.

# 1. Install Graphviz (see references/graphviz-setup.md)
# 2. Select a template and replace placeholders
cp references/dot-templates.md my-diagram.dot
# Edit my-diagram.dot, replace all {{PLACEHOLDER}}

# 3. Render as PNG (300 DPI recommended)
dot -Tpng -Gdpi=300 my-diagram.dot -o figure1.png

# 4. Insert into Word document (see references/docx-integration.md)
python insert_figure.py figure1.png "System Architecture Layering Diagram" --doc manuscript.docx

Typical request examples in conversation (from the skill SKILL.md examples section): “Please draw a vector diagram for my system architecture” — expected to receive Graphviz DOT source code and rendering instructions (and PNG / DOCX generation steps as needed).

Five-step quick start (skill body summary):

  1. Select the diagram type in dot-templates.md
  2. Replace {{PLACEHOLDER}} with actual node and edge text
  3. Select a color scheme in color-schemes.md
  4. dot -Tpng input.dot -o output.png
  5. Insert into Word according to docx-integration.md

Applicable Scenarios and Notes

Who is it for: Researchers and engineers writing papers, technical reports, or dissertations who need architecture layering diagrams, business flow diagrams, traceability chains, technology roadmaps, or data flow diagrams, and wish to retain DOT source code and output vector or high-DPI bitmap images.

Limitations and Notes:

  • The skill suggests splitting diagrams when there are too many nodes (scenario routing mentions splitting is appropriate if exceeding approximately 20 nodes; diagnostics mention >50 may cause chaotic layouts).
  • If Chinese nodes appear garbled, fonts need to be handled according to skill diagnostics (e.g., fontname, Chinese packages), see graphviz-setup.md.
  • Statistical charts, error bars, and significance markers do not belong to this Skill; academic-chart-gen should be used.
  • Graphviz, Python, and python-docx need to be available locally; the Skill mainly provides workflows, templates, and Agent behavior conventions, and does not replace the local dot executable.

Conclusion

“Structural Diagram Generation” converges five types of Graphviz academic templates, three color schemes, and DOCX insertion instructions into a unified Agent workflow. It is suitable for scenarios where diagrams need to be revised repeatedly during the writing stage while maintaining vector editability. Official Skill page and API entry:

  • https://www.skillhub.cn/skills/user_8d26dabd/academic-figure-gen
  • https://api.skillhub.cn/user_8d26dabd/academic-figure-gen
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye