@neyugn/agent-kits 0.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 (158) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +514 -0
  3. package/README.vi.md +410 -0
  4. package/README.zh.md +410 -0
  5. package/dist/cli.d.ts +1 -0
  6. package/dist/cli.js +422 -0
  7. package/kits/coder/ARCHITECTURE.md +289 -0
  8. package/kits/coder/agents/ai-engineer.md +344 -0
  9. package/kits/coder/agents/backend-specialist.md +270 -0
  10. package/kits/coder/agents/cloud-architect.md +363 -0
  11. package/kits/coder/agents/code-reviewer.md +284 -0
  12. package/kits/coder/agents/data-engineer.md +401 -0
  13. package/kits/coder/agents/database-specialist.md +251 -0
  14. package/kits/coder/agents/debugger.md +209 -0
  15. package/kits/coder/agents/devops-engineer.md +281 -0
  16. package/kits/coder/agents/documentation-writer.md +296 -0
  17. package/kits/coder/agents/frontend-specialist.md +298 -0
  18. package/kits/coder/agents/i18n-specialist.md +348 -0
  19. package/kits/coder/agents/integration-specialist.md +314 -0
  20. package/kits/coder/agents/mobile-developer.md +271 -0
  21. package/kits/coder/agents/multi-tenant-architect.md +281 -0
  22. package/kits/coder/agents/orchestrator.md +263 -0
  23. package/kits/coder/agents/performance-analyst.md +327 -0
  24. package/kits/coder/agents/project-planner.md +277 -0
  25. package/kits/coder/agents/queue-specialist.md +282 -0
  26. package/kits/coder/agents/realtime-specialist.md +267 -0
  27. package/kits/coder/agents/security-auditor.md +253 -0
  28. package/kits/coder/agents/test-engineer.md +315 -0
  29. package/kits/coder/agents/ux-researcher.md +388 -0
  30. package/kits/coder/rules/.cursorrules +287 -0
  31. package/kits/coder/rules/CLAUDE.md +287 -0
  32. package/kits/coder/rules/CODEX.md +287 -0
  33. package/kits/coder/rules/GEMINI.md +287 -0
  34. package/kits/coder/scripts/checklist.py +318 -0
  35. package/kits/coder/scripts/kit_status.py +292 -0
  36. package/kits/coder/scripts/skills_manager.py +243 -0
  37. package/kits/coder/scripts/verify_all.py +391 -0
  38. package/kits/coder/skills/accessibility-patterns/SKILL.md +372 -0
  39. package/kits/coder/skills/accessibility-patterns/scripts/a11y_checker.py +211 -0
  40. package/kits/coder/skills/ai-rag-patterns/SKILL.md +444 -0
  41. package/kits/coder/skills/api-patterns/SKILL.md +316 -0
  42. package/kits/coder/skills/api-patterns/assets/.gitkeep +1 -0
  43. package/kits/coder/skills/api-patterns/references/deep-dive.md +21 -0
  44. package/kits/coder/skills/api-patterns/scripts/api_validator.py +253 -0
  45. package/kits/coder/skills/api-patterns/scripts/validate.py +56 -0
  46. package/kits/coder/skills/auth-patterns/SKILL.md +267 -0
  47. package/kits/coder/skills/aws-patterns/SKILL.md +576 -0
  48. package/kits/coder/skills/brainstorming/SKILL.md +370 -0
  49. package/kits/coder/skills/brainstorming/assets/.gitkeep +1 -0
  50. package/kits/coder/skills/brainstorming/references/deep-dive.md +21 -0
  51. package/kits/coder/skills/brainstorming/scripts/validate.py +56 -0
  52. package/kits/coder/skills/clean-code/SKILL.md +240 -0
  53. package/kits/coder/skills/clean-code/assets/.gitkeep +1 -0
  54. package/kits/coder/skills/clean-code/references/deep-dive.md +21 -0
  55. package/kits/coder/skills/clean-code/scripts/lint_runner.py +186 -0
  56. package/kits/coder/skills/clean-code/scripts/validate.py +56 -0
  57. package/kits/coder/skills/database-design/SKILL.md +255 -0
  58. package/kits/coder/skills/database-design/assets/.gitkeep +1 -0
  59. package/kits/coder/skills/database-design/references/deep-dive.md +21 -0
  60. package/kits/coder/skills/database-design/scripts/schema_validator.py +272 -0
  61. package/kits/coder/skills/database-design/scripts/validate.py +56 -0
  62. package/kits/coder/skills/docker-patterns/SKILL.md +240 -0
  63. package/kits/coder/skills/documentation-templates/SKILL.md +441 -0
  64. package/kits/coder/skills/e2e-testing/SKILL.md +457 -0
  65. package/kits/coder/skills/flutter-patterns/SKILL.md +330 -0
  66. package/kits/coder/skills/frontend-design/SKILL.md +127 -0
  67. package/kits/coder/skills/github-actions/SKILL.md +349 -0
  68. package/kits/coder/skills/gitlab-ci-patterns/SKILL.md +466 -0
  69. package/kits/coder/skills/graphql-patterns/SKILL.md +558 -0
  70. package/kits/coder/skills/i18n-localization/SKILL.md +345 -0
  71. package/kits/coder/skills/i18n-localization/scripts/i18n_checker.py +267 -0
  72. package/kits/coder/skills/kubernetes-patterns/SKILL.md +357 -0
  73. package/kits/coder/skills/mermaid-diagrams/SKILL.md +351 -0
  74. package/kits/coder/skills/mobile-design/SKILL.md +305 -0
  75. package/kits/coder/skills/monitoring-observability/SKILL.md +458 -0
  76. package/kits/coder/skills/multi-tenancy/SKILL.md +317 -0
  77. package/kits/coder/skills/multi-tenancy/assets/.gitkeep +1 -0
  78. package/kits/coder/skills/multi-tenancy/references/deep-dive.md +21 -0
  79. package/kits/coder/skills/multi-tenancy/scripts/validate.py +56 -0
  80. package/kits/coder/skills/nodejs-best-practices/SKILL.md +220 -0
  81. package/kits/coder/skills/performance-profiling/SKILL.md +333 -0
  82. package/kits/coder/skills/performance-profiling/assets/.gitkeep +1 -0
  83. package/kits/coder/skills/performance-profiling/references/deep-dive.md +21 -0
  84. package/kits/coder/skills/performance-profiling/scripts/validate.py +56 -0
  85. package/kits/coder/skills/plan-writing/SKILL.md +360 -0
  86. package/kits/coder/skills/plan-writing/assets/.gitkeep +1 -0
  87. package/kits/coder/skills/plan-writing/references/deep-dive.md +21 -0
  88. package/kits/coder/skills/plan-writing/scripts/validate.py +56 -0
  89. package/kits/coder/skills/postgres-patterns/SKILL.md +361 -0
  90. package/kits/coder/skills/prompt-engineering/SKILL.md +277 -0
  91. package/kits/coder/skills/queue-patterns/SKILL.md +359 -0
  92. package/kits/coder/skills/queue-patterns/assets/.gitkeep +1 -0
  93. package/kits/coder/skills/queue-patterns/references/deep-dive.md +21 -0
  94. package/kits/coder/skills/queue-patterns/scripts/validate.py +56 -0
  95. package/kits/coder/skills/react-native-patterns/SKILL.md +393 -0
  96. package/kits/coder/skills/react-patterns/SKILL.md +319 -0
  97. package/kits/coder/skills/realtime-patterns/SKILL.md +506 -0
  98. package/kits/coder/skills/realtime-patterns/assets/.gitkeep +1 -0
  99. package/kits/coder/skills/realtime-patterns/references/deep-dive.md +21 -0
  100. package/kits/coder/skills/realtime-patterns/scripts/validate.py +56 -0
  101. package/kits/coder/skills/redis-patterns/SKILL.md +484 -0
  102. package/kits/coder/skills/security-fundamentals/SKILL.md +363 -0
  103. package/kits/coder/skills/security-fundamentals/assets/.gitkeep +1 -0
  104. package/kits/coder/skills/security-fundamentals/references/deep-dive.md +21 -0
  105. package/kits/coder/skills/security-fundamentals/scripts/security_scan.py +326 -0
  106. package/kits/coder/skills/security-fundamentals/scripts/validate.py +56 -0
  107. package/kits/coder/skills/seo-patterns/SKILL.md +262 -0
  108. package/kits/coder/skills/seo-patterns/scripts/seo_checker.py +211 -0
  109. package/kits/coder/skills/systematic-debugging/SKILL.md +478 -0
  110. package/kits/coder/skills/systematic-debugging/assets/.gitkeep +1 -0
  111. package/kits/coder/skills/systematic-debugging/references/deep-dive.md +21 -0
  112. package/kits/coder/skills/systematic-debugging/scripts/validate.py +56 -0
  113. package/kits/coder/skills/tailwind-patterns/SKILL.md +395 -0
  114. package/kits/coder/skills/terraform-patterns/SKILL.md +470 -0
  115. package/kits/coder/skills/testing-patterns/SKILL.md +285 -0
  116. package/kits/coder/skills/testing-patterns/assets/.gitkeep +1 -0
  117. package/kits/coder/skills/testing-patterns/references/deep-dive.md +21 -0
  118. package/kits/coder/skills/testing-patterns/scripts/test_runner.py +219 -0
  119. package/kits/coder/skills/testing-patterns/scripts/validate.py +56 -0
  120. package/kits/coder/skills/typescript-patterns/SKILL.md +417 -0
  121. package/kits/coder/skills/ui-ux-pro-max/SKILL.md +364 -0
  122. package/kits/coder/skills/ui-ux-pro-max/data/charts.csv +26 -0
  123. package/kits/coder/skills/ui-ux-pro-max/data/colors.csv +97 -0
  124. package/kits/coder/skills/ui-ux-pro-max/data/icons.csv +101 -0
  125. package/kits/coder/skills/ui-ux-pro-max/data/landing.csv +31 -0
  126. package/kits/coder/skills/ui-ux-pro-max/data/products.csv +97 -0
  127. package/kits/coder/skills/ui-ux-pro-max/data/prompts.csv +24 -0
  128. package/kits/coder/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  129. package/kits/coder/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  130. package/kits/coder/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  131. package/kits/coder/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  132. package/kits/coder/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  133. package/kits/coder/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  134. package/kits/coder/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  135. package/kits/coder/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  136. package/kits/coder/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  137. package/kits/coder/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  138. package/kits/coder/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  139. package/kits/coder/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  140. package/kits/coder/skills/ui-ux-pro-max/data/styles.csv +59 -0
  141. package/kits/coder/skills/ui-ux-pro-max/data/typography.csv +58 -0
  142. package/kits/coder/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  143. package/kits/coder/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  144. package/kits/coder/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  145. package/kits/coder/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-314.pyc +0 -0
  146. package/kits/coder/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-314.pyc +0 -0
  147. package/kits/coder/skills/ui-ux-pro-max/scripts/core.py +257 -0
  148. package/kits/coder/skills/ui-ux-pro-max/scripts/design_system.py +488 -0
  149. package/kits/coder/skills/ui-ux-pro-max/scripts/search.py +76 -0
  150. package/kits/coder/workflows/.gitkeep +20 -0
  151. package/kits/coder/workflows/create.md +152 -0
  152. package/kits/coder/workflows/debug.md +223 -0
  153. package/kits/coder/workflows/deploy.md +283 -0
  154. package/kits/coder/workflows/orchestrate.md +243 -0
  155. package/kits/coder/workflows/plan.md +134 -0
  156. package/kits/coder/workflows/test.md +237 -0
  157. package/kits/coder/workflows/ui-ux-pro-max.md +109 -0
  158. package/package.json +49 -0
@@ -0,0 +1,357 @@
1
+ ---
2
+ name: kubernetes-patterns
3
+ description: Kubernetes orchestration principles and decision-making. Use when deploying to K8s, designing cluster architecture, implementing GitOps, or configuring workloads. Covers manifests, Helm, deployments, services, and production patterns.
4
+ allowed-tools: Read, Write, Edit, Bash
5
+ version: 1.0
6
+ priority: HIGH
7
+ ---
8
+
9
+ # Kubernetes Patterns - Cloud-Native Orchestration
10
+
11
+ > **Philosophy:** Kubernetes is infrastructure as code. Declare what you want, let the system reconcile. **GitOps everything.**
12
+
13
+ ---
14
+
15
+ ## Core Principles
16
+
17
+ | Principle | Rule |
18
+ | ------------------- | ---------------------------------------------------- |
19
+ | **Declarative** | Define desired state, not imperative steps |
20
+ | **Immutable** | Never modify running resources - redeploy instead |
21
+ | **GitOps** | Git is the source of truth for all manifests |
22
+ | **Least Privilege** | RBAC with minimal permissions, pod security policies |
23
+ | **Observable** | Probes, metrics, logs for every workload |
24
+
25
+ ---
26
+
27
+ ## Workload Types
28
+
29
+ | Type | Use Case | Example |
30
+ | --------------- | -------------------------------- | -------------------------- |
31
+ | **Deployment** | Stateless apps, web servers | API servers, frontend |
32
+ | **StatefulSet** | Stateful apps needing stable IDs | Databases, message queues |
33
+ | **DaemonSet** | One pod per node | Log collectors, monitoring |
34
+ | **Job** | Run-to-completion tasks | DB migrations, batch jobs |
35
+ | **CronJob** | Scheduled tasks | Backups, reports |
36
+
37
+ ---
38
+
39
+ ## Essential Manifest Patterns
40
+
41
+ ### Production Deployment
42
+
43
+ ```yaml
44
+ apiVersion: apps/v1
45
+ kind: Deployment
46
+ metadata:
47
+ name: api
48
+ labels:
49
+ app: api
50
+ version: v1.0.0
51
+ spec:
52
+ replicas: 3
53
+ selector:
54
+ matchLabels:
55
+ app: api
56
+ strategy:
57
+ type: RollingUpdate
58
+ rollingUpdate:
59
+ maxUnavailable: 1
60
+ maxSurge: 1
61
+ template:
62
+ metadata:
63
+ labels:
64
+ app: api
65
+ spec:
66
+ securityContext:
67
+ runAsNonRoot: true
68
+ runAsUser: 1000
69
+ containers:
70
+ - name: api
71
+ image: myapp/api:v1.0.0
72
+ ports:
73
+ - containerPort: 3000
74
+ resources:
75
+ requests:
76
+ cpu: "100m"
77
+ memory: "128Mi"
78
+ limits:
79
+ cpu: "500m"
80
+ memory: "512Mi"
81
+ livenessProbe:
82
+ httpGet:
83
+ path: /health
84
+ port: 3000
85
+ initialDelaySeconds: 10
86
+ periodSeconds: 10
87
+ readinessProbe:
88
+ httpGet:
89
+ path: /ready
90
+ port: 3000
91
+ initialDelaySeconds: 5
92
+ periodSeconds: 5
93
+ env:
94
+ - name: DATABASE_URL
95
+ valueFrom:
96
+ secretKeyRef:
97
+ name: db-credentials
98
+ key: url
99
+ ```
100
+
101
+ ### Service + Ingress
102
+
103
+ ```yaml
104
+ apiVersion: v1
105
+ kind: Service
106
+ metadata:
107
+ name: api
108
+ spec:
109
+ selector:
110
+ app: api
111
+ ports:
112
+ - port: 80
113
+ targetPort: 3000
114
+ ---
115
+ apiVersion: networking.k8s.io/v1
116
+ kind: Ingress
117
+ metadata:
118
+ name: api
119
+ annotations:
120
+ cert-manager.io/cluster-issuer: letsencrypt-prod
121
+ spec:
122
+ tls:
123
+ - hosts:
124
+ - api.example.com
125
+ secretName: api-tls
126
+ rules:
127
+ - host: api.example.com
128
+ http:
129
+ paths:
130
+ - path: /
131
+ pathType: Prefix
132
+ backend:
133
+ service:
134
+ name: api
135
+ port:
136
+ number: 80
137
+ ```
138
+
139
+ ---
140
+
141
+ ## Resource Management
142
+
143
+ | Resource Type | Requests (min) | Limits (max) |
144
+ | ------------- | ------------------- | ------------------------- |
145
+ | **CPU** | Guaranteed CPU time | CPU throttled if exceeded |
146
+ | **Memory** | Reserved memory | OOMKilled if exceeded |
147
+
148
+ ### Sizing Guidelines
149
+
150
+ | App Type | CPU Request | Memory Request | CPU Limit | Memory Limit |
151
+ | -------------- | ----------- | -------------- | ----------- | ------------ |
152
+ | **API Server** | 100m-200m | 128Mi-256Mi | 500m-1000m | 512Mi-1Gi |
153
+ | **Worker** | 200m-500m | 256Mi-512Mi | 1000m-2000m | 1Gi-2Gi |
154
+ | **Database** | 500m-1000m | 1Gi-2Gi | 2000m-4000m | 4Gi-8Gi |
155
+
156
+ > 🔴 **Always set requests!** Without requests, K8s can't schedule efficiently.
157
+
158
+ ---
159
+
160
+ ## Health Probes
161
+
162
+ | Probe Type | Purpose | On Failure |
163
+ | ------------------ | ------------------- | ------------------------------ |
164
+ | **livenessProbe** | Is container alive? | Container restarted |
165
+ | **readinessProbe** | Ready for traffic? | Removed from Service endpoints |
166
+ | **startupProbe** | Still starting up? | Liveness/readiness disabled |
167
+
168
+ ### Probe Configuration
169
+
170
+ ```yaml
171
+ livenessProbe:
172
+ httpGet:
173
+ path: /health
174
+ port: 3000
175
+ initialDelaySeconds: 10 # Wait before first check
176
+ periodSeconds: 10 # Check every 10s
177
+ timeoutSeconds: 5 # Timeout for check
178
+ failureThreshold: 3 # Restart after 3 failures
179
+
180
+ readinessProbe:
181
+ httpGet:
182
+ path: /ready
183
+ port: 3000
184
+ initialDelaySeconds: 5
185
+ periodSeconds: 5
186
+ failureThreshold: 3
187
+ ```
188
+
189
+ ---
190
+
191
+ ## Configuration Management
192
+
193
+ | Method | Use Case | When to Use |
194
+ | -------------------- | --------------------------- | --------------------------- |
195
+ | **ConfigMap** | Non-sensitive config | App settings, feature flags |
196
+ | **Secret** | Sensitive data | API keys, passwords |
197
+ | **External Secrets** | Production secrets | Sync from Vault/AWS/GCP |
198
+ | **Helm Values** | Environment-specific config | Per-env deployments |
199
+
200
+ ### Secret Best Practices
201
+
202
+ ```yaml
203
+ # Don't store secrets in manifests!
204
+ # Use External Secrets Operator:
205
+ apiVersion: external-secrets.io/v1beta1
206
+ kind: ExternalSecret
207
+ metadata:
208
+ name: db-credentials
209
+ spec:
210
+ refreshInterval: 1h
211
+ secretStoreRef:
212
+ name: aws-secrets-manager
213
+ kind: ClusterSecretStore
214
+ target:
215
+ name: db-credentials
216
+ data:
217
+ - secretKey: url
218
+ remoteRef:
219
+ key: prod/database
220
+ ```
221
+
222
+ ---
223
+
224
+ ## Helm Patterns
225
+
226
+ ### Chart Structure
227
+
228
+ ```
229
+ mychart/
230
+ ├── Chart.yaml # Chart metadata
231
+ ├── values.yaml # Default values
232
+ ├── values-prod.yaml # Production overrides
233
+ ├── templates/
234
+ │ ├── deployment.yaml
235
+ │ ├── service.yaml
236
+ │ ├── ingress.yaml
237
+ │ └── _helpers.tpl # Template helpers
238
+ ```
239
+
240
+ ### Values Pattern
241
+
242
+ ```yaml
243
+ # values.yaml (base)
244
+ replicaCount: 1
245
+ image:
246
+ repository: myapp/api
247
+ tag: latest
248
+ resources:
249
+ requests:
250
+ cpu: 100m
251
+ memory: 128Mi
252
+
253
+ # values-prod.yaml (override)
254
+ replicaCount: 3
255
+ image:
256
+ tag: v1.0.0
257
+ resources:
258
+ requests:
259
+ cpu: 500m
260
+ memory: 512Mi
261
+ ```
262
+
263
+ ---
264
+
265
+ ## Decision Trees
266
+
267
+ ### Which Workload Type?
268
+
269
+ ```
270
+ Need stable network identity/storage?
271
+ ├── Yes → StatefulSet
272
+ └── No → Run on every node?
273
+ ├── Yes → DaemonSet
274
+ └── No → One-time task?
275
+ ├── Yes → Job or CronJob
276
+ └── No → Deployment
277
+ ```
278
+
279
+ ### Ingress vs LoadBalancer?
280
+
281
+ ```
282
+ Multiple services behind one IP?
283
+ ├── Yes → Ingress with Ingress Controller
284
+ └── No → Just one service exposed?
285
+ ├── Yes → LoadBalancer Service
286
+ └── No → Internal only?
287
+ └── Yes → ClusterIP Service
288
+ ```
289
+
290
+ ---
291
+
292
+ ## GitOps with ArgoCD
293
+
294
+ ```yaml
295
+ apiVersion: argoproj.io/v1alpha1
296
+ kind: Application
297
+ metadata:
298
+ name: myapp
299
+ namespace: argocd
300
+ spec:
301
+ project: default
302
+ source:
303
+ repoURL: https://github.com/org/manifests
304
+ targetRevision: main
305
+ path: apps/myapp
306
+ destination:
307
+ server: https://kubernetes.default.svc
308
+ namespace: production
309
+ syncPolicy:
310
+ automated:
311
+ prune: true
312
+ selfHeal: true
313
+ ```
314
+
315
+ ---
316
+
317
+ ## Anti-Patterns (DON'T)
318
+
319
+ | ❌ Anti-Pattern | ✅ Correct Approach |
320
+ | ---------------------------- | --------------------------------------- |
321
+ | `kubectl apply` from laptop | GitOps - apply from Git repo |
322
+ | `latest` image tag | Specific versioned tags |
323
+ | No resource requests/limits | Always set requests, usually set limits |
324
+ | Running as root | `runAsNonRoot: true` |
325
+ | Secrets in ConfigMap | Use Secrets or External Secrets |
326
+ | No health probes | livenessProbe + readinessProbe |
327
+ | Single replica in prod | Minimum 2-3 replicas with PDB |
328
+ | `kubectl edit` in production | Edit in Git, apply via GitOps |
329
+
330
+ ---
331
+
332
+ ## 🔴 Self-Check Before Deploying
333
+
334
+ | Check | Question |
335
+ | ------------------------- | ------------------------------------- |
336
+ | ✅ **Resources set?** | requests and limits configured? |
337
+ | ✅ **Probes configured?** | liveness + readiness probes? |
338
+ | ✅ **Non-root?** | Pod runs as non-root user? |
339
+ | ✅ **Image pinned?** | Specific tag, not `latest`? |
340
+ | ✅ **Secrets external?** | No hardcoded secrets in manifests? |
341
+ | ✅ **Replicas > 1?** | At least 2 replicas for HA? |
342
+ | ✅ **PDB defined?** | PodDisruptionBudget for availability? |
343
+
344
+ ---
345
+
346
+ ## Related Skills
347
+
348
+ | Need | Skill |
349
+ | -------------------- | ------------------------- |
350
+ | Container images | `docker-patterns` |
351
+ | CI/CD pipelines | `github-actions` (future) |
352
+ | Server management | `server-management` |
353
+ | Deployment workflows | `deployment-procedures` |
354
+
355
+ ---
356
+
357
+ > **Remember:** Kubernetes is not magic. It amplifies your practices - good and bad. If your deployments are messy, K8s will make them messier at scale. Start with GitOps, proper manifests, and observability.
@@ -0,0 +1,351 @@
1
+ ---
2
+ name: mermaid-diagrams
3
+ description: Mermaid diagram patterns for documentation. Create flowcharts, sequence diagrams, ERDs, and architecture diagrams. Use when visualizing systems, processes, or data relationships.
4
+ allowed-tools: Read, Write, Edit
5
+ version: 1.0
6
+ priority: LOW
7
+ ---
8
+
9
+ # Mermaid Diagrams - Visual Documentation
10
+
11
+ > **Philosophy:** A good diagram is worth a thousand words. Keep it simple, readable, and purposeful.
12
+
13
+ ---
14
+
15
+ ## 🎯 Core Principles
16
+
17
+ | Principle | Rule |
18
+ | --------------- | -------------------------------------------- |
19
+ | **Clarity** | One diagram, one concept |
20
+ | **Simplicity** | Avoid overcrowding - less is more |
21
+ | **Consistency** | Same styling and conventions across diagrams |
22
+ | **Purpose** | Every element should serve understanding |
23
+ | **Maintenance** | Easy to update as system evolves |
24
+
25
+ ---
26
+
27
+ ## 📊 Diagram Types
28
+
29
+ | Type | Best For |
30
+ | ----------------- | --------------------------------------- |
31
+ | `flowchart` | Processes, decision trees, workflows |
32
+ | `sequenceDiagram` | API calls, interactions, timing |
33
+ | `classDiagram` | Object relationships, inheritance |
34
+ | `erDiagram` | Database schemas, entity relationships |
35
+ | `stateDiagram-v2` | State machines, lifecycle |
36
+ | `gantt` | Project timelines, milestones |
37
+ | `pie` | Proportions, distributions |
38
+ | `gitGraph` | Branch strategies, merges |
39
+ | `journey` | User experience flows |
40
+ | `C4Context` | System architecture (with C4 extension) |
41
+
42
+ ---
43
+
44
+ ## 📈 Flowchart Patterns
45
+
46
+ ### Basic Flowchart
47
+
48
+ ```mermaid
49
+ flowchart TD
50
+ A[Start] --> B{Is valid?}
51
+ B -->|Yes| C[Process]
52
+ B -->|No| D[Error]
53
+ C --> E[End]
54
+ D --> E
55
+ ```
56
+
57
+ ### Node Shapes
58
+
59
+ | Shape | Syntax | Use For |
60
+ | ------------- | ---------- | ------------------- |
61
+ | Rectangle | `[text]` | Process, action |
62
+ | Rounded | `(text)` | Start/end, terminal |
63
+ | Stadium | `([text])` | Start/end (alt) |
64
+ | Diamond | `{text}` | Decision |
65
+ | Hexagon | `{{text}}` | Preparation |
66
+ | Parallelogram | `[/text/]` | Input/output |
67
+ | Circle | `((text))` | Connector |
68
+ | Database | `[(text)]` | Database |
69
+
70
+ ### Subgraphs for Organization
71
+
72
+ ```mermaid
73
+ flowchart TB
74
+ subgraph Frontend
75
+ A[React App] --> B[API Client]
76
+ end
77
+
78
+ subgraph Backend
79
+ C[API Server] --> D[(Database)]
80
+ end
81
+
82
+ B --> C
83
+ ```
84
+
85
+ ---
86
+
87
+ ## 🔄 Sequence Diagram Patterns
88
+
89
+ ### Basic API Flow
90
+
91
+ ```mermaid
92
+ sequenceDiagram
93
+ participant C as Client
94
+ participant A as API
95
+ participant D as Database
96
+
97
+ C->>+A: POST /users
98
+ A->>+D: INSERT user
99
+ D-->>-A: user record
100
+ A-->>-C: 201 Created
101
+ ```
102
+
103
+ ### Arrow Types
104
+
105
+ | Arrow | Meaning |
106
+ | ------- | ---------------------- |
107
+ | `->>` | Solid with arrowhead |
108
+ | `-->` | Dotted with arrowhead |
109
+ | `->>+` | Activate lifeline |
110
+ | `-->>-` | Deactivate lifeline |
111
+ | `-x` | Solid with X (failure) |
112
+ | `--x` | Dotted with X |
113
+
114
+ ### Notes and Loops
115
+
116
+ ```mermaid
117
+ sequenceDiagram
118
+ participant U as User
119
+ participant S as Server
120
+
121
+ Note over U,S: Authentication Flow
122
+
123
+ U->>S: Login request
124
+ activate S
125
+
126
+ loop Validate
127
+ S->>S: Check credentials
128
+ end
129
+
130
+ alt Success
131
+ S-->>U: JWT Token
132
+ else Failure
133
+ S-->>U: 401 Error
134
+ end
135
+
136
+ deactivate S
137
+ ```
138
+
139
+ ---
140
+
141
+ ## 🗃️ ER Diagram Patterns
142
+
143
+ ### Database Schema
144
+
145
+ ```mermaid
146
+ erDiagram
147
+ USER ||--o{ ORDER : places
148
+ USER {
149
+ uuid id PK
150
+ string email UK
151
+ string name
152
+ timestamp created_at
153
+ }
154
+
155
+ ORDER ||--|{ ORDER_ITEM : contains
156
+ ORDER {
157
+ uuid id PK
158
+ uuid user_id FK
159
+ decimal total
160
+ string status
161
+ }
162
+
163
+ ORDER_ITEM }o--|| PRODUCT : references
164
+ ORDER_ITEM {
165
+ uuid id PK
166
+ uuid order_id FK
167
+ uuid product_id FK
168
+ int quantity
169
+ }
170
+
171
+ PRODUCT {
172
+ uuid id PK
173
+ string name
174
+ decimal price
175
+ }
176
+ ```
177
+
178
+ ### Relationship Symbols
179
+
180
+ | Symbol | Meaning |
181
+ | ------ | ------------ | ----------- | ----------- |
182
+ | ` | | ` | Exactly one |
183
+ | `o{` | Zero or more |
184
+ | ` | {` | One or more |
185
+ | `o | ` | Zero or one |
186
+
187
+ ---
188
+
189
+ ## 🔀 State Diagram Patterns
190
+
191
+ ### Lifecycle States
192
+
193
+ ```mermaid
194
+ stateDiagram-v2
195
+ [*] --> Draft
196
+
197
+ Draft --> Pending: Submit
198
+ Pending --> Approved: Approve
199
+ Pending --> Rejected: Reject
200
+
201
+ Approved --> Published: Publish
202
+ Published --> Archived: Archive
203
+
204
+ Rejected --> Draft: Revise
205
+ Archived --> [*]
206
+
207
+ note right of Pending
208
+ Awaiting review
209
+ end note
210
+ ```
211
+
212
+ ---
213
+
214
+ ## 🎨 Styling
215
+
216
+ ### Theme Options
217
+
218
+ ```mermaid
219
+ %%{init: {'theme': 'dark'}}%%
220
+ flowchart LR
221
+ A --> B
222
+ ```
223
+
224
+ | Theme | Best For |
225
+ | --------- | ----------------------- |
226
+ | `default` | Light backgrounds |
227
+ | `dark` | Dark mode documentation |
228
+ | `forest` | Calm, professional |
229
+ | `neutral` | Minimal, clean |
230
+
231
+ ### Custom Styling
232
+
233
+ ```mermaid
234
+ flowchart TD
235
+ A[Critical]:::critical --> B[Normal]
236
+ B --> C[Success]:::success
237
+
238
+ classDef critical fill:#ff6b6b,stroke:#c92a2a,color:#fff
239
+ classDef success fill:#51cf66,stroke:#2b8a3e,color:#fff
240
+ ```
241
+
242
+ ---
243
+
244
+ ## 📋 Best Practices
245
+
246
+ ### Do's
247
+
248
+ | Practice | Why |
249
+ | ----------------------- | -------------------------------- |
250
+ | One concept per diagram | Clarity and focus |
251
+ | Use descriptive labels | Self-documenting |
252
+ | Consistent direction | TD/LR - pick one and stick to it |
253
+ | Group with subgraphs | Visual organization |
254
+ | Use proper shapes | Semantic meaning |
255
+
256
+ ### Don'ts
257
+
258
+ | Anti-Pattern | Problem |
259
+ | --------------------- | -------------------------------- |
260
+ | Too many nodes | Overwhelming, hard to read |
261
+ | Long text in nodes | Cluttered diagram |
262
+ | Crossing lines | Confusing flow |
263
+ | Inconsistent styling | Unprofessional look |
264
+ | No legend when needed | Readers can't understand symbols |
265
+
266
+ ---
267
+
268
+ ## 🔧 Common Use Cases
269
+
270
+ ### Architecture Decision
271
+
272
+ ```mermaid
273
+ flowchart TD
274
+ subgraph Options
275
+ A[REST API] --> X{Choose}
276
+ B[GraphQL] --> X
277
+ C[gRPC] --> X
278
+ end
279
+
280
+ X -->|Web/Mobile| B
281
+ X -->|Microservices| C
282
+ X -->|Simple CRUD| A
283
+ ```
284
+
285
+ ### Deployment Flow
286
+
287
+ ```mermaid
288
+ flowchart LR
289
+ subgraph Development
290
+ A[Code] --> B[PR]
291
+ end
292
+
293
+ subgraph CI/CD
294
+ B --> C[Build]
295
+ C --> D[Test]
296
+ D --> E{Pass?}
297
+ end
298
+
299
+ subgraph Deploy
300
+ E -->|Yes| F[Staging]
301
+ F --> G[Production]
302
+ end
303
+
304
+ E -->|No| A
305
+ ```
306
+
307
+ ### User Journey
308
+
309
+ ```mermaid
310
+ journey
311
+ title User Signup Flow
312
+ section Discovery
313
+ Visit landing page: 5: User
314
+ Read features: 4: User
315
+ section Signup
316
+ Click signup: 5: User
317
+ Fill form: 3: User
318
+ Verify email: 2: User
319
+ section Onboarding
320
+ Complete profile: 4: User
321
+ Start using: 5: User
322
+ ```
323
+
324
+ ---
325
+
326
+ ## ✅ Diagram Checklist
327
+
328
+ Before sharing a diagram:
329
+
330
+ - [ ] Single clear purpose
331
+ - [ ] All nodes have meaningful labels
332
+ - [ ] No unnecessary complexity
333
+ - [ ] Consistent styling
334
+ - [ ] Renders correctly in target platform
335
+ - [ ] Accessible (add description if needed)
336
+ - [ ] Source stored in version control
337
+
338
+ ---
339
+
340
+ ## 🔗 Related Skills
341
+
342
+ | Need | Skill |
343
+ | ---------------------- | ------------------------- |
344
+ | Architecture decisions | `architecture` |
345
+ | Database design | `database-design` |
346
+ | API documentation | `documentation-templates` |
347
+ | Project planning | `plan-writing` |
348
+
349
+ ---
350
+
351
+ > **Remember:** The purpose of a diagram is to communicate. If it takes longer to understand the diagram than the concept it represents, simplify it.