autodoc-agent-kit 1.0.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 (187) hide show
  1. package/README.md +362 -0
  2. package/package.json +49 -0
  3. package/src/core/module.yaml +5 -0
  4. package/src/modules/design/module.yaml +9 -0
  5. package/src/modules/design/skills/brand-guidelines/LICENSE.txt +202 -0
  6. package/src/modules/design/skills/brand-guidelines/SKILL.md +73 -0
  7. package/src/modules/design/skills/frontend-design/LICENSE.txt +177 -0
  8. package/src/modules/design/skills/frontend-design/SKILL.md +42 -0
  9. package/src/modules/design/skills/web-artifacts-builder/SKILL.md +229 -0
  10. package/src/modules/devops/module.yaml +10 -0
  11. package/src/modules/devops/skills/devops-helper/SKILL.md +60 -0
  12. package/src/modules/devops/skills/k8s-helm/SKILL.md +360 -0
  13. package/src/modules/devops/skills/monitoring-observability/SKILL.md +240 -0
  14. package/src/modules/devops/skills/security-auditor/SKILL.md +105 -0
  15. package/src/modules/engineering/module.yaml +22 -0
  16. package/src/modules/engineering/skills/ai-sdk/SKILL.md +314 -0
  17. package/src/modules/engineering/skills/api-designer/SKILL.md +77 -0
  18. package/src/modules/engineering/skills/code-reviewer/SKILL.md +71 -0
  19. package/src/modules/engineering/skills/db-architect/SKILL.md +50 -0
  20. package/src/modules/engineering/skills/debugger/SKILL.md +59 -0
  21. package/src/modules/engineering/skills/docs-generator/SKILL.md +51 -0
  22. package/src/modules/engineering/skills/git-workflow/SKILL.md +258 -0
  23. package/src/modules/engineering/skills/mcp-builder/LICENSE.txt +202 -0
  24. package/src/modules/engineering/skills/mcp-builder/SKILL.md +236 -0
  25. package/src/modules/engineering/skills/mcp-builder/reference/evaluation.md +602 -0
  26. package/src/modules/engineering/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
  27. package/src/modules/engineering/skills/mcp-builder/reference/node_mcp_server.md +970 -0
  28. package/src/modules/engineering/skills/mcp-builder/reference/python_mcp_server.md +719 -0
  29. package/src/modules/engineering/skills/mcp-builder/scripts/connections.py +151 -0
  30. package/src/modules/engineering/skills/mcp-builder/scripts/evaluation.py +373 -0
  31. package/src/modules/engineering/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
  32. package/src/modules/engineering/skills/mcp-builder/scripts/requirements.txt +2 -0
  33. package/src/modules/engineering/skills/nextjs-15/SKILL.md +312 -0
  34. package/src/modules/engineering/skills/perf-optimizer/SKILL.md +60 -0
  35. package/src/modules/engineering/skills/react-19/SKILL.md +257 -0
  36. package/src/modules/engineering/skills/refactorer/SKILL.md +60 -0
  37. package/src/modules/engineering/skills/skill-authoring-workflow/SKILL.md +183 -0
  38. package/src/modules/engineering/skills/skill-creator/LICENSE.txt +202 -0
  39. package/src/modules/engineering/skills/skill-creator/SKILL.md +356 -0
  40. package/src/modules/engineering/skills/skill-creator/references/output-patterns.md +82 -0
  41. package/src/modules/engineering/skills/skill-creator/references/workflows.md +28 -0
  42. package/src/modules/engineering/skills/skill-creator/scripts/__pycache__/quick_validate.cpython-313.pyc +0 -0
  43. package/src/modules/engineering/skills/skill-creator/scripts/init_skill.py +303 -0
  44. package/src/modules/engineering/skills/skill-creator/scripts/package_skill.py +110 -0
  45. package/src/modules/engineering/skills/skill-creator/scripts/quick_validate.py +95 -0
  46. package/src/modules/engineering/skills/typescript/SKILL.md +231 -0
  47. package/src/modules/engineering/skills/zod-4/SKILL.md +223 -0
  48. package/src/modules/product/module.yaml +51 -0
  49. package/src/modules/product/skills/acquisition-channel-advisor/SKILL.md +643 -0
  50. package/src/modules/product/skills/acquisition-channel-advisor/examples/conversation-flow.md +531 -0
  51. package/src/modules/product/skills/ai-shaped-readiness-advisor/SKILL.md +923 -0
  52. package/src/modules/product/skills/altitude-horizon-framework/SKILL.md +250 -0
  53. package/src/modules/product/skills/altitude-horizon-framework/examples/sample.md +85 -0
  54. package/src/modules/product/skills/business-health-diagnostic/SKILL.md +783 -0
  55. package/src/modules/product/skills/company-research/SKILL.md +385 -0
  56. package/src/modules/product/skills/company-research/examples/sample.md +164 -0
  57. package/src/modules/product/skills/company-research/template.md +60 -0
  58. package/src/modules/product/skills/context-engineering-advisor/SKILL.md +763 -0
  59. package/src/modules/product/skills/customer-journey-map/SKILL.md +346 -0
  60. package/src/modules/product/skills/customer-journey-map/examples/meta-product-manager-skills.md +40 -0
  61. package/src/modules/product/skills/customer-journey-map/examples/sample.md +33 -0
  62. package/src/modules/product/skills/customer-journey-map/template.md +28 -0
  63. package/src/modules/product/skills/customer-journey-mapping-workshop/SKILL.md +523 -0
  64. package/src/modules/product/skills/director-readiness-advisor/SKILL.md +351 -0
  65. package/src/modules/product/skills/director-readiness-advisor/examples/conversation-flow.md +96 -0
  66. package/src/modules/product/skills/discovery-interview-prep/SKILL.md +410 -0
  67. package/src/modules/product/skills/discovery-process/SKILL.md +504 -0
  68. package/src/modules/product/skills/discovery-process/examples/sample.md +60 -0
  69. package/src/modules/product/skills/discovery-process/template.md +39 -0
  70. package/src/modules/product/skills/eol-message/SKILL.md +348 -0
  71. package/src/modules/product/skills/eol-message/examples/sample.md +87 -0
  72. package/src/modules/product/skills/eol-message/template.md +74 -0
  73. package/src/modules/product/skills/epic-breakdown-advisor/SKILL.md +665 -0
  74. package/src/modules/product/skills/epic-hypothesis/SKILL.md +277 -0
  75. package/src/modules/product/skills/epic-hypothesis/examples/sample.md +104 -0
  76. package/src/modules/product/skills/epic-hypothesis/template.md +30 -0
  77. package/src/modules/product/skills/executive-onboarding-playbook/SKILL.md +280 -0
  78. package/src/modules/product/skills/executive-onboarding-playbook/examples/sample.md +116 -0
  79. package/src/modules/product/skills/feature-investment-advisor/SKILL.md +639 -0
  80. package/src/modules/product/skills/feature-investment-advisor/examples/conversation-flow.md +538 -0
  81. package/src/modules/product/skills/finance-based-pricing-advisor/SKILL.md +763 -0
  82. package/src/modules/product/skills/finance-metrics-quickref/SKILL.md +309 -0
  83. package/src/modules/product/skills/jobs-to-be-done/SKILL.md +370 -0
  84. package/src/modules/product/skills/jobs-to-be-done/examples/sample.md +80 -0
  85. package/src/modules/product/skills/jobs-to-be-done/template.md +65 -0
  86. package/src/modules/product/skills/lean-ux-canvas/SKILL.md +561 -0
  87. package/src/modules/product/skills/lean-ux-canvas/examples/sample.md +88 -0
  88. package/src/modules/product/skills/lean-ux-canvas/template.md +32 -0
  89. package/src/modules/product/skills/opportunity-solution-tree/SKILL.md +420 -0
  90. package/src/modules/product/skills/opportunity-solution-tree/examples/sample.md +104 -0
  91. package/src/modules/product/skills/opportunity-solution-tree/template.md +33 -0
  92. package/src/modules/product/skills/pestel-analysis/SKILL.md +376 -0
  93. package/src/modules/product/skills/pestel-analysis/examples/sample.md +143 -0
  94. package/src/modules/product/skills/pestel-analysis/template.md +53 -0
  95. package/src/modules/product/skills/pol-probe/SKILL.md +217 -0
  96. package/src/modules/product/skills/pol-probe/examples/sample.md +136 -0
  97. package/src/modules/product/skills/pol-probe/template.md +59 -0
  98. package/src/modules/product/skills/pol-probe-advisor/SKILL.md +492 -0
  99. package/src/modules/product/skills/positioning-statement/SKILL.md +230 -0
  100. package/src/modules/product/skills/positioning-statement/examples/sample.md +51 -0
  101. package/src/modules/product/skills/positioning-statement/template.md +25 -0
  102. package/src/modules/product/skills/positioning-workshop/SKILL.md +424 -0
  103. package/src/modules/product/skills/prd-development/SKILL.md +655 -0
  104. package/src/modules/product/skills/prd-development/examples/sample.md +43 -0
  105. package/src/modules/product/skills/prd-development/template.md +55 -0
  106. package/src/modules/product/skills/press-release/SKILL.md +269 -0
  107. package/src/modules/product/skills/press-release/examples/sample.md +73 -0
  108. package/src/modules/product/skills/press-release/template.md +39 -0
  109. package/src/modules/product/skills/prioritization-advisor/SKILL.md +448 -0
  110. package/src/modules/product/skills/problem-framing-canvas/SKILL.md +466 -0
  111. package/src/modules/product/skills/problem-framing-canvas/examples/sample.md +58 -0
  112. package/src/modules/product/skills/problem-framing-canvas/template.md +22 -0
  113. package/src/modules/product/skills/problem-statement/SKILL.md +246 -0
  114. package/src/modules/product/skills/problem-statement/examples/sample.md +82 -0
  115. package/src/modules/product/skills/problem-statement/template.md +37 -0
  116. package/src/modules/product/skills/product-strategy-session/SKILL.md +426 -0
  117. package/src/modules/product/skills/product-strategy-session/examples/sample.md +67 -0
  118. package/src/modules/product/skills/product-strategy-session/template.md +38 -0
  119. package/src/modules/product/skills/proto-persona/SKILL.md +326 -0
  120. package/src/modules/product/skills/proto-persona/examples/sample.md +97 -0
  121. package/src/modules/product/skills/proto-persona/template.md +45 -0
  122. package/src/modules/product/skills/recommendation-canvas/SKILL.md +375 -0
  123. package/src/modules/product/skills/recommendation-canvas/examples/sample.md +94 -0
  124. package/src/modules/product/skills/recommendation-canvas/template.md +86 -0
  125. package/src/modules/product/skills/roadmap-planning/SKILL.md +505 -0
  126. package/src/modules/product/skills/roadmap-planning/examples/sample.md +62 -0
  127. package/src/modules/product/skills/roadmap-planning/template.md +30 -0
  128. package/src/modules/product/skills/saas-economics-efficiency-metrics/SKILL.md +694 -0
  129. package/src/modules/product/skills/saas-economics-efficiency-metrics/examples/cash-trap.md +365 -0
  130. package/src/modules/product/skills/saas-economics-efficiency-metrics/examples/healthy-unit-economics.md +279 -0
  131. package/src/modules/product/skills/saas-economics-efficiency-metrics/template.md +263 -0
  132. package/src/modules/product/skills/saas-revenue-growth-metrics/SKILL.md +630 -0
  133. package/src/modules/product/skills/saas-revenue-growth-metrics/examples/healthy-saas.md +131 -0
  134. package/src/modules/product/skills/saas-revenue-growth-metrics/examples/warning-signs.md +229 -0
  135. package/src/modules/product/skills/saas-revenue-growth-metrics/template.md +192 -0
  136. package/src/modules/product/skills/storyboard/SKILL.md +252 -0
  137. package/src/modules/product/skills/storyboard/examples/sample.md +71 -0
  138. package/src/modules/product/skills/storyboard/template.md +41 -0
  139. package/src/modules/product/skills/tam-sam-som-calculator/SKILL.md +392 -0
  140. package/src/modules/product/skills/tam-sam-som-calculator/examples/sample.md +142 -0
  141. package/src/modules/product/skills/tam-sam-som-calculator/scripts/market-sizing.py +95 -0
  142. package/src/modules/product/skills/tam-sam-som-calculator/template.md +35 -0
  143. package/src/modules/product/skills/user-story/SKILL.md +272 -0
  144. package/src/modules/product/skills/user-story/examples/sample.md +110 -0
  145. package/src/modules/product/skills/user-story/scripts/user-story-template.py +65 -0
  146. package/src/modules/product/skills/user-story/template.md +32 -0
  147. package/src/modules/product/skills/user-story-mapping/SKILL.md +285 -0
  148. package/src/modules/product/skills/user-story-mapping/examples/sample.md +77 -0
  149. package/src/modules/product/skills/user-story-mapping/template.md +41 -0
  150. package/src/modules/product/skills/user-story-mapping-workshop/SKILL.md +477 -0
  151. package/src/modules/product/skills/user-story-mapping-workshop/template.md +28 -0
  152. package/src/modules/product/skills/user-story-splitting/SKILL.md +303 -0
  153. package/src/modules/product/skills/user-story-splitting/examples/sample.md +147 -0
  154. package/src/modules/product/skills/user-story-splitting/template.md +37 -0
  155. package/src/modules/product/skills/vp-cpo-readiness-advisor/SKILL.md +409 -0
  156. package/src/modules/product/skills/vp-cpo-readiness-advisor/examples/conversation-flow.md +95 -0
  157. package/src/modules/product/skills/workshop-facilitation/SKILL.md +87 -0
  158. package/src/modules/productivity/module.yaml +9 -0
  159. package/src/modules/productivity/skills/doc-coauthoring/SKILL.md +375 -0
  160. package/src/modules/productivity/skills/internal-comms/LICENSE.txt +202 -0
  161. package/src/modules/productivity/skills/internal-comms/SKILL.md +32 -0
  162. package/src/modules/productivity/skills/internal-comms/examples/3p-updates.md +47 -0
  163. package/src/modules/productivity/skills/internal-comms/examples/company-newsletter.md +65 -0
  164. package/src/modules/productivity/skills/internal-comms/examples/faq-answers.md +30 -0
  165. package/src/modules/productivity/skills/internal-comms/examples/general-comms.md +16 -0
  166. package/src/modules/productivity/skills/technical-writing/SKILL.md +266 -0
  167. package/src/modules/qa/module.yaml +9 -0
  168. package/src/modules/qa/skills/test-strategy/SKILL.md +263 -0
  169. package/src/modules/qa/skills/test-writer/SKILL.md +57 -0
  170. package/src/modules/qa/skills/webapp-testing/LICENSE.txt +202 -0
  171. package/src/modules/qa/skills/webapp-testing/SKILL.md +96 -0
  172. package/src/modules/qa/skills/webapp-testing/examples/console_logging.py +35 -0
  173. package/src/modules/qa/skills/webapp-testing/examples/element_discovery.py +40 -0
  174. package/src/modules/qa/skills/webapp-testing/examples/static_html_automation.py +33 -0
  175. package/src/modules/qa/skills/webapp-testing/scripts/with_server.py +106 -0
  176. package/tools/autodoc-npx-wrapper.js +34 -0
  177. package/tools/cli/autodoc-cli.js +55 -0
  178. package/tools/cli/commands/install.js +36 -0
  179. package/tools/cli/commands/status.js +35 -0
  180. package/tools/cli/commands/uninstall.js +60 -0
  181. package/tools/cli/installers/lib/core/installer.js +164 -0
  182. package/tools/cli/installers/lib/core/manifest.js +49 -0
  183. package/tools/cli/installers/lib/ide/manager.js +112 -0
  184. package/tools/cli/installers/lib/ide/platform-codes.yaml +207 -0
  185. package/tools/cli/installers/lib/modules/manager.js +59 -0
  186. package/tools/cli/lib/ui.js +199 -0
  187. package/tools/cli/lib/welcome.js +82 -0
@@ -0,0 +1,360 @@
1
+ ---
2
+ name: k8s-helm
3
+ description: Kubernetes and Helm deployment patterns. Trigger when writing Kubernetes manifests, creating Helm charts, configuring deployments/services/ingress, or managing cluster resources.
4
+ ---
5
+
6
+ # Kubernetes & Helm
7
+
8
+ Deploy applications on Kubernetes with production-ready configurations. Use Helm for templating and managing releases.
9
+
10
+ ## Core Kubernetes Resources
11
+
12
+ ### Deployment
13
+
14
+ ```yaml
15
+ # deployment.yaml
16
+ apiVersion: apps/v1
17
+ kind: Deployment
18
+ metadata:
19
+ name: api
20
+ labels:
21
+ app: api
22
+ spec:
23
+ replicas: 3
24
+ selector:
25
+ matchLabels:
26
+ app: api
27
+ strategy:
28
+ type: RollingUpdate
29
+ rollingUpdate:
30
+ maxSurge: 1
31
+ maxUnavailable: 0 # zero downtime
32
+ template:
33
+ metadata:
34
+ labels:
35
+ app: api
36
+ spec:
37
+ containers:
38
+ - name: api
39
+ image: myapp/api:1.2.3 # always use specific tags, never :latest
40
+ ports:
41
+ - containerPort: 3000
42
+ env:
43
+ - name: NODE_ENV
44
+ value: production
45
+ - name: DATABASE_URL
46
+ valueFrom:
47
+ secretKeyRef:
48
+ name: api-secrets
49
+ key: database-url
50
+ resources:
51
+ requests:
52
+ memory: "128Mi"
53
+ cpu: "100m"
54
+ limits:
55
+ memory: "512Mi"
56
+ cpu: "500m"
57
+ readinessProbe:
58
+ httpGet:
59
+ path: /health/ready
60
+ port: 3000
61
+ initialDelaySeconds: 10
62
+ periodSeconds: 5
63
+ failureThreshold: 3
64
+ livenessProbe:
65
+ httpGet:
66
+ path: /health/live
67
+ port: 3000
68
+ initialDelaySeconds: 30
69
+ periodSeconds: 10
70
+ securityContext:
71
+ runAsNonRoot: true
72
+ runAsUser: 1000
73
+ allowPrivilegeEscalation: false
74
+ readOnlyRootFilesystem: true
75
+ topologySpreadConstraints:
76
+ - maxSkew: 1
77
+ topologyKey: kubernetes.io/hostname
78
+ whenUnsatisfiable: DoNotSchedule
79
+ labelSelector:
80
+ matchLabels:
81
+ app: api
82
+ ```
83
+
84
+ ### Service
85
+
86
+ ```yaml
87
+ # service.yaml
88
+ apiVersion: v1
89
+ kind: Service
90
+ metadata:
91
+ name: api
92
+ spec:
93
+ selector:
94
+ app: api
95
+ ports:
96
+ - port: 80
97
+ targetPort: 3000
98
+ type: ClusterIP # internal only; use LoadBalancer for external
99
+ ```
100
+
101
+ ### Ingress
102
+
103
+ ```yaml
104
+ # ingress.yaml
105
+ apiVersion: networking.k8s.io/v1
106
+ kind: Ingress
107
+ metadata:
108
+ name: api
109
+ annotations:
110
+ nginx.ingress.kubernetes.io/rate-limit: "100"
111
+ cert-manager.io/cluster-issuer: letsencrypt-prod
112
+ spec:
113
+ ingressClassName: nginx
114
+ tls:
115
+ - hosts:
116
+ - api.example.com
117
+ secretName: api-tls
118
+ rules:
119
+ - host: api.example.com
120
+ http:
121
+ paths:
122
+ - path: /
123
+ pathType: Prefix
124
+ backend:
125
+ service:
126
+ name: api
127
+ port:
128
+ number: 80
129
+ ```
130
+
131
+ ### ConfigMap and Secrets
132
+
133
+ ```yaml
134
+ # configmap.yaml
135
+ apiVersion: v1
136
+ kind: ConfigMap
137
+ metadata:
138
+ name: api-config
139
+ data:
140
+ LOG_LEVEL: info
141
+ CACHE_TTL: "300"
142
+
143
+ # secret.yaml — store in Vault or external secret manager, not in Git
144
+ apiVersion: v1
145
+ kind: Secret
146
+ metadata:
147
+ name: api-secrets
148
+ type: Opaque
149
+ stringData:
150
+ database-url: "postgresql://user:pass@db:5432/app"
151
+ api-key: "sk-..."
152
+ ```
153
+
154
+ ### HorizontalPodAutoscaler
155
+
156
+ ```yaml
157
+ # hpa.yaml
158
+ apiVersion: autoscaling/v2
159
+ kind: HorizontalPodAutoscaler
160
+ metadata:
161
+ name: api
162
+ spec:
163
+ scaleTargetRef:
164
+ apiVersion: apps/v1
165
+ kind: Deployment
166
+ name: api
167
+ minReplicas: 2
168
+ maxReplicas: 20
169
+ metrics:
170
+ - type: Resource
171
+ resource:
172
+ name: cpu
173
+ target:
174
+ type: Utilization
175
+ averageUtilization: 70
176
+ - type: Resource
177
+ resource:
178
+ name: memory
179
+ target:
180
+ type: Utilization
181
+ averageUtilization: 80
182
+ ```
183
+
184
+ ## Helm Charts
185
+
186
+ ### Chart Structure
187
+
188
+ ```
189
+ my-app/
190
+ ├── Chart.yaml # chart metadata
191
+ ├── values.yaml # default values
192
+ ├── values-staging.yaml # environment overrides
193
+ ├── values-prod.yaml
194
+ └── templates/
195
+ ├── _helpers.tpl # named templates
196
+ ├── deployment.yaml
197
+ ├── service.yaml
198
+ ├── ingress.yaml
199
+ ├── hpa.yaml
200
+ └── secret.yaml
201
+ ```
202
+
203
+ ### Chart.yaml
204
+
205
+ ```yaml
206
+ apiVersion: v2
207
+ name: my-app
208
+ description: My application Helm chart
209
+ type: application
210
+ version: 0.1.0 # chart version
211
+ appVersion: "1.2.3" # app version
212
+ ```
213
+
214
+ ### values.yaml
215
+
216
+ ```yaml
217
+ replicaCount: 2
218
+
219
+ image:
220
+ repository: myapp/api
221
+ tag: "" # defaults to Chart.appVersion
222
+ pullPolicy: IfNotPresent
223
+
224
+ service:
225
+ type: ClusterIP
226
+ port: 80
227
+
228
+ ingress:
229
+ enabled: true
230
+ host: api.example.com
231
+ tls: true
232
+
233
+ resources:
234
+ requests:
235
+ cpu: 100m
236
+ memory: 128Mi
237
+ limits:
238
+ cpu: 500m
239
+ memory: 512Mi
240
+
241
+ autoscaling:
242
+ enabled: true
243
+ minReplicas: 2
244
+ maxReplicas: 10
245
+ targetCPUUtilizationPercentage: 70
246
+
247
+ env: {}
248
+ secrets: {}
249
+ ```
250
+
251
+ ### Template with Helpers
252
+
253
+ ```yaml
254
+ # templates/_helpers.tpl
255
+ {{- define "myapp.fullname" -}}
256
+ {{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" }}
257
+ {{- end }}
258
+
259
+ {{- define "myapp.labels" -}}
260
+ helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
261
+ app.kubernetes.io/name: {{ .Chart.Name }}
262
+ app.kubernetes.io/instance: {{ .Release.Name }}
263
+ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
264
+ {{- end }}
265
+
266
+ # templates/deployment.yaml
267
+ apiVersion: apps/v1
268
+ kind: Deployment
269
+ metadata:
270
+ name: {{ include "myapp.fullname" . }}
271
+ labels:
272
+ {{- include "myapp.labels" . | nindent 4 }}
273
+ spec:
274
+ replicas: {{ .Values.replicaCount }}
275
+ template:
276
+ spec:
277
+ containers:
278
+ - name: {{ .Chart.Name }}
279
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
280
+ resources:
281
+ {{- toYaml .Values.resources | nindent 12 }}
282
+ ```
283
+
284
+ ## Common kubectl Commands
285
+
286
+ ```bash
287
+ # View all resources in a namespace
288
+ kubectl get all -n my-namespace
289
+
290
+ # Describe a pod (events, resource usage)
291
+ kubectl describe pod <pod-name> -n my-namespace
292
+
293
+ # View logs
294
+ kubectl logs <pod-name> -n my-namespace
295
+ kubectl logs -l app=api -n my-namespace --tail=100 -f # follow all pods
296
+
297
+ # Execute into pod
298
+ kubectl exec -it <pod-name> -n my-namespace -- sh
299
+
300
+ # Port forward for local debugging
301
+ kubectl port-forward svc/api 3000:80 -n my-namespace
302
+
303
+ # Apply manifests
304
+ kubectl apply -f manifests/ -n my-namespace
305
+
306
+ # Scale deployment manually
307
+ kubectl scale deployment api --replicas=5 -n my-namespace
308
+
309
+ # View rollout status
310
+ kubectl rollout status deployment/api -n my-namespace
311
+
312
+ # Rollback
313
+ kubectl rollout undo deployment/api -n my-namespace
314
+ kubectl rollout history deployment/api -n my-namespace
315
+
316
+ # Resource usage
317
+ kubectl top pods -n my-namespace
318
+ kubectl top nodes
319
+ ```
320
+
321
+ ## Common Helm Commands
322
+
323
+ ```bash
324
+ # Add a chart repository
325
+ helm repo add bitnami https://charts.bitnami.com/bitnami
326
+ helm repo update
327
+
328
+ # Install a chart
329
+ helm install my-release ./my-app -n my-namespace --create-namespace
330
+
331
+ # Upgrade with new values
332
+ helm upgrade my-release ./my-app -n my-namespace \
333
+ -f values-prod.yaml \
334
+ --set image.tag=1.2.4
335
+
336
+ # Preview rendered templates (dry run)
337
+ helm template my-release ./my-app -f values-prod.yaml
338
+
339
+ # Rollback
340
+ helm rollback my-release 1 -n my-namespace
341
+
342
+ # List releases
343
+ helm list -n my-namespace
344
+
345
+ # Uninstall
346
+ helm uninstall my-release -n my-namespace
347
+ ```
348
+
349
+ ## Production Best Practices
350
+
351
+ 1. **Never use `:latest` image tags** — use specific SHAs or version tags
352
+ 2. **Always set resource requests and limits** — prevents noisy neighbor issues
353
+ 3. **Configure readiness probes** — prevents traffic to not-ready pods
354
+ 4. **Set `minReplicas: 2` for HA** — single pod = single point of failure
355
+ 5. **Use `maxUnavailable: 0`** for zero-downtime deployments
356
+ 6. **Store secrets in Vault/AWS SSM**, sync with External Secrets Operator
357
+ 7. **Set `topologySpreadConstraints`** to spread pods across nodes
358
+ 8. **Run as non-root user** in all containers
359
+ 9. **Set `readOnlyRootFilesystem: true`** where possible
360
+ 10. **Use namespaces** for environment isolation (dev, staging, prod)
@@ -0,0 +1,240 @@
1
+ ---
2
+ name: monitoring-observability
3
+ description: Logging, metrics, tracing, and alerting for production systems. Trigger when setting up observability infrastructure, adding logging to services, configuring metrics, or diagnosing production incidents.
4
+ ---
5
+
6
+ # Monitoring & Observability
7
+
8
+ Observability is the ability to understand a system's state from its outputs. The three pillars: **Logs** (what happened), **Metrics** (how much/how often), **Traces** (why it's slow).
9
+
10
+ ## The Three Pillars
11
+
12
+ ### Logs — What Happened
13
+
14
+ Structured JSON logs are searchable and parseable by log aggregation systems.
15
+
16
+ ```ts
17
+ // Use a structured logger — never console.log in production
18
+ import pino from 'pino';
19
+
20
+ const logger = pino({
21
+ level: process.env.LOG_LEVEL ?? 'info',
22
+ ...(process.env.NODE_ENV === 'development' && {
23
+ transport: { target: 'pino-pretty' }, // human-readable in dev
24
+ }),
25
+ });
26
+
27
+ // Always include context
28
+ logger.info({ userId, action: 'checkout.started', cartItems: 3 }, 'Checkout initiated');
29
+ logger.error({ err, orderId, userId }, 'Payment processing failed');
30
+ logger.warn({ latencyMs: 1500, threshold: 1000 }, 'Slow database query detected');
31
+ ```
32
+
33
+ **Log Levels:**
34
+
35
+ | Level | Use for |
36
+ |-------|---------|
37
+ | `error` | Unrecoverable errors, requires immediate attention |
38
+ | `warn` | Degraded behavior, approaching limits |
39
+ | `info` | Normal operations, key business events |
40
+ | `debug` | Detailed troubleshooting (disabled in prod) |
41
+
42
+ **What to always include:**
43
+ - `requestId` / `traceId` — correlation across services
44
+ - `userId` — for user-impacting issues
45
+ - `service` / `version` — which service logged this
46
+ - `err` — full error object (not just message)
47
+ - Relevant entity IDs (`orderId`, `productId`, etc.)
48
+
49
+ ### Metrics — How Much / How Often
50
+
51
+ ```ts
52
+ // Prometheus with prom-client
53
+ import { Counter, Histogram, Gauge, register } from 'prom-client';
54
+
55
+ // Request counter
56
+ const httpRequests = new Counter({
57
+ name: 'http_requests_total',
58
+ help: 'Total HTTP requests',
59
+ labelNames: ['method', 'route', 'status_code'],
60
+ });
61
+
62
+ // Latency histogram
63
+ const httpLatency = new Histogram({
64
+ name: 'http_request_duration_ms',
65
+ help: 'HTTP request duration in milliseconds',
66
+ labelNames: ['method', 'route'],
67
+ buckets: [5, 10, 25, 50, 100, 250, 500, 1000, 2500],
68
+ });
69
+
70
+ // Active connections gauge
71
+ const activeConnections = new Gauge({
72
+ name: 'active_connections',
73
+ help: 'Number of active connections',
74
+ });
75
+
76
+ // Middleware usage
77
+ function metricsMiddleware(req, res, next) {
78
+ const timer = httpLatency.startTimer({ method: req.method, route: req.route?.path });
79
+ res.on('finish', () => {
80
+ timer();
81
+ httpRequests.inc({ method: req.method, route: req.route?.path, status_code: res.statusCode });
82
+ });
83
+ next();
84
+ }
85
+
86
+ // Expose metrics endpoint
87
+ app.get('/metrics', async (req, res) => {
88
+ res.set('Content-Type', register.contentType);
89
+ res.end(await register.metrics());
90
+ });
91
+ ```
92
+
93
+ **Key Metrics to Track (RED method):**
94
+ - **R**ate: requests per second
95
+ - **E**rrors: error rate (%)
96
+ - **D**uration: p50, p95, p99 latency
97
+
98
+ **Business Metrics:**
99
+ - Signups, purchases, conversions per hour
100
+ - Feature usage counts
101
+ - Queue depth, job processing rate
102
+
103
+ ### Traces — Why It's Slow
104
+
105
+ ```ts
106
+ // OpenTelemetry — vendor-neutral tracing
107
+ import { NodeSDK } from '@opentelemetry/sdk-node';
108
+ import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
109
+ import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
110
+ import { ExpressInstrumentation } from '@opentelemetry/instrumentation-express';
111
+ import { PrismaInstrumentation } from '@prisma/instrumentation';
112
+
113
+ const sdk = new NodeSDK({
114
+ traceExporter: new OTLPTraceExporter({
115
+ url: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,
116
+ }),
117
+ instrumentations: [
118
+ new HttpInstrumentation(),
119
+ new ExpressInstrumentation(),
120
+ new PrismaInstrumentation(),
121
+ ],
122
+ });
123
+
124
+ sdk.start(); // Must be called before importing app code
125
+ ```
126
+
127
+ ```ts
128
+ // Custom spans for business logic
129
+ import { trace } from '@opentelemetry/api';
130
+ const tracer = trace.getTracer('my-service');
131
+
132
+ async function processOrder(orderId: string) {
133
+ return tracer.startActiveSpan('processOrder', async (span) => {
134
+ span.setAttributes({ 'order.id': orderId });
135
+ try {
136
+ const result = await doWork(orderId);
137
+ span.setStatus({ code: SpanStatusCode.OK });
138
+ return result;
139
+ } catch (err) {
140
+ span.recordException(err);
141
+ span.setStatus({ code: SpanStatusCode.ERROR });
142
+ throw err;
143
+ } finally {
144
+ span.end();
145
+ }
146
+ });
147
+ }
148
+ ```
149
+
150
+ ## Alerting
151
+
152
+ ### Alert Philosophy
153
+
154
+ Alert on **symptoms** (user impact), not causes (CPU usage).
155
+
156
+ ```yaml
157
+ # Prometheus alerting rules
158
+ groups:
159
+ - name: api
160
+ rules:
161
+ # Error rate > 5% for 5 minutes
162
+ - alert: HighErrorRate
163
+ expr: |
164
+ sum(rate(http_requests_total{status_code=~"5.."}[5m]))
165
+ / sum(rate(http_requests_total[5m])) > 0.05
166
+ for: 5m
167
+ labels:
168
+ severity: critical
169
+ annotations:
170
+ summary: "High error rate: {{ $value | humanizePercentage }}"
171
+
172
+ # p99 latency > 2 seconds
173
+ - alert: HighLatency
174
+ expr: |
175
+ histogram_quantile(0.99, rate(http_request_duration_ms_bucket[5m])) > 2000
176
+ for: 10m
177
+ labels:
178
+ severity: warning
179
+
180
+ # Service down
181
+ - alert: ServiceDown
182
+ expr: up == 0
183
+ for: 1m
184
+ labels:
185
+ severity: critical
186
+ ```
187
+
188
+ ### Runbook Template
189
+
190
+ Every alert should link to a runbook:
191
+
192
+ ```markdown
193
+ # Alert: HighErrorRate
194
+
195
+ ## Impact
196
+ Users are seeing 5xx errors. Checkout and API calls may be failing.
197
+
198
+ ## Diagnosis Steps
199
+ 1. Check error logs: `kubectl logs -l app=api --tail=100`
200
+ 2. Check recent deploys: `kubectl rollout history deployment/api`
201
+ 3. Check database connectivity: `kubectl exec -it <pod> -- psql $DATABASE_URL -c '\l'`
202
+
203
+ ## Resolution
204
+ - If recent deploy: `kubectl rollout undo deployment/api`
205
+ - If DB issue: check RDS console for CPU/connections
206
+ - If memory: `kubectl top pods`
207
+ ```
208
+
209
+ ## Health Checks
210
+
211
+ ```ts
212
+ // Kubernetes-compatible health endpoints
213
+ app.get('/health/live', (req, res) => {
214
+ // Liveness: is the process running? Return 200 if so.
215
+ res.json({ status: 'ok' });
216
+ });
217
+
218
+ app.get('/health/ready', async (req, res) => {
219
+ // Readiness: can the service handle traffic?
220
+ try {
221
+ await db.$queryRaw`SELECT 1`;
222
+ await redis.ping();
223
+ res.json({ status: 'ready', checks: { database: 'ok', cache: 'ok' } });
224
+ } catch (err) {
225
+ res.status(503).json({ status: 'not ready', error: err.message });
226
+ }
227
+ });
228
+ ```
229
+
230
+ ## Production Checklist
231
+
232
+ - [ ] Structured logging (JSON) with consistent fields
233
+ - [ ] Request ID propagated across all service calls
234
+ - [ ] `/health/live` and `/health/ready` endpoints
235
+ - [ ] Metrics exposed at `/metrics` (Prometheus format)
236
+ - [ ] Distributed tracing configured (OpenTelemetry)
237
+ - [ ] Alerts for error rate, latency, and uptime
238
+ - [ ] Runbooks linked from alerts
239
+ - [ ] Log retention policy set (30-90 days typical)
240
+ - [ ] Sensitive data excluded from logs (passwords, tokens, PII)
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: security-auditor
3
+ description: Security vulnerability scanning and remediation for web applications and APIs. Use when you need a security review of code, dependencies, or infrastructure configuration. Triggers on "check for security issues", "audit my code", "is this secure", "review for vulnerabilities", "OWASP check", or "find security bugs".
4
+ ---
5
+
6
+ You are a security specialist focused on identifying and remediating vulnerabilities in application code.
7
+
8
+ ## Audit Scope
9
+
10
+ ### OWASP Top 10 Checks
11
+
12
+ **A01 - Broken Access Control**
13
+ - Missing authorization checks on endpoints
14
+ - IDOR (Insecure Direct Object Reference) — can users access others' resources?
15
+ - Missing function-level access control
16
+ - CORS misconfiguration allowing unauthorized origins
17
+ - JWT validation gaps (missing expiry check, weak signing)
18
+
19
+ **A02 - Cryptographic Failures**
20
+ - Sensitive data transmitted over HTTP
21
+ - Weak hashing algorithms (MD5, SHA1 for passwords)
22
+ - Hardcoded secrets, API keys, or credentials
23
+ - Missing encryption for PII at rest
24
+
25
+ **A03 - Injection**
26
+ - SQL injection via string concatenation
27
+ - XSS via unescaped user input in HTML
28
+ - Command injection via shell execution with user input
29
+ - Path traversal in file operations
30
+ - Template injection
31
+
32
+ **A04 - Insecure Design**
33
+ - Missing rate limiting on authentication endpoints
34
+ - No account lockout after failed attempts
35
+ - Predictable resource IDs
36
+ - Missing CSRF protection on state-changing operations
37
+
38
+ **A05 - Security Misconfiguration**
39
+ - Debug mode enabled in production configs
40
+ - Default credentials or configurations
41
+ - Unnecessary HTTP headers exposed
42
+ - Directory listing enabled
43
+ - Stack traces exposed in error responses
44
+
45
+ **A06 - Vulnerable Components**
46
+ - Known CVEs in dependencies (check package.json / requirements.txt)
47
+ - Outdated frameworks with known vulnerabilities
48
+ - Unmaintained dependencies
49
+
50
+ **A07 - Authentication Failures**
51
+ - Weak password policies
52
+ - Missing MFA support
53
+ - Session tokens in URLs
54
+ - Tokens not invalidated on logout
55
+
56
+ **A08 - Data Integrity Failures**
57
+ - Unsigned or unverified data from external sources
58
+ - Missing integrity checks on CI/CD pipeline
59
+ - Deserialization of untrusted data
60
+
61
+ **A09 - Logging & Monitoring Failures**
62
+ - Sensitive data logged (passwords, tokens, PII)
63
+ - Missing audit logs for sensitive operations
64
+ - No alerting on suspicious activity patterns
65
+
66
+ **A10 - SSRF**
67
+ - Unvalidated URLs in server-side requests
68
+ - Internal network exposure via URL parameters
69
+
70
+ ## Process
71
+
72
+ ### Step 1: Scan
73
+ 1. Map all entry points (API routes, form handlers, webhooks)
74
+ 2. Identify data flows from user input to storage/output
75
+ 3. Check authentication and authorization on every endpoint
76
+ 4. Review dependency versions for known vulnerabilities
77
+
78
+ ### Step 2: Analyze
79
+ For each finding:
80
+ - **Severity**: Critical / High / Medium / Low
81
+ - **Evidence**: Exact file and line
82
+ - **Exploitation**: How it could be exploited
83
+ - **Remediation**: Specific code fix
84
+
85
+ ### Step 3: Report
86
+ ```
87
+ ## Security Audit Report
88
+
89
+ ### Critical
90
+ - [file:line] [vulnerability type] — [description] — [fix]
91
+
92
+ ### High
93
+ - [file:line] [vulnerability type] — [description] — [fix]
94
+
95
+ ### Medium / Low
96
+ - [file:line] [vulnerability type] — [description] — [fix]
97
+
98
+ ### Recommendations
99
+ - [general security improvements]
100
+ ```
101
+
102
+ ## Rules
103
+ - Never disclose exploitation details in ways that could be misused
104
+ - Prioritize by actual risk, not theoretical possibility
105
+ - Include concrete remediation code, not just descriptions