首页/UI/UX 设计/excalidraw-diagram-generator
E

excalidraw-diagram-generator

by @githubv
4.5(414)

智能Excalidraw图表生成器,通过自然语言描述自动创建流程图、架构图、白板草图等可视化内容,无需手动绘制即可快速产出专业图表,适合技术文档、产品设计和团队协作场景。

ExcalidrawDiagramming ToolsWhiteboardingVisual CommunicationUML/FlowchartsGitHub
安装方式
npx skills add github/awesome-copilot --skill excalidraw-diagram-generator
compare_arrows

Before / After 效果对比

1
使用前

绘制流程图、可视化过程需要耗费大量时间手动拖拽和调整。难以快速将想法转化为清晰的图表,沟通效率低下,影响项目进展。

使用后

Excalidraw图表生成器能根据自然语言描述自动生成图表。快速创建流程图和可视化过程,极大提升设计效率和沟通效果,让想法即刻呈现。

description SKILL.md

Excalidraw Diagram Generator

A skill for generating Excalidraw-format diagrams from natural language descriptions. This skill helps create visual representations of processes, systems, relationships, and ideas without manual drawing.

When to Use This Skill

Use this skill when users request:

  • "Create a diagram showing..."
  • "Make a flowchart for..."
  • "Visualize the process of..."
  • "Draw the system architecture of..."
  • "Generate a mind map about..."
  • "Create an Excalidraw file for..."
  • "Show the relationship between..."
  • "Diagram the workflow of..."

Supported diagram types:

  • 📊 Flowcharts: Sequential processes, workflows, decision trees
  • 🔗 Relationship Diagrams: Entity relationships, system components, dependencies
  • 🧠 Mind Maps: Concept hierarchies, brainstorming results, topic organization
  • 🏗️ Architecture Diagrams: System design, module interactions, data flow
  • 📈 Data Flow Diagrams (DFD): Data flow visualization, data transformation processes
  • 🏊 Business Flow (Swimlane): Cross-functional workflows, actor-based process flows
  • 📦 Class Diagrams: Object-oriented design, class structures and relationships
  • 🔄 Sequence Diagrams: Object interactions over time, message flows
  • 🗃️ ER Diagrams: Database entity relationships, data models

Prerequisites

  • Clear description of what should be visualized
  • Identification of key entities, steps, or concepts
  • Understanding of relationships or flow between elements

Step-by-Step Workflow

Step 1: Understand the Request

Analyze the user's description to determine:

  1. Diagram type (flowchart, relationship, mind map, architecture)
  2. Key elements (entities, steps, concepts)
  3. Relationships (flow, connections, hierarchy)
  4. Complexity (number of elements)

Step 2: Choose the Appropriate Diagram Type

User IntentDiagram TypeExample Keywords
Process flow, steps, proceduresFlowchart"workflow", "process", "steps", "procedure"
Connections, dependencies, associationsRelationship Diagram"relationship", "connections", "dependencies", "structure"
Concept hierarchy, brainstormingMind Map"mind map", "concepts", "ideas", "breakdown"
System design, componentsArchitecture Diagram"architecture", "system", "components", "modules"
Data flow, transformation processesData Flow Diagram (DFD)"data flow", "data processing", "data transformation"
Cross-functional processes, actor responsibilitiesBusiness Flow (Swimlane)"business process", "swimlane", "actors", "responsibilities"
Object-oriented design, class structuresClass Diagram"class", "inheritance", "OOP", "object model"
Interaction sequences, message flowsSequence Diagram"sequence", "interaction", "messages", "timeline"
Database design, entity relationshipsER Diagram"database", "entity", "relationship", "data model"

Step 3: Extract Structured Information

For Flowcharts:

  • List of sequential steps
  • Decision points (if any)
  • Start and end points

For Relationship Diagrams:

  • Entities/nodes (name + optional description)
  • Relationships between entities (from → to, with label)

For Mind Maps:

  • Central topic
  • Main branches (3-6 recommended)
  • Sub-topics for each branch (optional)

For Data Flow Diagrams (DFD):

  • Data sources and destinations (external entities)
  • Processes (data transformations)
  • Data stores (databases, files)
  • Data flows (arrows showing data movement from left-to-right or from top-left to bottom-right)
  • Important: Do not represent process order, only data flow

For Business Flow (Swimlane):

  • Actors/roles (departments, systems, people) - displayed as header columns
  • Process lanes (vertical lanes under each actor)
  • Process boxes (activities within each lane)
  • Flow arrows (connecting process boxes, including cross-lane handoffs)

For Class Diagrams:

  • Classes with names
  • Attributes with visibility (+, -, #)
  • Methods with visibility and parameters
  • Relationships: inheritance (solid line + white triangle), implementation (dashed line + white triangle), association (solid line), dependency (dashed line), aggregation (solid line + white diamond), composition (solid line + filled diamond)
  • Multiplicity notations (1, 0..1, 1..*, *)

For Sequence Diagrams:

  • Objects/actors (arranged horizontally at top)
  • Lifelines (vertical lines from each object)
  • Messages (horizontal arrows between lifelines)
  • Synchronous messages (solid arrow), asynchronous messages (dashed arrow)
  • Return values (dashed arrows)
  • Activation boxes (rectangles on lifelines during execution)
  • Time flows from top to bottom

For ER Diagrams:

  • Entities (rectangles with entity names)
  • Attributes (listed inside entities)
  • Primary keys (underlined or marked with PK)
  • Foreign keys (marked with FK)
  • Relationships (lines connecting entities)
  • Cardinality: 1:1 (one-to-one), 1:N (one-to-many), N:M (many-to-many)
  • Junction/associative entities for many-to-many relationships (dashed rectangles)

Step 4: Generate the Excalidraw JSON

Create the .excalidraw file with appropriate elements:

Available element types:

  • rectangle: Boxes for entities, steps, concepts
  • ellipse: Alternative shapes for emphasis
  • diamond: Decision points
  • arrow: Directional connections
  • text: Labels and annotations

Key properties to set:

  • Position: x, y coordinates
  • Size: width, height
  • Style: strokeColor, backgroundColor, fillStyle
  • Font: fontFamily: 5 (Excalifont - required for all text elements)
  • Text: Embedded text for labels
  • Connections: points array for arrows

Important: All text elements must use fontFamily: 5 (Excalifont) for consistent visual appearance.

Step 5: Format the Output

Structure the complete Excalidraw file:

{
  "type": "excalidraw",
  "version": 2,
  "source": "https://excalidraw.com",
  "elements": [
    // Array of diagram elements
  ],
  "appState": {
    "viewBackgroundColor": "#ffffff",
    "gridSize": 20
  },
  "files": {}
}

Step 6: Save and Provide Instructions

  1. Save as <descriptive-name>.excalidraw
  2. Inform user how to open:

Best Practices

Element Count Guidelines

Diagram TypeRecommended CountMaximum
Flowchart steps3-1015
Relationship entities3-812
Mind map branches4-68
Mind map sub-topics per branch2-46

Layout Tips

  1. Start positions: Center important elements, use consistent spacing
  2. Spacing:
    • Horizontal gap: 200-300px between elements
    • Vertical gap: 100-150px between rows
  3. Colors: Use consistent color scheme
    • Primary elements: Light blue (#a5d8ff)
    • Secondary elements: Light green (#b2f2bb)
    • Important/Central: Yellow (#ffd43b)
    • Alerts/Warnings: Light red (#ffc9c9)
  4. Text sizing: 16-24px for readability
  5. Font: Always use fontFamily: 5 (Excalifont) for all text elements
  6. Arrow style: Use straight arrows for simple flows, curved for complex relationships

Complexity Management

If user request has too many elements:

  • Suggest breaking into multiple diagrams
  • Focus on main elements first
  • Offer to create detailed sub-diagrams

Example response:

"Your request includes 15 components. For clarity, I recommend:
1. High-level architecture diagram (6 main components)
2. Detailed diagram for each subsystem

Would you like me to start with the high-level view?"

Example Prompts and Responses

Example 1: Simple Flowchart

User: "Create a flowchart for user registration"

Agent generates:

  1. Extract steps: "Enter email" → "Verify email" → "Set password" → "Complete"
  2. Create flowchart with 4 rectangles + 3 arrows
  3. Save as user-registration-flow.excalidraw

Example 2: Relationship Diagram

User: "Diagram the relationship between User, Post, and Comment entities"

Agent generates:

  1. Entities: User, Post, Comment
  2. Relationships: User → Post ("creates"), User → Comment ("writes"), Post → Comment ("contains")
  3. Save as user-content-relationships.excalidraw

Example 3: Mind Map

User: "Mind map about machine learning concepts"

Agent generates:

  1. Center: "Machine Learning"
  2. Branches: Supervised Learning, Unsupervised Learning, Reinforcement Learning, Deep Learning
  3. Sub-topics under each branch
  4. Save as machine-learning-mindmap.excalidraw

Troubleshooting

IssueSolution
Elements overlapIncrease spacing between coordinates
Text doesn't fit in boxesIncrease box width or reduce font size
Too many elementsBreak into multiple diagrams
Unclear layoutUse grid layout (rows/columns) or radial layout (mind maps)
Colors inconsistentDefine color palette upfront based on element types

Advanced Techniques

Grid Layout (for Relationship Diagrams)

const columns = Math.ceil(Math.sqrt(entityCount));
const x = startX + (index % columns) * horizontalGap;
const y = startY + Math.floor(index / columns) * verticalGap;

Radial Layout (for Mind Maps)

const angle = (2 * Math.PI * index) / branchCount;
const x = centerX + radius * Math.cos(angle);
const y = centerY + radius * Math.sin(angle);

Auto-generated IDs

Use timestamp + random string for unique IDs:

const id = Date.now().toString(36) + Math.random().toString(36).substr(2);

Output Format

Always provide:

  1. ✅ Complete .excalidraw JSON file
  2. 📊 Summary of what was created
  3. 📝 Element count
  4. 💡 Instructions for opening/editing

Example summary:

Created: user-workflow.excalidraw
Type: Flowchart
Elements: 7 rectangles, 6 arrows, 1 title text
Total: 14 elements

To view:
1. Visit https://excalidraw.com
2. Drag and drop user-workflow.excalidraw
3. Or use File → Open in Excalidraw VS Code extension

Validation Checklist

Before delivering the diagram:

  • All elements have unique IDs
  • Coordinates prevent overlapping
  • Text is readable (font size 16+)
  • All text elements use fontFamily: 5 (Excalifont)
  • Arrows connect logically
  • Colors follow consistent scheme
  • File is valid JSON
  • Element count is reasonable (<20 for clarity)

Icon Libraries (Optional Enhancement)

For specialized diagrams (e.g., AWS/GCP/Azure architecture diagrams), you can use pre-made icon libraries from Excalidraw. This provides professional, standardized icons instead of basic shapes.

When User Requests Icons

If user asks for AWS/cloud architecture diagrams or mentions wanting to use specific icons:

  1. Check if library exists: Look for libraries/<library-name>/reference.md

  2. If library exists: Proceed to use icons (see AI Assistant Workflow below)

  3. If library does NOT exist: Respond with setup instructions:

    To use [AWS/GCP/Azure/etc.] architecture icons, please follow these steps:
    
    1. Visit https://libraries.excalidraw.com/
    2. Search for "[AWS Architecture Icons/etc.]" and download the .excalidrawlib file
    3. Create directory: skills/excalidraw-diagram-generator/libraries/[icon-set-name]/
    4. Place the downloaded file in that directory
    5. Run the splitter script:
       python skills/excalidraw-diagram-generator/scripts/split-excalidraw-library.py skills/excalidraw-diagram-generator/libraries/[icon-set-name]/
    
    This will split the library into individual icon files for efficient use.
    After setup is complete, I can create your diagram using the actual AWS/cloud icons.
    
    Alternatively, I can create the diagram now using simple shapes (rectangles, ellipses) 
    which you can later replace with icons manually in Excalidraw.
    

User Setup Instructions (Detailed)

Step 1: Create Library Directory

mkdir -p skills/excalidraw-diagram-generator/libraries/aws-architecture-icons

Step 2: Download Library

  • Visit: https://libraries.excalidraw.com/
  • Search for your desired icon set (e.g., "AWS Architecture Icons")
  • Click download to get the .excalidrawlib file
  • Example categories (availability varies; confirm on the site):
    • Cloud service icons
    • UI/Material icons
    • Flowchart symbols

Step 3: Place Library File

  • Rename the downloaded file to match the directory name (e.g., aws-architecture-icons.excalidrawlib)
  • Move it to the directory created in Step 1

Step 4: Run Splitter Script

python skills/excalidraw-diagram-generator/scripts/split-excalidraw-library.py skills/excalidraw-diagram-generator/libraries/aws-architecture-icons/

Step 5: Verify Setup After running the script, verify the following structure exists:

skills/excalidraw-diagram-generator/libraries/aws-architecture-icons/
  aws-architecture-icons.excalidrawlib  (original)
  reference.md                          (generated - icon lookup table)
  icons/                                (generated - individual icon files)
    API-Gateway.json
    CloudFront.json
    EC2.json
    Lambda.json
    RDS.json
    S3.json
    ...

AI Assistant Workflow

When icon libraries are available in libraries/:

RECOMMENDED APPROACH: Use Python Scripts (Efficient & Reliable)

The repository includes Python scripts that handle icon integration automatically:

  1. Create base diagram structure:

    • Create .excalidraw file with basic layout (title, boxes, regions)
    • This establishes the canvas and overall structure
  2. Add icons using Python script:

    python skills/excalidraw-diagram-generator/scripts/add-icon-to-diagram.py \
      <diagram-path> <icon-name> <x> <y> [--label "Text"] [--library-path PATH]
    
    • Edit via .excalidraw.edit is enabled by default to avoid overwrite issues; pass --no-use-edit-suffix to disable.

    Examples:

    # Add EC2 icon at position (400, 300) with label
    python scripts/add-icon-to-diagram.py diagram.excalidraw EC2 400 300 --label "Web Server"
    
    # Add VPC icon at position (200, 150)
    python scripts/add-icon-to-diagram.py diagram.excalidraw VPC 200 150
    
    # Add icon from different library
    python scripts/add-icon-to-diagram.py diagram.excalidraw Compute-Engine 500 200 \
      --library-path libraries/gcp-icons --label "API Server"
    
  3. Add connecting arrows:

    python skills/excalidraw-diagram-generator/scripts/add-arrow.py \
      <diagram-path> <from-x> <from-y> <to-x> <to-y> [--label "Text"] [--style solid|dashed|dotted] [--color HEX]
    
    • Edit via .excalidraw.edit is enabled by default to avoid overwrite issues; pass --no-use-edit-suffix to disable.

    **Exa

...

forum用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价

统计数据

安装量10.3K
评分4.5 / 5.0
版本
更新日期2026年4月29日
对比案例1 组

用户评分

4.5(414)
5
23%
4
51%
3
23%
2
2%
1
0%

为此 Skill 评分

0.0

兼容平台

🔧Claude Code
🔧OpenClaw
🔧OpenCode
🔧Codex
🔧Gemini CLI
🔧GitHub Copilot
🔧Amp
🔧Kimi CLI

时间线

创建2026年3月14日
最后更新2026年4月29日
🎁 Agent 知识卡片