c4-architecture

Generate C4 model architecture diagrams in Mermaid syntax for software systems.

Updated Aug 2, 2026
One-click install
npx skills add https://github.com/leonardoacosta/skills --skill c4-architecture-leonardoacosta
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: c4-architecture
Source: https://github.com/leonardoacosta/skills/tree/main/leo-design/skills/c4-architecture
Command: npx skills add https://github.com/leonardoacosta/skills --skill c4-architecture-leonardoacosta

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Documenting software architecture for different audiences (executives, architects, developers, DevOps) requires consistent notation across multiple abstraction levels, and ad-hoc box diagrams lose that consistency. This Skill generates C4 model diagrams in Mermaid so system structure is communicated clearly at every zoom level. ## Core Features & Use Cases - Audience-Tiered Diagram Generation: Produces C4Context, C4Container, C4Component, C4Deployment, and C4Dynamic diagrams matched to the target audience. - Decision Framework: Distinguishes when C4 is the right fit versus simpler Mermaid diagrams like sequence diagrams, flowcharts, or ERDs. - Anti-Pattern Prevention: Enforces notation rules covering container vs component confusion, shared library modeling, message broker hub-and-spoke mistakes, and external system boundaries. - Use Case: When asked to document a microservices e-commerce platform, the Skill analyzes the codebase, generates a Context diagram for stakeholders, a Container diagram showing services and databases, and a Deployment diagram for the AWS production environment, all written to docs/architecture/. ## Quick Start Ask the agent to generate C4 architecture diagrams documenting the current system's context, containers, and deployment topology.

Frequently Asked Questions about c4-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a C4 architecture diagram in Mermaid?

Start with a C4Context diagram showing the system and external actors, then add a C4Container diagram showing deployable units like services and databases. Use Person, System, Container, and Rel elements with name, technology, and description on every element.

When should I use C4 diagrams versus a simple flowchart?

Use C4 when multiple audiences need different detail levels of the same system with consistent notation. Use a plain flowchart or sequence diagram for single request flows, decision trees, CI/CD pipelines, or domain models where C4's abstraction levels add overhead without benefit.

What is the difference between a C4 container and a component?

Containers are deployable units like services, applications, and databases that scale and fail independently. Components are non-deployable code elements inside one container, such as classes or modules. Modeling a class as a container falsely implies it deploys independently.

Does Mermaid support all PlantUML C4 features?

No. Mermaid lacks sprites, tags, clickable links, auto-generated legends, custom shapes, dashed lines, and layout directives. Workarounds include UpdateLayoutConfig for positioning and UpdateRelStyle offsets for overlapping labels, or using Structurizr DSL for full C4 support.

How should I model Kafka or message brokers in C4 diagrams?

Model individual topics as separate ContainerQueue elements rather than one central broker box. A single hub-and-spoke broker hides which services produce and consume which events, defeating the diagram's purpose of showing actual data flow.

How many C4 diagram levels should I create for a system?

Always create Context and Container diagrams, which suffice for most teams. Add Component diagrams only when they genuinely add value for complex containers, and Deployment diagrams for production infrastructure. Avoid creating all four levels by default.