Mermaid/PlantUML 图表绘制
diagram-creator
使用 Mermaid、PlantUML 及其他文本图表工具创建专业图表。可生成流程图、时序图、架构图等。
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- diagram-creator
- tags
- [ "diagram", "flowchart", "mermaid", "plantuml", "architecture" ]
- author
- claude-office-skills
- models
- { "compatible": [ "claude-3-5-sonnet", "gpt-4", "gpt-4o" ], "recommended": [ "claude-sonnet-4", "claude-opus-4" ] }
- license
- MIT
- version
- 1.0.0
- category
- visualization
- languages
- [ "en", "zh" ]
- department
- Engineering/Design
- description
- Create professional diagrams using Mermaid, PlantUML, and other text-based diagram tools. Generate flowcharts, sequence diagrams, architecture diagrams, and more.
- capabilities
- [ "flowchart_creation", "sequence_diagrams", "architecture_diagrams", "er_diagrams", "class_diagrams" ]
- related_skills
- [ "chart-designer", "ppt-visual", "dev-slides" ]
03 SKILL.md 正文
Diagram Creator Skill
Overview
I help you create professional diagrams using text-based diagram tools like Mermaid and PlantUML. These diagrams can be rendered in documentation, presentations, and development tools.
What I can do:
- Create flowcharts and process diagrams
- Generate sequence diagrams
- Build architecture and system diagrams
- Design ER (Entity-Relationship) diagrams
- Create class diagrams and UML
- Generate organizational charts
- Build Gantt charts and timelines
What I cannot do:
- Render images directly (use Mermaid live editor or similar)
- Create pixel-perfect custom designs
- Generate raster images
How to Use Me
Step 1: Describe Your Diagram
Tell me:
- What process/system/concept to visualize
- Type of diagram needed
- Level of detail
- Target audience
Step 2: Choose Format
- Mermaid: Best for web, markdown, GitHub
- PlantUML: Best for UML, complex diagrams
- ASCII: Simple, universal compatibility
- D2: Modern, stylish diagrams
Step 3: Specify Style
- Colors and themes
- Direction (top-down, left-right)
- Level of detail
Diagram Types
1. Flowchart / Process Diagram
Use for: Business processes, decision trees, workflows
flowchart TD
A[Start] --> B{Decision?}
B -->|Yes| C[Action 1]
B -->|No| D[Action 2]
C --> E[End]
D --> E
2. Sequence Diagram
Use for: API calls, user interactions, system communication
sequenceDiagram
participant U as User
participant A as App
participant S as Server
participant D as Database
U->>A: Click Login
A->>S: POST /auth/login
S->>D: Query user
D-->>S: User data
S-->>A: JWT token
A-->>U: Redirect to dashboard
3. Architecture Diagram
Use for: System design, infrastructure, component relationships
flowchart TB
subgraph Client
A[Web App]
B[Mobile App]
end
subgraph Backend
C[API Gateway]
D[Auth Service]
E[User Service]
F[Order Service]
end
subgraph Data
G[(PostgreSQL)]
H[(Redis)]
I[(S3)]
end
A & B --> C
C --> D & E & F
D --> H
E --> G
F --> G & I
4. Entity-Relationship Diagram
Use for: Database design, data models
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE_ITEM : contains
PRODUCT ||--o{ LINE_ITEM : "ordered in"
CUSTOMER {
int id PK
string name
string email
}
ORDER {
int id PK
date created_at
int customer_id FK
}
PRODUCT {
int id PK
string name
decimal price
}
5. Class Diagram
Use for: OOP design, code structure
classDiagram
class Animal {
+String name
+int age
+makeSound()
}
class Dog {
+String breed
+bark()
}
class Cat {
+boolean indoor
+meow()
}
Animal <|-- Dog
Animal <|-- Cat
6. State Diagram
Use for: State machines, status workflows
stateDiagram-v2
[*] --> Draft
Draft --> Submitted: Submit
Submitted --> InReview: Assign reviewer
InReview --> Approved: Approve
InReview --> Rejected: Reject
Rejected --> Draft: Revise
Approved --> [*]
7. Gantt Chart
Use for: Project timelines, schedules
gantt
title Project Timeline
dateFormat YYYY-MM-DD
section Planning
Requirements :a1, 2024-01-01, 14d
Design :a2, after a1, 21d
section Development
Backend :b1, after a2, 30d
Frontend :b2, after a2, 30d
section Testing
QA Testing :c1, after b1, 14d
UAT :c2, after c1, 7d
8. Mind Map
Use for: Brainstorming, concept organization
mindmap
root((Project))
Features
Feature A
Feature B
Feature C
Team
Frontend
Backend
Design
Timeline
Q1
Q2
Q3
9. Git Graph
Use for: Branch visualization, git workflows
gitGraph
commit
commit
branch feature
checkout feature
commit
commit
checkout main
merge feature
commit
Output Format
# Diagram: [Name]
**Type**: [Flowchart / Sequence / Architecture / etc.]
**Tool**: [Mermaid / PlantUML]
**Purpose**: [What it illustrates]
---
## Diagram Code
### Mermaid
```mermaid
[Mermaid code here]
PlantUML (Alternative)
[PlantUML code here]
Rendering Instructions
- Mermaid Live Editor: https://mermaid.live/
- GitHub: Paste directly in markdown files
- VS Code: Install Mermaid extension
- Notion: Use code block with mermaid type
Customization Options
Color Theme
Add to the beginning:
%%{init: {'theme':'forest'}}%%
Available themes: default, forest, dark, neutral
Direction
- TB (top to bottom)
- BT (bottom to top)
- LR (left to right)
- RL (right to left)
Notes
- [Any notes about the diagram]
- [Assumptions made]
---
## PlantUML Examples
### Sequence Diagram
```plantuml
@startuml
actor User
participant "Web App" as App
participant "API Server" as API
database "Database" as DB
User -> App: Login request
App -> API: POST /auth/login
API -> DB: SELECT user
DB --> API: User record
API --> App: JWT token
App --> User: Redirect to dashboard
@enduml
Component Diagram
@startuml
package "Frontend" {
[React App]
[Mobile App]
}
package "Backend" {
[API Gateway]
[Auth Service]
[User Service]
}
database "PostgreSQL" as DB
[React App] --> [API Gateway]
[Mobile App] --> [API Gateway]
[API Gateway] --> [Auth Service]
[API Gateway] --> [User Service]
[User Service] --> DB
@enduml
Tips for Better Diagrams
- Keep it simple - Don't overcrowd
- Use consistent naming - Clear, descriptive labels
- Group related items - Use subgraphs/packages
- Choose appropriate type - Match diagram to concept
- Consider audience - Technical vs. business
- Use colors sparingly - For emphasis only
- Add legends - When using symbols/colors
- Maintain hierarchy - Top-down or left-right flow
Rendering Tools
| Tool | URL | Best For |
|---|---|---|
| Mermaid Live | mermaid.live | Quick editing |
| PlantUML Server | plantuml.com | PlantUML rendering |
| Draw.io | draw.io | Manual editing |
| Excalidraw | excalidraw.com | Hand-drawn style |
| Lucidchart | lucidchart.com | Professional diagrams |
Limitations
- Cannot render images directly
- Complex layouts may need manual adjustment
- Limited styling compared to design tools
- Some diagram types not supported in all tools
Built by the Claude Office Skills community. Contributions welcome!
04 同仓库更多 Skills
release-notes
Write release notes or a CHANGELOG entry from a list of merged pull requests. Use when the user asks for release notes, a changelog entry, "what shipped", or a version summary, even if they don't name the format. Don't use for commit messages, PR descriptions, or marketing copy.
grill-me
Interview the user about a plan, idea, or design before any code is written. Use when the user says "grill me", "interview me", "stress-test this plan", or shares a rough idea and wants it pressure-tested. Do not use for questions that have a factual answer.
需求澄清访谈
decision-interview
在开展工作规划之前,就模糊不清的需求或想法对需求提出者进行访谈。当用户说“访谈我”、“梳理这个需求”,或提出在形成需求简报或工单之前需要做出决策的模糊需求时使用。不适用于在源资料中已有事实性答案的问题。
培训会议格式校验
session-format-validator
在将新的或已更改的 GitHub Copilot Train-the-Trainer 培训会议目录加入课程之前,对其进行验证。当用户创建、添加、更新、审查会议,或询问 sessions/session-* 下的会议是否遵循仓库的可重复格式(包括必需材料、目录元数据、导航以及实验室访问或回退指引)时,使用此技能。即使用户只是要求检查某个会议 README 或实验室,也应使用。
前端界面设计与全面优化
impeccable
当用户想要设计、重新设计、塑造、评判、审计、打磨、厘清、提炼、强化、优化、适配、添加动画、着色、提取或以其他方式改进前端界面时使用。涵盖网站、落地页、仪表盘、产品 UI、应用框架、组件、表单、设置、引导流程和空状态。可处理 UX 评审、视觉层次、信息架构、认知负荷、无障碍、性能、响应式行为、主题、反模式、排版、字体、间距、布局、对齐、色彩、动效、微交互、UX 文案、错误状态、边界情况、国际化(i18n),以及可复用的设计系统或设计令牌。也适用于:将平淡的设计变得更大胆或更愉悦、将喧闹的设计变得更安静、在浏览器中对 UI 元素进行实时迭代,或实现技术上非凡的视觉特效。不适用于纯后端或非 UI 任务。
技能创建与优化
skill-creator
创建新技能、修改和改进现有技能,并衡量技能性能。当用户想要从头创建技能、编辑或优化现有技能、运行 evals 测试技能、通过方差分析对技能性能进行基准测试,或优化技能描述以提高触发准确性时使用。