@vpxa/aikit 0.1.74 → 0.1.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -1
- package/packages/cli/dist/index.js +2 -2
- package/packages/cli/dist/{init-DQkar6Es.js → init-CuRXmyD9.js} +1 -1
- package/packages/cli/dist/scaffold-WMQ2uQ48.js +2 -0
- package/packages/cli/dist/{user-CopNWxHP.js → user-vbJwa7x2.js} +1 -1
- package/scaffold/dist/adapters/claude-code.mjs +4 -0
- package/scaffold/dist/adapters/copilot.mjs +75 -0
- package/scaffold/dist/adapters/flows.mjs +1 -0
- package/scaffold/dist/adapters/skills.mjs +1 -0
- package/scaffold/{compiled → dist/compiled}/flows-data.mjs +304 -446
- package/scaffold/{compiled → dist/compiled}/skills-data.mjs +554 -2281
- package/scaffold/dist/definitions/agents.mjs +9 -0
- package/scaffold/dist/definitions/bodies.mjs +512 -0
- package/scaffold/dist/definitions/exclusions.mjs +1 -0
- package/scaffold/dist/definitions/hooks.mjs +1 -0
- package/scaffold/dist/definitions/models.mjs +1 -0
- package/scaffold/dist/definitions/plugins.mjs +1 -0
- package/scaffold/dist/definitions/prompts.mjs +225 -0
- package/scaffold/dist/definitions/protocols.mjs +835 -0
- package/scaffold/dist/definitions/tools.mjs +1 -0
- package/packages/cli/dist/scaffold-ukCDW3wQ.js +0 -2
- package/scaffold/_preview/agents/Architect-Reviewer-Alpha.agent.md +0 -132
- package/scaffold/_preview/agents/Architect-Reviewer-Beta.agent.md +0 -132
- package/scaffold/_preview/agents/Code-Reviewer-Alpha.agent.md +0 -112
- package/scaffold/_preview/agents/Code-Reviewer-Beta.agent.md +0 -112
- package/scaffold/_preview/agents/Debugger.agent.md +0 -412
- package/scaffold/_preview/agents/Documenter.agent.md +0 -468
- package/scaffold/_preview/agents/Explorer.agent.md +0 -76
- package/scaffold/_preview/agents/Frontend.agent.md +0 -440
- package/scaffold/_preview/agents/Implementer.agent.md +0 -425
- package/scaffold/_preview/agents/Orchestrator.agent.md +0 -452
- package/scaffold/_preview/agents/Planner.agent.md +0 -481
- package/scaffold/_preview/agents/README.md +0 -57
- package/scaffold/_preview/agents/Refactor.agent.md +0 -435
- package/scaffold/_preview/agents/Researcher-Alpha.agent.md +0 -151
- package/scaffold/_preview/agents/Researcher-Beta.agent.md +0 -152
- package/scaffold/_preview/agents/Researcher-Delta.agent.md +0 -153
- package/scaffold/_preview/agents/Researcher-Gamma.agent.md +0 -152
- package/scaffold/_preview/agents/Security.agent.md +0 -433
- package/scaffold/_preview/agents/_shared/architect-reviewer-base.md +0 -104
- package/scaffold/_preview/agents/_shared/code-agent-base.md +0 -366
- package/scaffold/_preview/agents/_shared/code-reviewer-base.md +0 -87
- package/scaffold/_preview/agents/_shared/decision-protocol.md +0 -27
- package/scaffold/_preview/agents/_shared/forge-protocol.md +0 -90
- package/scaffold/_preview/agents/_shared/researcher-base.md +0 -114
- package/scaffold/_preview/agents/templates/adr-template.md +0 -28
- package/scaffold/_preview/agents/templates/execution-state.md +0 -26
- package/scaffold/_preview/flows/_epilogue/steps/docs-sync/README.md +0 -120
- package/scaffold/_preview/flows/aikit-advanced/README.md +0 -70
- package/scaffold/_preview/flows/aikit-advanced/steps/design/README.md +0 -178
- package/scaffold/_preview/flows/aikit-advanced/steps/execute/README.md +0 -145
- package/scaffold/_preview/flows/aikit-advanced/steps/plan/README.md +0 -122
- package/scaffold/_preview/flows/aikit-advanced/steps/spec/README.md +0 -121
- package/scaffold/_preview/flows/aikit-advanced/steps/task/README.md +0 -119
- package/scaffold/_preview/flows/aikit-advanced/steps/verify/README.md +0 -145
- package/scaffold/_preview/flows/aikit-basic/README.md +0 -51
- package/scaffold/_preview/flows/aikit-basic/steps/assess/README.md +0 -109
- package/scaffold/_preview/flows/aikit-basic/steps/design/README.md +0 -116
- package/scaffold/_preview/flows/aikit-basic/steps/implement/README.md +0 -131
- package/scaffold/_preview/flows/aikit-basic/steps/verify/README.md +0 -123
- package/scaffold/_preview/prompts/aikit-ask.prompt.md +0 -13
- package/scaffold/_preview/prompts/aikit-debug.prompt.md +0 -15
- package/scaffold/_preview/prompts/aikit-design.prompt.md +0 -15
- package/scaffold/_preview/prompts/aikit-flow-add.prompt.md +0 -84
- package/scaffold/_preview/prompts/aikit-flow-create.prompt.md +0 -80
- package/scaffold/_preview/prompts/aikit-flow-manage.prompt.md +0 -24
- package/scaffold/_preview/prompts/aikit-implement.prompt.md +0 -17
- package/scaffold/_preview/prompts/aikit-plan.prompt.md +0 -15
- package/scaffold/_preview/prompts/aikit-review.prompt.md +0 -24
- package/scaffold/_preview/skills/adr-skill/SKILL.md +0 -335
- package/scaffold/_preview/skills/adr-skill/assets/templates/adr-madr.md +0 -89
- package/scaffold/_preview/skills/adr-skill/assets/templates/adr-readme.md +0 -20
- package/scaffold/_preview/skills/adr-skill/assets/templates/adr-simple.md +0 -46
- package/scaffold/_preview/skills/adr-skill/references/adr-conventions.md +0 -95
- package/scaffold/_preview/skills/adr-skill/references/examples.md +0 -193
- package/scaffold/_preview/skills/adr-skill/references/review-checklist.md +0 -77
- package/scaffold/_preview/skills/adr-skill/references/template-variants.md +0 -52
- package/scaffold/_preview/skills/adr-skill/scripts/bootstrap_adr.js +0 -259
- package/scaffold/_preview/skills/adr-skill/scripts/new_adr.js +0 -391
- package/scaffold/_preview/skills/adr-skill/scripts/set_adr_status.js +0 -169
- package/scaffold/_preview/skills/aikit/SKILL.md +0 -754
- package/scaffold/_preview/skills/brainstorming/SKILL.md +0 -265
- package/scaffold/_preview/skills/brainstorming/spec-document-reviewer-prompt.md +0 -49
- package/scaffold/_preview/skills/c4-architecture/SKILL.md +0 -389
- package/scaffold/_preview/skills/c4-architecture/references/advanced-patterns.md +0 -552
- package/scaffold/_preview/skills/c4-architecture/references/c4-syntax.md +0 -510
- package/scaffold/_preview/skills/c4-architecture/references/common-mistakes.md +0 -437
- package/scaffold/_preview/skills/c4-architecture/references/html-design-system.md +0 -337
- package/scaffold/_preview/skills/c4-architecture/references/html-template.html +0 -627
- package/scaffold/_preview/skills/docs/SKILL.md +0 -553
- package/scaffold/_preview/skills/docs/references/diataxis-anti-patterns.md +0 -147
- package/scaffold/_preview/skills/docs/references/diataxis-compass.md +0 -123
- package/scaffold/_preview/skills/docs/references/diataxis-quadrants.md +0 -192
- package/scaffold/_preview/skills/docs/references/diataxis-quality.md +0 -76
- package/scaffold/_preview/skills/docs/references/diataxis-templates.md +0 -120
- package/scaffold/_preview/skills/docs/references/flow-artifacts-guide.md +0 -70
- package/scaffold/_preview/skills/docs/references/project-knowledge-gotchas.md +0 -32
- package/scaffold/_preview/skills/docs/references/project-knowledge-templates.md +0 -281
- package/scaffold/_preview/skills/docs/references/project-knowledge-workflow.md +0 -80
- package/scaffold/_preview/skills/frontend-design/SKILL.md +0 -237
- package/scaffold/_preview/skills/lesson-learned/SKILL.md +0 -113
- package/scaffold/_preview/skills/lesson-learned/references/anti-patterns.md +0 -55
- package/scaffold/_preview/skills/lesson-learned/references/se-principles.md +0 -109
- package/scaffold/_preview/skills/multi-agents-development/SKILL.md +0 -448
- package/scaffold/_preview/skills/multi-agents-development/architecture-review-prompt.md +0 -81
- package/scaffold/_preview/skills/multi-agents-development/code-quality-review-prompt.md +0 -91
- package/scaffold/_preview/skills/multi-agents-development/implementer-prompt.md +0 -93
- package/scaffold/_preview/skills/multi-agents-development/parallel-dispatch-example.md +0 -167
- package/scaffold/_preview/skills/multi-agents-development/spec-review-prompt.md +0 -81
- package/scaffold/_preview/skills/present/SKILL.md +0 -616
- package/scaffold/_preview/skills/react/SKILL.md +0 -309
- package/scaffold/_preview/skills/repo-access/SKILL.md +0 -178
- package/scaffold/_preview/skills/repo-access/references/error-patterns.md +0 -116
- package/scaffold/_preview/skills/repo-access/references/platform-matrix.md +0 -142
- package/scaffold/_preview/skills/requirements-clarity/SKILL.md +0 -333
- package/scaffold/_preview/skills/session-handoff/SKILL.md +0 -199
- package/scaffold/_preview/skills/session-handoff/references/handoff-template.md +0 -139
- package/scaffold/_preview/skills/session-handoff/references/resume-checklist.md +0 -80
- package/scaffold/_preview/skills/session-handoff/scripts/check_staleness.js +0 -269
- package/scaffold/_preview/skills/session-handoff/scripts/create_handoff.js +0 -299
- package/scaffold/_preview/skills/session-handoff/scripts/list_handoffs.js +0 -113
- package/scaffold/_preview/skills/session-handoff/scripts/validate_handoff.js +0 -241
- package/scaffold/_preview/skills/typescript/SKILL.md +0 -405
- package/scaffold/adapters/claude-code.mjs +0 -73
- package/scaffold/adapters/copilot.mjs +0 -292
- package/scaffold/adapters/flows.mjs +0 -27
- package/scaffold/adapters/skills.mjs +0 -25
- package/scaffold/generate.mjs +0 -92
|
@@ -1,437 +0,0 @@
|
|
|
1
|
-
# Common C4 Model Mistakes to Avoid
|
|
2
|
-
|
|
3
|
-
This guide documents frequent anti-patterns and errors when creating C4 architecture diagrams, with examples of what to do instead.
|
|
4
|
-
|
|
5
|
-
## Abstraction Level Mistakes
|
|
6
|
-
|
|
7
|
-
### 1. Confusing Containers and Components
|
|
8
|
-
|
|
9
|
-
**The Problem:**
|
|
10
|
-
Containers are **deployable units** (applications, services, databases). Components are **non-deployable elements inside a container** (modules, classes, packages).
|
|
11
|
-
|
|
12
|
-
**Wrong - Java class shown as container:**
|
|
13
|
-
```mermaid
|
|
14
|
-
C4Container
|
|
15
|
-
title WRONG: Class as Container
|
|
16
|
-
|
|
17
|
-
Container(userController, "UserController", "Java Class", "Handles user requests")
|
|
18
|
-
Container(userService, "UserService", "Java Class", "Business logic")
|
|
19
|
-
ContainerDb(db, "Database", "PostgreSQL", "User data")
|
|
20
|
-
|
|
21
|
-
Rel(userController, userService, "Calls")
|
|
22
|
-
Rel(userService, db, "Queries")
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
**Correct - Classes as components inside a container:**
|
|
26
|
-
```mermaid
|
|
27
|
-
C4Component
|
|
28
|
-
title CORRECT: Classes as Components
|
|
29
|
-
|
|
30
|
-
ContainerDb(db, "Database", "PostgreSQL", "User data")
|
|
31
|
-
|
|
32
|
-
Container_Boundary(api, "User API Service") {
|
|
33
|
-
Component(userController, "UserController", "Spring MVC", "REST endpoints")
|
|
34
|
-
Component(userService, "UserService", "Spring Bean", "Business logic")
|
|
35
|
-
Component(userRepo, "UserRepository", "JPA", "Data access")
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
Rel(userController, userService, "Calls")
|
|
39
|
-
Rel(userService, userRepo, "Uses")
|
|
40
|
-
Rel(userRepo, db, "Queries", "JDBC")
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### 2. Adding Undefined Abstraction Levels
|
|
44
|
-
|
|
45
|
-
**The Problem:**
|
|
46
|
-
C4 defines exactly four levels. Don't invent "subcomponents", "modules", or other arbitrary levels.
|
|
47
|
-
|
|
48
|
-
**Wrong:**
|
|
49
|
-
- Level 3.5: "Subcomponents"
|
|
50
|
-
- Level 2.5: "Microservice groups"
|
|
51
|
-
- Custom levels like "packages" or "modules"
|
|
52
|
-
|
|
53
|
-
**Correct:**
|
|
54
|
-
Stick to Person, Software System, Container, Component. If you need more detail, you're at Level 4 (Code) which should use UML class diagrams.
|
|
55
|
-
|
|
56
|
-
### 3. Vague Subsystems
|
|
57
|
-
|
|
58
|
-
**The Problem:**
|
|
59
|
-
"Subsystem" is ambiguous. Is it a system, container, or component?
|
|
60
|
-
|
|
61
|
-
**Wrong:**
|
|
62
|
-
```
|
|
63
|
-
Subsystem(orders, "Order Subsystem", "Handles orders")
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
**Correct - Be specific:**
|
|
67
|
-
```
|
|
68
|
-
System(orderSystem, "Order System", "Handles order lifecycle")
|
|
69
|
-
# OR
|
|
70
|
-
Container(orderService, "Order Service", "Java", "Order processing API")
|
|
71
|
-
# OR
|
|
72
|
-
Component(orderProcessor, "Order Processor", "Spring Bean", "Order business logic")
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Shared Libraries Mistake
|
|
76
|
-
|
|
77
|
-
**The Problem:**
|
|
78
|
-
Modeling a shared library as a container implies it's an independently running service. Libraries are copied into applications, not deployed separately.
|
|
79
|
-
|
|
80
|
-
**Wrong - Library as separate container:**
|
|
81
|
-
```mermaid
|
|
82
|
-
C4Container
|
|
83
|
-
title WRONG: Library as Container
|
|
84
|
-
|
|
85
|
-
Container(serviceA, "Service A", "Java")
|
|
86
|
-
Container(serviceB, "Service B", "Java")
|
|
87
|
-
Container(sharedLib, "Shared Utils Library", "Java", "Common utilities")
|
|
88
|
-
|
|
89
|
-
Rel(serviceA, sharedLib, "Uses")
|
|
90
|
-
Rel(serviceB, sharedLib, "Uses")
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
**Correct - Show library within each service:**
|
|
94
|
-
```mermaid
|
|
95
|
-
C4Component
|
|
96
|
-
title CORRECT: Library in Each Service
|
|
97
|
-
|
|
98
|
-
Container_Boundary(serviceA, "Service A") {
|
|
99
|
-
Component(controllerA, "Controller", "Spring MVC")
|
|
100
|
-
Component(utilsA, "Shared Utils", "Java Library", "Bundled copy")
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
Container_Boundary(serviceB, "Service B") {
|
|
104
|
-
Component(controllerB, "Controller", "Spring MVC")
|
|
105
|
-
Component(utilsB, "Shared Utils", "Java Library", "Bundled copy")
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Or simply omit the library from architecture diagrams since it's an implementation detail.
|
|
110
|
-
|
|
111
|
-
## Message Broker Mistakes
|
|
112
|
-
|
|
113
|
-
### Single Message Bus Anti-Pattern
|
|
114
|
-
|
|
115
|
-
**The Problem:**
|
|
116
|
-
Showing Kafka/RabbitMQ as a single container creates a misleading "hub and spoke" diagram that hides actual data flows.
|
|
117
|
-
|
|
118
|
-
**Wrong - Central message bus:**
|
|
119
|
-
```mermaid
|
|
120
|
-
C4Container
|
|
121
|
-
title WRONG: Central Message Bus
|
|
122
|
-
|
|
123
|
-
Container(orderSvc, "Order Service", "Java")
|
|
124
|
-
Container(inventorySvc, "Inventory Service", "Java")
|
|
125
|
-
Container(paymentSvc, "Payment Service", "Java")
|
|
126
|
-
ContainerQueue(kafka, "Kafka", "Event Streaming", "Message bus")
|
|
127
|
-
|
|
128
|
-
Rel(orderSvc, kafka, "Publishes/Subscribes")
|
|
129
|
-
Rel(inventorySvc, kafka, "Publishes/Subscribes")
|
|
130
|
-
Rel(paymentSvc, kafka, "Publishes/Subscribes")
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
**Correct - Individual topics:**
|
|
134
|
-
```mermaid
|
|
135
|
-
C4Container
|
|
136
|
-
title CORRECT: Individual Topics
|
|
137
|
-
|
|
138
|
-
Container(orderSvc, "Order Service", "Java", "Creates orders")
|
|
139
|
-
Container(inventorySvc, "Inventory Service", "Java", "Manages stock")
|
|
140
|
-
Container(paymentSvc, "Payment Service", "Java", "Processes payments")
|
|
141
|
-
|
|
142
|
-
ContainerQueue(orderCreated, "order.created", "Kafka", "New orders")
|
|
143
|
-
ContainerQueue(stockReserved, "stock.reserved", "Kafka", "Stock events")
|
|
144
|
-
ContainerQueue(paymentComplete, "payment.complete", "Kafka", "Payment events")
|
|
145
|
-
|
|
146
|
-
Rel(orderSvc, orderCreated, "Publishes")
|
|
147
|
-
Rel(inventorySvc, orderCreated, "Consumes")
|
|
148
|
-
Rel(inventorySvc, stockReserved, "Publishes")
|
|
149
|
-
Rel(paymentSvc, stockReserved, "Consumes")
|
|
150
|
-
Rel(paymentSvc, paymentComplete, "Publishes")
|
|
151
|
-
Rel(orderSvc, paymentComplete, "Consumes")
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
**Alternative - Topics on relationship labels:**
|
|
155
|
-
```mermaid
|
|
156
|
-
C4Container
|
|
157
|
-
title ALTERNATIVE: Topics as Labels
|
|
158
|
-
|
|
159
|
-
Container(orderSvc, "Order Service", "Java")
|
|
160
|
-
Container(inventorySvc, "Inventory Service", "Java")
|
|
161
|
-
Container(paymentSvc, "Payment Service", "Java")
|
|
162
|
-
|
|
163
|
-
Rel(orderSvc, inventorySvc, "order.created", "Kafka")
|
|
164
|
-
Rel(inventorySvc, paymentSvc, "stock.reserved", "Kafka")
|
|
165
|
-
Rel(paymentSvc, orderSvc, "payment.complete", "Kafka")
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
## External Systems Mistakes
|
|
169
|
-
|
|
170
|
-
### Showing Internal Details of External Systems
|
|
171
|
-
|
|
172
|
-
**The Problem:**
|
|
173
|
-
You don't control external systems. Showing their internals creates coupling and becomes stale quickly.
|
|
174
|
-
|
|
175
|
-
**Wrong - External system internals:**
|
|
176
|
-
```mermaid
|
|
177
|
-
C4Container
|
|
178
|
-
title WRONG: External System Internals
|
|
179
|
-
|
|
180
|
-
Container(myApp, "My App", "Node.js")
|
|
181
|
-
|
|
182
|
-
System_Boundary(stripe, "Stripe") {
|
|
183
|
-
Container(stripeApi, "Stripe API", "Ruby")
|
|
184
|
-
Container(stripeWorker, "Payment Worker", "Java")
|
|
185
|
-
ContainerDb(stripeDb, "Payment DB", "MySQL")
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
Rel(myApp, stripeApi, "Charges cards")
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
**Correct - External system as black box:**
|
|
192
|
-
```mermaid
|
|
193
|
-
C4Context
|
|
194
|
-
title CORRECT: External System Black Box
|
|
195
|
-
|
|
196
|
-
Container(myApp, "My App", "Node.js", "E-commerce backend")
|
|
197
|
-
System_Ext(stripe, "Stripe", "Payment processing platform")
|
|
198
|
-
|
|
199
|
-
Rel(myApp, stripe, "Processes payments", "REST API")
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
## Metadata and Documentation Mistakes
|
|
203
|
-
|
|
204
|
-
### 1. Removing Type Labels
|
|
205
|
-
|
|
206
|
-
**The Problem:**
|
|
207
|
-
Removing element type labels (Container, Component, System) to "simplify" diagrams creates ambiguity.
|
|
208
|
-
|
|
209
|
-
**Wrong:**
|
|
210
|
-
```
|
|
211
|
-
Box(api, "API") # What is this? System? Container? Component?
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
**Correct:**
|
|
215
|
-
```
|
|
216
|
-
Container(api, "API Application", "Spring Boot", "REST API backend")
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### 2. Missing Descriptions
|
|
220
|
-
|
|
221
|
-
**The Problem:**
|
|
222
|
-
Elements without descriptions force viewers to guess their purpose.
|
|
223
|
-
|
|
224
|
-
**Wrong:**
|
|
225
|
-
```
|
|
226
|
-
Container(svc, "Service", "Java")
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
**Correct:**
|
|
230
|
-
```
|
|
231
|
-
Container(orderSvc, "Order Service", "Spring Boot", "Manages order lifecycle and fulfillment")
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### 3. Generic Relationship Labels
|
|
235
|
-
|
|
236
|
-
**The Problem:**
|
|
237
|
-
Labels like "uses" or "communicates with" don't explain what data flows or why.
|
|
238
|
-
|
|
239
|
-
**Wrong:**
|
|
240
|
-
```
|
|
241
|
-
Rel(frontend, api, "Uses")
|
|
242
|
-
Rel(api, db, "Accesses")
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
**Correct:**
|
|
246
|
-
```
|
|
247
|
-
Rel(frontend, api, "Fetches products, submits orders", "JSON/HTTPS")
|
|
248
|
-
Rel(api, db, "Reads/writes order data", "JDBC")
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
## Diagram Scope Mistakes
|
|
252
|
-
|
|
253
|
-
### 1. Not Tailoring to Audience
|
|
254
|
-
|
|
255
|
-
**The Problem:**
|
|
256
|
-
Showing Level 4 code diagrams to executives, or only Level 1 to developers who need implementation details.
|
|
257
|
-
|
|
258
|
-
| Audience | Appropriate Levels |
|
|
259
|
-
|----------|-------------------|
|
|
260
|
-
| Executives | Level 1 (Context) only |
|
|
261
|
-
| Product Managers | Levels 1-2 |
|
|
262
|
-
| Architects | Levels 1-3 |
|
|
263
|
-
| Developers | All levels as needed |
|
|
264
|
-
| DevOps | Levels 2 + Deployment |
|
|
265
|
-
|
|
266
|
-
### 2. Creating All Four Levels by Default
|
|
267
|
-
|
|
268
|
-
**The Problem:**
|
|
269
|
-
Not every system needs all four levels. Level 3 (Component) and Level 4 (Code) often add no value.
|
|
270
|
-
|
|
271
|
-
**Guidance:**
|
|
272
|
-
- **Always create:** Context (L1) and Container (L2)
|
|
273
|
-
- **Create if valuable:** Component (L3) for complex containers
|
|
274
|
-
- **Rarely create:** Code (L4) - let IDEs generate these
|
|
275
|
-
|
|
276
|
-
### 3. Too Many Elements Per Diagram
|
|
277
|
-
|
|
278
|
-
**The Problem:**
|
|
279
|
-
Diagrams with 20+ elements become unreadable.
|
|
280
|
-
|
|
281
|
-
**Simon Brown's advice:** "If a diagram with a dozen boxes is hard to understand, don't draw a diagram with a dozen boxes!"
|
|
282
|
-
|
|
283
|
-
**Solutions:**
|
|
284
|
-
- Split by bounded context or domain
|
|
285
|
-
- Create separate diagrams per service
|
|
286
|
-
- Show one service + its direct dependencies
|
|
287
|
-
- Use multiple focused diagrams instead of one comprehensive diagram
|
|
288
|
-
|
|
289
|
-
## Arrow Mistakes
|
|
290
|
-
|
|
291
|
-
### 1. Bidirectional Arrows
|
|
292
|
-
|
|
293
|
-
**The Problem:**
|
|
294
|
-
Bidirectional arrows are ambiguous. Who initiates the call? What flows each direction?
|
|
295
|
-
|
|
296
|
-
**Wrong:**
|
|
297
|
-
```
|
|
298
|
-
BiRel(frontend, api, "Data") # Ambiguous direction
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
**Correct:**
|
|
302
|
-
```
|
|
303
|
-
Rel(frontend, api, "Requests products", "JSON/HTTPS")
|
|
304
|
-
Rel(api, frontend, "Returns product data", "JSON/HTTPS")
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
Or show the initiator's perspective:
|
|
308
|
-
```
|
|
309
|
-
Rel(frontend, api, "Fetches products", "JSON/HTTPS")
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
### 2. Unlabeled Arrows
|
|
313
|
-
|
|
314
|
-
**The Problem:**
|
|
315
|
-
Arrows without labels force readers to guess what flows between elements.
|
|
316
|
-
|
|
317
|
-
**Wrong:**
|
|
318
|
-
```
|
|
319
|
-
Rel(orderSvc, paymentSvc)
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
**Correct:**
|
|
323
|
-
```
|
|
324
|
-
Rel(orderSvc, paymentSvc, "Requests payment authorization", "gRPC")
|
|
325
|
-
```
|
|
326
|
-
|
|
327
|
-
## Deployment Diagram Mistakes
|
|
328
|
-
|
|
329
|
-
### 1. Deployment Details in Container Diagrams
|
|
330
|
-
|
|
331
|
-
**The Problem:**
|
|
332
|
-
Container diagrams should show logical architecture, not infrastructure details.
|
|
333
|
-
|
|
334
|
-
**Wrong - Infrastructure in container diagram:**
|
|
335
|
-
```mermaid
|
|
336
|
-
C4Container
|
|
337
|
-
title WRONG: Infrastructure in Container Diagram
|
|
338
|
-
|
|
339
|
-
Container(api1, "API (Instance 1)", "Java", "Primary")
|
|
340
|
-
Container(api2, "API (Instance 2)", "Java", "Replica")
|
|
341
|
-
Container(api3, "API (Instance 3)", "Java", "Replica")
|
|
342
|
-
Container(lb, "Load Balancer", "HAProxy", "Distributes traffic")
|
|
343
|
-
ContainerDb(primary, "Primary DB", "PostgreSQL", "Write")
|
|
344
|
-
ContainerDb(replica, "Read Replica", "PostgreSQL", "Read")
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
**Correct - Use Deployment diagram for infrastructure:**
|
|
348
|
-
```mermaid
|
|
349
|
-
C4Deployment
|
|
350
|
-
title CORRECT: Deployment Diagram for Infrastructure
|
|
351
|
-
|
|
352
|
-
Deployment_Node(lb, "Load Balancer", "AWS ALB") {
|
|
353
|
-
Container(alb, "ALB", "AWS", "Traffic distribution")
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
Deployment_Node(ecs, "ECS Cluster", "Fargate") {
|
|
357
|
-
Container(api1, "API Instance 1", "Spring Boot")
|
|
358
|
-
Container(api2, "API Instance 2", "Spring Boot")
|
|
359
|
-
Container(api3, "API Instance 3", "Spring Boot")
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
Deployment_Node(rds, "RDS", "Multi-AZ") {
|
|
363
|
-
ContainerDb(primary, "Primary", "PostgreSQL")
|
|
364
|
-
ContainerDb(replica, "Replica", "PostgreSQL")
|
|
365
|
-
}
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
### 2. Missing Environment Context
|
|
369
|
-
|
|
370
|
-
**The Problem:**
|
|
371
|
-
Deployment diagrams should specify which environment (production, staging, dev).
|
|
372
|
-
|
|
373
|
-
**Wrong:**
|
|
374
|
-
```
|
|
375
|
-
C4Deployment
|
|
376
|
-
title Deployment Diagram # Which environment?
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
**Correct:**
|
|
380
|
-
```
|
|
381
|
-
C4Deployment
|
|
382
|
-
title Deployment Diagram - Production (AWS us-east-1)
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
## Consistency Mistakes
|
|
386
|
-
|
|
387
|
-
### 1. Inconsistent Notation Across Diagrams
|
|
388
|
-
|
|
389
|
-
**The Problem:**
|
|
390
|
-
Using different colors, shapes, or terminology for the same elements across diagrams.
|
|
391
|
-
|
|
392
|
-
**Wrong:**
|
|
393
|
-
- Context diagram: "Payment System" (blue)
|
|
394
|
-
- Container diagram: "Payment Service" (green)
|
|
395
|
-
- Component diagram: "Payment Module" (red)
|
|
396
|
-
|
|
397
|
-
**Correct:**
|
|
398
|
-
Use consistent naming, colors, and styling. Create a style guide for your team.
|
|
399
|
-
|
|
400
|
-
### 2. No Legend/Key
|
|
401
|
-
|
|
402
|
-
**The Problem:**
|
|
403
|
-
Assuming viewers understand your notation without explanation.
|
|
404
|
-
|
|
405
|
-
**Solution:**
|
|
406
|
-
Always include a legend explaining colors, shapes, and line styles. Even for "obvious" elements.
|
|
407
|
-
|
|
408
|
-
## Decision Documentation Mistakes
|
|
409
|
-
|
|
410
|
-
### Showing Decision Process in Diagrams
|
|
411
|
-
|
|
412
|
-
**The Problem:**
|
|
413
|
-
Architecture diagrams show **outcomes** of decisions, not the decision-making process.
|
|
414
|
-
|
|
415
|
-
**Wrong approach:**
|
|
416
|
-
Including "Option A vs Option B" annotations in diagrams.
|
|
417
|
-
|
|
418
|
-
**Correct approach:**
|
|
419
|
-
- Document decisions separately in Architecture Decision Records (ADRs)
|
|
420
|
-
- Link ADRs to relevant diagrams
|
|
421
|
-
- Diagrams show the chosen architecture, ADRs explain why
|
|
422
|
-
|
|
423
|
-
## Quick Reference: Checklist
|
|
424
|
-
|
|
425
|
-
Before finalizing any C4 diagram, verify:
|
|
426
|
-
|
|
427
|
-
- [ ] Every element has: name, type, technology (if applicable), description
|
|
428
|
-
- [ ] All arrows are unidirectional with action verb labels
|
|
429
|
-
- [ ] Technology/protocol included on relationships
|
|
430
|
-
- [ ] Diagram has a clear, specific title
|
|
431
|
-
- [ ] Under 20 elements (ideally under 15)
|
|
432
|
-
- [ ] Appropriate level for the target audience
|
|
433
|
-
- [ ] Containers are deployable, components are not
|
|
434
|
-
- [ ] External systems shown as black boxes
|
|
435
|
-
- [ ] Message topics shown individually (not as single broker)
|
|
436
|
-
- [ ] No infrastructure details in container diagrams
|
|
437
|
-
- [ ] Consistent with other diagrams in the set
|