Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate architecture documentation using C4 model Mermaid diagrams. Use when asked to create architecture diagrams, document system architecture, visualize software structure, create C4 diagrams, or generate context/container/component/deployment diagrams. Triggers include "architecture diagram", "C4 diagram", "system context", "container diagram", "component diagram", "deployment diagram", "document architecture", "visualize architecture".
.claude/skills/davila7-c4-architecture/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 71% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 75% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 160% | 0% |
| case-11 | ✗→✓ | ▲ Improved | -1% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 82% | 0% |
Generate software architecture documentation using C4 model diagrams in Mermaid syntax.
Select the appropriate level based on the documentation need:
| Level | Diagram Type | Audience | Shows | When to Create | |-------|-------------|----------|-------|----------------| | 1 | C4Context | Everyone | System + external actors | Always (required) | | 2 | C4Container | Technical | Apps, databases, services | Always (required) | | 3 | C4Component | Developers | Internal components | Only if adds value | | 4 | C4Deployment | DevOps | Infrastructure nodes | For production systems | | - | C4Dynamic | Technical | Request flows (numbered) | For complex workflows |
Key Insight: "Context + Container diagrams are sufficient for most software development teams." Only create Component/Code diagrams when they genuinely add value.
mermaidC4Context title System Context - Workout Tracker Person(user, "User", "Tracks workouts and exercises") System(app, "Workout Tracker", "Vue PWA for tracking strength and CrossFit workouts") System_Ext(browser, "Web Browser", "Stores data in IndexedDB") Rel(user, app, "Uses") Rel(app, browser, "Persists data to", "IndexedDB")
mermaidC4Container title Container Diagram - Workout Tracker Person(user, "User", "Tracks workouts") Container_Boundary(app, "Workout Tracker PWA") { Container(spa, "SPA", "Vue 3, TypeScript", "Single-page application") Container(pinia, "State Management", "Pinia", "Manages application state") ContainerDb(indexeddb, "IndexedDB", "Dexie", "Local workout storage") } Rel(user, spa, "Uses") Rel(spa, pinia, "Reads/writes state") Rel(pinia, indexeddb, "Persists", "Dexie ORM")
mermaidC4Component title Component Diagram - Workout Feature Container(views, "Views", "Vue Router pages") Container_Boundary(workout, "Workout Feature") { Component(useWorkout, "useWorkout", "Composable", "Workout execution state") Component(useTimer, "useTimer", "Composable", "Timer state machine") Component(workoutRepo, "WorkoutRepository", "Dexie", "Workout persistence") } Rel(views, useWorkout, "Uses") Rel(useWorkout, useTimer, "Controls") Rel(useWorkout, workoutRepo, "Saves to")
mermaidC4Dynamic title Dynamic Diagram - User Sign In Flow ContainerDb(db, "Database", "PostgreSQL", "User credentials") Container(spa, "Single-Page App", "React", "Banking UI") Container_Boundary(api, "API Application") { Component(signIn, "Sign In Controller", "Express", "Auth endpoint") Component(security, "Security Service", "JWT", "Validates credentials") } Rel(spa, signIn, "1. Submit credentials", "JSON/HTTPS") Rel(signIn, security, "2. Validate") Rel(security, db, "3. Query user", "SQL") UpdateRelStyle(spa, signIn, $textColor="blue", $offsetY="-30")
mermaidC4Deployment title Deployment Diagram - Production Deployment_Node(browser, "Customer Browser", "Chrome/Firefox") { Container(spa, "SPA", "React", "Web application") } Deployment_Node(aws, "AWS Cloud", "us-east-1") { Deployment_Node(ecs, "ECS Cluster", "Fargate") { Container(api, "API Service", "Node.js", "REST API") } Deployment_Node(rds, "RDS", "db.r5.large") { ContainerDb(db, "Database", "PostgreSQL", "Application data") } } Rel(spa, api, "API calls", "HTTPS") Rel(api, db, "Reads/writes", "JDBC")
Person(alias, "Label", "Description")
Person_Ext(alias, "Label", "Description") # External person
System(alias, "Label", "Description")
System_Ext(alias, "Label", "Description") # External system
SystemDb(alias, "Label", "Description") # Database system
SystemQueue(alias, "Label", "Description") # Queue systemContainer(alias, "Label", "Technology", "Description")
Container_Ext(alias, "Label", "Technology", "Description")
ContainerDb(alias, "Label", "Technology", "Description")
ContainerQueue(alias, "Label", "Technology", "Description")Component(alias, "Label", "Technology", "Description")
Component_Ext(alias, "Label", "Technology", "Description")
ComponentDb(alias, "Label", "Technology", "Description")Enterprise_Boundary(alias, "Label") { ... }
System_Boundary(alias, "Label") { ... }
Container_Boundary(alias, "Label") { ... }
Boundary(alias, "Label", "type") { ... }Rel(from, to, "Label")
Rel(from, to, "Label", "Technology")
BiRel(from, to, "Label") # Bidirectional
Rel_U(from, to, "Label") # Upward
Rel_D(from, to, "Label") # Downward
Rel_L(from, to, "Label") # Leftward
Rel_R(from, to, "Label") # RightwardDeployment_Node(alias, "Label", "Type", "Description") { ... }
Node(alias, "Label", "Type", "Description") { ... } # ShorthandUpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")$c4ShapeInRow - Number of shapes per row (default: 4)$c4BoundaryInRow - Number of boundaries per row (default: 2)UpdateElementStyle(alias, $fontColor="red", $bgColor="grey", $borderColor="red")UpdateRelStyle(from, to, $textColor="blue", $lineColor="blue", $offsetX="5", $offsetY="-10")Use $offsetX and $offsetY to fix overlapping relationship labels.
orderService not s1)See references/common-mistakes.md for detailed anti-patterns:
Model each microservice as a container (or container group):
mermaidC4Container title Microservices - Single Team System_Boundary(platform, "E-commerce Platform") { Container(orderApi, "Order Service", "Spring Boot", "Order processing") ContainerDb(orderDb, "Order DB", "PostgreSQL", "Order data") Container(inventoryApi, "Inventory Service", "Node.js", "Stock management") ContainerDb(inventoryDb, "Inventory DB", "MongoDB", "Stock data") }
Promote microservices to software systems when owned by separate teams:
mermaidC4Context title Microservices - Multi-Team Person(customer, "Customer", "Places orders") System(orderSystem, "Order System", "Team Alpha") System(inventorySystem, "Inventory System", "Team Beta") System(paymentSystem, "Payment System", "Team Gamma") Rel(customer, orderSystem, "Places orders") Rel(orderSystem, inventorySystem, "Checks stock") Rel(orderSystem, paymentSystem, "Processes payment")
Show individual topics/queues as containers, NOT a single "Kafka" box:
mermaidC4Container title Event-Driven Architecture Container(orderService, "Order Service", "Java", "Creates orders") Container(stockService, "Stock Service", "Java", "Manages inventory") ContainerQueue(orderTopic, "order.created", "Kafka", "Order events") ContainerQueue(stockTopic, "stock.reserved", "Kafka", "Stock events") Rel(orderService, orderTopic, "Publishes to") Rel(stockService, orderTopic, "Subscribes to") Rel(stockService, stockTopic, "Publishes to") Rel(orderService, stockTopic, "Subscribes to")
Write architecture documentation to docs/architecture/ with naming convention:
c4-context.md - System context diagramc4-containers.md - Container diagramc4-components-{feature}.md - Component diagrams per featurec4-deployment.md - Deployment diagramc4-dynamic-{flow}.md - Dynamic diagrams for specific flows| Audience | Recommended Diagrams | |----------|---------------------| | Executives | System Context only | | Product Managers | Context + Container | | Architects | Context + Container + key Components | | Developers | All levels as needed | | DevOps | Container + Deployment |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 1,641 | 2,580 | +57% | 1 | 1 | 0% | 238 | 2,890 | +1114% | 0 | 0 | — |
case-02 | fail→pass | 23,468 | 26,781 | +14% | 1 | 1 | 0% | 4,723 | 8,069 | +71% | 0 | 0 | — |
case-03 | pass→pass | 30,788 | 26,377 | -14% | 1 | 1 | 0% | 6,001 | 8,184 | +36% | 0 | 0 | — |
case-04 | pass→fail | 10,501 | 10,298 | -2% | 1 | 1 | 0% | 1,850 | 4,305 | +133% | 0 | 0 | — |
case-05 | pass→pass | 8,040 | 9,808 | +22% | 1 | 1 | 0% | 1,912 | 5,249 | +175% | 0 | 0 | — |
case-06 | pass→fail | 19,315 | 23,317 | +21% | 1 | 1 | 0% | 3,826 | 7,213 | +89% | 0 | 0 | — |
case-07 | pass→pass | 14,539 | 10,242 | -30% | 1 | 1 | 0% | 2,820 | 4,608 | +63% | 0 | 0 | — |
case-08 | fail→pass | 11,811 | 5,782 | -51% | 1 | 1 | 0% | 2,128 | 3,730 | +75% | 0 | 0 | — |
case-09 | fail→pass | 7,635 | 7,065 | -7% | 1 | 1 | 0% | 1,544 | 4,022 | +160% | 0 | 0 | — |
case-10 | fail→fail | 17,830 | 9,260 | -48% | 1 | 1 | 0% | 3,448 | 4,591 | +33% | 0 | 0 | — |
case-11 | fail→pass | 19,411 | 8,406 | -57% | 1 | 1 | 0% | 4,315 | 4,280 | -1% | 0 | 0 | — |
case-12 | fail→fail | 5,907 | 4,751 | -20% | 1 | 1 | 0% | 1,288 | 3,656 | +184% | 0 | 0 | — |
case-13 | fail→pass | 10,534 | 4,059 | -61% | 1 | 1 | 0% | 1,942 | 3,533 | +82% | 0 | 0 | — |
case-14 | fail→pass | 13,642 | 3,167 | -77% | 1 | 1 | 0% | 2,705 | 3,353 | +24% | 0 | 0 | — |
case-15 | pass→pass | 6,794 | 5,437 | -20% | 1 | 1 | 0% | 1,276 | 3,627 | +184% | 0 | 0 | — |
case-16 | fail→pass | 11,284 | 6,152 | -45% | 1 | 1 | 0% | 2,199 | 3,916 | +78% | 0 | 0 | — |
case-17 | pass→pass | 5,647 | 3,829 | -32% | 1 | 1 | 0% | 1,174 | 3,445 | +193% | 0 | 0 | — |
case-22 | fail→pass | 8,916 | 2,130 | -76% | 1 | 1 | 0% | 1,780 | 3,127 | +76% | 0 | 0 | — |
case-18 | pass→pass | 6,011 | 5,161 | -14% | 1 | 1 | 0% | 1,057 | 3,704 | +250% | 0 | 0 | — |
case-19 | pass→pass | 10,592 | 6,233 | -41% | 1 | 1 | 0% | 1,872 | 3,862 | +106% | 0 | 0 | — |
case-20 | fail→pass | 8,377 | 2,755 | -67% | 1 | 1 | 0% | 1,484 | 3,129 | +111% | 0 | 0 | — |
case-21 | fail→fail | 7,801 | 3,709 | -52% | 1 | 1 | 0% | 1,327 | 3,391 | +156% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +32 percentage points is the difference between those two pass rates over the 21 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.