opencode-skills-collection 3.0.46 → 3.0.48
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/bundled-skills/.antigravity-install-manifest.json +15 -1
- package/bundled-skills/2slides-ppt-generator/SKILL.md +1 -1
- package/bundled-skills/2slides-ppt-generator/scripts/create_pdf_slides.py +2 -1
- package/bundled-skills/2slides-ppt-generator/scripts/generate_narration.py +2 -1
- package/bundled-skills/2slides-ppt-generator/scripts/generate_slides.py +13 -7
- package/bundled-skills/accint-solve/SKILL.md +205 -0
- package/bundled-skills/android-cli/SKILL.md +239 -0
- package/bundled-skills/android-cli/references/interact.md +83 -0
- package/bundled-skills/android-cli/references/journeys.md +105 -0
- package/bundled-skills/android-dev/references/hybrid.md +7 -4
- package/bundled-skills/android-dev/references/react-native.md +5 -2
- package/bundled-skills/atlas-contract/SKILL.md +4 -4
- package/bundled-skills/atlas-ledger/SKILL.md +10 -7
- package/bundled-skills/bun-development/SKILL.md +1 -1
- package/bundled-skills/cloud-penetration-testing/SKILL.md +1 -1
- package/bundled-skills/codebase-to-wordpress-converter/SKILL.md +1 -0
- package/bundled-skills/codex-fable5/SKILL.md +154 -0
- package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
- package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
- package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
- package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
- package/bundled-skills/docs/users/bundles.md +1 -1
- package/bundled-skills/docs/users/claude-code-skills.md +1 -1
- package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
- package/bundled-skills/docs/users/getting-started.md +1 -1
- package/bundled-skills/docs/users/kiro-integration.md +1 -1
- package/bundled-skills/docs/users/usage.md +4 -4
- package/bundled-skills/docs/users/visual-guide.md +4 -4
- package/bundled-skills/dos-verify-done-claims/SKILL.md +173 -0
- package/bundled-skills/ecl-harness-engineer/LICENSE +21 -0
- package/bundled-skills/ecl-harness-engineer/SKILL.md +714 -0
- package/bundled-skills/ecl-harness-engineer/agents/analyzer.md +119 -0
- package/bundled-skills/ecl-harness-engineer/agents/auditor.md +212 -0
- package/bundled-skills/ecl-harness-engineer/agents/creator-config.md +343 -0
- package/bundled-skills/ecl-harness-engineer/agents/creator-docs.md +201 -0
- package/bundled-skills/ecl-harness-engineer/agents/creator-linters.md +123 -0
- package/bundled-skills/ecl-harness-engineer/references/adapters/adapter-schema.md +204 -0
- package/bundled-skills/ecl-harness-engineer/references/adapters/generic.md +156 -0
- package/bundled-skills/ecl-harness-engineer/references/adapters/go.md +212 -0
- package/bundled-skills/ecl-harness-engineer/references/adapters/java.md +205 -0
- package/bundled-skills/ecl-harness-engineer/references/adapters/python.md +225 -0
- package/bundled-skills/ecl-harness-engineer/references/adapters/rust.md +220 -0
- package/bundled-skills/ecl-harness-engineer/references/adapters/typescript.md +245 -0
- package/bundled-skills/ecl-harness-engineer/references/architecture-diagrams.md +420 -0
- package/bundled-skills/ecl-harness-engineer/references/audit-templates.md +649 -0
- package/bundled-skills/ecl-harness-engineer/references/capability-registry.md +485 -0
- package/bundled-skills/ecl-harness-engineer/references/darwin-eval-prompts.md +373 -0
- package/bundled-skills/ecl-harness-engineer/references/documentation-templates.md +741 -0
- package/bundled-skills/ecl-harness-engineer/references/durability-patterns.md +423 -0
- package/bundled-skills/ecl-harness-engineer/references/ecl-harness.md +1431 -0
- package/bundled-skills/ecl-harness-engineer/references/environment-config-guide.md +534 -0
- package/bundled-skills/ecl-harness-engineer/references/environment-detection-guide.md +751 -0
- package/bundled-skills/ecl-harness-engineer/references/eval-templates.md +377 -0
- package/bundled-skills/ecl-harness-engineer/references/gc-templates.md +798 -0
- package/bundled-skills/ecl-harness-engineer/references/greenfield-templates.md +1385 -0
- package/bundled-skills/ecl-harness-engineer/references/linter-templates.md +448 -0
- package/bundled-skills/ecl-harness-engineer/references/observability-templates.md +315 -0
- package/bundled-skills/efficient-web-research/SKILL.md +320 -0
- package/bundled-skills/environment-setup-guide/SKILL.md +2 -2
- package/bundled-skills/evolution/SKILL.md +1 -1
- package/bundled-skills/gitops-workflow/SKILL.md +1 -1
- package/bundled-skills/linkerd-patterns/SKILL.md +1 -1
- package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package-lock.json +504 -1317
- package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package.json +2 -2
- package/bundled-skills/lovable-cleanup/SKILL.md +416 -0
- package/bundled-skills/monopoly/SKILL.md +397 -0
- package/bundled-skills/monopoly/patterns/SKILL.md +331 -0
- package/bundled-skills/monopoly/scale-benchmarks/SKILL.md +174 -0
- package/bundled-skills/monopoly/security-checklist/SKILL.md +69 -0
- package/bundled-skills/monopoly/tech-matrix/SKILL.md +268 -0
- package/bundled-skills/pagespeed-enhancer/SKILL.md +579 -0
- package/bundled-skills/polis-protocol/SKILL.md +6 -3
- package/bundled-skills/sharp-coder/SKILL.md +131 -0
- package/bundled-skills/unship/SKILL.md +11 -5
- package/bundled-skills/uv-package-manager/resources/implementation-playbook.md +1 -1
- package/bundled-skills/varlock/SKILL.md +2 -2
- package/package.json +1 -1
- package/skills_index.json +314 -4
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
# Architecture Diagram Templates
|
|
2
|
+
|
|
3
|
+
Auto-generated Mermaid diagrams for visualizing codebase structure. These diagrams are derived
|
|
4
|
+
from actual code analysis — not hand-drawn, not aspirational. Every diagram should reflect
|
|
5
|
+
what the code **actually does**, not what the author wishes it did.
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [How to Generate Diagrams](#how-to-generate-diagrams)
|
|
10
|
+
- [Package Dependency Graph](#1-package-dependency-graph)
|
|
11
|
+
- [Data Flow Diagram](#2-data-flow-diagram)
|
|
12
|
+
- [Component Relationship Diagram](#3-component-relationship-diagram)
|
|
13
|
+
- [Call Hierarchy Diagram](#4-call-hierarchy-diagram)
|
|
14
|
+
- [Interface Implementation Map](#5-interface-implementation-map)
|
|
15
|
+
- [Module Boundary Diagram](#6-module-boundary-diagram)
|
|
16
|
+
- [Sequence Diagram for Key Flows](#7-sequence-diagram-for-key-flows)
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## How to Generate Diagrams
|
|
21
|
+
|
|
22
|
+
Diagrams are generated by analyzing actual code, not by guessing. Follow this process:
|
|
23
|
+
|
|
24
|
+
### For Go projects
|
|
25
|
+
```bash
|
|
26
|
+
# List all packages and their imports
|
|
27
|
+
go list -json ./... | jq '{ImportPath, Imports}'
|
|
28
|
+
|
|
29
|
+
# Find interfaces and their implementations
|
|
30
|
+
grep -rn 'type.*interface' --include='*.go' .
|
|
31
|
+
grep -rn 'func.*) .*(' --include='*.go' . | head -50
|
|
32
|
+
|
|
33
|
+
# Map package dependencies
|
|
34
|
+
go list -m -json all
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### For TypeScript/Node projects
|
|
38
|
+
```bash
|
|
39
|
+
# Find all imports
|
|
40
|
+
grep -rn "from ['\"]" --include='*.ts' src/
|
|
41
|
+
|
|
42
|
+
# Find interfaces and classes
|
|
43
|
+
grep -rn "export interface\|export class\|export type" --include='*.ts' src/
|
|
44
|
+
|
|
45
|
+
# Check package.json dependencies
|
|
46
|
+
cat package.json | jq '.dependencies, .devDependencies'
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### For Python projects
|
|
50
|
+
```bash
|
|
51
|
+
# Find all imports
|
|
52
|
+
grep -rn "^from \|^import " --include='*.py' src/
|
|
53
|
+
|
|
54
|
+
# Find classes and their bases
|
|
55
|
+
grep -rn "class .*:" --include='*.py' src/
|
|
56
|
+
|
|
57
|
+
# Check dependency declarations
|
|
58
|
+
cat pyproject.toml # or requirements.txt
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
After gathering this data, generate the appropriate Mermaid diagrams below.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 1. Package Dependency Graph
|
|
66
|
+
|
|
67
|
+
Shows which packages depend on which. The most important diagram for understanding architecture.
|
|
68
|
+
|
|
69
|
+
### Template
|
|
70
|
+
|
|
71
|
+
````markdown
|
|
72
|
+
```mermaid
|
|
73
|
+
graph TD
|
|
74
|
+
subgraph "Layer 5 — Entry Points"
|
|
75
|
+
CMD[cmd/]
|
|
76
|
+
end
|
|
77
|
+
subgraph "Layer 4 — Interfaces"
|
|
78
|
+
UI[ui/]
|
|
79
|
+
SDK[sdk/]
|
|
80
|
+
API[api/]
|
|
81
|
+
end
|
|
82
|
+
subgraph "Layer 3 — Business Logic"
|
|
83
|
+
CORE[core/]
|
|
84
|
+
SVC[services/]
|
|
85
|
+
end
|
|
86
|
+
subgraph "Layer 2 — Infrastructure"
|
|
87
|
+
CFG[config/]
|
|
88
|
+
LOG[logging/]
|
|
89
|
+
end
|
|
90
|
+
subgraph "Layer 1 — Utilities"
|
|
91
|
+
UTIL[utils/]
|
|
92
|
+
end
|
|
93
|
+
subgraph "Layer 0 — Types"
|
|
94
|
+
TYPES[types/]
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
CMD --> UI
|
|
98
|
+
CMD --> API
|
|
99
|
+
UI --> CORE
|
|
100
|
+
SDK --> CORE
|
|
101
|
+
API --> SVC
|
|
102
|
+
CORE --> CFG
|
|
103
|
+
CORE --> UTIL
|
|
104
|
+
SVC --> CFG
|
|
105
|
+
CFG --> TYPES
|
|
106
|
+
UTIL --> TYPES
|
|
107
|
+
LOG --> TYPES
|
|
108
|
+
|
|
109
|
+
style TYPES fill:#e8f5e9
|
|
110
|
+
style UTIL fill:#e3f2fd
|
|
111
|
+
style CFG fill:#e3f2fd
|
|
112
|
+
style LOG fill:#e3f2fd
|
|
113
|
+
style CORE fill:#fff3e0
|
|
114
|
+
style SVC fill:#fff3e0
|
|
115
|
+
style UI fill:#fce4ec
|
|
116
|
+
style SDK fill:#fce4ec
|
|
117
|
+
style API fill:#fce4ec
|
|
118
|
+
style CMD fill:#f3e5f5
|
|
119
|
+
```
|
|
120
|
+
````
|
|
121
|
+
|
|
122
|
+
### Generation Guidance
|
|
123
|
+
|
|
124
|
+
When generating this diagram from real code:
|
|
125
|
+
|
|
126
|
+
1. Run `go list -json ./...` (or equivalent for your language)
|
|
127
|
+
2. For each package, extract its internal imports
|
|
128
|
+
3. Group packages by their layer assignment (from lint-deps rules)
|
|
129
|
+
4. Draw edges for each internal import relationship
|
|
130
|
+
5. Color by layer level (green=L0, blue=L1-2, orange=L3, pink=L4, purple=L5)
|
|
131
|
+
|
|
132
|
+
Important: only include **internal** dependencies, not stdlib or third-party.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 2. Data Flow Diagram
|
|
137
|
+
|
|
138
|
+
Shows how data moves through the system end-to-end.
|
|
139
|
+
|
|
140
|
+
### Template
|
|
141
|
+
|
|
142
|
+
````markdown
|
|
143
|
+
```mermaid
|
|
144
|
+
flowchart LR
|
|
145
|
+
INPUT["User Input<br/><i>CLI args / HTTP request</i>"]
|
|
146
|
+
PARSE["Parse & Validate<br/><code>cmd/parse.go</code>"]
|
|
147
|
+
LOGIC["Business Logic<br/><code>core/processor.go</code>"]
|
|
148
|
+
STORE["Storage Layer<br/><code>storage/db.go</code>"]
|
|
149
|
+
OUTPUT["Output<br/><i>stdout / HTTP response</i>"]
|
|
150
|
+
|
|
151
|
+
INPUT --> PARSE
|
|
152
|
+
PARSE --> LOGIC
|
|
153
|
+
LOGIC --> STORE
|
|
154
|
+
STORE --> LOGIC
|
|
155
|
+
LOGIC --> OUTPUT
|
|
156
|
+
|
|
157
|
+
subgraph "Config"
|
|
158
|
+
CFG["config/config.go"]
|
|
159
|
+
end
|
|
160
|
+
CFG -.-> PARSE
|
|
161
|
+
CFG -.-> LOGIC
|
|
162
|
+
CFG -.-> STORE
|
|
163
|
+
```
|
|
164
|
+
````
|
|
165
|
+
|
|
166
|
+
### Generation Guidance
|
|
167
|
+
|
|
168
|
+
To map data flow accurately:
|
|
169
|
+
|
|
170
|
+
1. Find entry points (`main()`, HTTP handlers, CLI command handlers)
|
|
171
|
+
2. Trace what happens to user input step by step
|
|
172
|
+
3. Note which files/functions are involved at each step — include the actual file path
|
|
173
|
+
4. Identify where data is transformed, stored, or returned
|
|
174
|
+
5. Show config/logging as dotted lines (support infrastructure, not primary flow)
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 3. Component Relationship Diagram
|
|
179
|
+
|
|
180
|
+
Shows the major components and their interactions. Best for projects with clear module boundaries.
|
|
181
|
+
|
|
182
|
+
### Template
|
|
183
|
+
|
|
184
|
+
````markdown
|
|
185
|
+
```mermaid
|
|
186
|
+
graph TB
|
|
187
|
+
subgraph "Public API Surface"
|
|
188
|
+
REST["REST API<br/><code>api/router.go:25</code>"]
|
|
189
|
+
GRPC["gRPC Service<br/><code>api/grpc/server.go:18</code>"]
|
|
190
|
+
CLI_CMD["CLI Commands<br/><code>cmd/root.go:42</code>"]
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
subgraph "Core Domain"
|
|
194
|
+
AUTH["Auth Service<br/><code>core/auth/service.go:15</code>"]
|
|
195
|
+
USER["User Service<br/><code>core/user/service.go:22</code>"]
|
|
196
|
+
BILLING["Billing Engine<br/><code>core/billing/engine.go:30</code>"]
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
subgraph "Infrastructure"
|
|
200
|
+
DB["Database<br/><code>infra/postgres/client.go:10</code>"]
|
|
201
|
+
CACHE["Cache<br/><code>infra/redis/client.go:8</code>"]
|
|
202
|
+
QUEUE["Message Queue<br/><code>infra/queue/producer.go:12</code>"]
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
REST --> AUTH
|
|
206
|
+
REST --> USER
|
|
207
|
+
GRPC --> BILLING
|
|
208
|
+
CLI_CMD --> USER
|
|
209
|
+
|
|
210
|
+
AUTH --> DB
|
|
211
|
+
AUTH --> CACHE
|
|
212
|
+
USER --> DB
|
|
213
|
+
BILLING --> DB
|
|
214
|
+
BILLING --> QUEUE
|
|
215
|
+
```
|
|
216
|
+
````
|
|
217
|
+
|
|
218
|
+
### Generation Guidance
|
|
219
|
+
|
|
220
|
+
1. Identify major service/component boundaries
|
|
221
|
+
2. For each component, find the primary file and line where it's defined
|
|
222
|
+
3. Map method calls between components (grep for cross-package function calls)
|
|
223
|
+
4. Group by architectural layer
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## 4. Call Hierarchy Diagram
|
|
228
|
+
|
|
229
|
+
Shows the function call chain for critical code paths.
|
|
230
|
+
|
|
231
|
+
### Template
|
|
232
|
+
|
|
233
|
+
````markdown
|
|
234
|
+
```mermaid
|
|
235
|
+
graph TD
|
|
236
|
+
A["main()<br/><code>main.go:15</code>"]
|
|
237
|
+
B["cmd.Execute()<br/><code>cmd/root.go:42</code>"]
|
|
238
|
+
C["runCommand()<br/><code>cmd/run.go:28</code>"]
|
|
239
|
+
D["service.Process()<br/><code>core/service.go:55</code>"]
|
|
240
|
+
E["validator.Check()<br/><code>core/validate.go:12</code>"]
|
|
241
|
+
F["store.Save()<br/><code>storage/store.go:33</code>"]
|
|
242
|
+
G["reporter.Output()<br/><code>output/report.go:20</code>"]
|
|
243
|
+
|
|
244
|
+
A --> B
|
|
245
|
+
B --> C
|
|
246
|
+
C --> D
|
|
247
|
+
D --> E
|
|
248
|
+
D --> F
|
|
249
|
+
D --> G
|
|
250
|
+
E -->|"validation error"| C
|
|
251
|
+
F -->|"storage error"| D
|
|
252
|
+
```
|
|
253
|
+
````
|
|
254
|
+
|
|
255
|
+
### Generation Guidance
|
|
256
|
+
|
|
257
|
+
1. Start from the entry point of the flow you want to document
|
|
258
|
+
2. Use LSP `outgoingCalls` to trace the call chain, or grep for function invocations
|
|
259
|
+
3. Include the file and line number for each function
|
|
260
|
+
4. Show error paths as labeled edges
|
|
261
|
+
5. Keep it to 8-12 nodes max — if more complex, split into sub-diagrams
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## 5. Interface Implementation Map
|
|
266
|
+
|
|
267
|
+
Shows which types implement which interfaces. Critical for understanding extensibility.
|
|
268
|
+
|
|
269
|
+
### Template
|
|
270
|
+
|
|
271
|
+
````markdown
|
|
272
|
+
```mermaid
|
|
273
|
+
classDiagram
|
|
274
|
+
class Provider {
|
|
275
|
+
<<interface>>
|
|
276
|
+
+Execute(ctx, input) Result, error
|
|
277
|
+
+Name() string
|
|
278
|
+
+SupportsStream() bool
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
class OpenAIProvider {
|
|
282
|
+
-client *openai.Client
|
|
283
|
+
-model string
|
|
284
|
+
+Execute(ctx, input) Result, error
|
|
285
|
+
+Name() string
|
|
286
|
+
+SupportsStream() bool
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
class AnthropicProvider {
|
|
290
|
+
-client *anthropic.Client
|
|
291
|
+
-model string
|
|
292
|
+
+Execute(ctx, input) Result, error
|
|
293
|
+
+Name() string
|
|
294
|
+
+SupportsStream() bool
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
class MockProvider {
|
|
298
|
+
-responses []Result
|
|
299
|
+
+Execute(ctx, input) Result, error
|
|
300
|
+
+Name() string
|
|
301
|
+
+SupportsStream() bool
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
Provider <|.. OpenAIProvider : implements
|
|
305
|
+
Provider <|.. AnthropicProvider : implements
|
|
306
|
+
Provider <|.. MockProvider : implements
|
|
307
|
+
|
|
308
|
+
note for Provider "Defined in core/types/provider.go:18"
|
|
309
|
+
note for OpenAIProvider "Defined in providers/openai/provider.go:25"
|
|
310
|
+
note for AnthropicProvider "Defined in providers/anthropic/provider.go:22"
|
|
311
|
+
note for MockProvider "Defined in testing/mock_provider.go:10"
|
|
312
|
+
```
|
|
313
|
+
````
|
|
314
|
+
|
|
315
|
+
### Generation Guidance
|
|
316
|
+
|
|
317
|
+
1. Find all interfaces: `grep -rn 'type.*interface' --include='*.go'`
|
|
318
|
+
2. Find implementations by matching method signatures
|
|
319
|
+
3. For each implementation, list its struct fields (private) and methods (public)
|
|
320
|
+
4. Add source file location as notes
|
|
321
|
+
5. Focus on the most important interfaces — don't try to diagram everything
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## 6. Module Boundary Diagram
|
|
326
|
+
|
|
327
|
+
Shows public vs internal API surface. Useful for library/SDK projects.
|
|
328
|
+
|
|
329
|
+
### Template
|
|
330
|
+
|
|
331
|
+
````markdown
|
|
332
|
+
```mermaid
|
|
333
|
+
graph TB
|
|
334
|
+
subgraph "Public API (exported)"
|
|
335
|
+
PUB_TYPES["Types<br/><code>pkg/types.go</code><br/><i>Config, Options, Result</i>"]
|
|
336
|
+
PUB_FUNC["Functions<br/><code>pkg/client.go</code><br/><i>New(), Run(), Close()</i>"]
|
|
337
|
+
PUB_IFACE["Interfaces<br/><code>pkg/interfaces.go</code><br/><i>Provider, Store</i>"]
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
subgraph "Internal (unexported)"
|
|
341
|
+
INT_CORE["Core Logic<br/><code>internal/core/</code>"]
|
|
342
|
+
INT_PARSE["Parsing<br/><code>internal/parse/</code>"]
|
|
343
|
+
INT_UTIL["Utilities<br/><code>internal/util/</code>"]
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
PUB_FUNC --> INT_CORE
|
|
347
|
+
PUB_FUNC --> INT_PARSE
|
|
348
|
+
INT_CORE --> INT_UTIL
|
|
349
|
+
INT_PARSE --> INT_UTIL
|
|
350
|
+
|
|
351
|
+
style PUB_TYPES fill:#c8e6c9
|
|
352
|
+
style PUB_FUNC fill:#c8e6c9
|
|
353
|
+
style PUB_IFACE fill:#c8e6c9
|
|
354
|
+
style INT_CORE fill:#ffecb3
|
|
355
|
+
style INT_PARSE fill:#ffecb3
|
|
356
|
+
style INT_UTIL fill:#ffecb3
|
|
357
|
+
```
|
|
358
|
+
````
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
## 7. Sequence Diagram for Key Flows
|
|
363
|
+
|
|
364
|
+
Shows time-ordered interactions between components for specific user scenarios.
|
|
365
|
+
|
|
366
|
+
### Template
|
|
367
|
+
|
|
368
|
+
````markdown
|
|
369
|
+
```mermaid
|
|
370
|
+
sequenceDiagram
|
|
371
|
+
participant User
|
|
372
|
+
participant CLI as CLI (cmd/run.go)
|
|
373
|
+
participant Auth as Auth Service (core/auth/)
|
|
374
|
+
participant DB as Database (storage/)
|
|
375
|
+
participant API as External API
|
|
376
|
+
|
|
377
|
+
User->>CLI: run --project my-app
|
|
378
|
+
CLI->>Auth: Authenticate(token)
|
|
379
|
+
Auth->>DB: GetUser(token)
|
|
380
|
+
DB-->>Auth: User{id, role}
|
|
381
|
+
Auth-->>CLI: AuthResult{ok, user}
|
|
382
|
+
CLI->>API: FetchProject("my-app")
|
|
383
|
+
API-->>CLI: ProjectData{...}
|
|
384
|
+
CLI-->>User: Display results
|
|
385
|
+
```
|
|
386
|
+
````
|
|
387
|
+
|
|
388
|
+
### Generation Guidance
|
|
389
|
+
|
|
390
|
+
1. Pick the 3-5 most common/important user flows
|
|
391
|
+
2. Trace the complete sequence from user input to final output
|
|
392
|
+
3. Include actual component names and file paths
|
|
393
|
+
4. Show both success and error paths
|
|
394
|
+
5. Keep each sequence to 10-15 messages max
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
## Diagram Selection Guide
|
|
399
|
+
|
|
400
|
+
Not every project needs all seven diagram types. Choose based on what matters:
|
|
401
|
+
|
|
402
|
+
| Project Type | Recommended Diagrams |
|
|
403
|
+
|---|---|
|
|
404
|
+
| CLI tool | Package Dependency, Data Flow, Call Hierarchy |
|
|
405
|
+
| Web API | Package Dependency, Component Relationship, Sequence |
|
|
406
|
+
| Library/SDK | Package Dependency, Interface Implementation, Module Boundary |
|
|
407
|
+
| Microservice | Component Relationship, Data Flow, Sequence |
|
|
408
|
+
| Monolith | Package Dependency, Component Relationship, Interface Implementation |
|
|
409
|
+
|
|
410
|
+
## Diagram Quality Checklist
|
|
411
|
+
|
|
412
|
+
Every generated diagram should pass these checks:
|
|
413
|
+
|
|
414
|
+
- [ ] **Grounded in code**: Every node references an actual file/package (not aspirational)
|
|
415
|
+
- [ ] **File references**: Include `code>file:line</code>` where possible
|
|
416
|
+
- [ ] **No orphan nodes**: Every node has at least one connection
|
|
417
|
+
- [ ] **Layered layout**: Higher-level components at top, lower at bottom
|
|
418
|
+
- [ ] **Color coding**: Consistent colors across diagrams in the same project
|
|
419
|
+
- [ ] **Reasonable size**: 5-15 nodes per diagram; split if larger
|
|
420
|
+
- [ ] **Updated date**: Note when the diagram was last regenerated
|