specweave 0.3.13 → 0.4.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 (112) hide show
  1. package/CLAUDE.md +17 -1
  2. package/README.md +1 -1
  3. package/bin/install-all.sh +9 -2
  4. package/bin/install-hooks.sh +57 -0
  5. package/dist/cli/commands/init.d.ts.map +1 -1
  6. package/dist/cli/commands/init.js +55 -0
  7. package/dist/cli/commands/init.js.map +1 -1
  8. package/dist/core/agent-model-manager.d.ts +52 -0
  9. package/dist/core/agent-model-manager.d.ts.map +1 -0
  10. package/dist/core/agent-model-manager.js +120 -0
  11. package/dist/core/agent-model-manager.js.map +1 -0
  12. package/dist/core/cost-tracker.d.ts +108 -0
  13. package/dist/core/cost-tracker.d.ts.map +1 -0
  14. package/dist/core/cost-tracker.js +281 -0
  15. package/dist/core/cost-tracker.js.map +1 -0
  16. package/dist/core/model-selector.d.ts +57 -0
  17. package/dist/core/model-selector.d.ts.map +1 -0
  18. package/dist/core/model-selector.js +115 -0
  19. package/dist/core/model-selector.js.map +1 -0
  20. package/dist/core/phase-detector.d.ts +62 -0
  21. package/dist/core/phase-detector.d.ts.map +1 -0
  22. package/dist/core/phase-detector.js +229 -0
  23. package/dist/core/phase-detector.js.map +1 -0
  24. package/dist/types/cost-tracking.d.ts +43 -0
  25. package/dist/types/cost-tracking.d.ts.map +1 -0
  26. package/dist/types/cost-tracking.js +8 -0
  27. package/dist/types/cost-tracking.js.map +1 -0
  28. package/dist/types/model-selection.d.ts +53 -0
  29. package/dist/types/model-selection.d.ts.map +1 -0
  30. package/dist/types/model-selection.js +12 -0
  31. package/dist/types/model-selection.js.map +1 -0
  32. package/dist/utils/cost-reporter.d.ts +58 -0
  33. package/dist/utils/cost-reporter.d.ts.map +1 -0
  34. package/dist/utils/cost-reporter.js +224 -0
  35. package/dist/utils/cost-reporter.js.map +1 -0
  36. package/dist/utils/pricing-constants.d.ts +70 -0
  37. package/dist/utils/pricing-constants.d.ts.map +1 -0
  38. package/dist/utils/pricing-constants.js +71 -0
  39. package/dist/utils/pricing-constants.js.map +1 -0
  40. package/package.json +1 -1
  41. package/src/agents/architect/AGENT.md +3 -0
  42. package/src/agents/code-reviewer.md +156 -0
  43. package/src/agents/data-scientist/AGENT.md +181 -0
  44. package/src/agents/database-optimizer/AGENT.md +147 -0
  45. package/src/agents/devops/AGENT.md +3 -0
  46. package/src/agents/diagrams-architect/AGENT.md +3 -0
  47. package/src/agents/docs-writer/AGENT.md +3 -0
  48. package/src/agents/kubernetes-architect/AGENT.md +142 -0
  49. package/src/agents/ml-engineer/AGENT.md +150 -0
  50. package/src/agents/mlops-engineer/AGENT.md +201 -0
  51. package/src/agents/network-engineer/AGENT.md +149 -0
  52. package/src/agents/observability-engineer/AGENT.md +213 -0
  53. package/src/agents/payment-integration/AGENT.md +35 -0
  54. package/src/agents/performance/AGENT.md +3 -0
  55. package/src/agents/performance-engineer/AGENT.md +153 -0
  56. package/src/agents/pm/AGENT.md +3 -0
  57. package/src/agents/qa-lead/AGENT.md +3 -0
  58. package/src/agents/security/AGENT.md +3 -0
  59. package/src/agents/sre/AGENT.md +3 -0
  60. package/src/agents/tdd-orchestrator/AGENT.md +169 -0
  61. package/src/agents/tech-lead/AGENT.md +3 -0
  62. package/src/commands/specweave.costs.md +261 -0
  63. package/src/commands/specweave.ml-pipeline.md +292 -0
  64. package/src/commands/specweave.monitor-setup.md +501 -0
  65. package/src/commands/specweave.slo-implement.md +1055 -0
  66. package/src/commands/specweave.sync-github.md +1 -1
  67. package/src/commands/specweave.tdd-cycle.md +199 -0
  68. package/src/commands/specweave.tdd-green.md +842 -0
  69. package/src/commands/specweave.tdd-red.md +135 -0
  70. package/src/commands/specweave.tdd-refactor.md +165 -0
  71. package/src/skills/SKILLS-INDEX.md +18 -10
  72. package/src/skills/billing-automation/SKILL.md +559 -0
  73. package/src/skills/distributed-tracing/SKILL.md +438 -0
  74. package/src/skills/e2e-playwright/README.md +1 -1
  75. package/src/skills/e2e-playwright/package.json +1 -1
  76. package/src/skills/gitops-workflow/SKILL.md +285 -0
  77. package/src/skills/gitops-workflow/references/argocd-setup.md +134 -0
  78. package/src/skills/gitops-workflow/references/sync-policies.md +131 -0
  79. package/src/skills/grafana-dashboards/SKILL.md +369 -0
  80. package/src/skills/helm-chart-scaffolding/SKILL.md +544 -0
  81. package/src/skills/helm-chart-scaffolding/assets/Chart.yaml.template +42 -0
  82. package/src/skills/helm-chart-scaffolding/assets/values.yaml.template +185 -0
  83. package/src/skills/helm-chart-scaffolding/references/chart-structure.md +500 -0
  84. package/src/skills/helm-chart-scaffolding/scripts/validate-chart.sh +244 -0
  85. package/src/skills/k8s-manifest-generator/SKILL.md +511 -0
  86. package/src/skills/k8s-manifest-generator/assets/configmap-template.yaml +296 -0
  87. package/src/skills/k8s-manifest-generator/assets/deployment-template.yaml +203 -0
  88. package/src/skills/k8s-manifest-generator/assets/service-template.yaml +171 -0
  89. package/src/skills/k8s-manifest-generator/references/deployment-spec.md +753 -0
  90. package/src/skills/k8s-manifest-generator/references/service-spec.md +724 -0
  91. package/src/skills/k8s-security-policies/SKILL.md +334 -0
  92. package/src/skills/k8s-security-policies/assets/network-policy-template.yaml +177 -0
  93. package/src/skills/k8s-security-policies/references/rbac-patterns.md +187 -0
  94. package/src/skills/ml-pipeline-workflow/SKILL.md +245 -0
  95. package/src/skills/paypal-integration/SKILL.md +467 -0
  96. package/src/skills/pci-compliance/SKILL.md +466 -0
  97. package/src/skills/prometheus-configuration/SKILL.md +392 -0
  98. package/src/skills/slo-implementation/SKILL.md +329 -0
  99. package/src/skills/stripe-integration/SKILL.md +442 -0
  100. package/src/skills/tdd-workflow/SKILL.md +378 -0
  101. package/src/templates/README.md.template +1 -1
  102. package/src/skills/bmad-method-expert/SKILL.md +0 -626
  103. package/src/skills/bmad-method-expert/scripts/analyze-project.js +0 -318
  104. package/src/skills/bmad-method-expert/scripts/check-setup.js +0 -208
  105. package/src/skills/bmad-method-expert/scripts/generate-template.js +0 -1149
  106. package/src/skills/bmad-method-expert/scripts/validate-documents.js +0 -340
  107. package/src/skills/context-optimizer/SKILL.md +0 -588
  108. package/src/skills/figma-designer/SKILL.md +0 -149
  109. package/src/skills/figma-implementer/SKILL.md +0 -148
  110. package/src/skills/figma-mcp-connector/SKILL.md +0 -136
  111. package/src/skills/figma-to-code/SKILL.md +0 -128
  112. package/src/skills/spec-kit-expert/SKILL.md +0 -1010
@@ -0,0 +1,369 @@
1
+ ---
2
+ name: grafana-dashboards
3
+ description: Create and manage production Grafana dashboards for real-time visualization of system and application metrics. Use when building monitoring dashboards, visualizing metrics, or creating operational observability interfaces.
4
+ ---
5
+
6
+ # Grafana Dashboards
7
+
8
+ Create and manage production-ready Grafana dashboards for comprehensive system observability.
9
+
10
+ ## Purpose
11
+
12
+ Design effective Grafana dashboards for monitoring applications, infrastructure, and business metrics.
13
+
14
+ ## When to Use
15
+
16
+ - Visualize Prometheus metrics
17
+ - Create custom dashboards
18
+ - Implement SLO dashboards
19
+ - Monitor infrastructure
20
+ - Track business KPIs
21
+
22
+ ## Dashboard Design Principles
23
+
24
+ ### 1. Hierarchy of Information
25
+ ```
26
+ ┌─────────────────────────────────────┐
27
+ │ Critical Metrics (Big Numbers) │
28
+ ├─────────────────────────────────────┤
29
+ │ Key Trends (Time Series) │
30
+ ├─────────────────────────────────────┤
31
+ │ Detailed Metrics (Tables/Heatmaps) │
32
+ └─────────────────────────────────────┘
33
+ ```
34
+
35
+ ### 2. RED Method (Services)
36
+ - **Rate** - Requests per second
37
+ - **Errors** - Error rate
38
+ - **Duration** - Latency/response time
39
+
40
+ ### 3. USE Method (Resources)
41
+ - **Utilization** - % time resource is busy
42
+ - **Saturation** - Queue length/wait time
43
+ - **Errors** - Error count
44
+
45
+ ## Dashboard Structure
46
+
47
+ ### API Monitoring Dashboard
48
+
49
+ ```json
50
+ {
51
+ "dashboard": {
52
+ "title": "API Monitoring",
53
+ "tags": ["api", "production"],
54
+ "timezone": "browser",
55
+ "refresh": "30s",
56
+ "panels": [
57
+ {
58
+ "title": "Request Rate",
59
+ "type": "graph",
60
+ "targets": [
61
+ {
62
+ "expr": "sum(rate(http_requests_total[5m])) by (service)",
63
+ "legendFormat": "{{service}}"
64
+ }
65
+ ],
66
+ "gridPos": {"x": 0, "y": 0, "w": 12, "h": 8}
67
+ },
68
+ {
69
+ "title": "Error Rate %",
70
+ "type": "graph",
71
+ "targets": [
72
+ {
73
+ "expr": "(sum(rate(http_requests_total{status=~\"5..\"}[5m])) / sum(rate(http_requests_total[5m]))) * 100",
74
+ "legendFormat": "Error Rate"
75
+ }
76
+ ],
77
+ "alert": {
78
+ "conditions": [
79
+ {
80
+ "evaluator": {"params": [5], "type": "gt"},
81
+ "operator": {"type": "and"},
82
+ "query": {"params": ["A", "5m", "now"]},
83
+ "type": "query"
84
+ }
85
+ ]
86
+ },
87
+ "gridPos": {"x": 12, "y": 0, "w": 12, "h": 8}
88
+ },
89
+ {
90
+ "title": "P95 Latency",
91
+ "type": "graph",
92
+ "targets": [
93
+ {
94
+ "expr": "histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket[5m])) by (le, service))",
95
+ "legendFormat": "{{service}}"
96
+ }
97
+ ],
98
+ "gridPos": {"x": 0, "y": 8, "w": 24, "h": 8}
99
+ }
100
+ ]
101
+ }
102
+ }
103
+ ```
104
+
105
+ **Reference:** See `assets/api-dashboard.json`
106
+
107
+ ## Panel Types
108
+
109
+ ### 1. Stat Panel (Single Value)
110
+ ```json
111
+ {
112
+ "type": "stat",
113
+ "title": "Total Requests",
114
+ "targets": [{
115
+ "expr": "sum(http_requests_total)"
116
+ }],
117
+ "options": {
118
+ "reduceOptions": {
119
+ "values": false,
120
+ "calcs": ["lastNotNull"]
121
+ },
122
+ "orientation": "auto",
123
+ "textMode": "auto",
124
+ "colorMode": "value"
125
+ },
126
+ "fieldConfig": {
127
+ "defaults": {
128
+ "thresholds": {
129
+ "mode": "absolute",
130
+ "steps": [
131
+ {"value": 0, "color": "green"},
132
+ {"value": 80, "color": "yellow"},
133
+ {"value": 90, "color": "red"}
134
+ ]
135
+ }
136
+ }
137
+ }
138
+ }
139
+ ```
140
+
141
+ ### 2. Time Series Graph
142
+ ```json
143
+ {
144
+ "type": "graph",
145
+ "title": "CPU Usage",
146
+ "targets": [{
147
+ "expr": "100 - (avg by (instance) (rate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100)"
148
+ }],
149
+ "yaxes": [
150
+ {"format": "percent", "max": 100, "min": 0},
151
+ {"format": "short"}
152
+ ]
153
+ }
154
+ ```
155
+
156
+ ### 3. Table Panel
157
+ ```json
158
+ {
159
+ "type": "table",
160
+ "title": "Service Status",
161
+ "targets": [{
162
+ "expr": "up",
163
+ "format": "table",
164
+ "instant": true
165
+ }],
166
+ "transformations": [
167
+ {
168
+ "id": "organize",
169
+ "options": {
170
+ "excludeByName": {"Time": true},
171
+ "indexByName": {},
172
+ "renameByName": {
173
+ "instance": "Instance",
174
+ "job": "Service",
175
+ "Value": "Status"
176
+ }
177
+ }
178
+ }
179
+ ]
180
+ }
181
+ ```
182
+
183
+ ### 4. Heatmap
184
+ ```json
185
+ {
186
+ "type": "heatmap",
187
+ "title": "Latency Heatmap",
188
+ "targets": [{
189
+ "expr": "sum(rate(http_request_duration_seconds_bucket[5m])) by (le)",
190
+ "format": "heatmap"
191
+ }],
192
+ "dataFormat": "tsbuckets",
193
+ "yAxis": {
194
+ "format": "s"
195
+ }
196
+ }
197
+ ```
198
+
199
+ ## Variables
200
+
201
+ ### Query Variables
202
+ ```json
203
+ {
204
+ "templating": {
205
+ "list": [
206
+ {
207
+ "name": "namespace",
208
+ "type": "query",
209
+ "datasource": "Prometheus",
210
+ "query": "label_values(kube_pod_info, namespace)",
211
+ "refresh": 1,
212
+ "multi": false
213
+ },
214
+ {
215
+ "name": "service",
216
+ "type": "query",
217
+ "datasource": "Prometheus",
218
+ "query": "label_values(kube_service_info{namespace=\"$namespace\"}, service)",
219
+ "refresh": 1,
220
+ "multi": true
221
+ }
222
+ ]
223
+ }
224
+ }
225
+ ```
226
+
227
+ ### Use Variables in Queries
228
+ ```
229
+ sum(rate(http_requests_total{namespace="$namespace", service=~"$service"}[5m]))
230
+ ```
231
+
232
+ ## Alerts in Dashboards
233
+
234
+ ```json
235
+ {
236
+ "alert": {
237
+ "name": "High Error Rate",
238
+ "conditions": [
239
+ {
240
+ "evaluator": {
241
+ "params": [5],
242
+ "type": "gt"
243
+ },
244
+ "operator": {"type": "and"},
245
+ "query": {
246
+ "params": ["A", "5m", "now"]
247
+ },
248
+ "reducer": {"type": "avg"},
249
+ "type": "query"
250
+ }
251
+ ],
252
+ "executionErrorState": "alerting",
253
+ "for": "5m",
254
+ "frequency": "1m",
255
+ "message": "Error rate is above 5%",
256
+ "noDataState": "no_data",
257
+ "notifications": [
258
+ {"uid": "slack-channel"}
259
+ ]
260
+ }
261
+ }
262
+ ```
263
+
264
+ ## Dashboard Provisioning
265
+
266
+ **dashboards.yml:**
267
+ ```yaml
268
+ apiVersion: 1
269
+
270
+ providers:
271
+ - name: 'default'
272
+ orgId: 1
273
+ folder: 'General'
274
+ type: file
275
+ disableDeletion: false
276
+ updateIntervalSeconds: 10
277
+ allowUiUpdates: true
278
+ options:
279
+ path: /etc/grafana/dashboards
280
+ ```
281
+
282
+ ## Common Dashboard Patterns
283
+
284
+ ### Infrastructure Dashboard
285
+
286
+ **Key Panels:**
287
+ - CPU utilization per node
288
+ - Memory usage per node
289
+ - Disk I/O
290
+ - Network traffic
291
+ - Pod count by namespace
292
+ - Node status
293
+
294
+ **Reference:** See `assets/infrastructure-dashboard.json`
295
+
296
+ ### Database Dashboard
297
+
298
+ **Key Panels:**
299
+ - Queries per second
300
+ - Connection pool usage
301
+ - Query latency (P50, P95, P99)
302
+ - Active connections
303
+ - Database size
304
+ - Replication lag
305
+ - Slow queries
306
+
307
+ **Reference:** See `assets/database-dashboard.json`
308
+
309
+ ### Application Dashboard
310
+
311
+ **Key Panels:**
312
+ - Request rate
313
+ - Error rate
314
+ - Response time (percentiles)
315
+ - Active users/sessions
316
+ - Cache hit rate
317
+ - Queue length
318
+
319
+ ## Best Practices
320
+
321
+ 1. **Start with templates** (Grafana community dashboards)
322
+ 2. **Use consistent naming** for panels and variables
323
+ 3. **Group related metrics** in rows
324
+ 4. **Set appropriate time ranges** (default: Last 6 hours)
325
+ 5. **Use variables** for flexibility
326
+ 6. **Add panel descriptions** for context
327
+ 7. **Configure units** correctly
328
+ 8. **Set meaningful thresholds** for colors
329
+ 9. **Use consistent colors** across dashboards
330
+ 10. **Test with different time ranges**
331
+
332
+ ## Dashboard as Code
333
+
334
+ ### Terraform Provisioning
335
+
336
+ ```hcl
337
+ resource "grafana_dashboard" "api_monitoring" {
338
+ config_json = file("${path.module}/dashboards/api-monitoring.json")
339
+ folder = grafana_folder.monitoring.id
340
+ }
341
+
342
+ resource "grafana_folder" "monitoring" {
343
+ title = "Production Monitoring"
344
+ }
345
+ ```
346
+
347
+ ### Ansible Provisioning
348
+
349
+ ```yaml
350
+ - name: Deploy Grafana dashboards
351
+ copy:
352
+ src: "{{ item }}"
353
+ dest: /etc/grafana/dashboards/
354
+ with_fileglob:
355
+ - "dashboards/*.json"
356
+ notify: restart grafana
357
+ ```
358
+
359
+ ## Reference Files
360
+
361
+ - `assets/api-dashboard.json` - API monitoring dashboard
362
+ - `assets/infrastructure-dashboard.json` - Infrastructure dashboard
363
+ - `assets/database-dashboard.json` - Database monitoring dashboard
364
+ - `references/dashboard-design.md` - Dashboard design guide
365
+
366
+ ## Related Skills
367
+
368
+ - `prometheus-configuration` - For metric collection
369
+ - `slo-implementation` - For SLO dashboards