← 返回
开发者工具 中文

Diagram

Generate diagrams from descriptions with Mermaid, PlantUML, or ASCII for architecture, flows, sequences, and data models.
根据描述,使用Mermaid、PlantUML或ASCII生成架构图、流程图、时序图和数据模型图。
ivangdavila
开发者工具 clawhub v1.0.0 1 版本 99786.6 Key: 无需
★ 3
Stars
📥 2,746
下载
💾 137
安装
1
版本
#latest

概述

Principle

Diagrams should clarify, not complicate. Start simple, add detail only when needed. A 5-box flowchart beats a 50-node sprawl.

When User Describes a System or Flow

  1. Identify diagram type — Is this a flow, architecture, sequence, or data model?
  2. Choose format — Mermaid (default), PlantUML (complex), ASCII (inline), SVG (custom)
  3. Draft minimal version — Core elements only, no decoration
  4. Iterate — Add detail based on feedback

Diagram Types

TypeUse ForFormat
-----------------------
FlowchartProcesses, decisions, workflowsMermaid flowchart
SequenceAPI calls, interactions, protocolsMermaid sequenceDiagram
ArchitectureSystem components, infrastructureMermaid flowchart or C4
ER/Data modelDatabase schemas, relationshipsMermaid erDiagram
ClassObject structure, inheritanceMermaid classDiagram
StateLifecycles, status transitionsMermaid stateDiagram-v2
TimelineProject phases, historyMermaid timeline
MindmapBrainstorming, concept mappingMermaid mindmap

Output Methods

MethodWhen
--------------
Mermaid code blockUser can render (docs, GitHub, Notion)
Render to PNG/SVGUser needs image file
ASCII inlineQuick sketch in chat
HTML + Mermaid.jsInteractive viewing

Rendering Mermaid to Image

# Using mmdc (mermaid-cli)
npx -y @mermaid-js/mermaid-cli mmdc -i diagram.mmd -o diagram.png -b transparent

# Or via browser tool
# Write HTML with Mermaid, screenshot the rendered diagram

Mermaid Quick Reference

Flowchart:

flowchart LR
    A[Start] --> B{Decision}
    B -->|Yes| C[Action]
    B -->|No| D[End]

Sequence:

sequenceDiagram
    User->>API: Request
    API->>DB: Query
    DB-->>API: Result
    API-->>User: Response

ER Diagram:

erDiagram
    USER ||--o{ ORDER : places
    ORDER ||--|{ ITEM : contains

Style Guidelines

  • Left-to-right (LR) for processes, top-to-bottom (TB) for hierarchies
  • Max 10-15 nodes per diagram, split if larger
  • Consistent naming — all caps for systems, lowercase for actions
  • Subgraphs to group related components
  • Color sparingly — highlight critical paths only

Common Requests

RequestInterpret As
-----------------------
"Draw my API flow"Sequence diagram: client → API → services
"Show the architecture"Flowchart with subgraphs for components
"Database schema"ER diagram with relationships
"How the auth works"Sequence or flowchart depending on complexity
"User journey"Flowchart with decision points

Anti-Patterns

  • ❌ Too many nodes (split into multiple diagrams)
  • ❌ Decorative icons without meaning
  • ❌ Mixing abstraction levels (database tables next to business concepts)
  • ❌ Arrows in all directions (confuses flow)
  • ❌ Labels too long (use short names, add legend if needed)

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 19:14 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,358 📥 318,370
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,799
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,181