tech-hub-skills 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 (133) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +250 -0
  3. package/bin/cli.js +241 -0
  4. package/bin/copilot.js +182 -0
  5. package/bin/postinstall.js +42 -0
  6. package/package.json +46 -0
  7. package/tech_hub_skills/roles/ai-engineer/skills/01-prompt-engineering/README.md +252 -0
  8. package/tech_hub_skills/roles/ai-engineer/skills/02-rag-pipeline/README.md +448 -0
  9. package/tech_hub_skills/roles/ai-engineer/skills/03-agent-orchestration/README.md +599 -0
  10. package/tech_hub_skills/roles/ai-engineer/skills/04-llm-guardrails/README.md +735 -0
  11. package/tech_hub_skills/roles/ai-engineer/skills/05-vector-embeddings/README.md +711 -0
  12. package/tech_hub_skills/roles/ai-engineer/skills/06-llm-evaluation/README.md +777 -0
  13. package/tech_hub_skills/roles/azure/skills/01-infrastructure-fundamentals/README.md +264 -0
  14. package/tech_hub_skills/roles/azure/skills/02-data-factory/README.md +264 -0
  15. package/tech_hub_skills/roles/azure/skills/03-synapse-analytics/README.md +264 -0
  16. package/tech_hub_skills/roles/azure/skills/04-databricks/README.md +264 -0
  17. package/tech_hub_skills/roles/azure/skills/05-functions/README.md +264 -0
  18. package/tech_hub_skills/roles/azure/skills/06-kubernetes-service/README.md +264 -0
  19. package/tech_hub_skills/roles/azure/skills/07-openai-service/README.md +264 -0
  20. package/tech_hub_skills/roles/azure/skills/08-machine-learning/README.md +264 -0
  21. package/tech_hub_skills/roles/azure/skills/09-storage-adls/README.md +264 -0
  22. package/tech_hub_skills/roles/azure/skills/10-networking/README.md +264 -0
  23. package/tech_hub_skills/roles/azure/skills/11-sql-cosmos/README.md +264 -0
  24. package/tech_hub_skills/roles/azure/skills/12-event-hubs/README.md +264 -0
  25. package/tech_hub_skills/roles/code-review/skills/01-automated-code-review/README.md +394 -0
  26. package/tech_hub_skills/roles/code-review/skills/02-pr-review-workflow/README.md +427 -0
  27. package/tech_hub_skills/roles/code-review/skills/03-code-quality-gates/README.md +518 -0
  28. package/tech_hub_skills/roles/code-review/skills/04-reviewer-assignment/README.md +504 -0
  29. package/tech_hub_skills/roles/code-review/skills/05-review-analytics/README.md +540 -0
  30. package/tech_hub_skills/roles/data-engineer/skills/01-lakehouse-architecture/README.md +550 -0
  31. package/tech_hub_skills/roles/data-engineer/skills/02-etl-pipeline/README.md +580 -0
  32. package/tech_hub_skills/roles/data-engineer/skills/03-data-quality/README.md +579 -0
  33. package/tech_hub_skills/roles/data-engineer/skills/04-streaming-pipelines/README.md +608 -0
  34. package/tech_hub_skills/roles/data-engineer/skills/05-performance-optimization/README.md +547 -0
  35. package/tech_hub_skills/roles/data-governance/skills/01-data-catalog/README.md +112 -0
  36. package/tech_hub_skills/roles/data-governance/skills/02-data-lineage/README.md +129 -0
  37. package/tech_hub_skills/roles/data-governance/skills/03-data-quality-framework/README.md +182 -0
  38. package/tech_hub_skills/roles/data-governance/skills/04-access-control/README.md +39 -0
  39. package/tech_hub_skills/roles/data-governance/skills/05-master-data-management/README.md +40 -0
  40. package/tech_hub_skills/roles/data-governance/skills/06-compliance-privacy/README.md +46 -0
  41. package/tech_hub_skills/roles/data-scientist/skills/01-eda-automation/README.md +230 -0
  42. package/tech_hub_skills/roles/data-scientist/skills/02-statistical-modeling/README.md +264 -0
  43. package/tech_hub_skills/roles/data-scientist/skills/03-feature-engineering/README.md +264 -0
  44. package/tech_hub_skills/roles/data-scientist/skills/04-predictive-modeling/README.md +264 -0
  45. package/tech_hub_skills/roles/data-scientist/skills/05-customer-analytics/README.md +264 -0
  46. package/tech_hub_skills/roles/data-scientist/skills/06-campaign-analysis/README.md +264 -0
  47. package/tech_hub_skills/roles/data-scientist/skills/07-experimentation/README.md +264 -0
  48. package/tech_hub_skills/roles/data-scientist/skills/08-data-visualization/README.md +264 -0
  49. package/tech_hub_skills/roles/devops/skills/01-cicd-pipeline/README.md +264 -0
  50. package/tech_hub_skills/roles/devops/skills/02-container-orchestration/README.md +264 -0
  51. package/tech_hub_skills/roles/devops/skills/03-infrastructure-as-code/README.md +264 -0
  52. package/tech_hub_skills/roles/devops/skills/04-gitops/README.md +264 -0
  53. package/tech_hub_skills/roles/devops/skills/05-environment-management/README.md +264 -0
  54. package/tech_hub_skills/roles/devops/skills/06-automated-testing/README.md +264 -0
  55. package/tech_hub_skills/roles/devops/skills/07-release-management/README.md +264 -0
  56. package/tech_hub_skills/roles/devops/skills/08-monitoring-alerting/README.md +264 -0
  57. package/tech_hub_skills/roles/devops/skills/09-devsecops/README.md +265 -0
  58. package/tech_hub_skills/roles/finops/skills/01-cost-visibility/README.md +264 -0
  59. package/tech_hub_skills/roles/finops/skills/02-resource-tagging/README.md +264 -0
  60. package/tech_hub_skills/roles/finops/skills/03-budget-management/README.md +264 -0
  61. package/tech_hub_skills/roles/finops/skills/04-reserved-instances/README.md +264 -0
  62. package/tech_hub_skills/roles/finops/skills/05-spot-optimization/README.md +264 -0
  63. package/tech_hub_skills/roles/finops/skills/06-storage-tiering/README.md +264 -0
  64. package/tech_hub_skills/roles/finops/skills/07-compute-rightsizing/README.md +264 -0
  65. package/tech_hub_skills/roles/finops/skills/08-chargeback/README.md +264 -0
  66. package/tech_hub_skills/roles/ml-engineer/skills/01-mlops-pipeline/README.md +566 -0
  67. package/tech_hub_skills/roles/ml-engineer/skills/02-feature-engineering/README.md +655 -0
  68. package/tech_hub_skills/roles/ml-engineer/skills/03-model-training/README.md +704 -0
  69. package/tech_hub_skills/roles/ml-engineer/skills/04-model-serving/README.md +845 -0
  70. package/tech_hub_skills/roles/ml-engineer/skills/05-model-monitoring/README.md +874 -0
  71. package/tech_hub_skills/roles/mlops/skills/01-ml-pipeline-orchestration/README.md +264 -0
  72. package/tech_hub_skills/roles/mlops/skills/02-experiment-tracking/README.md +264 -0
  73. package/tech_hub_skills/roles/mlops/skills/03-model-registry/README.md +264 -0
  74. package/tech_hub_skills/roles/mlops/skills/04-feature-store/README.md +264 -0
  75. package/tech_hub_skills/roles/mlops/skills/05-model-deployment/README.md +264 -0
  76. package/tech_hub_skills/roles/mlops/skills/06-model-observability/README.md +264 -0
  77. package/tech_hub_skills/roles/mlops/skills/07-data-versioning/README.md +264 -0
  78. package/tech_hub_skills/roles/mlops/skills/08-ab-testing/README.md +264 -0
  79. package/tech_hub_skills/roles/mlops/skills/09-automated-retraining/README.md +264 -0
  80. package/tech_hub_skills/roles/platform-engineer/skills/01-internal-developer-platform/README.md +153 -0
  81. package/tech_hub_skills/roles/platform-engineer/skills/02-self-service-infrastructure/README.md +57 -0
  82. package/tech_hub_skills/roles/platform-engineer/skills/03-slo-sli-management/README.md +59 -0
  83. package/tech_hub_skills/roles/platform-engineer/skills/04-developer-experience/README.md +57 -0
  84. package/tech_hub_skills/roles/platform-engineer/skills/05-incident-management/README.md +73 -0
  85. package/tech_hub_skills/roles/platform-engineer/skills/06-capacity-management/README.md +59 -0
  86. package/tech_hub_skills/roles/product-designer/skills/01-requirements-discovery/README.md +407 -0
  87. package/tech_hub_skills/roles/product-designer/skills/02-user-research/README.md +382 -0
  88. package/tech_hub_skills/roles/product-designer/skills/03-brainstorming-ideation/README.md +437 -0
  89. package/tech_hub_skills/roles/product-designer/skills/04-ux-design/README.md +496 -0
  90. package/tech_hub_skills/roles/product-designer/skills/05-product-market-fit/README.md +376 -0
  91. package/tech_hub_skills/roles/product-designer/skills/06-stakeholder-management/README.md +412 -0
  92. package/tech_hub_skills/roles/security-architect/skills/01-pii-detection/README.md +319 -0
  93. package/tech_hub_skills/roles/security-architect/skills/02-threat-modeling/README.md +264 -0
  94. package/tech_hub_skills/roles/security-architect/skills/03-infrastructure-security/README.md +264 -0
  95. package/tech_hub_skills/roles/security-architect/skills/04-iam/README.md +264 -0
  96. package/tech_hub_skills/roles/security-architect/skills/05-application-security/README.md +264 -0
  97. package/tech_hub_skills/roles/security-architect/skills/06-secrets-management/README.md +264 -0
  98. package/tech_hub_skills/roles/security-architect/skills/07-security-monitoring/README.md +264 -0
  99. package/tech_hub_skills/roles/system-design/skills/01-architecture-patterns/README.md +337 -0
  100. package/tech_hub_skills/roles/system-design/skills/02-requirements-engineering/README.md +264 -0
  101. package/tech_hub_skills/roles/system-design/skills/03-scalability/README.md +264 -0
  102. package/tech_hub_skills/roles/system-design/skills/04-high-availability/README.md +264 -0
  103. package/tech_hub_skills/roles/system-design/skills/05-cost-optimization-design/README.md +264 -0
  104. package/tech_hub_skills/roles/system-design/skills/06-api-design/README.md +264 -0
  105. package/tech_hub_skills/roles/system-design/skills/07-observability-architecture/README.md +264 -0
  106. package/tech_hub_skills/roles/system-design/skills/08-process-automation/PROCESS_TEMPLATE.md +336 -0
  107. package/tech_hub_skills/roles/system-design/skills/08-process-automation/README.md +521 -0
  108. package/tech_hub_skills/skills/README.md +336 -0
  109. package/tech_hub_skills/skills/ai-engineer.md +104 -0
  110. package/tech_hub_skills/skills/azure.md +149 -0
  111. package/tech_hub_skills/skills/code-review.md +399 -0
  112. package/tech_hub_skills/skills/compliance-automation.md +747 -0
  113. package/tech_hub_skills/skills/data-engineer.md +113 -0
  114. package/tech_hub_skills/skills/data-governance.md +102 -0
  115. package/tech_hub_skills/skills/data-scientist.md +123 -0
  116. package/tech_hub_skills/skills/devops.md +160 -0
  117. package/tech_hub_skills/skills/docker.md +160 -0
  118. package/tech_hub_skills/skills/enterprise-dashboard.md +613 -0
  119. package/tech_hub_skills/skills/finops.md +184 -0
  120. package/tech_hub_skills/skills/ml-engineer.md +115 -0
  121. package/tech_hub_skills/skills/mlops.md +187 -0
  122. package/tech_hub_skills/skills/optimization-advisor.md +329 -0
  123. package/tech_hub_skills/skills/orchestrator.md +497 -0
  124. package/tech_hub_skills/skills/platform-engineer.md +102 -0
  125. package/tech_hub_skills/skills/process-automation.md +226 -0
  126. package/tech_hub_skills/skills/process-changelog.md +184 -0
  127. package/tech_hub_skills/skills/process-documentation.md +484 -0
  128. package/tech_hub_skills/skills/process-kanban.md +324 -0
  129. package/tech_hub_skills/skills/process-versioning.md +214 -0
  130. package/tech_hub_skills/skills/product-designer.md +104 -0
  131. package/tech_hub_skills/skills/project-starter.md +443 -0
  132. package/tech_hub_skills/skills/security-architect.md +135 -0
  133. package/tech_hub_skills/skills/system-design.md +126 -0
@@ -0,0 +1,613 @@
1
+ # Enterprise Dashboard & Monitoring
2
+
3
+ Centralized visibility into security, compliance, governance, and operational metrics for enterprise applications.
4
+
5
+ ## Role Overview
6
+
7
+ **Agent**: Enterprise Dashboard Specialist
8
+ **Focus**: Real-time monitoring, alerting, dashboards, and operational visibility
9
+ **Integration**: Aggregates data from all enterprise skills
10
+
11
+ ## When to Use
12
+
13
+ Invoke this role when you need to:
14
+ - Create unified dashboards for enterprise metrics
15
+ - Set up alerting for security and compliance events
16
+ - Monitor SLOs across the platform
17
+ - Track governance and audit metrics
18
+ - Visualize data lineage and access patterns
19
+
20
+ ## Dashboard Components
21
+
22
+ ### 1. Security Dashboard
23
+
24
+ ```yaml
25
+ # security-dashboard.yml
26
+ panels:
27
+ - title: "Security Posture Score"
28
+ type: gauge
29
+ metrics:
30
+ - vulnerability_count
31
+ - compliance_score
32
+ - incident_count
33
+ thresholds:
34
+ critical: 60
35
+ warning: 80
36
+ healthy: 95
37
+
38
+ - title: "Active Vulnerabilities"
39
+ type: stat
40
+ breakdown:
41
+ - critical
42
+ - high
43
+ - medium
44
+ - low
45
+
46
+ - title: "Security Events (24h)"
47
+ type: timeseries
48
+ metrics:
49
+ - authentication_failures
50
+ - authorization_denials
51
+ - suspicious_activities
52
+
53
+ - title: "Secrets Exposure"
54
+ type: stat
55
+ metrics:
56
+ - exposed_secrets_count
57
+ - secrets_rotation_due
58
+
59
+ - title: "Container Security"
60
+ type: table
61
+ columns:
62
+ - image_name
63
+ - vulnerability_count
64
+ - last_scanned
65
+ ```
66
+
67
+ ### 2. Compliance Dashboard
68
+
69
+ ```yaml
70
+ # compliance-dashboard.yml
71
+ panels:
72
+ - title: "Compliance Score by Framework"
73
+ type: barchart
74
+ frameworks:
75
+ - SOC2
76
+ - GDPR
77
+ - HIPAA
78
+ - PCI-DSS
79
+
80
+ - title: "Control Status"
81
+ type: piechart
82
+ statuses:
83
+ - passed
84
+ - failed
85
+ - warning
86
+ - not_applicable
87
+
88
+ - title: "Audit Trail Activity"
89
+ type: timeseries
90
+ metrics:
91
+ - audit_events_per_hour
92
+ - compliance_checks_run
93
+
94
+ - title: "Open Findings"
95
+ type: table
96
+ columns:
97
+ - finding_id
98
+ - severity
99
+ - framework
100
+ - age_days
101
+ - owner
102
+
103
+ - title: "Evidence Collection"
104
+ type: stat
105
+ metrics:
106
+ - evidence_artifacts_count
107
+ - last_evidence_generated
108
+ ```
109
+
110
+ ### 3. Data Governance Dashboard
111
+
112
+ ```yaml
113
+ # governance-dashboard.yml
114
+ panels:
115
+ - title: "Data Catalog Coverage"
116
+ type: gauge
117
+ target: 100%
118
+
119
+ - title: "Data Quality Score"
120
+ type: stat
121
+ dimensions:
122
+ - completeness
123
+ - accuracy
124
+ - timeliness
125
+ - consistency
126
+
127
+ - title: "PII Data Locations"
128
+ type: geomap
129
+ data: pii_distribution
130
+
131
+ - title: "Access Requests"
132
+ type: timeseries
133
+ metrics:
134
+ - approved_requests
135
+ - denied_requests
136
+ - pending_requests
137
+
138
+ - title: "Data Lineage"
139
+ type: flowchart
140
+ show: critical_data_flows
141
+ ```
142
+
143
+ ### 4. Code Review Dashboard
144
+
145
+ ```yaml
146
+ # code-review-dashboard.yml
147
+ panels:
148
+ - title: "Review Cycle Time"
149
+ type: timeseries
150
+ metrics:
151
+ - avg_time_to_first_review
152
+ - avg_time_to_approval
153
+ - avg_cycle_time
154
+
155
+ - title: "SLO Compliance"
156
+ type: gauge
157
+ slos:
158
+ - first_review_4h
159
+ - approval_24h
160
+ - merge_48h
161
+
162
+ - title: "Reviewer Load"
163
+ type: barchart
164
+ by: reviewer
165
+
166
+ - title: "PR Size Distribution"
167
+ type: piechart
168
+ categories: [XS, S, M, L, XL]
169
+
170
+ - title: "Quality Gate Pass Rate"
171
+ type: stat
172
+ breakdown_by: gate_type
173
+ ```
174
+
175
+ ## Implementation
176
+
177
+ ### Grafana Dashboard as Code
178
+
179
+ ```json
180
+ {
181
+ "dashboard": {
182
+ "title": "Enterprise Overview",
183
+ "uid": "enterprise-overview",
184
+ "tags": ["enterprise", "overview"],
185
+ "timezone": "browser",
186
+ "refresh": "5m",
187
+ "rows": [
188
+ {
189
+ "title": "Executive Summary",
190
+ "panels": [
191
+ {
192
+ "title": "Overall Health Score",
193
+ "type": "gauge",
194
+ "datasource": "prometheus",
195
+ "targets": [
196
+ {
197
+ "expr": "(security_score + compliance_score + quality_score) / 3"
198
+ }
199
+ ],
200
+ "fieldConfig": {
201
+ "defaults": {
202
+ "thresholds": {
203
+ "steps": [
204
+ {"color": "red", "value": null},
205
+ {"color": "yellow", "value": 70},
206
+ {"color": "green", "value": 90}
207
+ ]
208
+ },
209
+ "min": 0,
210
+ "max": 100
211
+ }
212
+ }
213
+ },
214
+ {
215
+ "title": "Active Incidents",
216
+ "type": "stat",
217
+ "datasource": "prometheus",
218
+ "targets": [
219
+ {"expr": "sum(active_incidents)"}
220
+ ],
221
+ "fieldConfig": {
222
+ "defaults": {
223
+ "thresholds": {
224
+ "steps": [
225
+ {"color": "green", "value": null},
226
+ {"color": "yellow", "value": 1},
227
+ {"color": "red", "value": 5}
228
+ ]
229
+ }
230
+ }
231
+ }
232
+ },
233
+ {
234
+ "title": "Compliance Status",
235
+ "type": "stat",
236
+ "datasource": "prometheus",
237
+ "targets": [
238
+ {"expr": "compliance_passing_controls / compliance_total_controls * 100"}
239
+ ]
240
+ },
241
+ {
242
+ "title": "Open PRs Awaiting Review",
243
+ "type": "stat",
244
+ "datasource": "github",
245
+ "targets": [
246
+ {"query": "count(open_prs where status = 'awaiting_review')"}
247
+ ]
248
+ }
249
+ ]
250
+ },
251
+ {
252
+ "title": "Security",
253
+ "panels": [
254
+ {
255
+ "title": "Vulnerabilities by Severity",
256
+ "type": "barchart",
257
+ "datasource": "security-scanner",
258
+ "targets": [
259
+ {"expr": "vulnerabilities_count by (severity)"}
260
+ ]
261
+ },
262
+ {
263
+ "title": "Security Events Timeline",
264
+ "type": "timeseries",
265
+ "datasource": "prometheus",
266
+ "targets": [
267
+ {"expr": "rate(security_events_total[5m])", "legendFormat": "Events/min"}
268
+ ]
269
+ }
270
+ ]
271
+ },
272
+ {
273
+ "title": "Delivery Metrics",
274
+ "panels": [
275
+ {
276
+ "title": "Deployment Frequency",
277
+ "type": "stat",
278
+ "datasource": "prometheus",
279
+ "targets": [
280
+ {"expr": "sum(increase(deployments_total[7d]))"}
281
+ ]
282
+ },
283
+ {
284
+ "title": "Lead Time for Changes",
285
+ "type": "gauge",
286
+ "datasource": "prometheus",
287
+ "targets": [
288
+ {"expr": "avg(lead_time_hours)"}
289
+ ]
290
+ },
291
+ {
292
+ "title": "Change Failure Rate",
293
+ "type": "stat",
294
+ "datasource": "prometheus",
295
+ "targets": [
296
+ {"expr": "failed_deployments / total_deployments * 100"}
297
+ ]
298
+ },
299
+ {
300
+ "title": "MTTR",
301
+ "type": "stat",
302
+ "datasource": "prometheus",
303
+ "targets": [
304
+ {"expr": "avg(incident_recovery_time_minutes)"}
305
+ ]
306
+ }
307
+ ]
308
+ }
309
+ ]
310
+ }
311
+ }
312
+ ```
313
+
314
+ ### Alerting Rules
315
+
316
+ ```yaml
317
+ # alerting-rules.yml
318
+ groups:
319
+ - name: security-alerts
320
+ rules:
321
+ - alert: CriticalVulnerabilityDetected
322
+ expr: vulnerabilities_critical > 0
323
+ for: 0m
324
+ labels:
325
+ severity: critical
326
+ team: security
327
+ annotations:
328
+ summary: "Critical vulnerability detected"
329
+ description: "{{ $value }} critical vulnerabilities found"
330
+
331
+ - alert: SecretsExposed
332
+ expr: exposed_secrets_count > 0
333
+ for: 0m
334
+ labels:
335
+ severity: critical
336
+ team: security
337
+ annotations:
338
+ summary: "Exposed secrets detected"
339
+ runbook: "https://wiki/runbooks/secrets-exposure"
340
+
341
+ - alert: UnusualAccessPattern
342
+ expr: access_anomaly_score > 0.9
343
+ for: 5m
344
+ labels:
345
+ severity: high
346
+ team: security
347
+ annotations:
348
+ summary: "Unusual access pattern detected"
349
+
350
+ - name: compliance-alerts
351
+ rules:
352
+ - alert: ComplianceControlFailed
353
+ expr: compliance_control_status == 0
354
+ for: 0m
355
+ labels:
356
+ severity: high
357
+ team: compliance
358
+ annotations:
359
+ summary: "Compliance control failed: {{ $labels.control }}"
360
+
361
+ - alert: AuditLogGap
362
+ expr: time() - audit_last_event_timestamp > 3600
363
+ for: 5m
364
+ labels:
365
+ severity: medium
366
+ annotations:
367
+ summary: "No audit events in the last hour"
368
+
369
+ - name: code-review-alerts
370
+ rules:
371
+ - alert: PRReviewSLOBreach
372
+ expr: pr_time_without_review_hours > 24
373
+ for: 0m
374
+ labels:
375
+ severity: medium
376
+ team: engineering
377
+ annotations:
378
+ summary: "PR #{{ $labels.pr_number }} waiting > 24h for review"
379
+
380
+ - alert: ReviewerOverloaded
381
+ expr: reviewer_active_prs > 7
382
+ for: 0m
383
+ labels:
384
+ severity: low
385
+ annotations:
386
+ summary: "Reviewer {{ $labels.reviewer }} has too many active reviews"
387
+
388
+ - name: data-governance-alerts
389
+ rules:
390
+ - alert: DataQualityDegraded
391
+ expr: data_quality_score < 0.8
392
+ for: 15m
393
+ labels:
394
+ severity: medium
395
+ team: data
396
+ annotations:
397
+ summary: "Data quality below threshold for {{ $labels.dataset }}"
398
+
399
+ - alert: PIIAccessAnomaly
400
+ expr: pii_access_anomaly_score > 0.8
401
+ for: 5m
402
+ labels:
403
+ severity: high
404
+ team: security
405
+ annotations:
406
+ summary: "Unusual PII access pattern detected"
407
+ ```
408
+
409
+ ### Dashboard Generator Script
410
+
411
+ ```python
412
+ #!/usr/bin/env python3
413
+ """Generate enterprise dashboards from configuration."""
414
+
415
+ import json
416
+ from dataclasses import dataclass
417
+ from typing import List, Dict, Any
418
+
419
+ @dataclass
420
+ class Panel:
421
+ """Dashboard panel configuration."""
422
+ title: str
423
+ panel_type: str
424
+ datasource: str
425
+ queries: List[str]
426
+ thresholds: Dict[str, int] = None
427
+ position: Dict[str, int] = None
428
+
429
+ @dataclass
430
+ class Dashboard:
431
+ """Complete dashboard configuration."""
432
+ title: str
433
+ uid: str
434
+ panels: List[Panel]
435
+ refresh: str = "5m"
436
+
437
+ class DashboardGenerator:
438
+ """Generate Grafana dashboards from templates."""
439
+
440
+ def __init__(self):
441
+ self.templates = {
442
+ "security": self._security_template,
443
+ "compliance": self._compliance_template,
444
+ "code-review": self._code_review_template,
445
+ "governance": self._governance_template,
446
+ }
447
+
448
+ def generate(self, template_name: str) -> Dict[str, Any]:
449
+ """Generate dashboard from template."""
450
+ if template_name not in self.templates:
451
+ raise ValueError(f"Unknown template: {template_name}")
452
+
453
+ return self.templates[template_name]()
454
+
455
+ def _security_template(self) -> Dict:
456
+ """Generate security dashboard."""
457
+ return {
458
+ "dashboard": {
459
+ "title": "Security Overview",
460
+ "uid": "security-overview",
461
+ "panels": [
462
+ {
463
+ "title": "Security Score",
464
+ "type": "gauge",
465
+ "gridPos": {"x": 0, "y": 0, "w": 6, "h": 8},
466
+ "targets": [{"expr": "security_posture_score"}],
467
+ },
468
+ {
469
+ "title": "Vulnerabilities",
470
+ "type": "stat",
471
+ "gridPos": {"x": 6, "y": 0, "w": 6, "h": 4},
472
+ "targets": [{"expr": "sum(vulnerabilities_count)"}],
473
+ },
474
+ {
475
+ "title": "Security Events",
476
+ "type": "timeseries",
477
+ "gridPos": {"x": 12, "y": 0, "w": 12, "h": 8},
478
+ "targets": [
479
+ {"expr": "rate(security_events_total[5m])", "legendFormat": "Events"}
480
+ ],
481
+ },
482
+ ]
483
+ }
484
+ }
485
+
486
+ def _compliance_template(self) -> Dict:
487
+ """Generate compliance dashboard."""
488
+ return {
489
+ "dashboard": {
490
+ "title": "Compliance Status",
491
+ "uid": "compliance-status",
492
+ "panels": [
493
+ {
494
+ "title": "SOC 2 Compliance",
495
+ "type": "gauge",
496
+ "gridPos": {"x": 0, "y": 0, "w": 6, "h": 6},
497
+ "targets": [{"expr": "soc2_compliance_score"}],
498
+ },
499
+ {
500
+ "title": "GDPR Compliance",
501
+ "type": "gauge",
502
+ "gridPos": {"x": 6, "y": 0, "w": 6, "h": 6},
503
+ "targets": [{"expr": "gdpr_compliance_score"}],
504
+ },
505
+ {
506
+ "title": "Open Findings",
507
+ "type": "table",
508
+ "gridPos": {"x": 0, "y": 6, "w": 24, "h": 10},
509
+ "targets": [{"expr": "compliance_findings"}],
510
+ },
511
+ ]
512
+ }
513
+ }
514
+
515
+ def _code_review_template(self) -> Dict:
516
+ """Generate code review dashboard."""
517
+ return {
518
+ "dashboard": {
519
+ "title": "Code Review Metrics",
520
+ "uid": "code-review-metrics",
521
+ "panels": [
522
+ {
523
+ "title": "Avg Time to First Review",
524
+ "type": "stat",
525
+ "gridPos": {"x": 0, "y": 0, "w": 6, "h": 4},
526
+ "targets": [{"expr": "avg(pr_time_to_first_review_hours)"}],
527
+ },
528
+ {
529
+ "title": "Review Cycle Time Trend",
530
+ "type": "timeseries",
531
+ "gridPos": {"x": 6, "y": 0, "w": 18, "h": 8},
532
+ "targets": [
533
+ {"expr": "avg(pr_cycle_time_hours)", "legendFormat": "Cycle Time"}
534
+ ],
535
+ },
536
+ {
537
+ "title": "Reviewer Load",
538
+ "type": "barchart",
539
+ "gridPos": {"x": 0, "y": 8, "w": 12, "h": 8},
540
+ "targets": [{"expr": "reviews_per_person by (reviewer)"}],
541
+ },
542
+ ]
543
+ }
544
+ }
545
+
546
+ def _governance_template(self) -> Dict:
547
+ """Generate data governance dashboard."""
548
+ return {
549
+ "dashboard": {
550
+ "title": "Data Governance",
551
+ "uid": "data-governance",
552
+ "panels": [
553
+ {
554
+ "title": "Data Catalog Coverage",
555
+ "type": "gauge",
556
+ "gridPos": {"x": 0, "y": 0, "w": 8, "h": 6},
557
+ "targets": [{"expr": "catalog_coverage_percent"}],
558
+ },
559
+ {
560
+ "title": "Data Quality Score",
561
+ "type": "gauge",
562
+ "gridPos": {"x": 8, "y": 0, "w": 8, "h": 6},
563
+ "targets": [{"expr": "data_quality_score"}],
564
+ },
565
+ {
566
+ "title": "PII Distribution",
567
+ "type": "piechart",
568
+ "gridPos": {"x": 16, "y": 0, "w": 8, "h": 6},
569
+ "targets": [{"expr": "pii_count by (classification)"}],
570
+ },
571
+ ]
572
+ }
573
+ }
574
+
575
+ def export_all(self, output_dir: str = "dashboards") -> None:
576
+ """Export all dashboards to JSON files."""
577
+ import os
578
+ os.makedirs(output_dir, exist_ok=True)
579
+
580
+ for name, template_fn in self.templates.items():
581
+ dashboard = template_fn()
582
+ with open(f"{output_dir}/{name}.json", "w") as f:
583
+ json.dump(dashboard, f, indent=2)
584
+ print(f"Generated: {output_dir}/{name}.json")
585
+
586
+
587
+ if __name__ == "__main__":
588
+ generator = DashboardGenerator()
589
+ generator.export_all()
590
+ ```
591
+
592
+ ## Enterprise Integration
593
+
594
+ ### Connected Skills
595
+ - **Security Architect (sa-07)**: Security monitoring data
596
+ - **Data Governance (dg-01-06)**: Governance metrics
597
+ - **Code Review (cr-05)**: Review analytics
598
+ - **Compliance Automation**: Compliance status
599
+
600
+ ### Data Sources
601
+ - Prometheus/Grafana for metrics
602
+ - GitHub API for code review data
603
+ - Security scanners (Snyk, SonarQube)
604
+ - Audit log systems
605
+
606
+ ## Quick Reference
607
+
608
+ ```bash
609
+ # In Claude Code
610
+ @enterprise-dashboard "Create security monitoring dashboard"
611
+ @enterprise-dashboard "Set up compliance alerting"
612
+ @enterprise-dashboard "Generate DORA metrics dashboard"
613
+ ```