ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 4/5

diagram-gen

Generate Mermaid diagrams from your codebase. Use when you need architecture visualizations.

Why use this skill?

Keep your documentation accurate with automated Mermaid diagrams. Analyze your codebase and visualize architecture instantly with this OpenClaw developer tool.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/lxgicstudios/diagram-gen
Or

What This Skill Does

The diagram-gen skill for OpenClaw is a powerful automated documentation assistant designed to eliminate the frustration of stale architecture diagrams. By leveraging intelligent code analysis, this skill scans your codebase and produces accurate, high-quality Mermaid.js diagrams. It bridges the gap between raw source code and visual representation, supporting various formats including flowcharts for process visualization, class diagrams for object-oriented structures, sequence diagrams for call flow analysis, and ER diagrams for database schema exploration. It outputs standardized Mermaid syntax that renders seamlessly across GitHub, VS Code, and popular markdown editors.

Installation

To integrate this skill into your OpenClaw environment, execute the following command in your terminal: clawhub install openclaw/skills/skills/lxgicstudios/diagram-gen

Ensure you have Node.js 18 or higher installed on your system. Additionally, because the skill utilizes AI for structural analysis, you must have a valid OPENAI_API_KEY set in your environment variables to allow the agent to process your codebase accurately.

Use Cases

  • Onboarding: Rapidly help new developers understand the project architecture by generating visual maps of complex modules.
  • Code Review: Visualize the impact of structural changes by generating 'before' and 'after' sequence diagrams during refactoring.
  • Documentation: Generate living documentation for your repository that stays in sync with your code, reducing the need for manual maintenance.
  • Architecture Audits: Quickly identify circular dependencies or overly complex class relationships that are difficult to spot in plain text files.

Example Prompts

  1. "Analyze the ./src/services directory and generate a sequence diagram showing how the authentication flow interacts with the database user module."
  2. "Create a class diagram for the core models in my project and save it to architecture-overview.mmd."
  3. "Generate a flowchart depicting the error handling logic within the primary API controllers found in the current directory."

Tips & Limitations

  • Focus Your Scope: While the tool can scan an entire repository, providing specific directories or file paths results in cleaner, more readable diagrams. Avoid running it on massive, monolithic directories to prevent visual clutter.
  • Pick the Right Type: Different diagrams serve different purposes. Use sequence diagrams for behavioral logic and class diagrams for static structural relationships.
  • Manual Verification: Treat generated diagrams as a starting point. While highly accurate, complex logical branches might require manual adjustments in the Mermaid syntax if the agent encounters ambiguous code patterns.
  • Environment: Always ensure your OPENAI_API_KEY is kept secure and not hardcoded in your source files.

Metadata

Stars1601
Views2
Updated2026-02-27
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-lxgicstudios-diagram-gen": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#mermaid#architecture#documentation#code-analysis#visualization
Safety Score: 4/5

Flags: file-read, external-api