Token导航 LogoToken导航

Agent Skill · 开发

mermaid-diagram-generator(Mermaid diagram 生成器)

mermaid-diagram-generator 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

mermaid-diagram-generator 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描有未通过项,按安装量在开发类的 21,746 个 Skill 里排第 4,148。

总安装 8,924周安装 361GitHub Stars 55下载 2,801核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:mermaid-diagram-generator(Mermaid diagram 生成器)
来源仓库:https://github.com/rysweet/amplihack
仓库路径:skills/mermaid-diagram-generator
安装命令:
npx skills add https://github.com/rysweet/amplihack --skill mermaid-diagram-generator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/rysweet/amplihack --skill mermaid-diagram-generator

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

mermaid-diagram-generator 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。通过 npx skills add 命令从指定仓库安装并使用该技能。

安装前需确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/mermaid-diagram-generator

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/rysweet/amplihack --skill mermaid-diagram-gene…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

mermaid-diagram-generator 怎么安装?

在终端执行 npx skills add https://github.com/rysweet/amplihack --skill mermaid-diagram-generator。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

mermaid-diagram-generator 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

mermaid-diagram-generator 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

mermaid-diagram-generator 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

mermaid-diagram-generator 用的人多吗?

公开数据是累计安装 8,924 次,近一周安装 361 次,下载 2,801 次,GitHub 55 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

mermaid-diagram-generator 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
mermaid-diagram-generator

Mermaid diagram 生成器 · 本页

8,92455接触敏感数据MIT未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Mermaid Diagram Generator Skill

Purpose

This skill automatically converts text descriptions of system architectures, module specifications, workflow documentation, and design concepts into valid Mermaid diagram syntax. It enables clear visual communication of complex systems, ensuring diagrams are production-ready and embeddable in markdown documentation.

When to Use This Skill

  • Architecture Visualization: Convert architecture descriptions into flowcharts or block diagrams
  • Module Relationships: Create diagrams showing how brick modules connect via their studs (public contracts)
  • Workflow Documentation: Visualize workflow states, decisions, and transitions (DDD phases, investigation stages)
  • System Design: Display system components, data flow, and interactions
  • Sequence Diagrams: Show agent interactions, request/response patterns, or call sequences
  • Class Hierarchies: Document module structure and class relationships
  • State Machines: Model workflow states and valid transitions
  • Entity Relationships: Display data model structures and relationships
  • Timeline Planning: Create Gantt charts for project phases or milestones

Supported Diagram Types

1. Flowcharts (Default)

Best for: workflow sequences, decision trees, process flows, module relationships

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

2. Sequence Diagrams

Best for: agent interactions, API calls, multi-step processes, request/response patterns

sequenceDiagram
    participant User
    participant API
    participant Service
    User->>API: Request
    API->>Service: Process
    Service-->>API: Response
    API-->>User: Result

3. Class Diagrams

Best for: module structure, inheritance hierarchies, data models, component relationships

classDiagram
    class Brick {
        +String responsibility
        +PublicContract studs
    }
    class Module {
        +init()
        +process()
    }
    Brick <|-- Module

4. State Diagrams

Best for: workflow states, state machines, workflow phases, condition-based transitions

stateDiagram-v2
    [*] --> Planning
    Planning --> Design
    Design --> Implementation
    Implementation --> Testing
    Testing --> [*]

5. Entity Relationship Diagrams

Best for: data models, database schemas, entity relationships

erDiagram
    MODULE ||--o{ FUNCTION : exports
    MODULE ||--o{ DEPENDENCY : requires
    FUNCTION }o--|| CONTRACT : implements

6. Gantt Charts

Best for: project timelines, workflow phases, milestone planning

gantt
    title Project Timeline
    section Phase 1
    Planning :p1, 0, 30d
    Design :p2, after p1, 20d
    section Phase 2
    Implementation :p3, after p2, 40d
    Testing :p4, after p3, 25d

Step-by-Step Generation Process

Step 1: Understand the Source Material

  1. Read the architecture description, spec, or workflow document
  2. Identify the main entities or nodes
  3. Determine how they relate or flow
  4. Choose the appropriate diagram type

Step 2: Identify Diagram Type

Source MaterialBest Diagram Type
Workflow steps, process flowFlowchart
Module relationships, brick connectionsFlowchart or Class Diagram
Agent interactions, call sequencesSequence Diagram
States and transitionsState Diagram
Data models, entitiesClass Diagram or ERD
Database schemaERD
Project timelineGantt Chart
Complex hierarchiesClass Diagram

Step 3: Extract Entities and Relationships

  1. List all nodes/entities from the source
  2. Identify connections between them
  3. Determine connection types (data flow, inheritance, calling, etc.)
  4. Note any decision points or conditions

Step 4: Generate Mermaid Syntax

  1. Use appropriate Mermaid diagram declaration
  2. Create nodes with descriptive labels
  3. Draw connections with proper syntax
  4. Add styling if needed for clarity
  5. Ensure valid Mermaid syntax

Step 5: Validate and Enhance

  1. Ensure all entities are included
  2. Verify connections are accurate
  3. Add styling for important elements
  4. Make diagram readable and not cluttered
  5. Test syntax for validity

Step 6: Document and Embed

  1. Add title and description
  2. Include explanation of diagram
  3. Provide legend if needed
  4. Embed in markdown with proper formatting

Usage Examples

Example 1: Architecture Description to Flowchart

Input:

The authentication module handles JWT token validation. When a request arrives,
it first checks if a token exists. If not, it returns unauthorized. If it does,
it validates the token signature. If valid, it extracts the payload and continues.
If invalid, it returns forbidden. The payload is passed to the authorization
module for role-based access control.

Output:

flowchart TD
    A[Request Arrives] --> B{Token Exists?}
    B -->|No| C[Return Unauthorized]
    B -->|Yes| D{Token Valid?}
    D -->|No| E[Return Forbidden]
    D -->|Yes| F[Extract Payload]
    F --> G[Check Role-Based Access]
    G --> H{Authorized?}
    H -->|No| I[Return Access Denied]
    H -->|Yes| J[Allow Request]
    C --> K[End]
    E --> K
    I --> K
    J --> K

Example 2: Module Spec to Class Diagram

Input:

Module: authentication
- Exports: validate_token, TokenPayload, AuthError
- Classes: TokenPayload (user_id, role, expires_at), AuthError (message, code)
- Functions: validate_token(token, secret) -> TokenPayload
- Internal: JWT (PyJWT library), Models (TokenPayload)

Output:

classDiagram
    class AuthenticationModule {
        +validate_token(token, secret)
        +TokenPayload
        +AuthError
    }
    class TokenPayload {
        +String user_id
        +String role
        +DateTime expires_at
        +to_dict()
    }
    class AuthError {
        +String message
        +Integer code
        +__str__()
    }
    AuthenticationModule -- TokenPayload
    AuthenticationModule -- AuthError

Example 3: Workflow to State Diagram

Input:

DDD Workflow: Phase 0 (Planning) -> Phase 1 (Documentation) ->
Approval Gate -> Phase 2 (Code Planning) -> Phase 3 (Implementation) ->
Phase 4 (Testing & Cleanup) -> Complete

Output:

stateDiagram-v2
    [*] --> Planning
    Planning --> Documentation
    Documentation --> ApprovalGate
    ApprovalGate --> CodePlanning
    CodePlanning --> Implementation
    Implementation --> Testing
    Testing --> [*]

Example 4: Agent Interaction to Sequence Diagram

Input:

The prompt-writer agent clarifies requirements from the user. It then sends
the clarified requirements to the architect agent. The architect creates a
specification and sends it to the builder agent. The builder implements code
and sends it to the reviewer. The reviewer checks quality and sends feedback
back to the builder if issues are found, or to the user if complete.

Output:

sequenceDiagram
    actor User
    participant PromptWriter
    participant Architect
    participant Builder
    participant Reviewer

    User->>PromptWriter: Request Feature
    PromptWriter->>Architect: Clarified Requirements
    Architect->>Builder: Specification
    Builder->>Reviewer: Implementation
    Reviewer-->>Builder: Issues Found
    Builder->>Reviewer: Fixed Implementation
    Reviewer-->>User: Complete & Approved

Example 5: System Architecture to Flowchart

Input:

Client requests flow through API Gateway to Services. Services can be
Authentication Service, User Service, or Data Service. All services
connect to a shared Database and Logger. Services return responses
through the API Gateway back to Client.

Output:

flowchart LR
    Client[Client]
    Gateway[API Gateway]
    Auth[Auth Service]
    User[User Service]
    Data[Data Service]
    DB[(Database)]
    Logger[Logger]

    Client <--> Gateway
    Gateway --> Auth
    Gateway --> User
    Gateway --> Data
    Auth --> DB
    User --> DB
    Data --> DB
    Auth --> Logger
    User --> Logger
    Data --> Logger

Mermaid Syntax Reference

Flowchart Nodes

A[Rectangle]
B(Rounded Rectangle)
C{Diamond/Decision}
D[(Database)]
E[/Parallelogram Right/]
F[\Parallelogram Left\]
G[[Subroutine]]
H((Circle))

Flowchart Connections

A --> B          # Arrow
A -- Text --> B  # Arrow with label
A ---|Yes| B     # Arrow with yes/no
A -->|Condition| B
A -.-> B         # Dotted line
A ==> B          # Bold arrow

Styling

classDef className fill:#f9f,stroke:#333,stroke-width:2px,color:#000
class A,B className
style A fill:#f9f,stroke:#333,stroke-width:4px

Quality Checklist

Before presenting a diagram, verify:

  • All entities from source are included
  • Connections accurately represent relationships
  • Diagram type matches content (flowchart for flows, sequence for interactions, etc.)
  • Labels are clear and descriptive
  • No circular logic or dead ends (unless intentional)
  • Mermaid syntax is valid
  • Diagram is readable and not overly complex
  • Decision points have clear yes/no paths
  • Legend provided if needed for understanding
  • Comments explain non-obvious elements

Common Patterns

Brick Module Visualization

flowchart TD
    B1["Brick Module 1<br/>(Responsibility)"]
    B2["Brick Module 2<br/>(Responsibility)"]
    S1["Stud: public_function"]
    S2["Stud: public_class"]

    B1 --> S1
    B1 --> S2
    S1 -.depends on.-> B2
    B2 --> "Stud: get_data"

Workflow Decision Tree

flowchart TD
    Start[Start] --> Q1{Condition 1?}
    Q1 -->|No| End1[End: Rejected]
    Q1 -->|Yes| Q2{Condition 2?}
    Q2 -->|No| End2[End: Review]
    Q2 -->|Yes| Q3{Condition 3?}
    Q3 -->|No| End3[End: Partial]
    Q3 -->|Yes| End4[End: Approved]

Error Handling Flow

flowchart TD
    A[Execute] --> B{Error?}
    B -->|No| C[Success]
    B -->|Yes| D{Recoverable?}
    D -->|No| E[Fail]
    D -->|Yes| F[Retry]
    F --> A
    C --> G[End]
    E --> G

Integration with Documentation

Embedding in Markdown

## System Architecture

flowchart TD ...

Key Components:

  • Component A handles...
  • Component B processes...
### Using with Document-Driven Development
- Create diagrams during documentation phase
- Include architecture diagrams in spec docs
- Use sequence diagrams to explain workflows
- Add state diagrams to describe state machines

### Using with Investigation Workflow
- Visualize discovered architecture
- Show data flow between components
- Map discovered dependencies
- Display call sequences between services

## Tips for Effective Diagrams

1. **Keep It Simple**: One concept per diagram
2. **Use Clear Labels**: Names should describe purpose
3. **Follow Visual Conventions**: Diamonds for decisions, circles for states
4. **Avoid Crossing Lines**: Reorganize to reduce visual clutter
5. **Logical Flow**: Top-to-bottom or left-to-right
6. **Consistent Styling**: Similar elements should look similar
7. **Legend**: Include if symbols aren't obvious
8. **Test Syntax**: Ensure Mermaid renders without errors
9. **Add Comments**: Explain non-obvious relationships
10. **Iterate**: Refine based on feedback

## Common Pitfalls to Avoid

- **Too Complex**: Diagram has too many elements (break into multiple diagrams)
- **Unclear Labels**: Node names don't describe their purpose
- **Missing Connections**: Important relationships not shown
- **Invalid Syntax**: Mermaid errors prevent rendering
- **Ambiguous Decision Points**: Yes/no paths not clearly marked
- **Crossing Arrows**: Visual confusion from overlapping connections
- **No Legend**: Symbols or colors not explained
- **Wrong Diagram Type**: Using flowchart for sequence data
- **Inconsistent Style**: Different formatting for similar elements
- **No Context**: Diagram shown without explanation

## Success Criteria

A good Mermaid diagram:
- [ ] Shows all key entities from source material
- [ ] Accurately represents relationships and flow
- [ ] Uses appropriate diagram type for content
- [ ] Clear, descriptive labels on all nodes
- [ ] Valid Mermaid syntax (renders without error)
- [ ] Readable without excessive complexity
- [ ] Supports understanding of the system
- [ ] Could be embedded in documentation
- [ ] Decision points clearly marked
- [ ] Legend included if needed
- [ ] Purpose and scope clear from context

## Related Skills

- **module-spec-generator**: Generate specs that can be visualized as class diagrams
- **Document-Driven Development**: Use diagrams in specification documents
- **Investigation Workflow**: Create architecture diagrams from discovered systems

## Output Format

Diagrams are generated in Mermaid markdown format, ready to embed:
    [Generated Mermaid Syntax]

Include explanation before or after the diagram.

## Feedback and Improvement

This skill evolves based on usage patterns:

- What types of diagrams are most useful?
- What features make diagrams clearer?
- What errors occur and how to prevent them?
- How can diagrams better support documentation?

Document learnings and suggest improvements for `~/.amplihack/.claude/context/DISCOVERIES.md`.

平台分布

Claude Code

30.03%
按下载量换算841

OpenCode

24.41%
按下载量换算684

Antigravity

16.45%
按下载量换算461

Gemini CLI

12.94%
按下载量换算362

Codex

8.31%
按下载量换算233

windsurf

3.35%
按下载量换算94

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills