cc-mirror 1.0.3 → 1.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 (25) hide show
  1. package/README.md +168 -98
  2. package/dist/cc-mirror.mjs +807 -287
  3. package/dist/skills/multi-agent-orchestrator/SKILL.md +391 -0
  4. package/dist/skills/multi-agent-orchestrator/references/code-review.md +266 -0
  5. package/dist/skills/multi-agent-orchestrator/references/data-analysis.md +315 -0
  6. package/dist/skills/multi-agent-orchestrator/references/devops.md +309 -0
  7. package/dist/skills/multi-agent-orchestrator/references/documentation.md +310 -0
  8. package/dist/skills/multi-agent-orchestrator/references/domains/code-review.md +301 -0
  9. package/dist/skills/multi-agent-orchestrator/references/domains/data-analysis.md +347 -0
  10. package/dist/skills/multi-agent-orchestrator/references/domains/devops.md +340 -0
  11. package/dist/skills/multi-agent-orchestrator/references/domains/documentation.md +343 -0
  12. package/dist/skills/multi-agent-orchestrator/references/domains/project-management.md +370 -0
  13. package/dist/skills/multi-agent-orchestrator/references/domains/research.md +322 -0
  14. package/dist/skills/multi-agent-orchestrator/references/domains/software-development.md +269 -0
  15. package/dist/skills/multi-agent-orchestrator/references/domains/testing.md +313 -0
  16. package/dist/skills/multi-agent-orchestrator/references/examples.md +377 -0
  17. package/dist/skills/multi-agent-orchestrator/references/guide.md +327 -0
  18. package/dist/skills/multi-agent-orchestrator/references/patterns.md +441 -0
  19. package/dist/skills/multi-agent-orchestrator/references/project-management.md +345 -0
  20. package/dist/skills/multi-agent-orchestrator/references/research.md +285 -0
  21. package/dist/skills/multi-agent-orchestrator/references/software-development.md +242 -0
  22. package/dist/skills/multi-agent-orchestrator/references/testing.md +282 -0
  23. package/dist/skills/multi-agent-orchestrator/references/tools.md +454 -0
  24. package/dist/tui.mjs +1063 -405
  25. package/package.json +2 -2
@@ -0,0 +1,347 @@
1
+ # Data Analysis Orchestration Patterns
2
+
3
+ ```
4
+ ┌─────────────────────────────────────────────────────────────┐
5
+ │ │
6
+ │ Data yields insights faster when explored in parallel. │
7
+ │ Multiple dimensions, simultaneous analysis, clear story. │
8
+ │ │
9
+ └─────────────────────────────────────────────────────────────┘
10
+ ```
11
+
12
+ > **Load when**: Exploratory data analysis, data quality, report generation, ETL pipelines, statistical analysis
13
+ > **Common patterns**: Multi-Dimensional Exploration, Comprehensive Quality Audit, Hypothesis Testing
14
+
15
+ ## Table of Contents
16
+
17
+ 1. [Exploratory Data Analysis](#exploratory-data-analysis)
18
+ 2. [Data Quality](#data-quality)
19
+ 3. [Report Generation](#report-generation)
20
+ 4. [ETL Pipelines](#etl-pipelines)
21
+ 5. [Statistical Analysis](#statistical-analysis)
22
+
23
+ ---
24
+
25
+ ## Exploratory Data Analysis
26
+
27
+ ### Pattern: Multi-Dimensional Exploration
28
+
29
+ ```
30
+ User Request: "Analyze this dataset"
31
+
32
+ Phase 1: FAN-OUT (Parallel initial exploration)
33
+ ├─ Agent A: Schema analysis (columns, types, constraints)
34
+ ├─ Agent B: Statistical summary (distributions, outliers)
35
+ ├─ Agent C: Missing data analysis
36
+ ├─ Agent D: Cardinality and uniqueness analysis
37
+ └─ Agent E: Sample data examination
38
+
39
+ Phase 2: REDUCE
40
+ └─ General-purpose agent: Synthesize initial findings
41
+
42
+ Phase 3: FAN-OUT (Deep dive based on findings)
43
+ ├─ Agent A: Correlation analysis
44
+ ├─ Agent B: Time series patterns (if applicable)
45
+ └─ Agent C: Categorical relationship analysis
46
+
47
+ Phase 4: REDUCE
48
+ └─ General-purpose agent: Complete EDA report
49
+ ```
50
+
51
+ ### Pattern: Question-Driven Analysis
52
+
53
+ ```
54
+ User Request: "Why are sales declining?"
55
+
56
+ Phase 1: EXPLORE
57
+ └─ Explore agent: Understand available data sources
58
+
59
+ Phase 2: FAN-OUT (Parallel hypothesis investigation)
60
+ ├─ Agent A: Analyze sales by region
61
+ ├─ Agent B: Analyze sales by product
62
+ ├─ Agent C: Analyze sales by customer segment
63
+ ├─ Agent D: Analyze external factors (seasonality, competition)
64
+ └─ Agent E: Analyze marketing/promotion effectiveness
65
+
66
+ Phase 3: REDUCE
67
+ └─ General-purpose agent: Identify key drivers, recommendations
68
+ ```
69
+
70
+ ### Pattern: Comparative Analysis
71
+
72
+ ```
73
+ Phase 1: FAN-OUT
74
+ ├─ Agent A: Analyze dataset A characteristics
75
+ ├─ Agent B: Analyze dataset B characteristics
76
+ └─ Agent C: Analyze overlap/differences
77
+
78
+ Phase 2: REDUCE
79
+ └─ General-purpose agent: Comparison report with insights
80
+ ```
81
+
82
+ ---
83
+
84
+ ## Data Quality
85
+
86
+ ### Pattern: Comprehensive Quality Audit
87
+
88
+ ```
89
+ User Request: "Check data quality for the customer table"
90
+
91
+ Phase 1: FAN-OUT (Parallel quality dimensions)
92
+ ├─ Agent A: Completeness (null rates, missing values)
93
+ ├─ Agent B: Accuracy (format validation, range checks)
94
+ ├─ Agent C: Consistency (cross-field validation)
95
+ ├─ Agent D: Timeliness (freshness, update patterns)
96
+ ├─ Agent E: Uniqueness (duplicates, key integrity)
97
+ └─ Agent F: Validity (business rule compliance)
98
+
99
+ Phase 2: REDUCE
100
+ └─ General-purpose agent: Quality scorecard with issues
101
+
102
+ Phase 3: FAN-OUT (Remediation)
103
+ ├─ Agent A: Fix completeness issues
104
+ ├─ Agent B: Fix accuracy issues
105
+ └─ Agent C: Fix consistency issues
106
+ ```
107
+
108
+ ### Pattern: Anomaly Detection
109
+
110
+ ```
111
+ Phase 1: FAN-OUT
112
+ ├─ Agent A: Statistical outlier detection
113
+ ├─ Agent B: Business rule violations
114
+ ├─ Agent C: Pattern anomalies (sudden changes)
115
+ └─ Agent D: Referential integrity issues
116
+
117
+ Phase 2: REDUCE
118
+ └─ General-purpose agent: Anomaly report with severity
119
+ ```
120
+
121
+ ### Pattern: Data Profiling Pipeline
122
+
123
+ ```
124
+ Phase 1: PIPELINE
125
+ ├─ General-purpose agent: Extract profiling metrics
126
+ ├─ General-purpose agent: Compare against historical baseline
127
+ └─ General-purpose agent: Flag deviations
128
+
129
+ Phase 2: BACKGROUND
130
+ └─ Background agent: Generate profile report
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Report Generation
136
+
137
+ ### Pattern: Multi-Section Report
138
+
139
+ ```
140
+ User Request: "Generate monthly business report"
141
+
142
+ Phase 1: FAN-OUT (Parallel section generation)
143
+ ├─ Agent A: Executive summary section
144
+ ├─ Agent B: Sales performance section
145
+ ├─ Agent C: Customer metrics section
146
+ ├─ Agent D: Product analytics section
147
+ ├─ Agent E: Financial summary section
148
+ └─ Agent F: Operational metrics section
149
+
150
+ Phase 2: REDUCE
151
+ └─ General-purpose agent: Compile sections, add insights
152
+
153
+ Phase 3: PIPELINE
154
+ └─ General-purpose agent: Format, add visualizations
155
+ ```
156
+
157
+ ### Pattern: Automated Dashboard Refresh
158
+
159
+ ```
160
+ Phase 1: FAN-OUT (Parallel data refresh)
161
+ ├─ Background agent: Refresh data source 1
162
+ ├─ Background agent: Refresh data source 2
163
+ └─ Background agent: Refresh data source 3
164
+
165
+ Phase 2: PIPELINE
166
+ ├─ General-purpose agent: Aggregate refreshed data
167
+ └─ General-purpose agent: Update dashboard calculations
168
+
169
+ Phase 3: BACKGROUND
170
+ └─ Background agent: Generate and distribute report
171
+ ```
172
+
173
+ ### Pattern: Ad-Hoc Query Report
174
+
175
+ ```
176
+ User Request: "Get me sales by region for Q4"
177
+
178
+ Phase 1: EXPLORE
179
+ └─ Explore agent: Find relevant tables and joins
180
+
181
+ Phase 2: PIPELINE
182
+ ├─ General-purpose agent: Build and execute query
183
+ ├─ General-purpose agent: Format results
184
+ └─ General-purpose agent: Add context and insights
185
+ ```
186
+
187
+ ---
188
+
189
+ ## ETL Pipelines
190
+
191
+ ### Pattern: ETL Development
192
+
193
+ ```
194
+ User Request: "Create ETL pipeline for user events"
195
+
196
+ Phase 1: EXPLORE
197
+ └─ Explore agent: Understand source schema, target requirements
198
+
199
+ Phase 2: PLAN
200
+ └─ Plan agent: Design ETL architecture
201
+
202
+ Phase 3: FAN-OUT (Parallel component development)
203
+ ├─ Agent A: Extract logic (source connectors)
204
+ ├─ Agent B: Transform logic (cleaning, mapping)
205
+ ├─ Agent C: Load logic (target insertion)
206
+ └─ Agent D: Error handling and logging
207
+
208
+ Phase 4: PIPELINE
209
+ ├─ General-purpose agent: Wire components
210
+ └─ Background agent: Test with sample data
211
+ ```
212
+
213
+ ### Pattern: ETL Debugging
214
+
215
+ ```
216
+ User Request: "ETL job is failing"
217
+
218
+ Phase 1: FAN-OUT (Parallel diagnosis)
219
+ ├─ Explore agent: Check job logs
220
+ ├─ Explore agent: Check source data quality
221
+ ├─ Explore agent: Check target schema compatibility
222
+ └─ Explore agent: Check resource utilization
223
+
224
+ Phase 2: REDUCE
225
+ └─ General-purpose agent: Root cause identification
226
+
227
+ Phase 3: PIPELINE
228
+ ├─ General-purpose agent: Implement fix
229
+ └─ Background agent: Verify fix with test run
230
+ ```
231
+
232
+ ### Pattern: Schema Evolution
233
+
234
+ ```
235
+ Phase 1: EXPLORE
236
+ └─ Explore agent: Identify schema changes
237
+
238
+ Phase 2: FAN-OUT
239
+ ├─ Agent A: Update extract logic
240
+ ├─ Agent B: Update transform mappings
241
+ └─ Agent C: Update load targets
242
+
243
+ Phase 3: PIPELINE
244
+ ├─ General-purpose agent: Migration script
245
+ └─ Background agent: Backfill historical data
246
+ ```
247
+
248
+ ---
249
+
250
+ ## Statistical Analysis
251
+
252
+ ### Pattern: Hypothesis Testing
253
+
254
+ ```
255
+ User Request: "Did the new feature improve conversion?"
256
+
257
+ Phase 1: EXPLORE
258
+ └─ Explore agent: Gather pre and post data
259
+
260
+ Phase 2: FAN-OUT
261
+ ├─ Agent A: Descriptive statistics (both groups)
262
+ ├─ Agent B: Distribution analysis
263
+ └─ Agent C: Confounding variable check
264
+
265
+ Phase 3: PIPELINE
266
+ ├─ General-purpose agent: Select appropriate test
267
+ ├─ General-purpose agent: Run statistical test
268
+ └─ General-purpose agent: Interpret results
269
+
270
+ Phase 4: REDUCE
271
+ └─ General-purpose agent: Conclusion with confidence
272
+ ```
273
+
274
+ ### Pattern: Predictive Modeling
275
+
276
+ ```
277
+ Phase 1: FAN-OUT (Data preparation)
278
+ ├─ Agent A: Feature engineering
279
+ ├─ Agent B: Data cleaning
280
+ └─ Agent C: Train/test split
281
+
282
+ Phase 2: SPECULATIVE (Model selection)
283
+ ├─ Agent A: Train model type 1
284
+ ├─ Agent B: Train model type 2
285
+ └─ Agent C: Train model type 3
286
+
287
+ Phase 3: REDUCE
288
+ └─ General-purpose agent: Compare models, select best
289
+
290
+ Phase 4: PIPELINE
291
+ └─ General-purpose agent: Final evaluation, documentation
292
+ ```
293
+
294
+ ### Pattern: Trend Analysis
295
+
296
+ ```
297
+ Phase 1: FAN-OUT
298
+ ├─ Agent A: Decompose time series
299
+ ├─ Agent B: Identify seasonality patterns
300
+ ├─ Agent C: Detect change points
301
+ └─ Agent D: Forecast future values
302
+
303
+ Phase 2: REDUCE
304
+ └─ General-purpose agent: Trend report with insights
305
+ ```
306
+
307
+ ---
308
+
309
+ ## Task Management for Data Analysis
310
+
311
+ Structure data analysis with parallel exploration:
312
+
313
+ ```python
314
+ # Create analysis tasks
315
+ TaskCreate(subject="Understand data sources", description="Schema, types, relationships...")
316
+ TaskCreate(subject="Explore distributions", description="Statistical summaries, outliers...")
317
+ TaskCreate(subject="Analyze missing data", description="Null patterns, imputation needs...")
318
+ TaskCreate(subject="Check data quality", description="Validation, consistency...")
319
+ TaskCreate(subject="Synthesize findings", description="Aggregate insights, recommendations...")
320
+ TaskCreate(subject="Generate report", description="Visualizations, documentation...")
321
+
322
+ # Parallel exploration after understanding
323
+ TaskUpdate(taskId="2", addBlockedBy=["1"])
324
+ TaskUpdate(taskId="3", addBlockedBy=["1"])
325
+ TaskUpdate(taskId="4", addBlockedBy=["1"])
326
+ TaskUpdate(taskId="5", addBlockedBy=["2", "3", "4"])
327
+ TaskUpdate(taskId="6", addBlockedBy=["5"])
328
+
329
+ # Spawn parallel analysis agents
330
+ Task(subagent_type="general-purpose", prompt="TaskId 2: Explore distributions...")
331
+ Task(subagent_type="general-purpose", prompt="TaskId 3: Analyze missing data...")
332
+ Task(subagent_type="general-purpose", prompt="TaskId 4: Check data quality...")
333
+ ```
334
+
335
+ ## Best Practices
336
+
337
+ 1. **Parallelize exploration** across dimensions
338
+ 2. **Validate data quality** before analysis
339
+ 3. **Background long queries** to maintain responsiveness
340
+ 4. **Document assumptions** in reports
341
+ 5. **Include confidence levels** in statistical conclusions
342
+
343
+ ---
344
+
345
+ ```
346
+ ─── ◈ Data Analysis ─────────────────────
347
+ ```
@@ -0,0 +1,340 @@
1
+ # DevOps Orchestration Patterns
2
+
3
+ ```
4
+ ┌─────────────────────────────────────────────────────────────┐
5
+ │ │
6
+ │ Infrastructure as carefully orchestrated as code. │
7
+ │ Safe deployments. Fast pipelines. Reliable operations. │
8
+ │ │
9
+ └─────────────────────────────────────────────────────────────┘
10
+ ```
11
+
12
+ > **Load when**: CI/CD pipeline, deployment, infrastructure as code, monitoring, incident response
13
+ > **Common patterns**: Pipeline Setup, Zero-Downtime Deployment, Incident Triage
14
+
15
+ ## Table of Contents
16
+
17
+ 1. [CI/CD Pipeline](#cicd-pipeline)
18
+ 2. [Deployment](#deployment)
19
+ 3. [Infrastructure](#infrastructure)
20
+ 4. [Monitoring and Alerting](#monitoring-and-alerting)
21
+ 5. [Incident Response](#incident-response)
22
+
23
+ ---
24
+
25
+ ## CI/CD Pipeline
26
+
27
+ ### Pattern: Pipeline Setup
28
+
29
+ ```
30
+ User Request: "Set up CI/CD for this project"
31
+
32
+ Phase 1: EXPLORE
33
+ └─ Explore agent: Analyze project structure, build system, test setup
34
+
35
+ Phase 2: PLAN
36
+ └─ Plan agent: Design pipeline stages and requirements
37
+
38
+ Phase 3: FAN-OUT (Parallel stage implementation)
39
+ ├─ Agent A: Build stage (compile, dependencies)
40
+ ├─ Agent B: Test stage (unit, integration)
41
+ ├─ Agent C: Security scan stage (SAST, dependencies)
42
+ └─ Agent D: Deploy stage (environments, rollback)
43
+
44
+ Phase 4: PIPELINE
45
+ └─ General-purpose agent: Wire stages, add notifications
46
+ ```
47
+
48
+ ### Pattern: Pipeline Optimization
49
+
50
+ ```
51
+ User Request: "Speed up our CI pipeline"
52
+
53
+ Phase 1: FAN-OUT (Parallel analysis)
54
+ ├─ Explore agent: Analyze current pipeline duration by stage
55
+ ├─ Explore agent: Find parallelization opportunities
56
+ ├─ Explore agent: Check caching effectiveness
57
+ └─ Explore agent: Review resource allocation
58
+
59
+ Phase 2: REDUCE
60
+ └─ Plan agent: Prioritized optimization plan
61
+
62
+ Phase 3: FAN-OUT (Implement optimizations)
63
+ ├─ Agent A: Implement caching improvements
64
+ ├─ Agent B: Parallelize independent jobs
65
+ └─ Agent C: Optimize resource-heavy stages
66
+ ```
67
+
68
+ ### Pattern: Multi-Environment Pipeline
69
+
70
+ ```
71
+ Phase 1: EXPLORE
72
+ └─ Explore agent: Map environments (dev, staging, prod)
73
+
74
+ Phase 2: FAN-OUT
75
+ ├─ Agent A: Configure dev deployment
76
+ ├─ Agent B: Configure staging deployment
77
+ ├─ Agent C: Configure prod deployment (with gates)
78
+ └─ Agent D: Configure environment promotions
79
+
80
+ Phase 3: PIPELINE
81
+ └─ General-purpose agent: Add approval workflows, rollback triggers
82
+ ```
83
+
84
+ ---
85
+
86
+ ## Deployment
87
+
88
+ ### Pattern: Zero-Downtime Deployment
89
+
90
+ ```
91
+ User Request: "Deploy the new version without downtime"
92
+
93
+ Phase 1: EXPLORE
94
+ └─ Explore agent: Current deployment strategy, infrastructure
95
+
96
+ Phase 2: PIPELINE
97
+ ├─ General-purpose agent: Build and tag new image
98
+ ├─ General-purpose agent: Deploy to canary/blue environment
99
+ ├─ Background agent: Run smoke tests
100
+ └─ General-purpose agent: Shift traffic, drain old instances
101
+
102
+ Phase 3: BACKGROUND
103
+ └─ Background agent: Monitor error rates post-deploy
104
+ ```
105
+
106
+ ### Pattern: Rollback Preparation
107
+
108
+ ```
109
+ Phase 1: FAN-OUT (Pre-deployment)
110
+ ├─ Agent A: Tag current stable version
111
+ ├─ Agent B: Document database state
112
+ ├─ Agent C: Prepare rollback scripts
113
+ └─ Agent D: Verify rollback path
114
+
115
+ Phase 2: PIPELINE (Deployment with safety)
116
+ ├─ General-purpose agent: Deploy new version
117
+ ├─ Background agent: Health check monitoring
118
+ └─ General-purpose agent: (If needed) Execute rollback
119
+ ```
120
+
121
+ ### Pattern: Database Migration Deployment
122
+
123
+ ```
124
+ Phase 1: PIPELINE (Safe migration)
125
+ ├─ General-purpose agent: Backup current database
126
+ ├─ General-purpose agent: Run forward migration
127
+ ├─ General-purpose agent: Deploy compatible app version
128
+ └─ Background agent: Verify data integrity
129
+
130
+ Phase 2: BACKGROUND
131
+ └─ Background agent: Monitor for migration issues
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Infrastructure
137
+
138
+ ### Pattern: Infrastructure as Code
139
+
140
+ ```
141
+ User Request: "Create Terraform for our AWS setup"
142
+
143
+ Phase 1: EXPLORE
144
+ └─ Explore agent: Map current infrastructure, requirements
145
+
146
+ Phase 2: FAN-OUT (Parallel module creation)
147
+ ├─ Agent A: Network module (VPC, subnets, security groups)
148
+ ├─ Agent B: Compute module (ECS/EKS, EC2)
149
+ ├─ Agent C: Database module (RDS, ElastiCache)
150
+ ├─ Agent D: Storage module (S3, EFS)
151
+ └─ Agent E: CDN and DNS module
152
+
153
+ Phase 3: PIPELINE
154
+ ├─ General-purpose agent: Wire modules, configure state backend
155
+ └─ Background agent: Validate and plan
156
+ ```
157
+
158
+ ### Pattern: Kubernetes Manifest Generation
159
+
160
+ ```
161
+ Phase 1: EXPLORE
162
+ └─ Explore agent: Analyze application requirements
163
+
164
+ Phase 2: FAN-OUT
165
+ ├─ Agent A: Deployment manifests
166
+ ├─ Agent B: Service and ingress manifests
167
+ ├─ Agent C: ConfigMaps and Secrets
168
+ ├─ Agent D: HPA and PDB configurations
169
+ └─ Agent E: NetworkPolicies
170
+
171
+ Phase 3: PIPELINE
172
+ ├─ General-purpose agent: Kustomize or Helm setup
173
+ └─ Background agent: Validate against cluster
174
+ ```
175
+
176
+ ### Pattern: Security Hardening
177
+
178
+ ```
179
+ Phase 1: FAN-OUT (Parallel security checks)
180
+ ├─ Agent A: Network security (firewall, security groups)
181
+ ├─ Agent B: IAM and access control
182
+ ├─ Agent C: Encryption (at rest, in transit)
183
+ ├─ Agent D: Secrets management
184
+ └─ Agent E: Compliance checks
185
+
186
+ Phase 2: REDUCE
187
+ └─ General-purpose agent: Security report with remediations
188
+
189
+ Phase 3: FAN-OUT (Implement fixes)
190
+ ├─ Agents implement security improvements
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Monitoring and Alerting
196
+
197
+ ### Pattern: Observability Setup
198
+
199
+ ```
200
+ User Request: "Set up monitoring for the application"
201
+
202
+ Phase 1: FAN-OUT (Parallel pillar implementation)
203
+ ├─ Agent A: Metrics (Prometheus, CloudWatch)
204
+ ├─ Agent B: Logging (ELK, CloudWatch Logs)
205
+ ├─ Agent C: Tracing (Jaeger, X-Ray)
206
+ └─ Agent D: Dashboards (Grafana, custom)
207
+
208
+ Phase 2: PIPELINE
209
+ └─ General-purpose agent: Configure alerting rules, runbooks
210
+ ```
211
+
212
+ ### Pattern: Alert Tuning
213
+
214
+ ```
215
+ Phase 1: EXPLORE
216
+ └─ Explore agent: Analyze current alerts, noise ratio
217
+
218
+ Phase 2: FAN-OUT
219
+ ├─ Agent A: Tune threshold-based alerts
220
+ ├─ Agent B: Implement anomaly detection
221
+ └─ Agent C: Configure alert routing
222
+
223
+ Phase 3: PIPELINE
224
+ └─ General-purpose agent: Document runbooks for each alert
225
+ ```
226
+
227
+ ### Pattern: SLO Definition
228
+
229
+ ```
230
+ Phase 1: EXPLORE
231
+ └─ Explore agent: Identify critical user journeys
232
+
233
+ Phase 2: FAN-OUT
234
+ ├─ Agent A: Define availability SLIs/SLOs
235
+ ├─ Agent B: Define latency SLIs/SLOs
236
+ ├─ Agent C: Define error rate SLIs/SLOs
237
+ └─ Agent D: Configure error budget alerts
238
+
239
+ Phase 3: PIPELINE
240
+ └─ General-purpose agent: Create SLO dashboard
241
+ ```
242
+
243
+ ---
244
+
245
+ ## Incident Response
246
+
247
+ ### Pattern: Incident Triage
248
+
249
+ ```
250
+ User Request: "Production is down!"
251
+
252
+ Phase 1: FAN-OUT (Rapid parallel diagnosis)
253
+ ├─ Agent A: Check application logs for errors
254
+ ├─ Agent B: Check infrastructure metrics
255
+ ├─ Agent C: Check recent deployments
256
+ ├─ Agent D: Check external dependencies
257
+ └─ Agent E: Check database health
258
+
259
+ Phase 2: REDUCE (Fast)
260
+ └─ General-purpose agent: Identify most likely cause
261
+
262
+ Phase 3: PIPELINE
263
+ ├─ General-purpose agent: Implement fix or rollback
264
+ └─ Background agent: Verify recovery
265
+ ```
266
+
267
+ ### Pattern: Post-Incident Review
268
+
269
+ ```
270
+ Phase 1: FAN-OUT (Evidence gathering)
271
+ ├─ Explore agent: Timeline of events
272
+ ├─ Explore agent: Relevant logs and metrics
273
+ ├─ Explore agent: Changes before incident
274
+ └─ Explore agent: Response actions taken
275
+
276
+ Phase 2: PIPELINE
277
+ ├─ General-purpose agent: Root cause analysis
278
+ ├─ General-purpose agent: Impact assessment
279
+ └─ General-purpose agent: Action items and preventions
280
+
281
+ Phase 3: REDUCE
282
+ └─ General-purpose agent: Post-mortem document
283
+ ```
284
+
285
+ ### Pattern: Runbook Execution
286
+
287
+ ```
288
+ Phase 1: EXPLORE
289
+ └─ Explore agent: Find relevant runbook
290
+
291
+ Phase 2: PIPELINE (Step-by-step)
292
+ ├─ General-purpose agent: Execute step 1
293
+ ├─ General-purpose agent: Verify step 1
294
+ ├─ General-purpose agent: Execute step 2
295
+ └─ ... continue until resolved
296
+
297
+ Phase 3: BACKGROUND
298
+ └─ Background agent: Continued monitoring
299
+ ```
300
+
301
+ ---
302
+
303
+ ## Task Management for DevOps
304
+
305
+ Structure infrastructure work with safety checkpoints:
306
+
307
+ ```python
308
+ # Create DevOps tasks
309
+ TaskCreate(subject="Assess infrastructure", description="Current state, requirements...")
310
+ TaskCreate(subject="Plan changes", description="Design with minimal disruption...")
311
+ TaskCreate(subject="Implement network changes", description="VPC, security groups...")
312
+ TaskCreate(subject="Implement compute changes", description="ECS, scaling...")
313
+ TaskCreate(subject="Validate deployment", description="Health checks, smoke tests...")
314
+ TaskCreate(subject="Configure monitoring", description="Alerts, dashboards...")
315
+
316
+ # Sequential safety gates
317
+ TaskUpdate(taskId="2", addBlockedBy=["1"])
318
+ TaskUpdate(taskId="3", addBlockedBy=["2"])
319
+ TaskUpdate(taskId="4", addBlockedBy=["2"]) # Can parallel with network
320
+ TaskUpdate(taskId="5", addBlockedBy=["3", "4"])
321
+ TaskUpdate(taskId="6", addBlockedBy=["5"])
322
+
323
+ # Parallel infrastructure implementation
324
+ Task(subagent_type="general-purpose", prompt="TaskId 3: Implement network changes...")
325
+ Task(subagent_type="general-purpose", prompt="TaskId 4: Implement compute changes...")
326
+ ```
327
+
328
+ ## Safety Principles
329
+
330
+ 1. **Always have rollback plan** before deploying
331
+ 2. **Background monitor** during and after deployment
332
+ 3. **Parallel diagnosis** during incidents for speed
333
+ 4. **Document everything** for future incidents
334
+ 5. **Test in staging** before production
335
+
336
+ ---
337
+
338
+ ```
339
+ ─── ◈ DevOps ────────────────────────────
340
+ ```