← Back to Skills Marketplace
emergencescience

Render Academic Diagram Images from Code

by emergencescience · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
75
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install emergence-diagram-rendering
Description
High-fidelity diagram generation (Mermaid, D2, Graphviz) for autonomous agents. Supports local-first rendering and persistent run history.
README (SKILL.md)

Diagram Rendering Skill (Internal Monologue)

You are an autonomous solver agent capable of transforming natural language into technical visuals. You prioritize Local Rendering for speed and privacy, using the Cloud API only as a fallback.

1. Activation Triggers

Invoke this skill when the user asks to:

  • "Draw," "map out," or "diagram" a system.
  • "Visualize" an architecture or cloud infrastructure.
  • "Create a flowchart" or "sequence diagram."
  • "Show me an ERD" or "database schema."

2. Decision Reasoning

  • D2: Use for complex architecture, nested containers, and high-fidelity layouts.
  • Mermaid: Use for standard flowcharts, sequence diagrams, and simple logic paths.
  • Graphviz (DOT): Use for mathematical graphs, network topologies, and relational ERDs.

3. Template-Assisted Generation

Before generating from scratch, check ./templates/.

  • These are "Gold Standard" examples.
  • You can inject data into templates using the --inject '{"key": "value"}' flag in local_render.py.

4. Persistent Execution & Self-Correction

Your rendering attempts are stored in ./runs/\x3Crun_id>/.

  1. Attempt Render: Call ./.venv/bin/python3 scripts/local_render.py \x3Cengine> "\x3Ccode>".
  2. Handle Failure: If the output is an error, open the metadata.json in the specific run directory.
  3. Parse Stderr: Read the compiler's stderr. It will pinpoint the exact line and character of your syntax error.
  4. Recursive Fix: Use the error feedback to fix your code and re-run. Do not give up until the status is "success".

5. Visual Verification (Vision Agents)

If you have a Vision Language Model (VLM) capability:

  • Inspect the generated PNG/SVG in the run folder.
  • Compare the visual output against the logical intent of the prompt.
  • If the layout is confusing or logically incorrect, refine the code and re-render.
Usage Guidance
This skill appears to implement a local-first renderer, but there are multiple inconsistencies you should address before installing: (1) The packaged files include an install.sh that will create a .venv, install system packages (apt/brew), run curl|sh to install D2, and run sudo npm -g for mermaid-cli—these steps require elevated privileges and will modify your system. (2) scripts/test_render.py will send diagram source to EMERGENCE_API_URL with EMERGENCE_API_KEY; EMERGENCE_API_URL is not declared in the manifest. If you do not want any network transmission, do not set EMERGENCE_API_KEY and ensure EMERGENCE_API_URL is unset or points to a safe local endpoint. (3) Metadata in the registry (no required binaries, 'instruction-only') does not match SKILL.md and the included scripts; ask the author/maintainer to reconcile the manifest, or review the repository yourself. Recommended steps: inspect install.sh and scripts locally, run in an isolated sandbox/VM, avoid running install.sh with sudo until you audit it, and set EMERGENCE_API_URL to a trusted endpoint (or leave unset) if you must provide EMERGENCE_API_KEY. If you need higher assurance, request the source repository and a maintainer statement explaining why the API endpoint env var is omitted from the manifest.
Capability Analysis
Type: OpenClaw Skill Name: emergence-diagram-rendering Version: 0.1.0 The skill provides legitimate diagram rendering via Mermaid, D2, and Graphviz, but contains several high-risk patterns and vulnerabilities. The 'install.sh' script requires 'sudo' and uses 'curl | sh' to install the D2 CLI, which are significant security risks. The 'scripts/local_render.py' script is vulnerable to arbitrary file disclosure because it attempts to read the 'code' argument as a file path if it exists on disk; an attacker could use this to make the agent read sensitive files (e.g., /etc/passwd) and then view the contents via the 'metadata.json' error logs as instructed in 'SKILL.md'. While no clear evidence of intentional malice was found, the combination of high-privilege installation and permissive file handling warrants caution.
Capability Assessment
Purpose & Capability
The skill's code (local_render.py, schema generator, and install.sh) aligns with a local-first renderer for Mermaid/D2/Graphviz. However the registry metadata claimed 'instruction-only' and 'no required binaries' while SKILL.md and scripts expect dot/d2/npm and include an install.sh — these metadata vs. implementation mismatches are unexpected and should be clarified.
Instruction Scope
SKILL.md instructs agents to create and read persistent run artifacts in ./runs/ and to open metadata.json to parse errors (consistent with self-correction). But scripts/test_render.py will POST rendering jobs to a remote API (EMERGENCE_API_URL) using EMERGENCE_API_KEY, which is a network transmission of user-provided diagram code; that network behavior is referenced in code but the endpoint env var (EMERGENCE_API_URL) is not declared in the skill manifest. Agents following the SKILL.md could therefore transmit diagrams externally unless the operator configures the environment carefully.
Install Mechanism
install.sh performs common tasks: apt/brew for graphviz, creates a Python venv, pip installs requirements, installs D2 via curl|sh from d2lang.com, and installs mermaid-cli via npm. The D2 curl|sh and sudo npm -g steps are common but higher-risk (remote script execution, global npm install). No unknown or clearly malicious URLs are used, but the install performs privileged operations and writes to disk.
Credentials
The skill declares EMERGENCE_API_KEY as required (reasonable for a cloud fallback). However the code also reads EMERGENCE_API_URL (defaults to http://localhost:8000) via dotenv and will send diagram content to that endpoint. EMERGENCE_API_URL is not declared in requires.env, and the skill's manifest earlier claimed no required binaries while SKILL.md lists dot, d2, npm. The undeclared API endpoint and mismatched manifests make credential and endpoint use unclear.
Persistence & Privilege
The skill writes persistent run artifacts to ./runs/ and creates a local .venv; it does not request always:true or attempt to modify other skills or global agent settings. Persistent storage is consistent with its self-correcting design.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install emergence-diagram-rendering
  3. After installation, invoke the skill by name or use /emergence-diagram-rendering
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.0
- Initial release of the Diagram Rendering Skill for transforming natural language into technical diagrams. - Supports local rendering with fallback to Cloud API for privacy and speed. - Decision-making system for selecting D2, Mermaid, or Graphviz (DOT) based on diagram type. - Integrates with template library for consistent, best-practice diagram syntax and styling. - Implements persistent execution with automated self-correction using error feedback. - Optional visual verification step for Vision Language Model (VLM) agents to ensure diagram accuracy and legibility.
Metadata
Slug emergence-diagram-rendering
Version 0.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Render Academic Diagram Images from Code?

High-fidelity diagram generation (Mermaid, D2, Graphviz) for autonomous agents. Supports local-first rendering and persistent run history. It is an AI Agent Skill for Claude Code / OpenClaw, with 75 downloads so far.

How do I install Render Academic Diagram Images from Code?

Run "/install emergence-diagram-rendering" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Render Academic Diagram Images from Code free?

Yes, Render Academic Diagram Images from Code is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Render Academic Diagram Images from Code support?

Render Academic Diagram Images from Code is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Render Academic Diagram Images from Code?

It is built and maintained by emergencescience (@emergencescience); the current version is v0.1.0.

💬 Comments