All skills
simota avatar

/canvas

@35ffd55
by shingo imotasimota/agent-skills85 stars
15

Visualizing code, specs, or context as Mermaid, ASCII, or draw.io diagrams: flowcharts, sequence/state/class/ER, Journey Maps, personas, coverage heatmaps. Use to reverse-document systems visually.

Use this Skill: https://skilld.dev/gh/simota/agent-skills/canvas

This session only. Nothing lands on disk.

referencearchitecture-diagrams.md

≈1.4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Architecture Diagrams Reference (Canvas architecture recipe)

Purpose: Produce informal, ad-hoc system architecture sketches using Mermaid flowchart + subgraph — fast enough for a Slack DM, readable enough for an ADR. These are not C4 models; they are the diagrams engineers draw on whiteboards to align on shape before committing to formal modeling.

Scope Boundary

  • Canvas architecture: Informal architecture sketches. One view per diagram: logical, physical, or deployment. Topologies include layered monolith, hexagonal / ports-and-adapters, microservice mesh, event-driven bus, BFF + edge.
  • Canvas c4: Formal C4 rendering with Mermaid C4 syntax (System Context / Container / Component). Use when the conversation already speaks in C4 vocabulary.

If the ask is "builder how the pieces fit" → architecture. If the ask is "give me a C4 Container view" → c4.

View Selection

View Answers Subgraph grouping
Logical What are the modules and how do they call each other? Layers or bounded contexts
Physical What runs where (processes, nodes, clusters)? Hosts, pods, VMs
Deployment What lives in which environment (region, VPC, zone)? Regions, VPCs, availability zones

Pick one per diagram. Combining logical + deployment in the same builder is the most common readability failure.

Workflow

UNDERSTAND  →  pick view (logical / physical / deployment)
            →  pick topology vocabulary (layered / hexagonal / microservice / event-driven)
            →  list the ≤7 top-level groupings before any node

ANALYZE     →  for each grouping, list concrete, named elements (real service names)
            →  list edges: sync call, async event, shared DB, read replica
            →  mark external boundaries (third-party APIs, SaaS)

DRAW        →  Mermaid flowchart LR (most architecture reads left-to-right)
            →  wrap each grouping in a `subgraph` with a human-readable label
            →  distinguish edge kinds: solid for sync, dotted for async, thick for primary path

REVIEW      →  ≤20 nodes; split by subgraph if over
            →  every subgraph has a purpose label, not just a name
            →  external boundary is visually distinct (dashed border or separate subgraph)
            →  ensure arrow direction matches call direction (not data direction)

Mermaid Patterns

Layered Monolith (Logical View)

flowchart TB
  subgraph Presentation["Presentation Layer"]
    web[Web UI]
    mobile[Mobile App]
  end
  subgraph Application["Application Layer"]
    api[REST API]
    auth[Auth Service]
  end
  subgraph Domain["Domain Layer"]
    orders[Orders]
    billing[Billing]
    catalog[Catalog]
  end
  subgraph Infrastructure["Infrastructure Layer"]
    db[(PostgreSQL)]
    cache[(Redis)]
    queue[/SQS/]
  end
  web --> api
  mobile --> api
  api --> auth
  api --> orders
  api --> billing
  orders --> db
  billing --> db
  catalog --> cache
  orders -.-> queue

Hexagonal / Ports-and-Adapters

flowchart LR
  subgraph Adapters_In["Driving Adapters"]
    http[HTTP Controller]
    cli[CLI]
    job[Scheduled Job]
  end
  subgraph Core["Domain Core"]
    usecase[Use Cases]
    model[Domain Model]
    usecase --> model
  end
  subgraph Adapters_Out["Driven Adapters"]
    repo[Postgres Repo]
    bus[Event Bus]
    mail[Email Gateway]
  end
  http --> usecase
  cli --> usecase
  job --> usecase
  usecase --> repo
  usecase --> bus
  usecase --> mail

Event-Driven Microservices (Physical View)

flowchart LR
  subgraph Edge["Edge"]
    gw[API Gateway]
  end
  subgraph Services["Services"]
    orders[orders-svc]
    fulfill[fulfillment-svc]
    notify[notification-svc]
  end
  subgraph Backbone["Event Backbone"]
    bus{{Kafka: orders-topic}}
  end
  subgraph Data["Data"]
    ordersDb[(orders-db)]
    fulfillDb[(fulfillment-db)]
  end
  gw --> orders
  orders --> ordersDb
  orders -.->|OrderPlaced| bus
  bus -.->|OrderPlaced| fulfill
  bus -.->|OrderPlaced| notify
  fulfill --> fulfillDb

Anti-Patterns

  • Mixing logical and physical nodes (a domain "Orders" module next to a "us-east-1a" zone) — split into two diagrams and cross-link.
  • Subgraphs with generic labels ("Group A", "Backend") — label by purpose ("Domain Layer", "Event Backbone").
  • Undifferentiated edges — if both sync and async calls exist, distinguish with solid vs dotted.
  • Drawing every microservice individually when 12+ exist — group by bounded context subgraph and drill down in a follow-up diagram.
  • Re-drawing a C4 Container view in flowchart syntax — if C4 vocabulary is already in use, switch to the c4 recipe.
  • Smuggling deployment detail (regions, VPCs) into a logical view — separate views.

Handoff

  • To c4 (within Canvas): when the audience explicitly wants a C4 level rendering.
  • To Atlas: when the diagram exposes dependency cycles, god modules, or a debt assessment request emerges.

Output Checklist

  • Single view declared (logical / physical / deployment).
  • Topology pattern declared (layered / hexagonal / microservice / event-driven / BFF).
  • Subgraphs have purpose labels.
  • Sync vs async edges visually distinct.
  • External boundaries marked.
  • ≤20 nodes, split and cross-link otherwise.
  • Note in Sources: "informal builder; canonical model not authored here."

Source: SKILL.md on GitHub

No alerts13d5 checks · Risk SAFE
  • Gen Agent Trust Hub13d

    The skill provides comprehensive visualization and reverse-engineering capabilities using Mermaid and other diagramming tools. It possesses a potential attack surface for indirect prompt injection by processing untrusted project code, though it includes best-practice instructions for source disclosure and uncertainty marking. It also documentedly uses well-known external rendering services like Kroki for processing diagram DSL.

  • Socket13d

    No alerts

  • Snyk13d

    Risk: LOW · No issues

  • Runlayer6mo

    14 files scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 35ffd55. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 2 weeks ago

README badge

README badge for simota/agent-skills/canvas