@vpxa/aikit 0.1.74 → 0.1.75

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 (134) hide show
  1. package/package.json +6 -1
  2. package/packages/cli/dist/index.js +2 -2
  3. package/packages/cli/dist/{init-DQkar6Es.js → init-CuRXmyD9.js} +1 -1
  4. package/packages/cli/dist/scaffold-WMQ2uQ48.js +2 -0
  5. package/packages/cli/dist/{user-CopNWxHP.js → user-vbJwa7x2.js} +1 -1
  6. package/scaffold/dist/adapters/claude-code.mjs +4 -0
  7. package/scaffold/dist/adapters/copilot.mjs +75 -0
  8. package/scaffold/dist/adapters/flows.mjs +1 -0
  9. package/scaffold/dist/adapters/skills.mjs +1 -0
  10. package/scaffold/{compiled → dist/compiled}/flows-data.mjs +304 -446
  11. package/scaffold/{compiled → dist/compiled}/skills-data.mjs +554 -2281
  12. package/scaffold/dist/definitions/agents.mjs +9 -0
  13. package/scaffold/{definitions → dist/definitions}/bodies.mjs +6 -229
  14. package/scaffold/dist/definitions/exclusions.mjs +1 -0
  15. package/scaffold/dist/definitions/hooks.mjs +1 -0
  16. package/scaffold/dist/definitions/models.mjs +1 -0
  17. package/scaffold/dist/definitions/plugins.mjs +1 -0
  18. package/scaffold/{definitions → dist/definitions}/prompts.mjs +9 -149
  19. package/scaffold/{definitions → dist/definitions}/protocols.mjs +9 -37
  20. package/scaffold/dist/definitions/tools.mjs +1 -0
  21. package/packages/cli/dist/scaffold-ukCDW3wQ.js +0 -2
  22. package/scaffold/_preview/agents/Architect-Reviewer-Alpha.agent.md +0 -132
  23. package/scaffold/_preview/agents/Architect-Reviewer-Beta.agent.md +0 -132
  24. package/scaffold/_preview/agents/Code-Reviewer-Alpha.agent.md +0 -112
  25. package/scaffold/_preview/agents/Code-Reviewer-Beta.agent.md +0 -112
  26. package/scaffold/_preview/agents/Debugger.agent.md +0 -412
  27. package/scaffold/_preview/agents/Documenter.agent.md +0 -468
  28. package/scaffold/_preview/agents/Explorer.agent.md +0 -76
  29. package/scaffold/_preview/agents/Frontend.agent.md +0 -440
  30. package/scaffold/_preview/agents/Implementer.agent.md +0 -425
  31. package/scaffold/_preview/agents/Orchestrator.agent.md +0 -452
  32. package/scaffold/_preview/agents/Planner.agent.md +0 -481
  33. package/scaffold/_preview/agents/README.md +0 -57
  34. package/scaffold/_preview/agents/Refactor.agent.md +0 -435
  35. package/scaffold/_preview/agents/Researcher-Alpha.agent.md +0 -151
  36. package/scaffold/_preview/agents/Researcher-Beta.agent.md +0 -152
  37. package/scaffold/_preview/agents/Researcher-Delta.agent.md +0 -153
  38. package/scaffold/_preview/agents/Researcher-Gamma.agent.md +0 -152
  39. package/scaffold/_preview/agents/Security.agent.md +0 -433
  40. package/scaffold/_preview/agents/_shared/architect-reviewer-base.md +0 -104
  41. package/scaffold/_preview/agents/_shared/code-agent-base.md +0 -366
  42. package/scaffold/_preview/agents/_shared/code-reviewer-base.md +0 -87
  43. package/scaffold/_preview/agents/_shared/decision-protocol.md +0 -27
  44. package/scaffold/_preview/agents/_shared/forge-protocol.md +0 -90
  45. package/scaffold/_preview/agents/_shared/researcher-base.md +0 -114
  46. package/scaffold/_preview/agents/templates/adr-template.md +0 -28
  47. package/scaffold/_preview/agents/templates/execution-state.md +0 -26
  48. package/scaffold/_preview/flows/_epilogue/steps/docs-sync/README.md +0 -120
  49. package/scaffold/_preview/flows/aikit-advanced/README.md +0 -70
  50. package/scaffold/_preview/flows/aikit-advanced/steps/design/README.md +0 -178
  51. package/scaffold/_preview/flows/aikit-advanced/steps/execute/README.md +0 -145
  52. package/scaffold/_preview/flows/aikit-advanced/steps/plan/README.md +0 -122
  53. package/scaffold/_preview/flows/aikit-advanced/steps/spec/README.md +0 -121
  54. package/scaffold/_preview/flows/aikit-advanced/steps/task/README.md +0 -119
  55. package/scaffold/_preview/flows/aikit-advanced/steps/verify/README.md +0 -145
  56. package/scaffold/_preview/flows/aikit-basic/README.md +0 -51
  57. package/scaffold/_preview/flows/aikit-basic/steps/assess/README.md +0 -109
  58. package/scaffold/_preview/flows/aikit-basic/steps/design/README.md +0 -116
  59. package/scaffold/_preview/flows/aikit-basic/steps/implement/README.md +0 -131
  60. package/scaffold/_preview/flows/aikit-basic/steps/verify/README.md +0 -123
  61. package/scaffold/_preview/prompts/aikit-ask.prompt.md +0 -13
  62. package/scaffold/_preview/prompts/aikit-debug.prompt.md +0 -15
  63. package/scaffold/_preview/prompts/aikit-design.prompt.md +0 -15
  64. package/scaffold/_preview/prompts/aikit-flow-add.prompt.md +0 -84
  65. package/scaffold/_preview/prompts/aikit-flow-create.prompt.md +0 -80
  66. package/scaffold/_preview/prompts/aikit-flow-manage.prompt.md +0 -24
  67. package/scaffold/_preview/prompts/aikit-implement.prompt.md +0 -17
  68. package/scaffold/_preview/prompts/aikit-plan.prompt.md +0 -15
  69. package/scaffold/_preview/prompts/aikit-review.prompt.md +0 -24
  70. package/scaffold/_preview/skills/adr-skill/SKILL.md +0 -335
  71. package/scaffold/_preview/skills/adr-skill/assets/templates/adr-madr.md +0 -89
  72. package/scaffold/_preview/skills/adr-skill/assets/templates/adr-readme.md +0 -20
  73. package/scaffold/_preview/skills/adr-skill/assets/templates/adr-simple.md +0 -46
  74. package/scaffold/_preview/skills/adr-skill/references/adr-conventions.md +0 -95
  75. package/scaffold/_preview/skills/adr-skill/references/examples.md +0 -193
  76. package/scaffold/_preview/skills/adr-skill/references/review-checklist.md +0 -77
  77. package/scaffold/_preview/skills/adr-skill/references/template-variants.md +0 -52
  78. package/scaffold/_preview/skills/adr-skill/scripts/bootstrap_adr.js +0 -259
  79. package/scaffold/_preview/skills/adr-skill/scripts/new_adr.js +0 -391
  80. package/scaffold/_preview/skills/adr-skill/scripts/set_adr_status.js +0 -169
  81. package/scaffold/_preview/skills/aikit/SKILL.md +0 -754
  82. package/scaffold/_preview/skills/brainstorming/SKILL.md +0 -265
  83. package/scaffold/_preview/skills/brainstorming/spec-document-reviewer-prompt.md +0 -49
  84. package/scaffold/_preview/skills/c4-architecture/SKILL.md +0 -389
  85. package/scaffold/_preview/skills/c4-architecture/references/advanced-patterns.md +0 -552
  86. package/scaffold/_preview/skills/c4-architecture/references/c4-syntax.md +0 -510
  87. package/scaffold/_preview/skills/c4-architecture/references/common-mistakes.md +0 -437
  88. package/scaffold/_preview/skills/c4-architecture/references/html-design-system.md +0 -337
  89. package/scaffold/_preview/skills/c4-architecture/references/html-template.html +0 -627
  90. package/scaffold/_preview/skills/docs/SKILL.md +0 -553
  91. package/scaffold/_preview/skills/docs/references/diataxis-anti-patterns.md +0 -147
  92. package/scaffold/_preview/skills/docs/references/diataxis-compass.md +0 -123
  93. package/scaffold/_preview/skills/docs/references/diataxis-quadrants.md +0 -192
  94. package/scaffold/_preview/skills/docs/references/diataxis-quality.md +0 -76
  95. package/scaffold/_preview/skills/docs/references/diataxis-templates.md +0 -120
  96. package/scaffold/_preview/skills/docs/references/flow-artifacts-guide.md +0 -70
  97. package/scaffold/_preview/skills/docs/references/project-knowledge-gotchas.md +0 -32
  98. package/scaffold/_preview/skills/docs/references/project-knowledge-templates.md +0 -281
  99. package/scaffold/_preview/skills/docs/references/project-knowledge-workflow.md +0 -80
  100. package/scaffold/_preview/skills/frontend-design/SKILL.md +0 -237
  101. package/scaffold/_preview/skills/lesson-learned/SKILL.md +0 -113
  102. package/scaffold/_preview/skills/lesson-learned/references/anti-patterns.md +0 -55
  103. package/scaffold/_preview/skills/lesson-learned/references/se-principles.md +0 -109
  104. package/scaffold/_preview/skills/multi-agents-development/SKILL.md +0 -448
  105. package/scaffold/_preview/skills/multi-agents-development/architecture-review-prompt.md +0 -81
  106. package/scaffold/_preview/skills/multi-agents-development/code-quality-review-prompt.md +0 -91
  107. package/scaffold/_preview/skills/multi-agents-development/implementer-prompt.md +0 -93
  108. package/scaffold/_preview/skills/multi-agents-development/parallel-dispatch-example.md +0 -167
  109. package/scaffold/_preview/skills/multi-agents-development/spec-review-prompt.md +0 -81
  110. package/scaffold/_preview/skills/present/SKILL.md +0 -616
  111. package/scaffold/_preview/skills/react/SKILL.md +0 -309
  112. package/scaffold/_preview/skills/repo-access/SKILL.md +0 -178
  113. package/scaffold/_preview/skills/repo-access/references/error-patterns.md +0 -116
  114. package/scaffold/_preview/skills/repo-access/references/platform-matrix.md +0 -142
  115. package/scaffold/_preview/skills/requirements-clarity/SKILL.md +0 -333
  116. package/scaffold/_preview/skills/session-handoff/SKILL.md +0 -199
  117. package/scaffold/_preview/skills/session-handoff/references/handoff-template.md +0 -139
  118. package/scaffold/_preview/skills/session-handoff/references/resume-checklist.md +0 -80
  119. package/scaffold/_preview/skills/session-handoff/scripts/check_staleness.js +0 -269
  120. package/scaffold/_preview/skills/session-handoff/scripts/create_handoff.js +0 -299
  121. package/scaffold/_preview/skills/session-handoff/scripts/list_handoffs.js +0 -113
  122. package/scaffold/_preview/skills/session-handoff/scripts/validate_handoff.js +0 -241
  123. package/scaffold/_preview/skills/typescript/SKILL.md +0 -405
  124. package/scaffold/adapters/claude-code.mjs +0 -73
  125. package/scaffold/adapters/copilot.mjs +0 -292
  126. package/scaffold/adapters/flows.mjs +0 -27
  127. package/scaffold/adapters/skills.mjs +0 -25
  128. package/scaffold/definitions/agents.mjs +0 -266
  129. package/scaffold/definitions/exclusions.mjs +0 -58
  130. package/scaffold/definitions/hooks.mjs +0 -43
  131. package/scaffold/definitions/models.mjs +0 -84
  132. package/scaffold/definitions/plugins.mjs +0 -147
  133. package/scaffold/definitions/tools.mjs +0 -250
  134. package/scaffold/generate.mjs +0 -92
@@ -1,389 +0,0 @@
1
- ---
2
- name: c4-architecture
3
- description: "Generate architecture documentation using C4 model diagrams. Supports two output formats: Mermaid (md) for documentation and HTML/SVG for presentations. Use when asked to create architecture diagrams, document system architecture, visualize software structure, create C4 diagrams, or generate context/container/component/deployment diagrams."
4
- metadata:
5
- category: cross-cutting
6
- domain: general
7
- applicability: on-demand
8
- inputs: [codebase, architecture]
9
- outputs: [diagrams]
10
- relatedSkills: [adr-skill]
11
- ---
12
-
13
- # C4 Architecture Documentation
14
-
15
- Generate software architecture documentation using C4 model diagrams in Mermaid syntax.
16
-
17
- ## Workflow
18
-
19
- 1. **Understand scope** - Determine which C4 level(s) are needed based on audience
20
- 2. **Analyze codebase** - Explore the system to identify components, containers, and relationships
21
- 3. **Generate diagrams** - Create Mermaid C4 diagrams at appropriate abstraction levels
22
- > **Tip:** Use `present({ format: "html" })` to render diagrams as interactive visual output, rather than raw Mermaid code blocks. This provides a better viewing experience for stakeholders.
23
- 4. **Document** - Write diagrams to markdown files with explanatory context
24
-
25
- ## Format Selection
26
-
27
- This skill supports two output formats. Choose based on the audience and delivery method:
28
-
29
- > **Default rule:** When using the `present` tool to display architecture, **always use HTML/SVG format** (Method 2). It produces professional dark-themed diagrams with SVG icons, category colors, and summary cards. Use Mermaid only for saving to markdown docs or when the user explicitly requests it.
30
-
31
- | Format | Output | Best For | Delivery |
32
- |--------|--------|----------|----------|
33
- | **Mermaid (md)** | `.md` files with Mermaid code blocks | Developer docs, GitHub rendering, version control | Save to `docs/architecture/*.md` |
34
- | **HTML/SVG (html)** | Self-contained `.html` files | Stakeholder presentations, visual reviews, browser viewing | Save as `.html` or render via `present` tool |
35
-
36
- ### Format Decision Tree
37
-
38
- ```
39
- What is the goal?
40
- ├── Save to docs / version control → Mermaid (md)
41
- ├── Present via `present` tool → HTML/SVG (html) ← DEFAULT for present
42
- ├── User says "Mermaid" or "markdown" → Mermaid (md)
43
- └── User says "show", "visualize", "present" → HTML/SVG (html)
44
- ```
45
-
46
- ### Present Tool Integration
47
-
48
- Both formats work with the `present` tool:
49
-
50
- **Mermaid format** - Use a `mermaid` content block:
51
- ```js
52
- present({
53
- format: "html", // or "browser"
54
- title: "System Architecture",
55
- content: [
56
- { type: "mermaid", title: "C4 Container Diagram", value: "C4Container\n title Container Diagram\n ..." }
57
- ]
58
- })
59
- ```
60
-
61
- **HTML/SVG format** - Use a `markdown` block with the full HTML structure. Pair with `metrics` and `cards` blocks for a complete dashboard. See [references/html-design-system.md](references/html-design-system.md#present-tool-integration) for the full composition pattern.
62
-
63
- ```js
64
- present({
65
- format: "html", // or "browser" - both work
66
- title: "System Architecture",
67
- content: [
68
- { type: "metrics", title: "Overview", value: [{ label: "Services", value: "6" }, ...] },
69
- { type: "markdown", title: "Architecture Diagram", value: "<div class='arch-diagram'>...(inline SVG + CSS)...</div>" },
70
- { type: "cards", title: "Summary", value: [{ title: "Frontend", body: "React SPA" }, ...] }
71
- ]
72
- })
73
- ```
74
-
75
- ## C4 Diagram Levels
76
-
77
- Select the appropriate level based on the documentation need:
78
-
79
- | Level | Diagram Type | Audience | Shows | When to Create |
80
- |-------|-------------|----------|-------|----------------|
81
- | 1 | **C4Context** | Everyone | System + external actors | Always (required) |
82
- | 2 | **C4Container** | Technical | Apps, databases, services | Always (required) |
83
- | 3 | **C4Component** | Developers | Internal components | Only if adds value |
84
- | 4 | **C4Deployment** | DevOps | Infrastructure nodes | For production systems |
85
- | - | **C4Dynamic** | Technical | Request flows (numbered) | For complex workflows |
86
-
87
- **Key Insight:** "Context + Container diagrams are sufficient for most software development teams." Only create Component/Code diagrams when they genuinely add value.
88
-
89
- ## Quick Start Examples
90
-
91
- ### System Context (Level 1)
92
- ```mermaid
93
- C4Context
94
- title System Context - Workout Tracker
95
-
96
- Person(user, "User", "Tracks workouts and exercises")
97
- System(app, "Workout Tracker", "Vue PWA for tracking strength and CrossFit workouts")
98
- System_Ext(browser, "Web Browser", "Stores data in IndexedDB")
99
-
100
- Rel(user, app, "Uses")
101
- Rel(app, browser, "Persists data to", "IndexedDB")
102
- ```
103
-
104
- ### Container Diagram (Level 2)
105
- ```mermaid
106
- C4Container
107
- title Container Diagram - Workout Tracker
108
-
109
- Person(user, "User", "Tracks workouts")
110
-
111
- Container_Boundary(app, "Workout Tracker PWA") {
112
- Container(spa, "SPA", "Vue 3, TypeScript", "Single-page application")
113
- Container(pinia, "State Management", "Pinia", "Manages application state")
114
- ContainerDb(indexeddb, "IndexedDB", "Dexie", "Local workout storage")
115
- }
116
-
117
- Rel(user, spa, "Uses")
118
- Rel(spa, pinia, "Reads/writes state")
119
- Rel(pinia, indexeddb, "Persists", "Dexie ORM")
120
- ```
121
-
122
- ### Component Diagram (Level 3)
123
- ```mermaid
124
- C4Component
125
- title Component Diagram - Workout Feature
126
-
127
- Container(views, "Views", "Vue Router pages")
128
-
129
- Container_Boundary(workout, "Workout Feature") {
130
- Component(useWorkout, "useWorkout", "Composable", "Workout execution state")
131
- Component(useTimer, "useTimer", "Composable", "Timer state machine")
132
- Component(workoutRepo, "WorkoutRepository", "Dexie", "Workout persistence")
133
- }
134
-
135
- Rel(views, useWorkout, "Uses")
136
- Rel(useWorkout, useTimer, "Controls")
137
- Rel(useWorkout, workoutRepo, "Saves to")
138
- ```
139
-
140
- ### Dynamic Diagram (Request Flow)
141
- ```mermaid
142
- C4Dynamic
143
- title Dynamic Diagram - User Sign In Flow
144
-
145
- ContainerDb(db, "Database", "PostgreSQL", "User credentials")
146
- Container(spa, "Single-Page App", "React", "Banking UI")
147
-
148
- Container_Boundary(api, "API Application") {
149
- Component(signIn, "Sign In Controller", "Express", "Auth endpoint")
150
- Component(security, "Security Service", "JWT", "Validates credentials")
151
- }
152
-
153
- Rel(spa, signIn, "1. Submit credentials", "JSON/HTTPS")
154
- Rel(signIn, security, "2. Validate")
155
- Rel(security, db, "3. Query user", "SQL")
156
-
157
- UpdateRelStyle(spa, signIn, $textColor="blue", $offsetY="-30")
158
- ```
159
-
160
- ### Deployment Diagram
161
- ```mermaid
162
- C4Deployment
163
- title Deployment Diagram - Production
164
-
165
- Deployment_Node(browser, "Customer Browser", "Chrome/Firefox") {
166
- Container(spa, "SPA", "React", "Web application")
167
- }
168
-
169
- Deployment_Node(aws, "AWS Cloud", "us-east-1") {
170
- Deployment_Node(ecs, "ECS Cluster", "Fargate") {
171
- Container(api, "API Service", "Node.js", "REST API")
172
- }
173
- Deployment_Node(rds, "RDS", "db.r5.large") {
174
- ContainerDb(db, "Database", "PostgreSQL", "Application data")
175
- }
176
- }
177
-
178
- Rel(spa, api, "API calls", "HTTPS")
179
- Rel(api, db, "Reads/writes", "JDBC")
180
- ```
181
-
182
- ## HTML/SVG Format
183
-
184
- For HTML/SVG output, use the design system and template from the references.
185
-
186
- The component type registry, color palette, typography, and layout rules are defined in [references/html-design-system.md](references/html-design-system.md). This is the single source of truth - update colors, types, and icons there.
187
-
188
- Copy and customize [references/html-template.html](references/html-template.html) for each diagram. The template is self-contained and opens directly in any browser.
189
-
190
- ### Component Categories
191
-
192
- See the design system for the full sub-type registry and icon slots.
193
-
194
- - Frontend - stroke `#22d3ee`
195
- - Backend - stroke `#34d399`
196
- - Data - stroke `#a78bfa`
197
- - Infrastructure - stroke `#fbbf24`
198
- - Messaging - stroke `#fb923c`
199
- - Security - stroke `#fb7185`
200
- - External - stroke `#94a3b8`
201
- - Monitoring - stroke `#38bdf8`
202
-
203
- ### Minimal Component Box Example
204
-
205
- Use the design system's inline SVG component pattern inside the HTML template's main `<svg>`:
206
-
207
- ```svg
208
- <g class="node backend">
209
- <rect x="280" y="210" width="190" height="60" rx="6" />
210
- <text class="c4-tag" x="294" y="226">&lt;&lt;Container&gt;&gt;</text>
211
- <text class="node-title" x="294" y="243">API Service</text>
212
- <text class="node-subtitle" x="294" y="257">Backend / HTTPS JSON</text>
213
- </g>
214
- ```
215
-
216
- ## Element Syntax
217
-
218
- ### People and Systems
219
- ```
220
- Person(alias, "Label", "Description")
221
- Person_Ext(alias, "Label", "Description") # External person
222
- System(alias, "Label", "Description")
223
- System_Ext(alias, "Label", "Description") # External system
224
- SystemDb(alias, "Label", "Description") # Database system
225
- SystemQueue(alias, "Label", "Description") # Queue system
226
- ```
227
-
228
- ### Containers
229
- ```
230
- Container(alias, "Label", "Technology", "Description")
231
- Container_Ext(alias, "Label", "Technology", "Description")
232
- ContainerDb(alias, "Label", "Technology", "Description")
233
- ContainerQueue(alias, "Label", "Technology", "Description")
234
- ```
235
-
236
- ### Components
237
- ```
238
- Component(alias, "Label", "Technology", "Description")
239
- Component_Ext(alias, "Label", "Technology", "Description")
240
- ComponentDb(alias, "Label", "Technology", "Description")
241
- ```
242
-
243
- ### Boundaries
244
- ```
245
- Enterprise_Boundary(alias, "Label") { ... }
246
- System_Boundary(alias, "Label") { ... }
247
- Container_Boundary(alias, "Label") { ... }
248
- Boundary(alias, "Label", "type") { ... }
249
- ```
250
-
251
- ### Relationships
252
- ```
253
- Rel(from, to, "Label")
254
- Rel(from, to, "Label", "Technology")
255
- BiRel(from, to, "Label") # Bidirectional
256
- Rel_U(from, to, "Label") # Upward
257
- Rel_D(from, to, "Label") # Downward
258
- Rel_L(from, to, "Label") # Leftward
259
- Rel_R(from, to, "Label") # Rightward
260
- ```
261
-
262
- ### Deployment Nodes
263
- ```
264
- Deployment_Node(alias, "Label", "Type", "Description") { ... }
265
- Node(alias, "Label", "Type", "Description") { ... } # Shorthand
266
- ```
267
-
268
- ## Styling and Layout
269
-
270
- ### Layout Configuration
271
- ```
272
- UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")
273
- ```
274
- - `$c4ShapeInRow` - Number of shapes per row (default: 4)
275
- - `$c4BoundaryInRow` - Number of boundaries per row (default: 2)
276
-
277
- ### Element Styling
278
- ```
279
- UpdateElementStyle(alias, $fontColor="red", $bgColor="grey", $borderColor="red")
280
- ```
281
-
282
- ### Relationship Styling
283
- ```
284
- UpdateRelStyle(from, to, $textColor="blue", $lineColor="blue", $offsetX="5", $offsetY="-10")
285
- ```
286
- Use `$offsetX` and `$offsetY` to fix overlapping relationship labels.
287
-
288
- ## Best Practices
289
-
290
- ### Essential Rules
291
-
292
- 1. **Every element must have**: Name, Type, Technology (where applicable), and Description
293
- 2. **Use unidirectional arrows only** - Bidirectional arrows create ambiguity
294
- 3. **Label arrows with action verbs** - "Sends email using", "Reads from", not just "uses"
295
- 4. **Include technology labels** - "JSON/HTTPS", "JDBC", "gRPC"
296
- 5. **Stay under 20 elements per diagram** - Split complex systems into multiple diagrams
297
-
298
- ### Clarity Guidelines
299
-
300
- 1. **Start at Level 1** - Context diagrams help frame the system scope
301
- 2. **One diagram per file** - Keep diagrams focused on a single abstraction level
302
- 3. **Meaningful aliases** - Use descriptive aliases (e.g., `orderService` not `s1`)
303
- 4. **Concise descriptions** - Keep descriptions under 50 characters when possible
304
- 5. **Always include a title** - "System Context diagram for [System Name]"
305
-
306
- ### What to Avoid
307
-
308
- See [references/common-mistakes.md](references/common-mistakes.md) for detailed anti-patterns:
309
- - Confusing containers (deployable) vs components (non-deployable)
310
- - Modeling shared libraries as containers
311
- - Showing message brokers as single containers instead of individual topics
312
- - Adding undefined abstraction levels like "subcomponents"
313
- - Removing type labels to "simplify" diagrams
314
-
315
- ## Microservices Guidelines
316
-
317
- ### Single Team Ownership
318
- Model each microservice as a **container** (or container group):
319
- ```mermaid
320
- C4Container
321
- title Microservices - Single Team
322
-
323
- System_Boundary(platform, "E-commerce Platform") {
324
- Container(orderApi, "Order Service", "Spring Boot", "Order processing")
325
- ContainerDb(orderDb, "Order DB", "PostgreSQL", "Order data")
326
- Container(inventoryApi, "Inventory Service", "Node.js", "Stock management")
327
- ContainerDb(inventoryDb, "Inventory DB", "MongoDB", "Stock data")
328
- }
329
- ```
330
-
331
- ### Multi-Team Ownership
332
- Promote microservices to **software systems** when owned by separate teams:
333
- ```mermaid
334
- C4Context
335
- title Microservices - Multi-Team
336
-
337
- Person(customer, "Customer", "Places orders")
338
- System(orderSystem, "Order System", "Team Alpha")
339
- System(inventorySystem, "Inventory System", "Team Beta")
340
- System(paymentSystem, "Payment System", "Team Gamma")
341
-
342
- Rel(customer, orderSystem, "Places orders")
343
- Rel(orderSystem, inventorySystem, "Checks stock")
344
- Rel(orderSystem, paymentSystem, "Processes payment")
345
- ```
346
-
347
- ### Event-Driven Architecture
348
- Show individual topics/queues as containers, NOT a single "Kafka" box:
349
- ```mermaid
350
- C4Container
351
- title Event-Driven Architecture
352
-
353
- Container(orderService, "Order Service", "Java", "Creates orders")
354
- Container(stockService, "Stock Service", "Java", "Manages inventory")
355
- ContainerQueue(orderTopic, "order.created", "Kafka", "Order events")
356
- ContainerQueue(stockTopic, "stock.reserved", "Kafka", "Stock events")
357
-
358
- Rel(orderService, orderTopic, "Publishes to")
359
- Rel(stockService, orderTopic, "Subscribes to")
360
- Rel(stockService, stockTopic, "Publishes to")
361
- Rel(orderService, stockTopic, "Subscribes to")
362
- ```
363
-
364
- ## Output Location
365
-
366
- Write architecture documentation to `docs/architecture/` with naming convention:
367
- - `c4-context.md` - System context diagram
368
- - `c4-containers.md` - Container diagram
369
- - `c4-components-{feature}.md` - Component diagrams per feature
370
- - `c4-deployment.md` - Deployment diagram
371
- - `c4-dynamic-{flow}.md` - Dynamic diagrams for specific flows
372
-
373
- ## Audience-Appropriate Detail
374
-
375
- | Audience | Recommended Diagrams |
376
- |----------|---------------------|
377
- | Executives | System Context only |
378
- | Product Managers | Context + Container |
379
- | Architects | Context + Container + key Components |
380
- | Developers | All levels as needed |
381
- | DevOps | Container + Deployment |
382
-
383
- ## References
384
-
385
- - [references/c4-syntax.md](references/c4-syntax.md) - Complete Mermaid C4 syntax
386
- - [references/common-mistakes.md](references/common-mistakes.md) - Anti-patterns to avoid
387
- - [references/advanced-patterns.md](references/advanced-patterns.md) - Microservices, event-driven, deployment
388
- - [references/html-design-system.md](references/html-design-system.md) - Centralized HTML/SVG design system (types, colors, icons, present integration)
389
- - [references/html-template.html](references/html-template.html) - Self-contained HTML template for C4 diagrams