Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计提醒

design-doc-mermaid设计 DOC Mermaid

Agent Skill

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

总安装

2,208

周安装

92

GitHub Stars

54

下载量

736
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/spillwavesolutions/design-doc-mermaid --skill design-doc-mermaid

简介

用于生成和维护 Mermaid 图表及关联技术文档,支持多种图形类型。

  • 适合绘制流程图、时序图、类图等,提升设计表达的系统性和可读性。
  • 提供风格指南和代码转换工具,帮助统一视觉呈现和技术规范。
  • 使用时需遵循项目设计语言,避免引入未经测试的视觉元素或格式。
  • design-doc-mermaid 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Mermaid Architect - Hierarchical Diagram and Documentation Skill

Mermaid diagram and documentation system with specialized guides and code-to-diagram capabilities.

Table of Contents

Decision Tree

How this skill works:

  1. User makes a request → Skill analyzes intent
  2. Skill determines diagram/document type → Loads appropriate guide(s)
  3. AI reads specialized guide → Generates diagram/document using templates
  4. Result delivered → With validation and export options

User Intent Analysis:

flowchart TD
    Start([User Request]) --> Analyze{Analyze Intent}

    Analyze -->|"workflow, process, business logic"| Activity[Load Activity Diagram Guide<br/>references/guides/diagrams/activity-diagrams.md]
    Analyze -->|"infrastructure, deployment, cloud"| Deploy[Load Deployment Diagram Guide<br/>references/guides/diagrams/deployment-diagrams.md]
    Analyze -->|"system architecture, components"| Arch[Load Architecture Guide<br/>references/guides/diagrams/architecture-diagrams.md]
    Analyze -->|"API flow, interactions"| Sequence[Load Sequence Diagram Guide<br/>references/guides/diagrams/sequence-diagrams.md]
    Analyze -->|"code to diagram"| CodeToDiag[Load Code-to-Diagram Guide<br/>references/guides/code-to-diagram/ + examples/]
    Analyze -->|"design document, full docs"| DesignDoc[Load Design Document Template<br/>assets/*-design-template.md]
    Analyze -->|"unicode symbols, icons"| Unicode[Load Unicode Symbols Guide<br/>references/guides/unicode-symbols/guide.md]
    Analyze -->|"extract, validate, convert"| Scripts[Use Python Scripts<br/>scripts/extract_mermaid.py<br/>scripts/mermaid_to_image.py]

    Activity --> Generate[Generate Diagram]
    Deploy --> Generate
    Arch --> Generate
    Sequence --> Generate
    CodeToDiag --> Generate
    DesignDoc --> Generate
    Unicode --> Generate
    Scripts --> Execute[Execute Script]

    Generate --> Validate{Validate?}
    Validate -->|Yes| RunValidation[Run mmdc validation]
    Validate -->|No| Output
    RunValidation --> Output[Output Result]
    Execute --> Output

    classDef decision fill:#FFD700,stroke:#333,stroke-width:2px,color:black
    classDef guide fill:#90EE90,stroke:#333,stroke-width:2px,color:darkgreen
    classDef action fill:#87CEEB,stroke:#333,stroke-width:2px,color:darkblue

    class Analyze,Validate decision
    class Activity,Deploy,Arch,Sequence,CodeToDiag,DesignDoc,Unicode,Scripts guide
    class Generate,Execute,RunValidation,Output action

Available Guides and Resources

Diagram Type Guides (references/guides/diagrams/)

GuideFull PathLoad When User WantsExamples
Activity Diagramsreferences/guides/diagrams/activity-diagrams.mdWorkflows, processes, business logic, user flows, decision trees"Show checkout flow", "Document ETL pipeline", "Create approval workflow"
Deployment Diagramsreferences/guides/diagrams/deployment-diagrams.mdInfrastructure, cloud architecture, K8s, serverless, network topology"Show AWS architecture", "Document GCP deployment", "Create K8s diagram"
Architecture Diagramsreferences/guides/diagrams/architecture-diagrams.mdSystem architecture, component design, high-level structure"Show system components", "Document microservices", "Architecture overview"
Sequence Diagramsreferences/guides/diagrams/sequence-diagrams.mdAPI interactions, service communication, request/response flows"Show API call sequence", "Document auth flow", "Service interactions"

Code-to-Diagram Guide & Examples

ResourceFull PathWhat It Provides
Master Guidereferences/guides/code-to-diagram/README.mdComplete workflow for analyzing any codebase and extracting diagrams
Spring Bootexamples/spring-boot/README.mdController→Service→Repository architecture, deployment config, sequence from methods, activity from business logic
FastAPIexamples/fastapi/README.mdPython async patterns, Pydantic models, dependency injection, cloud deployment
Reactexamples/react/README.mdComponent hierarchy, state management, data flow, build pipeline
Python ETLexamples/python-etl/README.mdData pipeline, transformation steps, error handling, scheduling
Node/Expressexamples/node-webapp/README.mdMiddleware chain, route handlers, async patterns, deployment
Java Web Appexamples/java-webapp/README.mdTraditional MVC, servlet containers, WAR deployment

Design Document Templates

TemplateFull PathUse ForLoad When
Architecture Designassets/architecture-design-template.mdSystem-wide architecture"Create architecture doc", "Document system design"
API Designassets/api-design-template.mdAPI specifications"API design doc", "Document REST API"
Feature Designassets/feature-design-template.mdFeature planning"Feature design", "Plan new feature"
Database Designassets/database-design-template.mdDatabase schema"Database design", "Document schema"
System Designassets/system-design-template.mdComplete system"System design doc", "Full system documentation"

Unicode Symbols Guide

Full Path: references/guides/unicode-symbols/guide.md

Load when user mentions: "unicode symbols", "emoji in diagrams", "semantic icons", "add symbols"

Quick Reference:

  • 📦 Infrastructure: ☁️ 🌐 🔌 📡 🗄️
  • ⚙️ Compute: ⚙️ ⚡ 🔄 ♻️ 🚀 💨
  • 💾 Data: 💾 📦 📊 📈 🗃️ 🧊
  • 📨 Messaging: 📨 📬 📤 📥 🐰 📢
  • 🔐 Security: 🔐 🔑 🛡️ 🚪 👤 🎫
  • 📝 Monitoring: 📝 📊 🚨 ⚠️ ✅ ❌

Python Scripts (scripts/)

ScriptUse ForLoad When
extract_mermaid.pyExtract diagrams from Markdown, validate syntax, replace with images"extract diagrams", "validate mermaid", "find all diagrams"
mermaid_to_image.pyConvert.mmd to PNG/SVG, batch conversion, custom themes"convert to image", "render diagram", "create PNG"
resilient_diagram.pyFull workflow: save.mmd, generate image, validate, error recovery"generate diagram", "create diagram with validation", "resilient diagram"

Usage Patterns

Common request patterns and guide selection. See When to Use What for complete mapping.

PatternExample RequestGuides to Load
Single Diagram"Create activity diagram for login flow"Diagram type guide + Unicode symbols
Code-to-Diagram"Generate deployment from application.yml"Framework example + Deployment guide
Design Document"Create API design document"Template from assets/ + Relevant diagram guides
Extract/Validate"Extract diagrams from design.md"Use scripts/extract_mermaid.py
Batch Convert"Convert all.mmd to PNG"Use scripts/mermaid_to_image.py

Resilient Workflow

CRITICAL: This is the recommended approach for ALL diagram generation. It ensures validation, error recovery, and consistent file organization.

Full Guide: references/guides/resilient-workflow.md

Workflow Overview

flowchart LR
    A[1. Identify Type] --> B[2. Save .mmd + Image]
    B --> C{3. Valid?}
    C -->|Yes| D[4. Add to Markdown]
    C -->|No| E[5. Error Recovery]
    E --> F{Fix Found?}
    F -->|Yes| A
    F -->|No| G[Search External]
    G --> A

    classDef step fill:#90EE90,stroke:#333,color:darkgreen
    classDef decision fill:#FFD700,stroke:#333,color:black
    class A,B,D,E,G step
    class C,F decision

Key Principle

NEVER add a diagram to markdown until it passes validation. This prevents broken diagrams in documentation.

Using the Script (Recommended)

# Generate with full error recovery
python scripts/resilient_diagram.py \
    --code "flowchart TD; A-->B" \
    --markdown-file design_doc \
    --diagram-num 1 \
    --title "process_flow" \
    --format png \
    --json

Output: Both .mmd and .png files in ./diagrams/ directory.

File Naming Convention

./diagrams/<markdown_file>_<num>_<type>_<title>.mmd
./diagrams/<markdown_file>_<num>_<type>_<title>.png

Example: ./diagrams/api_design_01_sequence_auth_flow.png

Error Recovery Priority

When validation fails, the workflow automatically:

  1. Check troubleshooting guide - references/guides/troubleshooting.md (28 documented errors)
  2. Search with perplexity - perplexity_ask MCP for syntax questions
  3. Search with brave - brave_web_search MCP for recent solutions
  4. Ask gemini - gemini skill for alternative perspective
  5. General search - WebSearch tool as fallback

Manual Fallback Steps

If the script is unavailable:

  1. Identify diagram type from first line (flowchart, sequence, etc.)
  2. Load reference guide from references/guides/diagrams/
  3. Save to ./diagrams/<markdown_file>_<num>_<type>_<title>.mmd
  4. Validate: mmdc -i file.mmd -o file.png -b transparent
  5. On error: Search references/guides/troubleshooting.md for matching error
  6. If not found: Use search tools in priority order above
  7. Add reference: ![Description](./diagrams/filename.png)

Pattern 6: Resilient Diagram Generation

User: "Create a sequence diagram and add it to the design doc"

Skill Actions:

  1. Identify intent: diagram generation + markdown integration
  2. Load workflow guide: references/guides/resilient-workflow.md
  3. Identify diagram type: sequence
  4. Load diagram guide: references/guides/diagrams/sequence-diagrams.md
  5. Generate Mermaid code using templates
  6. Execute resilient workflow: python scripts/resilient_diagram.py \ --code "[generated code]" \ --markdown-file design_doc \ --diagram-num 1 \ --title "api_sequence" \ --json
  7. If validation fails → Apply troubleshooting fix → Retry
  8. On success → Add ![API Sequence](./diagrams/design_doc_01_sequence_api_sequence.png) to markdown

Unicode Semantic Symbols

Always use Unicode symbols to enhance diagram clarity. Common patterns:

Infrastructure & Deployment

graph TB
    Client[👤 User] --> LB[🌐 Load Balancer]
    LB --> App1[⚙️ App Server 1]
    LB --> App2[⚙️ App Server 2]
    App1 --> DB[(💾 Database)]
    App1 --> Cache[(⚡ Redis)]

Activity Flow with States

flowchart TD
    Start([🚀 Start]) --> Process[⚙️ Process Data]
    Process --> Check{✓ Valid?}
    Check -->|Yes| Save[💾 Save]
    Check -->|No| Error[❌ Error]
    Save --> Complete([✅ Complete])

Microservices Architecture

graph TB
    API[🌐 API Gateway] --> Auth[🔐 Auth Service]
    API --> Orders[📋 Order Service]
    Orders --> Queue[📬 Message Queue]
    Queue --> Worker[⚙️ Background Worker]
    Worker --> Storage[📦 Object Storage]

For complete symbol reference, load: references/guides/unicode-symbols/guide.md

Python Utilities

Extract Mermaid Diagrams

# List all diagrams
python scripts/extract_mermaid.py document.md --list-only

# Extract to separate files
python scripts/extract_mermaid.py document.md --output-dir diagrams/

# Validate all diagrams
python scripts/extract_mermaid.py document.md --validate

# Replace with image references (for Confluence upload)
python scripts/extract_mermaid.py document.md --replace-with-images \
  --image-format png --output-markdown output.md

Convert to Images

# Single conversion
python scripts/mermaid_to_image.py diagram.mmd output.png

# With custom settings
python scripts/mermaid_to_image.py diagram.mmd output.svg \
  --theme dark --background white --width 1200

# Batch convert directory
python scripts/mermaid_to_image.py diagrams/ output/ --format png --recursive

# From stdin
echo "graph TD; A-->B" | python scripts/mermaid_to_image.py - output.png

Decision Tree Examples

Example 1: User Asks for Workflow Diagram

Input: "Show the checkout process workflow"

Skill Decision Path:

1. Analyze: workflow, process → ACTIVITY DIAGRAM
2. Load guide: guides/diagrams/activity-diagrams.md
3. Find pattern: E-commerce checkout (template exists in guide)
4. Generate using template + Unicode symbols
5. Output activity diagram with decision points

Output: Complete activity diagram with Unicode symbols for cart, payment, order states.

Example 2: User Provides Spring Boot Code

Input: "Here's my Spring Boot controller, create diagrams"

Skill Decision Path:

1. Analyze: Spring Boot, code provided → CODE-TO-DIAGRAM + SPRING BOOT
2. Load guides:
   - examples/spring-boot/README.md
   - guides/diagrams/architecture-diagrams.md (for structure)
   - guides/diagrams/sequence-diagrams.md (for method calls)
   - guides/diagrams/activity-diagrams.md (for business logic)
3. Generate multiple diagrams:
   a. Architecture diagram from @RestController/@Service/@Repository annotations
   b. Sequence diagram from method call chain
   c. Activity diagram from business logic flow
4. Output all diagrams with explanations

Output: 3-4 diagrams showing different views of the Spring Boot application.

Example 3: User Wants Infrastructure Documentation

Input: "Document my GCP Cloud Run deployment with AlloyDB"

Skill Decision Path:

1. Analyze: infrastructure, GCP, Cloud Run → DEPLOYMENT DIAGRAM
2. Load guides:
   - guides/diagrams/deployment-diagrams.md
   - examples/spring-boot/ or examples/fastapi/ (if code provided)
3. Check for IaC files (Pulumi, Terraform, docker-compose)
4. Generate deployment diagram with:
   - Cloud Run services with specs
   - VPC connector
   - AlloyDB cluster
   - Security (IAM, Secret Manager)
   - Monitoring
5. Apply Unicode symbols for clarity
6. Output with resource specifications

Output: Complete GCP deployment diagram with all resources labeled.

High-Contrast Styling

ALL diagrams MUST use high-contrast colors:

graph TB
    classDef primary fill:#90EE90,stroke:#333,stroke-width:2px,color:darkgreen
    classDef secondary fill:#87CEEB,stroke:#333,stroke-width:2px,color:darkblue
    classDef database fill:#E6E6FA,stroke:#333,stroke-width:2px,color:darkblue
    classDef error fill:#FFB6C1,stroke:#DC143C,stroke-width:2px,color:black

    %% Every classDef MUST have color: property

Rules:

  • Light background → Dark text color
  • Dark background → Light text color
  • Always specify color: in every classDef

File Organization

design-doc-mermaid/
├── SKILL.md                          # This file - Main orchestrator
├── README.md                         # User documentation
├── CLAUDE.md                         # Claude Code instructions
│
├── references/                       # Reference materials
│   ├── mermaid-diagram-guide.md     # Legacy general guide
│   └── guides/                       # Specialized guides (load on-demand)
│       ├── diagrams/
│       │   ├── activity-diagrams.md      # Workflows, processes
│       │   ├── deployment-diagrams.md    # Infrastructure, cloud
│       │   ├── architecture-diagrams.md  # System architecture
│       │   └── sequence-diagrams.md      # API interactions
│       ├── code-to-diagram/
│       │   └── README.md                 # Master guide for code analysis
│       ├── unicode-symbols/
│       │   └── guide.md                  # Complete symbol reference
│       └── troubleshooting.md        # Common syntax errors & fixes
│
├── assets/                           # Design document templates
│   ├── architecture-design-template.md
│   ├── api-design-template.md
│   ├── feature-design-template.md
│   ├── database-design-template.md
│   └── system-design-template.md
│
├── scripts/                          # Python utilities
│   ├── extract_mermaid.py           # Extract & validate diagrams
│   └── mermaid_to_image.py          # Convert to PNG/SVG
│
├── examples/                         # Language-specific patterns
│   ├── spring-boot/                 # Spring Boot patterns
│   ├── fastapi/                     # FastAPI patterns
│   ├── react/                       # React patterns
│   ├── python-etl/                  # Data pipeline patterns
│   ├── node-webapp/                 # Express.js patterns
│   └── java-webapp/                 # Traditional Java patterns
│
└── references/                       # General Mermaid reference
    └── mermaid-diagram-guide.md     # Complete Mermaid syntax guide

Workflow Summary

  1. Analyze user intent → Determine diagram type, document type, or action needed
  2. Load appropriate guide(s) → Read only what's needed (token efficient)
  3. Apply templates and patterns → Use examples from guides
  4. Generate output → Create diagram or document
  5. Validate (optional) → Use scripts to verify
  6. Convert (optional) → Export to images if needed

When to Use What

User RequestLoad This
"activity diagram", "workflow", "process flow"references/guides/diagrams/activity-diagrams.md
"deployment", "infrastructure", "cloud", "k8s"references/guides/diagrams/deployment-diagrams.md
"architecture", "system design", "components"references/guides/diagrams/architecture-diagrams.md + design template
"API", "sequence", "interactions", "flow"references/mermaid-diagram-guide.md (sequence section)
"Spring Boot code"examples/spring-boot/ + relevant diagram guides
"FastAPI code", "Python API"examples/fastapi/ + relevant diagram guides
"React app", "frontend"examples/react/ + architecture guide
"ETL", "data pipeline", "Python batch"examples/python-etl/ + activity guide
"symbols", "unicode", "emoji"references/guides/unicode-symbols/guide.md
"syntax error", "diagram won't render", "troubleshoot"references/guides/troubleshooting.md
"extract diagrams"scripts/extract_mermaid.py
"convert to image", "PNG", "SVG"scripts/mermaid_to_image.py
"create diagram", "generate diagram", "add diagram to markdown"scripts/resilient_diagram.py + references/guides/resilient-workflow.md
"design document", "full docs"assets/*-design-template.md + diagram guides

Best Practices

  1. Single Responsibility: One diagram = One concept
  2. Unicode Enhancement: Always use semantic symbols for clarity
  3. High Contrast: Never skip the color: property in styles
  4. Validate Early: Use scripts to catch syntax errors
  5. Template Reuse: Leverage existing templates and examples
  6. Load On-Demand: Only read guides needed for the specific request
  7. Token Efficiency: Use hierarchical loading instead of reading everything

Learning Path

New to Mermaid? Start here:

  1. Read references/guides/unicode-symbols/guide.md for symbol meanings
  2. Read references/guides/diagrams/activity-diagrams.md for basic patterns
  3. Try examples in examples/spring-boot/ or examples/fastapi/
  4. Use scripts/extract_mermaid.py --validate to check your work

Need to document code? Follow this:

  1. Identify your framework → Load relevant examples/{framework}/
  2. Match code pattern to diagram type
  3. Use templates from guide
  4. Validate with scripts

Creating design docs? Follow this:

  1. Choose document type → Load template from assets/
  2. Fill in text sections
  3. Load diagram guides as needed for each section
  4. Use Unicode symbols throughout
  5. Save to docs/design/ with timestamp

Version: 2.0 (Hierarchical Architecture) Last Updated: 2025-01-13 Maintained by: Claude Code Skills

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.88%
按下载量换算271

Claude

31.59%
按下载量换算233

Cursor

18.97%
按下载量换算140

Gemini CLI

8.76%
按下载量换算64

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills