.claude/skills/diagram/SKILL.md
Generate architecture diagrams using Python diagrams library
npx skillsauth add DavidROliverBA/ArchitectKB diagramInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate architecture diagrams in multiple formats (C4, System Landscape, Data Flow, AWS).
Use /diagram when you need to create or update architecture visualizations:
/diagram <type> [options]
| 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 |
When invoked, the skill asks:
Diagram type (required)
Scope (required)
Systems to include (optional)
Styling preferences (optional)
Output format (optional)
python — PNG via Python diagrams library (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)/c4-diagram for data-driven generation from System note frontmatterOutput location (optional)
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
When generating Mermaid or PlantUML output (not Python):
For C4-specific layout guidance including iterative refinement and PlantUML directional hints, see the /c4-diagram skill.
The skill:
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.
CRITICAL: You must read the rendered PNG back using the Read tool and visually inspect it. Do not assess criteria from the Python/Mermaid source alone — valid code frequently produces poor layouts.
| Criterion | How to Check (from the rendered PNG) |
| ----------------------------- | ---------------------------------------------------------------------------- |
| Edge crossings | Trace each relationship path visually — do any lines cross confusingly? |
| Visual hierarchy | Is the Cluster boundary immediately identifiable as the primary element? |
| Grouping | Do elements within the same Cluster appear as distinct tiers/layers? |
| Flow direction | Does data flow follow the declared direction parameter (TB or LR)? |
| Relationship traceability | Can each Edge be followed from source to destination without confusion? |
| Abstraction level | Does the diagram mix levels (e.g., database tables on a container diagram)? |
| Edge label readability | Are all edge labels readable at normal zoom? Max ~30 characters per line. |
| Path distinguishability | If multiple data flow paths exist, can you tell them apart at a glance? |
| Node placement | Are related nodes close together? Are any nodes orphaned or visually adrift? |
After rendering, read the PNG back using the Read tool and assess against every criterion above. If any criterion fails, revise and re-render. Repeat until all pass. Do not present to the user until the loop completes with all-PASS.
Apply one or more of the following techniques for the Python diagrams library:
Cluster blocks to group related elements by tier or domain. Nested clusters create visual nesting that reinforces boundaries.direction parameter ("TB", "LR") or restructure Edge connections so the primary data flow follows a single consistent direction.fontsize on Edge styles if labels look small in the rendered PNG.Edge colour and penwidth. Use a legend or consistent naming (Path 1, Path 2) so the reader can follow each flow independently.These rules prevent common layout mistakes. Apply them before generating the first render:
At C4 context level, only these should be boxes (nodes):
These should be edge labels or annotations, NOT boxes:
Rule of thumb: If you can't send it a request or log into it, it's probably a label.
At C4 container level, network components (VPC endpoints, load balancers) and IAM roles may become boxes — the abstraction level determines what's a node.
| Layout pattern | Use TB (top-to-bottom) | Use LR (left-to-right) |
|---------------|--------------------------|--------------------------|
| Single linear flow | Yes | — |
| Hierarchical (org chart, decision tree) | Yes | — |
| Two+ parallel output paths | — | Yes — paths branch vertically |
| Wide system landscape (many peers) | — | Yes |
| Timeline or sequence | — | Yes |
Default remains TB, but switch to LR when the diagram has branching paths — a tall narrow diagram with 10+ vertical nodes is hard to read.
Anti-pattern: Don't create clusters for logical groupings that aren't real boundaries (e.g., "Path 1: Vendor Upload" is a data flow, not a deployment boundary).
For Mermaid/PlantUML formats: reorder declarations to match data flow, add directional hints (Rel_Down, Lay_Right). See /c4-diagram skill for detailed refinement guidance.
| Scenario | Format | Reason |
| -------------------------------------- | -------------- | --------------------------------------------------- |
| AWS infrastructure, cloud icons | python | Rich icon library, professional PNG output |
| System landscape, presentations | python | Best for standalone images and Confluence |
| Quick C4 diagram in Obsidian | mermaid | Native rendering, Git-friendly, fast iteration |
| C4 from System note frontmatter | mermaid | Use /c4-diagram for data-driven generation |
| Complex C4 with persistent crossings | plantuml | Directional hints fix crossings Mermaid cannot |
| >15 elements in a C4 diagram | plantuml | Layout control prevents chaos at scale |
| Formal documentation, PDF export | plantuml | Automatic legends, consistent server-side rendering |
/diagram c4-context
Scope: Data Platform (Data Integration Platform)
Systems: ERP System, Kafka, Data Warehouse, API Gateway
Color scheme: classic
Output: Canvas - Data Platform C4 Context.md
Result: Creates Canvas - Data Platform C4 Context.md with C4 Level 1 diagram showing:
/diagram data-flow
Scope: ERP to Data Warehouse Real-time Integration
Systems: ERP System, Kafka, Data Platform, Data Warehouse
Styling: vibrant
Output: Concept - ERP to Data Warehouse Real-time Flow.md
Result: Creates Concept - ERP to Data Warehouse Real-time Flow.md showing:
/diagram aws-architecture
Scope: Production Account (eu-west-1)
Systems: EKS, RDS, S3, ALB, Kafka
Color scheme: muted
Output: Canvas - Production AWS Architecture.md
Result: Creates Canvas - Production AWS Architecture.md showing:
The skill automatically:
Detects systems from context
Extracts data flows
Applies styling
Generates captions
Creates cross-references
/diagram <type> --style vibrant
classic - Traditional blues, grays, blacksmuted - Soft pastels, professionalvibrant - Bright colors, high contrastdark - Dark background, light text/diagram <type> --icons detailed
simple - Minimal icons, text-basedminimalist - Very simple, cleandetailed - Rich icons, realistic/diagram <type> --direction LR
TB - Top to Bottom (default)LR - Left to RightRL - Right to LeftBT - Bottom to Top/diagram <type> --metrics yes
/diagram system-landscape --criticality critical
critical - Critical systems onlyhigh - High + Criticalmedium - Medium and aboveall - All systemsThe skill generates:
type: Canvas
title: "System Landscape"
diagramType: system-landscape
scope: Enterprise
systems: [ERP, DataPlatform, DataWarehouse, APIGateway, AWS]
latencyTarget: null
refreshedDate: 2026-01-14
Each generated diagram includes:
# Quality Indicators
confidence: high # Auto-generated from current data
freshness: current # Just generated
source: synthetic # Generated from note metadata
verified: false # Needs manual review
reviewed: null
Diagrams are regenerated:
/diagram command/diagram --refresh)To refresh existing diagram:
/diagram refresh Canvas - System Landscape.md
The /diagram skill works with:
/system - Links diagrams to system notes/integration - Shows data flows from integration specs/architecture - Includes in HLD documentation/scenario-compare - Generates before/after diagrams/impact-analysis - Shows affected systemsIf diagram generation fails:
These Canvas files were generated using the /diagram skill:
Canvas - System Landscape - All enterprise systemsCanvas - C4 Context Diagram - Data Platform contextCanvas - Data Flow Diagram - ERP to Data Warehouse flowCanvas - AWS Architecture - Production infrastructureCanvas - Scenario Comparison - Scenario alternativesAfter creating a diagram:
--style, --icons, --direction/canvas-annotate skill/scenario-compare/c4-diagram - Data-driven C4 diagram generation from System note frontmatter (Mermaid, flowchart, or PlantUML)/diagram-review - Analyse existing diagrams for readability and architecture quality/scenario-compare - Compare diagrams for different scenarios/impact-analysis - Analyse impacts of changes shown in diagram/architecture-report - Generate report with diagrams/system-landscape - Alternative skill specifically for system maps/dependency-graph - Focus on dependencies and risks.claude/prompts/c4-mermaid-diagrams.md — Graph drawing theory, C4 templates, and Mermaid best practicesReference - C4 Diagrams with AI — Research-backed guide to readable C4 diagramsInvoke with: /diagram <type>
Example: /diagram c4-context → Prompts for scope and options → Generates diagram
tools
--- context: fork --- # /youtube Save a YouTube video as both a Weblink (quick reference) and a detailed Page (full analysis). ## Usage ``` /youtube <url> /youtube <url> <optional title override> ``` ## Examples ``` /youtube https://www.youtube.com/watch?v=0TpON5T-Sw4 /youtube https://youtu.be/abc123 AWS re:Invent Keynote ``` ## Prerequisites This skill uses the MCP Docker YouTube tools: - `mcp__MCP_DOCKER__get_video_info` - Video metadata - `mcp__MCP_DOCKER__get_transcript` - Full trans
data-ai
Create and manage git worktrees for parallel agent sessions
testing
--- context: fork --- # /wipe Generate a context handoff summary, clear the session, and resume in a fresh conversation. Detects environment and provides automated (tmux) or manual workflow. ## Usage ``` /wipe /wipe quick # Minimal handoff, just essentials /wipe detailed # Comprehensive handoff with full context ``` ## Instructions When the user invokes `/wipe`: ### Phase 1: Detect Environment First, check the terminal environment: ```bash echo "Environment Detection:"
data-ai
--- context: fork --- # /weekly-summary Generate comprehensive weekly summary from daily notes, meetings, tasks, and project updates using parallel sub-agents. ## Usage ``` /weekly-summary /weekly-summary --last-week /weekly-summary --from 2026-01-01 --to 2026-01-07 /weekly-summary --output page # Create Page note instead of just outputting ``` ## Instructions This skill uses **5 parallel sub-agents** to gather data concurrently from different vault areas, then synthesizes a comprehensi