跳到正文

宝玉:技术图表与结构说明

根据技术说明或代码关系规划图表,组织图形结构、主题和渲染步骤,用于解释流程与系统关系。

开源精选知识加工10 个文件26,681 Stars浏览次数 0JimLiu/baoyu-skills MIT版本 1567581
开始使用

下载前阅读 SKILL.md 中的使用条件,并确认所用工具支持对应能力。

输入资料
技术资料与图表目标 图表类型和输出要求 阅读本节完整说明
交付内容
结构化图表 图表源文件与说明 阅读本节完整说明
  1. 获取完整包,保留配套文件的目录结构。
  2. 按照原文准备所需工具、依赖与输入资料。
  3. 阅读对应使用步骤与输入输出说明,在自己的环境中验证结果。

使用提示摘自原文,配套文件保留来源版本;实际运行条件以各包说明为准。

正文

获取原文件

references/architecture.md

Flow Direction

Choose one primary direction:

  • Left-to-Right (LTR): Best for data pipelines, request flows. Users/clients on left, data stores on right.
  • Top-to-Bottom (TTB): Best for layered architectures. Clients at top, infrastructure at bottom.

Layout Algorithm

  1. Identify layers: Group components by role (clients, gateways, services, data, infrastructure)
  2. Assign columns (LTR) or rows (TTB): One layer per column/row
  3. Within each layer: Stack components vertically (LTR) or horizontally (TTB), 40px gap minimum
  4. Region boundaries: Draw around groups that share infrastructure (e.g., "AWS us-east-1", "Kubernetes Cluster")
  5. Connectors: Route arrows between layers. For buses/queues between layers, place a thin connector bar in the gap.

Typical Layer Structure (LTR)

Col 1 (x=40)     Col 2 (x=250)     Col 3 (x=460)     Col 4 (x=670)
┌──────────┐     ┌──────────┐      ┌──────────┐      ┌──────────┐
│  Client   │────▶│ Gateway  │─────▶│ Services │─────▶│ Database │
│  Layer    │     │  Layer   │      │  Layer   │      │  Layer   │
└──────────┘     └──────────┘      └──────────┘      └──────────┘

Column spacing: 200-220px between column starts. Adjust if components are wider.

Typical Layer Structure (TTB)

Row 1 (y=60):   [ Browser ]  [ Mobile App ]  [ API Client ]
Row 2 (y=160):  [         Load Balancer / API Gateway       ]
Row 3 (y=280):  [ Auth Svc ]  [ User Svc ]  [ Order Svc ]
Row 4 (y=400):  [  Redis  ]   [ PostgreSQL ]  [ S3 Bucket ]

Row spacing: 120-140px between row starts.

Connection Routing

  • Prefer straight horizontal or vertical lines
  • For connections that would cross components, use two-segment (L-shaped) paths:
    <path d="M x1,y1 L midX,y1 L midX,y2" fill="none" stroke="#64748b" marker-end="url(#arrow)"/>
    
  • For busy diagrams, use stroke-opacity="0.6" on less important connections
  • Label important connections with a text element near the midpoint

Message Bus / Event Bus Pattern

When services communicate through a shared bus, draw it as a horizontal bar between the service layer:

Services:  [ Svc A ]    [ Svc B ]    [ Svc C ]
              │              │            │
Bus:     ════╪══════════════╪════════════╪═══════
              │              │            │
Data:    [ DB A ]        [ DB B ]     [ Cache ]

Use the Connector color (orange) for the bus bar.

Multi-Region / Multi-Cloud

Nest region boundaries:

  • Outer boundary: Cloud provider (AWS, GCP)
  • Inner boundary: Region or VPC
  • Innermost: Availability zones or subnets

Use different dash patterns to distinguish nesting levels:

  • Outer: stroke-dasharray="12,4"
  • Middle: stroke-dasharray="8,4"
  • Inner: stroke-dasharray="4,4"

CONTACT HAONAN

联系haonan

医疗 AI · 产品与独立开发

刘浩南

关注医疗 AI 从 demo 到真实落地,聚焦产品化、商业化与院内工作流效率提升。

12年医疗产研经验,大湾区头部医疗AI公司前产品总监,独立开发者

医疗 AI 产品化医疗 AI 商业化院内工作流效率
刘浩南的微信联系二维码
微信扫一扫,联系 haonan