diagram
Generate architecture diagrams using Python diagrams library
от DavidROliverBA★ 53 звезды на GitHub
Установить diagram в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
/diagram Skill
Generate architecture diagrams in multiple formats (C4, System Landscape, Data Flow, AWS).
When to Use This Skill
Use /diagram when you need to create or update architecture visualizations:
- Create new C4 context/container/component diagrams
- Generate system landscape maps
- Visualize data flow architectures
- Create AWS infrastructure diagrams
- Diagram integration patterns
- Map system dependencies
Usage
/diagram <type> [options]
Diagram Types
| Type | Description | Use Case |
|---|---|---|
c4-context |
C4 Level 1 - System context | Show external actors and system boundary |
c4-container |
C4 Level 2 - System containers | Show major components (services, databases) |
c4-component |
C4 Level 3 - Component level | Show detailed component interactions |
system-landscape |
Enterprise system map | Show all systems and connections |
data-flow |
Data movement diagram | Show how data moves through systems |
aws-architecture |
AWS infrastructure | Show EC2, RDS, S3, networking |
integration-pattern |
Integration architecture | Show message flows and patterns |
dependency-graph |
System dependencies | Show what depends on what |
Workflow
Phase 1: Capture Requirements
When invoked, the skill asks:
Diagram type (required)
- Options: c4-context, c4-container, system-landscape, data-flow, aws-architecture, integration-pattern, dependency-graph
- Default: c4-context
Scope (required)
- For C4: Which system/product?
- For landscape: Which program/domain?
- For AWS: Which account/region?
- For data-flow: Which integration?
Systems to include (optional)
- Comma-separated list of systems
- Leave blank to auto-detect from context
Styling preferences (optional)
- Color scheme: classic, muted, vibrant
- Icon set: simple, detailed, minimalist
- Default: classic, simple
Output format (optional)
python— PNG via Pythondiagramslibrary (default for AWS/landscape types)mermaid— Inline Mermaid (default for C4 types; renders natively in Obsidian)plantuml— C4-PlantUML with directional hints (for complex C4 layouts, >15 elements)- For C4 types (c4-context, c4-container, c4-component), suggest Mermaid or PlantUML and cross-reference
/c4-diagramfor data-driven generation from System note frontmatter
Output location (optional)
- Save diagram in Canvas, Concept note, or embed in Note?
- Default: Create standalone file
Phase 2: Generate Diagram
The skill generates a Python script using the diagrams package:
from diagrams import Diagram, Cluster, Edge
from diagrams.aws.compute import EKS, EC2
from diagrams.aws.database import RDS
from diagrams.aws.storage import S3
from diagrams.onprem.queue import Kafka
from diagrams.onprem.analytics import Spark
with Diagram("System Landscape", show=False, direction="TB"):
# Your architecture here
Layout Science (Mermaid/PlantUML formats)
When generating Mermaid or PlantUML output (not Python):
- Declaration order matters — declare elements in reading order (left-to-right or top-to-bottom). The Dagre/Sugiyama algorithm positions elements based on declaration sequence.
- Tier-based ordering — Actors → Presentation → API → Services → Data → External
- Edge crossing targets — <5 for complex diagrams, 0 for simple ones. Crossings are the strongest predictor of comprehension difficulty (Purchase et al.).
- Use subgraphs/boundaries to group related elements (Gestalt proximity principle).
For C4-specific layout guidance including iterative refinement and PlantUML directional hints, see the /c4-diagram skill.
Phase 3: Render and Save
The skill:
- Executes the Python script
- Generates PNG image
- Creates markdown note with embedded diagram
- Saves to vault as Canvas or Concept note
- Links to related System/Integration notes
Phase 4: Validation Gate
After rendering, assess the diagram against each criterion and output a structured validation table with concrete results:
## Diagram Validation
| Criterion | Target | Result | Status |
|-----------|--------|--------|--------|
| Edge crossings | <5 complex, 0 simple | {count} | {PASS/FAIL} |
| Visual hierarchy | Boundary most prominent | {assessment} | {PASS/FAIL} |
| Grouping | Related elements proximate | {assessment} | {PASS/FAIL} |
| Flow direction | Consistent L-to-R or T-to-B | {direction} | {PASS/FAIL} |
| Traceability | Can follow each line | {assessment} | {PASS/FAIL} |
| Abstraction | One level per diagram | {level} | {PASS/FAIL} |
Replace {count}, {assessment}, {direction}, and {level} with the actual findings for the generated diagram. Every /diagram invocation must include this table in its output.
How to Assess Each Criterion
CRITICAL: You must read the rendered PNG back using the Read tool and visually inspect it. Do not
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл diagram?
Generate architecture diagrams using Python diagrams library
Как установить скилл diagram?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл diagram запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…