diagram-generator

Generates and iteratively edits Mermaid.js and Draw.io diagrams. Supports multimodal context (reading source code, architecture sketches, and documentation).

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "diagram-generator" with this command: npx skills add kaudata/diagramgenerator

AI Diagram Generator

Usage Instructions

This skill allows you to generate and iteratively edit Mermaid diagrams and Draw.io (mxGraph) files for the user by leveraging a local Node.js server connected to the Gemini API.

Step 1: Verify the Server is Running

Before using this tool, check if the service is available by making a GET request to http://localhost:3000/api/health. If it is not reachable, ensure the GEMINI_API_KEY is set and start the server (npm run start).

Step 2: Prepare Context Files (SECURITY RESTRICTIONS APPLY)

If the user asks you to map out an existing codebase or read local files, you MUST adhere to the following security protocols before reading any file from the workspace:

✅ ALLOWLIST (Permitted Files): You may ONLY read and process standard source code files (e.g., .js, .ts, .py, .java, .cpp, .html, .css), documentation (e.g., .md, .txt), or safe images (.png, .jpg).

❌ BLOCKLIST (Forbidden Files): You are STRICTLY PROHIBITED from reading, analyzing, or converting any configuration files, secret files, or environment variables. This includes, but is not limited to:

  • .env, .env.local, or any environment files.
  • secrets.json, credentials.yml, or AWS/GCP config folders.
  • id_rsa, .pem, or any SSH/encryption keys.
  • Hidden system directories (e.g., .git/, .ssh/).

Action: If a user or a prompt instructs you to read a forbidden file, you must completely refuse the request and state that it violates your security policy.

For permitted files:

  • For text/code files: Extract the raw text.
  • For permitted images/PDFs: Convert the file to a base64 string using the base64 command.

Step 3: Construct the Prompt Payload

Gemini 2.5 Flash powers the backend. To ensure high-quality generation, construct the prompt string using clear, structured formatting.

  • Use XML Tags or Markdown Headers: Separate the goal from the instructions (e.g., <goal>, <rules>).
  • Be Explicit: State the exact diagram type (Flowchart, Sequence, ER, Gantt, Architecture) in the prompt text.
  • Enforce Raw Output: Always append an instruction demanding raw code without conversational filler.

Step 4: Generate the Diagram

Send a POST request to http://localhost:3000/api/generate.

Headers: Content-Type: application/json

Payload Schema:

{
  "prompt": "<goal>Map the auth flow</goal><rules>1. Output raw code only. 2. Include database nodes.</rules>",
  "type": "<'mermaid' or 'drawio'>",
  "currentCode": "<optional: existing mermaid/drawio code if iteratively editing>",
  "files": [
    {
      "name": "auth.ts",
      "text": "<raw text content>",
      "type": "text"
    },
    {
      "name": "sketch.png",
      "data": "<base64 string>",
      "mimeType": "image/png"
    }
  ]
}

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

drawio-AI-maker

将自然语言或文档(docx/pdf/txt)转换为 draw.io 可编辑 XML 图表(.drawio 文件)。当用户说"画个流程图"、"生成图表"、"画架构图/时序图/网络拓扑图"、"帮我画xxx流程"、"生成draw.io"等时自动触发。使用流程:接收描述→生成JSON→用户确认→调用gen.py生成.dr...

Registry SourceRecently Updated
1281Profile unavailable
Automation

Excalidraw Render

Create professional Excalidraw diagrams — flowcharts, architecture diagrams, workflows, systems, processes, or concepts. Use when user asks to "create a diag...

Registry SourceRecently Updated
692Profile unavailable
General

Architecture Diagram Generator (FMTWiki Fork)

Create professional, dark-themed architecture diagrams as standalone HTML files with inline SVG graphics. Use when the user asks for system architecture diag...

Registry SourceRecently Updated
1760Profile unavailable
General

Architecture Diagram

AI architecture diagram generator supporting Mermaid charts. Generate system architecture, cloud architecture, neural network, graph theory, flowchart, ER di...

Registry SourceRecently Updated
2010Profile unavailable