architecture-diagram ยท git:20260714.b87d8d4 ยท 2026-07-14 ยท sha256 89c9e733908abf3c

architecture-diagram git:20260714.b87d8d4A

Immutable. This exact content is served forever at /api/v1/blob/89c9e733908abf3c.

---
name: architecture-diagram
description: "Diagram a system or technical architecture โ€” services, data stores, and how they connect. Use when asked to draw an architecture, show how components fit together, map a system/data flow, or visualize services and dependencies. Produces a ready-to-render Mermaid diagram with grouped subgraphs (renders live, exportable as PNG/SVG) plus a component legend and notes."
homepage: https://mohitagw15856.github.io/pm-claude-skills/skill/architecture-diagram.html
metadata:
  {
    "openclaw": { "emoji": "๐Ÿ–ผ" }
  }
---

# Architecture Diagram Skill

"How does the system fit together?" is best answered with a picture. This skill turns a described system
into a clean **Mermaid architecture diagram** โ€” clients, services, data stores, and third parties, grouped
into logical layers with labelled connections (sync vs async, protocols) โ€” not an undifferentiated blob of
boxes.

## Required Inputs

Ask for these only if they aren't already provided:

- **The components** โ€” services, apps, databases, queues, external APIs.
- **How they connect** โ€” who calls whom; sync (HTTP/gRPC) vs async (queue/event); data flow direction.
- **Logical groupings** โ€” frontend / backend / data / third-party, or by team/domain.
- **Focus** โ€” the whole system or one slice (e.g. just the checkout path).

## Output Format

### [System name] โ€” architecture

One line on what the diagram covers and its boundary.

```mermaid
flowchart LR
    subgraph Client
        Web[Web app]
        Mobile[Mobile app]
    end
    subgraph Backend
        API[API gateway]
        Svc[Order service]
    end
    subgraph Data
        DB[(Postgres)]
        Cache[(Redis)]
    end
    Web --> API
    Mobile --> API
    API --> Svc
    Svc --> DB
    Svc -.async.-> Queue[[Event bus]]
    Svc --> Cache
```

**Component legend** โ€” one line per non-obvious component (what it is, why it's there).

**Notes** โ€” trust boundaries, single points of failure, sync vs async (`-.->` = async), anything to revisit.

## Mermaid Rules (so it renders)

- Use `flowchart LR` (or `TD`) with `subgraph Name ... end` for logical layers.
- Databases/stores read well as `[(name)]`; queues/buses as `[[name]]`.
- Solid arrows `-->` for synchronous calls, dotted `-.label.->` for async/events.
- Short node labels; keep IDs unique and simple. No parentheses/quotes inside labels.

## Quality Checks

- [ ] Components are grouped into meaningful layers (subgraphs), not one flat pile
- [ ] Connection direction reflects who calls whom; async vs sync is distinguished
- [ ] Data stores and external/third-party systems are visually distinct from services
- [ ] The legend explains anything non-obvious; trust boundaries / SPOFs are noted
- [ ] The Mermaid block renders without edits

## Anti-Patterns

- [ ] Do not draw every box the same with undifferentiated arrows โ€” show layers and connection types
- [ ] Do not omit data stores or external dependencies โ€” they're usually where the risk lives
- [ ] Do not blur sync and async โ€” they have very different failure modes
- [ ] Do not cram the entire system when the ask is one slice โ€” match the requested focus
- [ ] Do not break Mermaid with special characters in labels

## Based On

Architecture diagramming (C4-style grouping, logical layers, sync/async edges), expressed as renderable Mermaid.