@wipal/agent-team 1.0.3 → 1.1.0

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.
Files changed (124) hide show
  1. package/.claude/commands/skills/discover.md +127 -0
  2. package/.claude/commands/skills/install.md +225 -0
  3. package/.claude/commands/skills/review.md +234 -0
  4. package/.claude/commands/utils/learn.md +142 -0
  5. package/.claude/commands/utils/retrospect.md +62 -0
  6. package/.claude/commands/utils/switch.md +113 -0
  7. package/.claude/commands/utils/sync.md +183 -0
  8. package/.claude/rules/common/general-rules.md +6 -0
  9. package/.claude/rules/role-rules/dev-be-rules.md +241 -0
  10. package/.claude/rules/role-rules/dev-fe-rules.md +76 -0
  11. package/.claude/skills/SKILL-INDEX.md +24 -5
  12. package/.claude/skills/core/knowledge-graph/SKILL.md +214 -0
  13. package/.claude/skills/core/sequential-thinking/SKILL.md +112 -0
  14. package/.claude/skills/core/sequential-thinking/references/advanced.md +122 -0
  15. package/.claude/skills/core/sequential-thinking/references/examples.md +274 -0
  16. package/.claude/skills/domain/architecture/c4-architecture/SKILL.md +314 -0
  17. package/.claude/skills/domain/architecture/c4-architecture/references/advanced-patterns.md +552 -0
  18. package/.claude/skills/domain/architecture/c4-architecture/references/c4-syntax.md +492 -0
  19. package/.claude/skills/domain/architecture/c4-architecture/references/common-mistakes.md +437 -0
  20. package/.claude/skills/domain/architecture/mermaid-diagrams/SKILL.md +238 -0
  21. package/.claude/skills/domain/architecture/mermaid-diagrams/references/advanced-features.md +556 -0
  22. package/.claude/skills/domain/architecture/mermaid-diagrams/references/architecture-diagrams.md +192 -0
  23. package/.claude/skills/domain/architecture/mermaid-diagrams/references/c4-diagrams.md +410 -0
  24. package/.claude/skills/domain/architecture/mermaid-diagrams/references/class-diagrams.md +361 -0
  25. package/.claude/skills/domain/architecture/mermaid-diagrams/references/erd-diagrams.md +510 -0
  26. package/.claude/skills/domain/architecture/mermaid-diagrams/references/flowcharts.md +450 -0
  27. package/.claude/skills/domain/architecture/mermaid-diagrams/references/sequence-diagrams.md +394 -0
  28. package/.claude/skills/domain/backend/testing-be/SKILL.md +121 -17
  29. package/.claude/skills/domain/design/design-system/SKILL.md +169 -0
  30. package/.claude/skills/domain/design/html-css-output/SKILL.md +253 -0
  31. package/.claude/skills/domain/design/mockup-creation/SKILL.md +230 -0
  32. package/.claude/skills/domain/design/responsive-design/SKILL.md +207 -0
  33. package/.claude/skills/domain/design/ui-design/SKILL.md +124 -0
  34. package/.claude/skills/domain/frontend/testing-fe/SKILL.md +143 -38
  35. package/.claude/skills/domain/frontend/ui-ux-pro-max/README.md +45 -0
  36. package/.claude/skills/domain/frontend/ui-ux-pro-max/SKILL.md +404 -0
  37. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/charts.csv +26 -0
  38. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/colors.csv +97 -0
  39. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/icons.csv +101 -0
  40. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/landing.csv +31 -0
  41. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/products.csv +97 -0
  42. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/react-performance.csv +45 -0
  43. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  44. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  45. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  46. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  47. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  48. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  49. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  50. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  51. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/stacks/react.csv +54 -0
  52. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  53. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  54. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  55. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  56. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/styles.csv +68 -0
  57. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/typography.csv +58 -0
  58. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  59. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  60. package/.claude/skills/domain/frontend/ui-ux-pro-max/data/web-interface.csv +31 -0
  61. package/.claude/skills/domain/frontend/ui-ux-pro-max/scripts/core.py +253 -0
  62. package/.claude/skills/domain/frontend/ui-ux-pro-max/scripts/design_system.py +1067 -0
  63. package/.claude/skills/domain/frontend/ui-ux-pro-max/scripts/search.py +114 -0
  64. package/.claude/skills/domain/product/requirements-clarity/SKILL.md +340 -0
  65. package/.claude/skills/skills-registry.yaml +103 -8
  66. package/README.md +107 -33
  67. package/README.npm.md +252 -0
  68. package/TUTORIAL.md +256 -0
  69. package/bin/agent-team.js +26 -7
  70. package/config/roles.yaml +107 -0
  71. package/docs/01-architecture.md +699 -0
  72. package/docs/02-setup-guide.md +634 -0
  73. package/docs/03-skills-guide.md +628 -0
  74. package/docs/04-workflows.md +792 -0
  75. package/docs/05-model-strategy.md +550 -0
  76. package/docs/06-extend-guide.md +1226 -0
  77. package/docs/07-quick-reference.md +578 -0
  78. package/docs/08-skills-discovery.md +342 -0
  79. package/docs/README.md +134 -0
  80. package/docs/rqm.md +560 -0
  81. package/package.json +10 -4
  82. package/scripts/postinstall.js +46 -0
  83. package/src/commands/add.js +131 -67
  84. package/src/commands/init.js +419 -9
  85. package/src/commands/list.js +20 -16
  86. package/src/commands/projects.js +127 -0
  87. package/src/commands/setup-hooks.js +261 -0
  88. package/src/index.js +0 -1
  89. package/src/utils/file-utils.js +147 -50
  90. package/src/utils/global-registry.js +224 -0
  91. package/templates/CLAUDE.md.tmpl +128 -20
  92. package/templates/MEMORY.md.tmpl +119 -0
  93. package/templates/agent.md.tmpl +205 -0
  94. package/templates/code/nestjs-controller.ts.tmpl +49 -0
  95. package/templates/code/nestjs-dto.ts.tmpl +63 -0
  96. package/templates/code/nestjs-service.ts.tmpl +45 -0
  97. package/templates/code/react-component.tsx.tmpl +24 -0
  98. package/templates/code/react-hook.ts.tmpl +54 -0
  99. package/templates/code/test.spec.ts.tmpl +50 -0
  100. package/templates/code/vue-component.vue.tmpl +49 -0
  101. package/templates/code/vue-composable.ts.tmpl +54 -0
  102. package/templates/knowledge.md.tmpl +152 -17
  103. package/templates/meeting-notes.md.tmpl +110 -0
  104. package/templates/memory/hooks.memory.json +50 -0
  105. package/templates/memory/settings.memory.json +16 -0
  106. package/templates/reports/bug-report.md.tmpl +164 -0
  107. package/templates/reports/code-review.md.tmpl +201 -0
  108. package/templates/reports/sprint-report.md.tmpl +218 -0
  109. package/templates/roles/ba.md +53 -0
  110. package/templates/roles/designer.md +82 -0
  111. package/templates/roles/dev-be.md +49 -0
  112. package/templates/roles/dev-fe.md +49 -0
  113. package/templates/roles/devops.md +53 -0
  114. package/templates/roles/pm.md +49 -0
  115. package/templates/roles/qa.md +53 -0
  116. package/templates/roles/sa.md +49 -0
  117. package/templates/roles/tech-lead.md +132 -0
  118. package/templates/skills/memory/memory-status.md +78 -0
  119. package/templates/skills/memory/recall.md +160 -0
  120. package/templates/skills/memory/reflect.md +168 -0
  121. package/templates/skills/memory/remember.md +105 -0
  122. package/templates/tasks/lessons.md.tmpl +77 -0
  123. package/templates/tasks/todo.md.tmpl +53 -0
  124. package/src/commands/switch.js +0 -53
@@ -0,0 +1,492 @@
1
+ # C4 Mermaid Diagram Syntax Reference
2
+
3
+ Complete syntax reference for Mermaid C4 diagrams. Compatible with PlantUML C4 syntax.
4
+
5
+ ## Table of Contents
6
+
7
+ 1. [Diagram Types](#diagram-types)
8
+ 2. [System Context Elements](#system-context-elements)
9
+ 3. [Container Elements](#container-elements)
10
+ 4. [Component Elements](#component-elements)
11
+ 5. [Deployment Elements](#deployment-elements)
12
+ 6. [Relationship Types](#relationship-types)
13
+ 7. [Boundaries](#boundaries)
14
+ 8. [Styling](#styling)
15
+ 9. [Layout Configuration](#layout-configuration)
16
+ 10. [Parameter Syntax](#parameter-syntax)
17
+ 11. [Complete Examples](#complete-examples)
18
+ 12. [Mermaid Limitations](#mermaid-limitations)
19
+
20
+ ## Diagram Types
21
+
22
+ Start each diagram with the appropriate type declaration:
23
+
24
+ | Type | Declaration | Purpose |
25
+ |------|-------------|---------|
26
+ | System Context | `C4Context` | Shows system in context with users and external systems |
27
+ | Container | `C4Container` | Shows high-level technical building blocks |
28
+ | Component | `C4Component` | Shows internal components within a container |
29
+ | Dynamic | `C4Dynamic` | Shows request flows with numbered sequence |
30
+ | Deployment | `C4Deployment` | Shows infrastructure and deployment nodes |
31
+
32
+ ## System Context Elements
33
+
34
+ ### Person
35
+ ```
36
+ Person(alias, label, ?descr)
37
+ Person_Ext(alias, label, ?descr) # External person
38
+ ```
39
+
40
+ ### System
41
+ ```
42
+ System(alias, label, ?descr)
43
+ System_Ext(alias, label, ?descr) # External system
44
+ SystemDb(alias, label, ?descr) # Database system
45
+ SystemDb_Ext(alias, label, ?descr) # External database
46
+ SystemQueue(alias, label, ?descr) # Message queue
47
+ SystemQueue_Ext(alias, label, ?descr)
48
+ ```
49
+
50
+ ## Container Elements
51
+
52
+ ### Container
53
+ ```
54
+ Container(alias, label, ?techn, ?descr)
55
+ Container_Ext(alias, label, ?techn, ?descr)
56
+ ContainerDb(alias, label, ?techn, ?descr)
57
+ ContainerDb_Ext(alias, label, ?techn, ?descr)
58
+ ContainerQueue(alias, label, ?techn, ?descr)
59
+ ContainerQueue_Ext(alias, label, ?techn, ?descr)
60
+ ```
61
+
62
+ ## Component Elements
63
+
64
+ ### Component
65
+ ```
66
+ Component(alias, label, ?techn, ?descr)
67
+ Component_Ext(alias, label, ?techn, ?descr)
68
+ ComponentDb(alias, label, ?techn, ?descr)
69
+ ComponentDb_Ext(alias, label, ?techn, ?descr)
70
+ ComponentQueue(alias, label, ?techn, ?descr)
71
+ ComponentQueue_Ext(alias, label, ?techn, ?descr)
72
+ ```
73
+
74
+ ## Deployment Elements
75
+
76
+ ### Deployment Node
77
+ ```
78
+ Deployment_Node(alias, label, ?type, ?descr) { ... }
79
+ Node(alias, label, ?type, ?descr) { ... } # Shorthand
80
+ Node_L(alias, label, ?type, ?descr) { ... } # Left-aligned
81
+ Node_R(alias, label, ?type, ?descr) { ... } # Right-aligned
82
+ ```
83
+
84
+ Deployment nodes can be nested:
85
+ ```mermaid
86
+ C4Deployment
87
+ title Nested Deployment Nodes
88
+
89
+ Deployment_Node(dc, "Data Center", "Physical") {
90
+ Deployment_Node(server, "Web Server", "Ubuntu 22.04") {
91
+ Container(app, "Application", "Node.js", "Serves API")
92
+ }
93
+ }
94
+ ```
95
+
96
+ ## Relationship Types
97
+
98
+ ### Basic Relationships
99
+ ```
100
+ Rel(from, to, label)
101
+ Rel(from, to, label, ?techn)
102
+ Rel(from, to, label, ?techn, ?descr)
103
+ ```
104
+
105
+ ### Bidirectional
106
+ ```
107
+ BiRel(from, to, label)
108
+ BiRel(from, to, label, ?techn)
109
+ ```
110
+
111
+ ### Directional Hints
112
+ ```
113
+ Rel_U(from, to, label) # Upward
114
+ Rel_Up(from, to, label) # Upward (alias)
115
+ Rel_D(from, to, label) # Downward
116
+ Rel_Down(from, to, label) # Downward (alias)
117
+ Rel_L(from, to, label) # Leftward
118
+ Rel_Left(from, to, label) # Leftward (alias)
119
+ Rel_R(from, to, label) # Rightward
120
+ Rel_Right(from, to, label)# Rightward (alias)
121
+ Rel_Back(from, to, label) # Reverse direction
122
+ ```
123
+
124
+ ### Dynamic Diagram Relationships
125
+ ```
126
+ RelIndex(index, from, to, label)
127
+ ```
128
+ Note: Index parameter is ignored; sequence determined by statement order.
129
+
130
+ ## Boundaries
131
+
132
+ ### Enterprise Boundary
133
+ ```
134
+ Enterprise_Boundary(alias, label) {
135
+ # Systems and people go here
136
+ }
137
+ ```
138
+
139
+ ### System Boundary
140
+ ```
141
+ System_Boundary(alias, label) {
142
+ # Containers go here
143
+ }
144
+ ```
145
+
146
+ ### Container Boundary
147
+ ```
148
+ Container_Boundary(alias, label) {
149
+ # Components go here
150
+ }
151
+ ```
152
+
153
+ ### Generic Boundary
154
+ ```
155
+ Boundary(alias, label, ?type) {
156
+ # Elements go here
157
+ }
158
+ ```
159
+
160
+ ## Styling
161
+
162
+ ### Update Element Style
163
+ ```
164
+ UpdateElementStyle(elementAlias, $bgColor, $fontColor, $borderColor, $shadowing, $shape)
165
+ ```
166
+
167
+ Available parameters (all optional, use `$name=value` syntax):
168
+ - `$bgColor` - Background color
169
+ - `$fontColor` - Text color
170
+ - `$borderColor` - Border color
171
+ - `$shadowing` - Enable/disable shadow
172
+ - `$shape` - Element shape
173
+
174
+ ### Update Relationship Style
175
+ ```
176
+ UpdateRelStyle(from, to, $textColor, $lineColor, $offsetX, $offsetY)
177
+ ```
178
+
179
+ Available parameters:
180
+ - `$textColor` - Label text color
181
+ - `$lineColor` - Line color
182
+ - `$offsetX` - Horizontal label offset (pixels)
183
+ - `$offsetY` - Vertical label offset (pixels)
184
+
185
+ **Tip:** Use `$offsetX` and `$offsetY` to fix overlapping relationship labels:
186
+ ```mermaid
187
+ C4Context
188
+ Person(user, "User")
189
+ System(api, "API")
190
+
191
+ Rel(user, api, "Uses", "HTTPS")
192
+ UpdateRelStyle(user, api, $offsetY="-20")
193
+ ```
194
+
195
+ ## Layout Configuration
196
+
197
+ ```
198
+ UpdateLayoutConfig($c4ShapeInRow, $c4BoundaryInRow)
199
+ ```
200
+
201
+ - `$c4ShapeInRow` - Number of shapes per row (default: 4)
202
+ - `$c4BoundaryInRow` - Number of boundaries per row (default: 2)
203
+
204
+ **Example - Reduce crowding:**
205
+ ```mermaid
206
+ C4Context
207
+ title Less Crowded Layout
208
+
209
+ UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="1")
210
+
211
+ Person(user, "User")
212
+ System(sys1, "System 1")
213
+ System(sys2, "System 2")
214
+ ```
215
+
216
+ ## Parameter Syntax
217
+
218
+ Two ways to pass optional parameters:
219
+
220
+ ### Positional (in order)
221
+ ```
222
+ Rel(customerA, bankA, "Uses", "HTTPS")
223
+ UpdateRelStyle(customerA, bankA, "red", "blue", "-40", "60")
224
+ ```
225
+
226
+ ### Named (with $ prefix, any order)
227
+ ```
228
+ UpdateRelStyle(customerA, bankA, $offsetX="-40", $offsetY="60", $lineColor="blue")
229
+ ```
230
+
231
+ ## Complete Examples
232
+
233
+ ### C4Context Example
234
+ ```mermaid
235
+ C4Context
236
+ title System Context diagram for Internet Banking System
237
+
238
+ Enterprise_Boundary(b0, "Bank") {
239
+ Person(customer, "Banking Customer", "A customer with bank accounts")
240
+ System(bankingSystem, "Internet Banking System", "View accounts and make payments")
241
+
242
+ Enterprise_Boundary(b1, "Internal Systems") {
243
+ SystemDb_Ext(mainframe, "Mainframe", "Core banking data")
244
+ System_Ext(email, "E-mail System", "Microsoft Exchange")
245
+ }
246
+ }
247
+
248
+ BiRel(customer, bankingSystem, "Uses")
249
+ Rel(bankingSystem, mainframe, "Reads/writes", "JDBC")
250
+ Rel(bankingSystem, email, "Sends emails", "SMTP")
251
+ Rel(email, customer, "Sends emails to")
252
+
253
+ UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")
254
+ ```
255
+
256
+ ### C4Container Example
257
+ ```mermaid
258
+ C4Container
259
+ title Container diagram for Internet Banking System
260
+
261
+ Person(customer, "Customer", "Bank customer with accounts")
262
+ System_Ext(email, "E-Mail System", "Microsoft Exchange")
263
+ System_Ext(mainframe, "Mainframe Banking System", "Core banking")
264
+
265
+ Container_Boundary(c1, "Internet Banking") {
266
+ Container(spa, "Single-Page App", "JavaScript, Angular", "Banking UI")
267
+ Container(mobile, "Mobile App", "C#, Xamarin", "Mobile banking")
268
+ Container(api, "API Application", "Java, Spring MVC", "Banking API")
269
+ ContainerDb(db, "Database", "SQL Server", "User data, logs")
270
+ }
271
+
272
+ Rel(customer, spa, "Uses", "HTTPS")
273
+ Rel(customer, mobile, "Uses")
274
+ Rel(spa, api, "Uses", "JSON/HTTPS")
275
+ Rel(mobile, api, "Uses", "JSON/HTTPS")
276
+ Rel(api, db, "Reads/writes", "JDBC")
277
+ Rel(api, mainframe, "Uses", "XML/HTTPS")
278
+ Rel(api, email, "Sends emails", "SMTP")
279
+ ```
280
+
281
+ ### C4Component Example
282
+ ```mermaid
283
+ C4Component
284
+ title Component diagram for API Application
285
+
286
+ Container(spa, "Single Page App", "Angular", "Banking UI")
287
+ ContainerDb(db, "Database", "SQL Server", "User data")
288
+ System_Ext(mainframe, "Mainframe", "Core banking")
289
+
290
+ Container_Boundary(api, "API Application") {
291
+ Component(signIn, "Sign In Controller", "Spring MVC", "User authentication")
292
+ Component(accounts, "Accounts Controller", "Spring MVC", "Account operations")
293
+ Component(security, "Security Component", "Spring Bean", "Auth logic")
294
+ Component(facade, "Mainframe Facade", "Spring Bean", "Mainframe integration")
295
+ }
296
+
297
+ Rel(spa, signIn, "Uses", "JSON/HTTPS")
298
+ Rel(spa, accounts, "Uses", "JSON/HTTPS")
299
+ Rel(signIn, security, "Uses")
300
+ Rel(accounts, facade, "Uses")
301
+ Rel(security, db, "Reads/writes", "JDBC")
302
+ Rel(facade, mainframe, "Uses", "XML/HTTPS")
303
+ ```
304
+
305
+ ### C4Dynamic Example
306
+ ```mermaid
307
+ C4Dynamic
308
+ title Dynamic diagram - User Sign In Flow
309
+
310
+ ContainerDb(db, "Database", "SQL Server", "User credentials")
311
+ Container(spa, "Single-Page App", "Angular", "Banking UI")
312
+
313
+ Container_Boundary(api, "API Application") {
314
+ Component(signIn, "Sign In Controller", "Spring MVC", "Authentication endpoint")
315
+ Component(security, "Security Component", "Spring Bean", "Validates credentials")
316
+ }
317
+
318
+ Rel(spa, signIn, "1. Submit credentials", "JSON/HTTPS")
319
+ Rel(signIn, security, "2. Validate")
320
+ Rel(security, db, "3. Query user", "JDBC")
321
+ ```
322
+
323
+ ### C4Deployment Example
324
+ ```mermaid
325
+ C4Deployment
326
+ title Deployment Diagram - Production
327
+
328
+ Deployment_Node(mobile, "Customer's Mobile", "iOS/Android") {
329
+ Container(mobileApp, "Mobile App", "Xamarin", "Mobile banking")
330
+ }
331
+
332
+ Deployment_Node(browser, "Customer's Browser", "Chrome/Firefox") {
333
+ Container(spa, "SPA", "Angular", "Web banking")
334
+ }
335
+
336
+ Deployment_Node(dc, "Data Center", "AWS") {
337
+ Deployment_Node(web, "Web Tier", "EC2") {
338
+ Container(api, "API", "Spring Boot", "Banking API")
339
+ }
340
+ Deployment_Node(data, "Data Tier", "RDS") {
341
+ ContainerDb(db, "Database", "PostgreSQL", "Banking data")
342
+ }
343
+ }
344
+
345
+ Rel(mobileApp, api, "API calls", "HTTPS")
346
+ Rel(spa, api, "API calls", "HTTPS")
347
+ Rel(api, db, "Reads/writes", "JDBC")
348
+ ```
349
+
350
+ ### E-commerce Microservices Example
351
+ ```mermaid
352
+ C4Container
353
+ title E-commerce Platform - Container Diagram
354
+
355
+ Person(customer, "Customer", "Online shopper")
356
+ Person(admin, "Admin", "Store manager")
357
+
358
+ System_Ext(payment, "Stripe", "Payment processing")
359
+ System_Ext(shipping, "FedEx API", "Shipping rates")
360
+
361
+ Container_Boundary(platform, "E-commerce Platform") {
362
+ Container(web, "Web App", "React", "Customer storefront")
363
+ Container(adminApp, "Admin Portal", "React", "Management UI")
364
+ Container(gateway, "API Gateway", "Kong", "Routes and auth")
365
+
366
+ Container(orderSvc, "Order Service", "Node.js", "Order processing")
367
+ Container(productSvc, "Product Service", "Go", "Product catalog")
368
+ Container(userSvc, "User Service", "Java", "Authentication")
369
+
370
+ ContainerDb(orderDb, "Order DB", "PostgreSQL", "Orders")
371
+ ContainerDb(productDb, "Product DB", "MongoDB", "Products")
372
+ ContainerDb(userDb, "User DB", "PostgreSQL", "Users")
373
+ ContainerDb(cache, "Cache", "Redis", "Session data")
374
+ }
375
+
376
+ Rel(customer, web, "Browses", "HTTPS")
377
+ Rel(admin, adminApp, "Manages", "HTTPS")
378
+ Rel(web, gateway, "API calls", "JSON/HTTPS")
379
+ Rel(adminApp, gateway, "API calls", "JSON/HTTPS")
380
+
381
+ Rel(gateway, orderSvc, "Routes to", "HTTP")
382
+ Rel(gateway, productSvc, "Routes to", "HTTP")
383
+ Rel(gateway, userSvc, "Routes to", "HTTP")
384
+
385
+ Rel(orderSvc, orderDb, "Reads/writes", "SQL")
386
+ Rel(productSvc, productDb, "Reads/writes", "MongoDB")
387
+ Rel(userSvc, userDb, "Reads/writes", "SQL")
388
+ Rel(userSvc, cache, "Caches sessions", "Redis")
389
+
390
+ Rel(orderSvc, payment, "Charges cards", "REST")
391
+ Rel(orderSvc, shipping, "Gets rates", "REST")
392
+
393
+ UpdateLayoutConfig($c4ShapeInRow="4", $c4BoundaryInRow="1")
394
+ ```
395
+
396
+ ### Event-Driven Architecture Example
397
+ ```mermaid
398
+ C4Container
399
+ title Event-Driven Order Processing
400
+
401
+ Container(orderSvc, "Order Service", "Java", "Accepts orders")
402
+ Container(inventorySvc, "Inventory Service", "Go", "Manages stock")
403
+ Container(paymentSvc, "Payment Service", "Node.js", "Processes payments")
404
+ Container(notificationSvc, "Notification Service", "Python", "Sends emails/SMS")
405
+
406
+ ContainerQueue(orderCreated, "order.created", "Kafka", "New order events")
407
+ ContainerQueue(paymentProcessed, "payment.processed", "Kafka", "Payment events")
408
+ ContainerQueue(orderFulfilled, "order.fulfilled", "Kafka", "Fulfillment events")
409
+
410
+ Rel(orderSvc, orderCreated, "Publishes", "Avro")
411
+ Rel(inventorySvc, orderCreated, "Consumes", "Avro")
412
+ Rel(paymentSvc, orderCreated, "Consumes", "Avro")
413
+
414
+ Rel(paymentSvc, paymentProcessed, "Publishes", "Avro")
415
+ Rel(orderSvc, paymentProcessed, "Consumes", "Avro")
416
+
417
+ Rel(inventorySvc, orderFulfilled, "Publishes", "Avro")
418
+ Rel(notificationSvc, orderFulfilled, "Consumes", "Avro")
419
+
420
+ UpdateLayoutConfig($c4ShapeInRow="4")
421
+ ```
422
+
423
+ ### AWS Deployment Example
424
+ ```mermaid
425
+ C4Deployment
426
+ title Production Deployment - AWS
427
+
428
+ Deployment_Node(cdn, "CloudFront", "CDN") {
429
+ Container(static, "Static Assets", "S3", "HTML/CSS/JS")
430
+ }
431
+
432
+ Deployment_Node(vpc, "VPC", "10.0.0.0/16") {
433
+ Deployment_Node(publicSubnet, "Public Subnet", "10.0.1.0/24") {
434
+ Deployment_Node(alb, "Application Load Balancer", "ALB") {
435
+ Container(lb, "Load Balancer", "AWS ALB", "Routes traffic")
436
+ }
437
+ }
438
+
439
+ Deployment_Node(privateSubnet, "Private Subnet", "10.0.2.0/24") {
440
+ Deployment_Node(ecs, "ECS Cluster", "Fargate") {
441
+ Container(api1, "API Instance 1", "Node.js", "REST API")
442
+ Container(api2, "API Instance 2", "Node.js", "REST API")
443
+ }
444
+
445
+ Deployment_Node(rds, "RDS", "Multi-AZ") {
446
+ ContainerDb(primary, "Primary DB", "PostgreSQL", "Main database")
447
+ ContainerDb(replica, "Read Replica", "PostgreSQL", "Read scaling")
448
+ }
449
+ }
450
+ }
451
+
452
+ Rel(cdn, alb, "Forwards requests", "HTTPS")
453
+ Rel(lb, api1, "Routes to", "HTTP")
454
+ Rel(lb, api2, "Routes to", "HTTP")
455
+ Rel(api1, primary, "Writes to", "JDBC")
456
+ Rel(api2, replica, "Reads from", "JDBC")
457
+ ```
458
+
459
+ ## Mermaid Limitations
460
+
461
+ The following PlantUML C4 features are not yet supported in Mermaid:
462
+
463
+ ### Unsupported Features
464
+ - `sprite` - Custom icons
465
+ - `tags` - Element tagging
466
+ - `link` - Clickable links
467
+ - `Legend` - Auto-generated legends
468
+ - `AddElementTag` / `AddRelTag` - Tag styling
469
+ - `RoundedBoxShape` / `EightSidedShape` - Custom shapes
470
+ - `DashedLine` / `DottedLine` / `BoldLine` - Line styles
471
+ - Layout directives (`Lay_U`, `Lay_D`, `Lay_L`, `Lay_R`)
472
+
473
+ ### Workarounds
474
+
475
+ **Layout Control:**
476
+ Use `UpdateLayoutConfig` to control shape positioning instead of layout directives.
477
+
478
+ **Overlapping Labels:**
479
+ Use `UpdateRelStyle` with `$offsetX` and `$offsetY` to move relationship labels.
480
+
481
+ **Complex Diagrams:**
482
+ Keep diagrams under 15 elements. Split complex architectures into multiple focused diagrams.
483
+
484
+ **Element Ordering:**
485
+ Elements appear in the order they are defined. Reorder statements to adjust layout.
486
+
487
+ ### Alternative Tools
488
+
489
+ For features Mermaid doesn't support, consider:
490
+ - **Structurizr DSL** - Full C4 support with model-based generation
491
+ - **C4-PlantUML** - More mature C4 implementation
492
+ - **IcePanel** - Visual C4 diagram editor