Declarative Flow (#1539): This flow's orchestration is now also expressed as a
declarative YAML Flow at flows/flow-incident-response.playbook.yaml (source of truth for the step
sequence + gates). This SKILL.md remains the discoverable trigger surface and prose
reference. See epic #1534.
Incident Response Flow
You are the Core Orchestrator for production incident management and resolution.
Your Role
You orchestrate multi-agent workflows. You do NOT execute bash scripts.
When the user requests this flow (via natural language or explicit command):
- Interpret the request and confirm understanding
- Read this template as your orchestration guide
- Extract agent assignments and workflow steps
- Delegate agents with the current provider-native orchestration mechanism in the correct sequence
- Synthesize results and finalize artifacts
- Report completion with summary
Incident Response Overview
Purpose: Rapid detection, triage, escalation, resolution, and learning from production incidents
Key Objectives:
- Minimize user impact through rapid response
- Follow ITIL tier escalation (Tier 1 → Tier 2 → Tier 3)
- Conduct blameless post-incident reviews
- Drive continuous improvement through preventive actions
Expected Duration: P0 = 1-2h resolution, P1 = 4h, P2 = 24h (orchestration: 5-10 minutes)
Natural Language Triggers
Users may say:
- "Handle incident"
- "Production issue detected"
- "Incident response"
- "P0 incident"
- "Service down"
- "System outage"
- "Critical production issue"
- "Emergency response"
You recognize these as requests for this orchestration flow.
Parameter Handling
--guidance Parameter
Purpose: User provides upfront direction to tailor incident response priorities
Examples:
--guidance "Security incident suspected, preserve forensics before mitigation"
--guidance "Performance degradation, focus on database query optimization"
--guidance "Payment processing down, revenue impact critical"
--guidance "Tight SLA window, prioritize fast rollback over investigation"
--guidance "First P0 for new team, need extra documentation and communication"
How to Apply:
- Parse guidance for keywords: security, performance, compliance, revenue, data-loss
- Adjust agent assignments (add security-gatekeeper for security incidents)
- Modify escalation paths (immediate executive notification for revenue impact)
- Influence mitigation strategy (rollback vs hotfix vs investigation)
- Prioritize documentation depth (standard vs comprehensive for learning)
--interactive Parameter
Purpose: You ask 5-8 strategic questions to understand incident context
Questions to Ask (if --interactive):
I'll ask 8 strategic questions to tailor incident response to your situation:
Q1: What is the observed user impact?
(e.g., complete outage, degraded performance, specific feature unavailable)
Q2: What percentage of users are affected?
(Helps me assign initial severity: P0 = >50%, P1 = 10-50%, P2 = <10%)
Q3: When did the issue start?
(Timeline helps identify triggering events: deployments, traffic spikes)
Q4: What recent changes occurred in the last 24 hours?
(Deployments, config changes, infrastructure updates - guides rollback decisions)
Q5: Is this security-related or involving data loss?
(Immediate escalation to security team, forensics preservation)
Q6: What is the business impact?
(Revenue loss, compliance risk, reputation damage - affects escalation urgency)
Q7: What is your on-call team's experience level?
(Helps me tailor runbook detail and escalation speed)
Q8: What is your current SLA status?
(Error budget remaining, time to SLA breach - affects mitigation strategy)
Based on your answers, I'll adjust:
- Severity classification (P0/P1/P2/P3)
- Escalation urgency (functional and hierarchical)
- Mitigation strategy priority (rollback vs investigation)
- Communication frequency (every 15 min vs hourly)
- Documentation depth (standard vs comprehensive PIR)
Synthesize Guidance: Combine answers into structured guidance string for execution
Artifacts to Generate
Primary Deliverables:
- Incident Record: Initial detection and classification →
.aiwg/incidents/{incident-id}/incident-record.md
- Incident Timeline: Chronological event log →
.aiwg/incidents/{incident-id}/timeline.md
- Triage Assessment: Impact and urgency analysis →
.aiwg/incidents/{incident-id}/triage-assessment.md
- Regression Analysis: Regression triage results →
.aiwg/incidents/{incident-id}/regression-analysis.md
- Root Cause Analysis: 5 Whys and fishbone →
.aiwg/incidents/{incident-id}/root-cause-analysis.md
- Mitigation Report: Resolution strategy and validation →
.aiwg/incidents/{incident-id}/mitigation-report.md
- Post-Incident Review (PIR): Blameless retrospective →
.aiwg/incidents/{incident-id}/post-incident-review.md
- Preventive Actions: Tracked action items →
.aiwg/incidents/{incident-id}/preventive-actions.md
Supporting Artifacts:
- Escalation logs (who, when, why)
- Communication templates (status page updates)
- Runbook updates (new troubleshooting steps)
- Knowledge base articles (lessons learned)
Multi-Agent Orchestration Workflow
Step 1: Incident Detection and Initial Logging
Purpose: Capture incident details immediately to enable rapid response
Your Actions:
Create Incident Directory:
# You do this directly (no agent needed)
mkdir -p .aiwg/incidents/{incident-id}/{logs,diagnostics,communications,actions}
Launch Detection and Logging Agent:
Task(
subagent_type="incident-responder",
description="Create incident record and initial classification",
prompt="""
Incident ID: {incident-id}
Reported symptoms: {user-provided description}
Create Incident Record:
**Incident ID**: {incident-id}
**Detection Time**: {YYYY-MM-DD HH:MM:SS UTC}
**Reporter**: {user/system/alert}
**Detection Method**: {automated-alert | user-report | monitoring | manual}
## Initial Description
{1-2 sentence summary of reported issue}
**User Impact**: {description of user-facing symptoms}
**Affected Systems**: {list systems/components based on description}
**Affected User Count**: {estimated count | UNKNOWN}
## Initial Classification
**Severity**: {P0 | P1 | P2 | P3 | TBD}
**Category**: {availability | performance | functionality | security | data-integrity}
## Assigned Team
**Incident Commander**: {TBD - to be assigned based on severity}
**On-Call Engineer**: {TBD - from on-call rotation}
**Status**: DETECTED
Save to: .aiwg/incidents/{incident-id}/incident-record.md
Also create initial timeline entry:
| Time | Event | Actor | Notes |
|------|-------|-------|-------|
| {HH:MM UTC} | Incident detected | {reporter} | {initial symptoms} |
Save to: .aiwg/incidents/{incident-id}/timeline.md
"""
)
Create Incident Communication Channel:
Task(
subagent_type="incident-responder",
description="Create incident alert and communication template",
prompt="""
Generate initial incident alert template:
## Incident Alert: {incident-id}
**Status**: DETECTED
**Severity**: {P0/P1/P2/P3}
**Time**: {HH:MM UTC}
**Issue**: {brief description}
**User Impact**: {high-level impact}
**Assigned**: {on-call engineer}
**Next Update**: {estimated time}
**Incident Channel**: #incident-{YYYY-MM-DD}-{ID}
**Incident Dashboard**: {link to monitoring dashboard}
Save to: .aiwg/incidents/{incident-id}/communications/initial-alert.md
"""
)
Communicate Progress:
✓ Incident {incident-id} logged
✓ Initial record created
⏳ Proceeding to regression triage...
Step 1.5: Regression Triage
Purpose: Determine if incident is a regression from recent changes to guide rollback decisions
Your Actions:
Launch Regression Detection Agent:
Task(
subagent_type="regression-analyst",
description="Determine if incident is a regression from recent changes",
prompt="""
Read incident record: .aiwg/incidents/{incident-id}/incident-record.md
Execute Regression Triage:
## Step 1: Identify Recent Deployments
Check for recent deployments/changes:
- Use command: /regression-check --baseline last-deployment
- Review git log for last 24-48 hours
- Check deployment history from CI/CD
- Review configuration changes
- Check infrastructure updates
Document all recent changes with timestamps.
## Step 2: Symptom Correlation
Compare incident symptoms against baseline:
**Symptom Pattern Matching**:
- Did this functionality work before? {YES | NO | UNKNOWN}
- When did it last work? {timestamp | UNKNOWN}
- What changed between working and broken? {specific change | UNKNOWN}
**Regression Indicators** (Check all that apply):
- [ ] Functionality worked in previous version
- [ ] Issue appeared immediately after deployment
- [ ] Issue correlates with specific commit/PR
- [ ] Similar pattern in staging/canary deployment
- [ ] Metrics show clear inflection point at deployment time
## Step 3: Regression Verdict
**Is this a regression?**: {CONFIRMED | LIKELY | POSSIBLE | UNLIKELY | NOT_REGRESSION}
**Confidence**: {HIGH (>90%) | MEDIUM (70-90%) | LOW (<70%)}
**Evidence**:
1. {evidence point 1}
2. {evidence point 2}
3. {evidence point 3}
Save initial assessment to: .aiwg/incidents/{incident-id}/regression-analysis.md (Step 1-3)
Append timeline:
| {HH:MM UTC} | Regression triage initiated | regression-analyst | Verdict: {CONFIRMED|LIKELY|POSSIBLE|UNLIKELY|NOT_REGRESSION} |
"""
)
If Regression Confirmed/Likely, Launch Regression Bisect:
# Only if regression verdict is CONFIRMED or LIKELY
Task(
subagent_type="regression-analyst",
description="Identify introducing change via bisect",
prompt="""
Read regression analysis: .aiwg/incidents/{incident-id}/regression-analysis.md
Since regression is {CONFIRMED|LIKELY}, identify introducing change:
## Step 4: Bisect to Find Introducing Commit
Use command: /regression-bisect
Execute bisect process:
- Start: {last-known-good-commit}
- End: {current-broken-commit}
- Test: {reproduction steps or test case}
Document bisect process and result:
**Bisect Results**:
- **Introducing Commit**: {SHA}
- **Author**: {name}
- **Timestamp**: {YYYY-MM-DD HH:MM:SS}
- **PR/MR**: {PR-number} - {PR-title}
- **Commit Message**: {message}
- **Files Changed**: {count} files
- **Risk Assessment**: {LOW | MEDIUM | HIGH based on scope}
**Commit Details**:
```
{git show {SHA} --stat output}
```
**Related Changes**:
- [ ] Code changes in affected component
- [ ] Configuration changes
- [ ] Database migrations
- [ ] Dependency updates
- [ ] Infrastructure changes
Append to: .aiwg/incidents/{incident-id}/regression-analysis.md (Step 4)
Append timeline:
| {HH:MM UTC} | Introducing commit identified | regression-analyst | Commit: {SHA}, PR: {PR-number} |
"""
)
Rollback Feasibility Assessment:
Task(
subagent_type="reliability-engineer",
description="Assess rollback feasibility and calculate blast radius",
prompt="""
Read regression analysis: .aiwg/incidents/{incident-id}/regression-analysis.md
Since introducing change identified, assess rollback options:
## Step 5: Rollback Feasibility
**Rollback Options**:
### Option A: Full Rollback to Previous Version
- **Target Version**: {version before introducing commit}
- **Feasibility**: {SAFE | RISKY | BLOCKED}
- **Risk Factors**:
- [ ] Database migrations in between (incompatible schema)
- [ ] External API contract changes (breaking)
- [ ] Data written in new format (can't be read by old version)
- [ ] Dependent services already updated (coordination required)
- **Rollback Time**: {estimated minutes}
- **Data Loss Risk**: {NONE | MINIMAL | SIGNIFICANT}
### Option B: Revert Specific Commit(s)
- **Commits to Revert**: {SHA1, SHA2, ...}
- **Feasibility**: {SAFE | RISKY | BLOCKED}
- **Conflicts**: {count} potential merge conflicts
- **Testing Required**: {minimal | moderate | extensive}
- **Revert + Deploy Time**: {estimated minutes}
### Option C: Feature Flag Disable
- **Applicable**: {YES | NO}
- **Feature Flags Involved**: {flag-names}
- **Disable Time**: {estimated minutes} (near-instant)
- **Partial Rollback**: {which features disabled}
### Option D: Hotfix Forward
- **Feasibility**: {VIABLE | NOT_VIABLE}
- **Fix Complexity**: {SIMPLE | MODERATE | COMPLEX}
- **Estimated Fix Time**: {minutes}
- **Testing Time**: {minutes}
- **Total Time**: {minutes}
**Recommended Option**: {A | B | C | D}
**Rationale**: {why this option is best given constraints}
## Step 6: Blast Radius Calculation
**Scope of Introducing Change**:
- **Components Affected**: {list all components touched by change}
- **Services Impacted**: {list all services}
- **Dependencies**: {downstream systems affected}
- **Users Impacted**: {estimated count or percentage}
- **Geographic Scope**: {all regions | specific regions}
- **User Segments**: {all users | specific segments}
**Rollback Impact Assessment**:
- **Services Affected by Rollback**: {list}
- **Data Loss Risk**: {NONE | MINIMAL | ACCEPTABLE | UNACCEPTABLE}
- **Downtime Required**: {NONE | <5 min | 5-15 min | >15 min}
- **Coordination Required**: {list teams/services needing notification}
**Blast Radius Score**: {LOW | MEDIUM | HIGH}
Append to: .aiwg/incidents/{incident-id}/regression-analysis.md (Steps 5-6)
Append timeline:
| {HH:MM UTC} | Rollback feasibility assessed | reliability-engineer | Recommended: {option}, Blast radius: {score} |
"""
)
Immediate Action Recommendation:
Task(
subagent_type="regression-analyst",
description="Recommend immediate action based on regression analysis",
prompt="""
Read complete regression analysis: .aiwg/incidents/{incident-id}/regression-analysis.md
## Step 7: Immediate Action Decision Matrix
Use decision matrix to recommend action:
| Regression Confidence | Rollback Risk | User Impact | Recommendation |
|-----------------------|---------------|-------------|----------------|
| CONFIRMED + HIGH | LOW | HIGH | **ROLLBACK IMMEDIATELY** |
| CONFIRMED + HIGH | LOW | MEDIUM | **ROLLBACK** |
| CONFIRMED + HIGH | MEDIUM | HIGH | **ROLLBACK with validation** |
| CONFIRMED + HIGH | HIGH | HIGH | **HOTFIX (rollback blocked)** |
| LIKELY + MEDIUM | LOW | HIGH | **ROLLBACK after quick validation** |
| LIKELY + MEDIUM | MEDIUM | HIGH | **INVESTIGATE + prepare rollback** |
| POSSIBLE + LOW | ANY | HIGH | **INVESTIGATE (parallel to Tier 1)** |
| UNLIKELY | ANY | ANY | **STANDARD TRIAGE (continue to Step 2)** |
**Current Situation**:
- Regression Confidence: {from Step 3}
- Rollback Risk: {from Step 5}
- User Impact: {from incident record}
**Recommended Immediate Action**: {action from matrix}
**Action Details**:
- **Action Type**: {ROLLBACK | HOTFIX | INVESTIGATE | STANDARD_TRIAGE}
- **Urgency**: {IMMEDIATE (<5 min) | URGENT (<15 min) | NORMAL (standard SLA)}
- **Prerequisites**: {any validation or approval needed}
- **Execution Steps**: {high-level steps}
- **Fallback Plan**: {if this action fails}
**Communication**:
- Notify Incident Commander: {key finding summary}
- Notify Deployment Manager: {rollback decision if applicable}
- Update status: "Regression {CONFIRMED|LIKELY|POSSIBLE}, {action} in progress"
Append to: .aiwg/incidents/{incident-id}/regression-analysis.md (Step 7)
Append timeline:
| {HH:MM UTC} | Immediate action recommended | regression-analyst | Action: {ROLLBACK|HOTFIX|INVESTIGATE|STANDARD_TRIAGE} |
"""
)
Update Regression Register:
Task(
subagent_type="regression-analyst",
description="Record regression in regression register",
prompt="""
If regression is CONFIRMED or LIKELY, update regression register:
Read regression analysis: .aiwg/incidents/{incident-id}/regression-analysis.md
Update regression register with incident:
**Regression Entry**:
```yaml
regression_id: REG-{YYYY-MM-DD}-{sequence}
incident_id: {incident-id}
detection_date: {YYYY-MM-DD}
severity: {P0|P1|P2|P3}
introducing_change:
commit_sha: {SHA}
pr_number: {PR-number}
author: {name}
merge_date: {YYYY-MM-DD}
deployment_date: {YYYY-MM-DD}
regression_category: {functional | performance | security | data-integrity}
affected_functionality:
component: {component-name}
feature: {feature-name}
user_facing: {YES|NO}
detection_gap:
escaped_testing: {unit | integration | e2e | manual | staging}
detection_time: {hours from deployment to detection}
reason: {why tests didn't catch this}
mitigation_action: {rollback | hotfix | feature-flag-disable}
mitigation_time: {minutes from detection to resolution}
preventive_actions:
- {action 1 to prevent recurrence}
- {action 2 to improve detection}
status: {OPEN | MITIGATED | ANALYZED | CLOSED}
```
Save to: .aiwg/regression/register/{regression-id}.yaml
Also update regression summary:
Append one-line entry to: .aiwg/regression/regression-register-summary.md
| {regression-id} | {incident-id} | {YYYY-MM-DD} | {P0|P1|P2} | {commit-SHA} | {category} | {status} |
Cross-reference in incident:
Append to: .aiwg/incidents/{incident-id}/regression-analysis.md
## Regression Register Entry
This incident has been registered as: **{regression-id}**
See: @.aiwg/regression/register/{regression-id}.yaml
Append timeline:
| {HH:MM UTC} | Regression registered | regression-analyst | Registered as: {regression-id} |
"""
)
Decision Flow:
Regression Triage Decision Tree:
1. Is this a regression?
├─ CONFIRMED/LIKELY → Proceed to rollback assessment
│ ├─ Rollback SAFE + HIGH user impact → Execute rollback immediately
│ ├─ Rollback RISKY or BLOCKED → Proceed to hotfix path
│ └─ Rollback SAFE + LOW user impact → Prepare rollback, investigate in parallel
│
├─ POSSIBLE → Continue standard triage in parallel with regression investigation
│
└─ UNLIKELY/NOT_REGRESSION → Continue to standard triage (Step 2)
Communicate Progress:
✓ Incident logged
⏳ Regression triage in progress...
✓ Recent deployments identified: {count} in last {hours}h
✓ Regression verdict: {CONFIRMED|LIKELY|POSSIBLE|UNLIKELY|NOT_REGRESSION}
{✓ Introducing commit identified: {SHA}, PR: {PR-number}}
{✓ Rollback feasibility: {SAFE|RISKY|BLOCKED}}
✓ Recommended action: {ROLLBACK|HOTFIX|INVESTIGATE|STANDARD_TRIAGE}
{✓ Regression registered: {regression-id}}
⏳ {Executing immediate rollback | Proceeding to hotfix development | Continuing to standard triage}...
Step 2: Triage and Severity Assessment
Purpose: Rapidly assess severity and assign priority using Impact × Urgency matrix
Your Actions:
Launch Triage Agents (parallel):
# Agent 1: Impact Assessment
Task(
subagent_type="incident-responder",
description="Assess incident impact (user effect)",
prompt="""
Read incident record: .aiwg/incidents/{incident-id}/incident-record.md
Assess Impact Level:
**User Impact Assessment**:
- Affected Users: {count or percentage}
- Severity of Effect: {complete outage | severe degradation | minor issue}
- Impact Level: {HIGH | MEDIUM | LOW}
Criteria:
- HIGH: Complete service outage OR >50% users affected OR data loss/corruption
- MEDIUM: Severe degradation OR 10-50% users affected OR critical feature unavailable
- LOW: Minor degradation OR <10% users affected OR cosmetic issue
**Business Impact**:
- Revenue Impact: {$amount | NONE}
- Compliance Risk: {YES | NO}
- Reputation Risk: {HIGH | MEDIUM | LOW}
- User Safety Risk: {YES | NO}
**Affected Systems**: {list all affected components, services, integrations}
Save to: .aiwg/incidents/{incident-id}/triage-assessment.md (Impact section)
"""
)
# Agent 2: Urgency Assessment
Task(
subagent_type="reliability-engineer",
description="Assess incident urgency (time sensitivity)",
prompt="""
Read incident record: .aiwg/incidents/{incident-id}/incident-record.md
Assess Urgency Level:
**Urgency Assessment**:
- Time Sensitivity: {immediate | hours | days}
- Worsening Trend: {rapidly degrading | stable | improving}
- Urgency Level: {HIGH | MEDIUM | LOW}
Criteria:
- HIGH: Immediate resolution required, worsening rapidly, SLA breach imminent
- MEDIUM: Resolution needed within hours, stable degradation
- LOW: Resolution can be scheduled, no time pressure
**SLA Breach Risk**:
- Current Availability: {percentage}%
- SLA Target: {percentage}%
- Error Budget Remaining: {percentage}%
- Time to SLA Breach: {estimated time}
Append to: .aiwg/incidents/{incident-id}/triage-assessment.md (Urgency section)
"""
)
Synthesize Priority Classification:
Task(
subagent_type="incident-responder",
description="Determine incident priority from Impact × Urgency",
prompt="""
Read triage assessment: .aiwg/incidents/{incident-id}/triage-assessment.md
Determine Priority using matrix:
| Impact/Urgency | High Urgency | Medium Urgency | Low Urgency |
|----------------|--------------|----------------|-------------|
| High Impact | P0 (Critical) | P1 (High) | P2 (Medium) |
| Medium Impact | P1 (High) | P2 (Medium) | P3 (Low) |
| Low Impact | P2 (Medium) | P3 (Low) | P3 (Low) |
**Priority**: {P0 | P1 | P2 | P3}
**Response SLA**:
- P0: Acknowledgment immediate, Engage 15 min, Resolve 1-2h, Updates every 15 min
- P1: Acknowledgment 5 min, Engage 30 min, Resolve 4h, Updates every 30 min
- P2: Acknowledgment 30 min, Engage 4h, Resolve 24h, Updates daily
- P3: Acknowledgment 1 business day, Standard backlog process
**Escalation Path**:
- P0: Page on-call → Incident Commander → Deployment Manager → Executive (30 min)
- P1: Alert on-call → Incident Commander → Component Owner → Management (2h)
- P2: Create ticket → On-call triage → Component Owner if needed
- P3: Standard backlog
**Incident Commander Assignment** (P0/P1 only):
- Assign Incident Commander: {name or role}
- Assign Technical Lead: {on-call engineer or component owner}
- Assign Communications Lead: {support lead or PM}
Update incident record with priority and assignments
Save to: .aiwg/incidents/{incident-id}/incident-record.md
Append timeline:
| {HH:MM UTC} | Triage complete, severity {P0/P1/P2/P3} assigned | incident-responder | Impact: {HIGH/MED/LOW}, Urgency: {HIGH/MED/LOW} |
| {HH:MM UTC} | Incident Commander assigned | {name} | {P0/P1 only} |
Append to: .aiwg/incidents/{incident-id}/timeline.md
"""
)
Communicate Progress:
✓ Incident detected
⏳ Assessing impact and urgency...
✓ Impact: {HIGH/MEDIUM/LOW}
✓ Urgency: {HIGH/MEDIUM/LOW}
✓ Priority assigned: {P0/P1/P2/P3}
✓ Incident Commander assigned: {name} (P0/P1)
⏳ Initiating functional escalation (Tier 1)...
Step 3: Functional Escalation (Tier 1 → Tier 2 → Tier 3)
Purpose: Engage appropriate expertise based on incident complexity
Your Actions:
Tier 1 Response (First 15-30 minutes):
Task(
subagent_type="reliability-engineer",
description="Tier 1 response: Runbook execution and data gathering",
prompt="""
Read incident record: .aiwg/incidents/{incident-id}/incident-record.md
Execute Tier 1 Response:
## Initial Actions (First 5 minutes)
- [ ] Acknowledge incident
- [ ] Confirm user impact (reproduce if possible)
- [ ] Check recent deployments/changes (last 24h)
- [ ] Review monitoring dashboards for anomalies
- [ ] Identify applicable runbook: deployment/runbook-{scenario}.md
## Data Gathering
Collect diagnostic data:
- System health (pods, nodes, services status)
- Recent deployments (git log, rollout history)
- Logs (last 500 lines from affected services)
- Metrics (error rate, latency, throughput)
- Database health (active connections, slow queries)
Document actions taken and results.
## Escalation Decision (Tier 1 → Tier 2)
Escalate if:
- Runbook not available OR issue unresolved after {15 min P0 | 30 min P1}
- Requires deep component knowledge or code changes
- Database, network, or infrastructure issue suspected
If escalation needed, document:
- Why escalating (specific reason)
- Data collected (attach logs, metrics)
- Hypotheses tested (what was tried)
Save diagnostic data to: .aiwg/incidents/{incident-id}/diagnostics/tier1-data.md
Append timeline with all actions taken.
"""
)
Tier 2 Response (If escalated):
Task(
subagent_type="component-owner",
description="Tier 2 response: Advanced troubleshooting and code review",
prompt="""
Read incident record: .aiwg/incidents/{incident-id}/incident-record.md
Read Tier 1 data: .aiwg/incidents/{incident-id}/diagnostics/tier1-data.md
Execute Tier 2 Response:
## Handoff from Tier 1
- Review incident summary and diagnostic data
- Review actions already taken by Tier 1
- Review relevant runbooks and recent changes
## Advanced Troubleshooting
- Deep log analysis (error patterns, stack traces)
- Code review for recent changes (git diff last 48h)
- Reproduce issue in non-prod environment (if possible)
- Check component dependencies (upstream/downstream services)
- Analyze performance profiles (CPU, memory, query execution plans)
## Root Cause Hypothesis
Formulate hypothesis:
**Hypothesis**: {statement of suspected root cause}
**Evidence**:
1. {log pattern or metric anomaly}
2. {recent deployment or config change}
3. {external dependency status}
**Test Plan**:
- [ ] {validation step 1}
- [ ] {validation step 2}
## Escalation Decision (Tier 2 → Tier 3)
Escalate if:
- Architectural issue or design flaw suspected
- Vendor/third-party dependency issue
- Unresolved after {30 min P0 | 1 hour P1}
- Emergency code fix required (hotfix approval needed)
Save hypothesis and findings to: .aiwg/incidents/{incident-id}/diagnostics/tier2-analysis.md
Append timeline with advanced troubleshooting results.
"""
)
Tier 3 Response (If escalated):
Task(
subagent_type="architecture-designer",
description="Tier 3 response: Architectural analysis and emergency decisions",
prompt="""
Read all prior diagnostics:
- .aiwg/incidents/{incident-id}/diagnostics/tier1-data.md
- .aiwg/incidents/{incident-id}/diagnostics/tier2-analysis.md
Execute Tier 3 Response:
## Architectural Analysis
- Review system design for fundamental issues
- Evaluate scalability/capacity constraints
- Consider architectural trade-offs (CAP theorem, consistency models)
- Engage vendor support if third-party dependency issue
## Emergency Decision Authority
Provide decisions on:
- Emergency architecture changes (approve/reject)
- Vendor escalation (initiate if needed)
- Hotfix deployment outside normal process (approve with conditions)
- Temporary workaround vs. full fix (recommend approach)
Document architectural assessment and decisions:
Save to: .aiwg/incidents/{incident-id}/diagnostics/tier3-architecture-assessment.md
Append timeline with architectural decisions.
"""
)
Communicate Progress:
✓ Priority assigned: {P0/P1/P2/P3}
⏳ Tier 1 response initiated...
✓ Runbook executed: {runbook-name}
✓ Diagnostic data collected
⚠️ Escalating to Tier 2 (reason: {escalation-reason})
⏳ Tier 2 response: Component Owner engaged...
✓ Root cause hypothesis: {hypothesis}
{✓ Hypothesis confirmed | ⚠️ Escalating to Tier 3}
Step 4: Hierarchical Escalation (Management / Executive)
Purpose: Notify leadership when business impact warrants executive involvement
Your Actions:
Management Notification (P0/P1):
Task(
subagent_type="project-manager",
description="Notify management per escalation matrix",
prompt="""
Read incident record: .aiwg/incidents/{incident-id}/incident-record.md
Determine if management notification required:
**Trigger**:
- P0: Within 30 minutes of detection (automatic)
- P1: Within 2 hours if unresolved
- P2: If user impact escalates or SLA breach imminent
Generate management notification:
Subject: [{P0 | P1} INCIDENT] {brief-title} - {status}
**Incident ID**: {incident-id}
**Severity**: {P0/P1}
**Start Time**: {HH:MM UTC}
**Duration**: {elapsed-time}
**User Impact**: {high-level description}
**Affected Users**: {count | percentage}
**Business Impact**: {revenue loss | compliance risk | reputation impact}
**Current Status**: {INVESTIGATING | MITIGATING | RESOLVED}
**Root Cause**: {hypothesis or confirmed}
**ETA to Resolution**: {estimated time | UNKNOWN}
**Incident Commander**: {name}
**Next Update**: {time}
Save to: .aiwg/incidents/{incident-id}/communications/management-notification.md
Append timeline: Management notified
"""
)
Executive Escalation (P0 Critical):
Task(
subagent_type="project-manager",
description="Notify executive leadership for P0 or major business impact",
prompt="""
Read incident record: .aiwg/incidents/{incident-id}/incident-record.md
Determine if executive notification required:
**Trigger**:
- P0: If unresolved after 2 hours OR major business impact
- Security breach or data loss (immediate)
- Public/media attention likely
- Regulatory reporting required
Generate executive notification:
Subject: [EXECUTIVE ALERT] P0 Incident - {brief-title}
**Business Impact Summary**:
- Revenue Impact: {$amount estimated}
- User Impact: {count} users / {percentage}% of user base
- Compliance Risk: {YES/NO - describe}
- Reputation Risk: {HIGH/MEDIUM/LOW}
**Incident Summary**:
{2-3 sentence summary of issue and response}
**Current Status**: {status}
**ETA to Resolution**: {time}
**Incident Commander**: {name}
**Executive Action Needed**:
{NONE | DECISION REQUIRED | AWARENESS ONLY}
**Next Update**: {time}
Save to: .aiwg/incidents/{incident-id}/communications/executive-notification.md
Append timeline: Executive leadership notified
"""
)
Status Page Communication (P0/P1):
Task(
subagent_type="incident-responder",
description="Generate status page update template",
prompt="""
Create public-facing status page update:
{YYYY-MM-DD HH:MM UTC} - Investigating
We are currently investigating an issue affecting {service/feature}.
Users may experience {specific symptoms}. We will provide updates every {15|30|60} minutes.
Save template to: .aiwg/incidents/{incident-id}/communications/status-page-update.md
Note: Update within 30 minutes for P0, 1 hour for P1
"""
)
Communicate Progress:
✓ Tier 2 analysis complete
⏳ Escalating per severity matrix...
✓ Management notified (P0/P1)
{✓ Executive notified (P0 >2h or critical business impact) | ⊘ Executive notification not required}
✓ Status page update template created
⏳ Proceeding to root cause analysis and mitigation...
Step 5: Root Cause Analysis
Purpose: Identify root cause using structured methodologies (5 Whys, Fishbone)
Your Actions:
- Launch RCA Agents (parallel):
# Agent 1: 5 Whys Analysis
Task(
subagent_type="incident-responder",
description="Conduct 5 Whys root cause analysis",
prompt="""
Read diagnostics:
- .aiwg/incidents/{incident-id}/diagnostics/tier1-data.md
- .aiwg/incidents/{incident-id}/diagnostics/tier2-analysis.md
- .aiwg/incidents/{incident-id}/diagnostics/tier3-architecture-assessment.md (if exists)
Conduct 5 Whys Analysis:
**Problem Statement**: {what happened}
1. **Why did {problem} occur?**
- Because {reason-1}
2. **Why did {reason-1} occur?**
- Because {reason-2}
3. **Why did {reason-2} occur?**
- Because {reason-3}
4. **Why did {reason-3} occur?**
- Because {reason-4}
5. **Why did {reason-4} occur?**
- Because {root-cause}
**Root Cause**: {final answer from 5th why}
**Validation**: {test to confirm root cause}
Save to: .aiwg/incidents/{incident-id}/root-cause-analysis.md (5 Whys section)
"""
)
# Agent 2: Contributing Factors (Fishbone)
Task(
subagent_type="reliability-engineer",
description="Identify contributing factors using Ishikawa diagram",
prompt="""
Read diagnostics and 5 Whys analysis
Analyze Contributing Factors:
**Problem**: {incident title}
### People
- {factor 1: e.g., insufficient training}
- {factor 2: e.g., on-call fatigue}
### Process
- {factor 1: e.g., inadequate testing}
- {factor 2: e.g., unclear runbook}
### Technology
- {factor 1: e.g., database connection pool exhaustion}
- {factor 2: e.g., monitoring gap}
### Environment
- {factor 1: e.g., traffic spike}
- {factor 2: e.g., resource constraints}
**Primary Root Cause**: {from 5 Whys}
**Contributing Factors**: {list key factors from above}
Append to: .aiwg/incidents/{incident-id}/root-cause-analysis.md (Contributing Factors section)
"""
)
Communicate Progress:
✓ Hierarchical escalation complete
⏳ Conducting root cause analysis...
✓ 5 Whys analysis: Root cause identified as {root-cause}
✓ Contributing factors analysis: {count} factors identified
✓ Root cause analysis complete: .aiwg/incidents/{incident-id}/root-cause-analysis.md
⏳ Implementing mitigation strategy...
Step 6: Mitigation and Resolution
Purpose: Implement workaround or fix to restore service and eliminate user impact
Your Actions:
Select Mitigation Strategy:
Task(
subagent_type="incident-responder",
description="Select mitigation strategy based on root cause",
prompt="""
Read root cause analysis: .aiwg/incidents/{incident-id}/root-cause-analysis.md
Evaluate Mitigation Options:
**Option 1: Rollback** (fastest, safest for deployment-related incidents)
- Use Case: Recent deployment caused issue, old version was stable
- Time to Mitigate: 5-15 minutes
- Risk: Low (return to known-good state)
**Option 2: Hotfix** (targeted code fix)
- Use Case: Bug fix required, rollback not viable
- Time to Mitigate: 30 minutes - 2 hours
- Risk: Medium (new code, limited testing)
**Option 3: Configuration Change** (parameter adjustment)
- Use Case: Resource limits, timeouts, feature flags
- Time to Mitigate: 10-30 minutes
- Risk: Low-Medium (no code change)
**Option 4: Workaround** (temporary user-side solution)
- Use Case: Fix requires significant time, need immediate relief
- Time to Mitigate: Immediate (communication)
- Risk: Low (no system change)
**Option 5: Infrastructure Scaling** (resource addition)
- Use Case: Capacity issue, traffic spike
- Time to Mitigate: 10-20 minutes
- Risk: Low-Medium (cost implications)
**Selected Strategy**: {option}
**Rationale**: {why this option was chosen}
**Implementation Plan**: {specific steps}
**Rollback Plan**: {if mitigation fails, how to revert}
Save to: .aiwg/incidents/{incident-id}/mitigation-report.md (Strategy section)
"""
)
Execute Mitigation (agent depends on strategy):
# If Rollback
Task(
subagent_type="devops-engineer",
description="Execute rollback procedure",
prompt="""
Execute rollback based on deployment strategy:
Use existing deployment command:
/flow-deploy-to-production --rollback
Document rollback execution:
- Rollback timestamp
- Previous version: {old-version}
- Rolled back to: {stable-version}
- Verification: smoke tests, metrics
Append to: .aiwg/incidents/{incident-id}/mitigation-report.md (Execution section)
Append timeline: Rollback executed
"""
)
# If Hotfix
Task(
subagent_type="devops-engineer",
description="Deploy emergency hotfix",
prompt="""
Execute hotfix deployment:
1. Create hotfix branch: hotfix/INC-{incident-ID}-{brief-description}
2. Implement minimal fix (code change already identified)
3. Test in staging (smoke tests, regression tests)
4. Deploy to production using standard flow
5. Monitor for 15 minutes (metrics validation)
Get Deployment Manager approval before production deploy.
Document hotfix deployment:
- Hotfix commit SHA
- Deployment timestamp
- Validation results
Append to: .aiwg/incidents/{incident-id}/mitigation-report.md (Execution section)
Append timeline: Hotfix deploye
…(truncated)
1---2name: flow-incident-response3description: Orchestrate production incident triage, escalation, resolution, and post-incident review using ITIL best practices4---56> **Declarative Flow (#1539):** This flow's orchestration is now also expressed as a7> declarative YAML Flow at `flows/flow-incident-response.playbook.yaml` (source of truth for the step8> sequence + gates). This SKILL.md remains the discoverable trigger surface and prose9> reference. See epic #1534.1011# Incident Response Flow1213**You are the Core Orchestrator** for production incident management and resolution.1415## Your Role1617**You orchestrate multi-agent workflows. You do NOT execute bash scripts.**1819When the user requests this flow (via natural language or explicit command):20211. **Interpret the request** and confirm understanding222. **Read this template** as your orchestration guide233. **Extract agent assignments** and workflow steps244. **Delegate agents with the current provider-native orchestration mechanism** in the correct sequence255. **Synthesize results** and finalize artifacts266. **Report completion** with summary2728## Incident Response Overview2930**Purpose**: Rapid detection, triage, escalation, resolution, and learning from production incidents3132**Key Objectives**:33- Minimize user impact through rapid response34- Follow ITIL tier escalation (Tier 1 → Tier 2 → Tier 3)35- Conduct blameless post-incident reviews36- Drive continuous improvement through preventive actions3738**Expected Duration**: P0 = 1-2h resolution, P1 = 4h, P2 = 24h (orchestration: 5-10 minutes)3940## Natural Language Triggers4142Users may say:43- "Handle incident"44- "Production issue detected"45- "Incident response"46- "P0 incident"47- "Service down"48- "System outage"49- "Critical production issue"50- "Emergency response"5152You recognize these as requests for this orchestration flow.5354## Parameter Handling5556### --guidance Parameter5758**Purpose**: User provides upfront direction to tailor incident response priorities5960**Examples**:61```62--guidance "Security incident suspected, preserve forensics before mitigation"63--guidance "Performance degradation, focus on database query optimization"64--guidance "Payment processing down, revenue impact critical"65--guidance "Tight SLA window, prioritize fast rollback over investigation"66--guidance "First P0 for new team, need extra documentation and communication"67```6869**How to Apply**:70- Parse guidance for keywords: security, performance, compliance, revenue, data-loss71- Adjust agent assignments (add security-gatekeeper for security incidents)72- Modify escalation paths (immediate executive notification for revenue impact)73- Influence mitigation strategy (rollback vs hotfix vs investigation)74- Prioritize documentation depth (standard vs comprehensive for learning)7576### --interactive Parameter7778**Purpose**: You ask 5-8 strategic questions to understand incident context7980**Questions to Ask** (if --interactive):8182```83I'll ask 8 strategic questions to tailor incident response to your situation:8485Q1: What is the observed user impact?86 (e.g., complete outage, degraded performance, specific feature unavailable)8788Q2: What percentage of users are affected?89 (Helps me assign initial severity: P0 = >50%, P1 = 10-50%, P2 = <10%)9091Q3: When did the issue start?92 (Timeline helps identify triggering events: deployments, traffic spikes)9394Q4: What recent changes occurred in the last 24 hours?95 (Deployments, config changes, infrastructure updates - guides rollback decisions)9697Q5: Is this security-related or involving data loss?98 (Immediate escalation to security team, forensics preservation)99100Q6: What is the business impact?101 (Revenue loss, compliance risk, reputation damage - affects escalation urgency)102103Q7: What is your on-call team's experience level?104 (Helps me tailor runbook detail and escalation speed)105106Q8: What is your current SLA status?107 (Error budget remaining, time to SLA breach - affects mitigation strategy)108109Based on your answers, I'll adjust:110- Severity classification (P0/P1/P2/P3)111- Escalation urgency (functional and hierarchical)112- Mitigation strategy priority (rollback vs investigation)113- Communication frequency (every 15 min vs hourly)114- Documentation depth (standard vs comprehensive PIR)115```116117**Synthesize Guidance**: Combine answers into structured guidance string for execution118119## Artifacts to Generate120121**Primary Deliverables**:122- **Incident Record**: Initial detection and classification → `.aiwg/incidents/{incident-id}/incident-record.md`123- **Incident Timeline**: Chronological event log → `.aiwg/incidents/{incident-id}/timeline.md`124- **Triage Assessment**: Impact and urgency analysis → `.aiwg/incidents/{incident-id}/triage-assessment.md`125- **Regression Analysis**: Regression triage results → `.aiwg/incidents/{incident-id}/regression-analysis.md`126- **Root Cause Analysis**: 5 Whys and fishbone → `.aiwg/incidents/{incident-id}/root-cause-analysis.md`127- **Mitigation Report**: Resolution strategy and validation → `.aiwg/incidents/{incident-id}/mitigation-report.md`128- **Post-Incident Review (PIR)**: Blameless retrospective → `.aiwg/incidents/{incident-id}/post-incident-review.md`129- **Preventive Actions**: Tracked action items → `.aiwg/incidents/{incident-id}/preventive-actions.md`130131**Supporting Artifacts**:132- Escalation logs (who, when, why)133- Communication templates (status page updates)134- Runbook updates (new troubleshooting steps)135- Knowledge base articles (lessons learned)136137## Multi-Agent Orchestration Workflow138139### Step 1: Incident Detection and Initial Logging140141**Purpose**: Capture incident details immediately to enable rapid response142143**Your Actions**:1441451. **Create Incident Directory**:146 ```147 # You do this directly (no agent needed)148 mkdir -p .aiwg/incidents/{incident-id}/{logs,diagnostics,communications,actions}149 ```1501512. **Launch Detection and Logging Agent**:152 ```153 Task(154 subagent_type="incident-responder",155 description="Create incident record and initial classification",156 prompt="""157 Incident ID: {incident-id}158 Reported symptoms: {user-provided description}159160 Create Incident Record:161162 **Incident ID**: {incident-id}163 **Detection Time**: {YYYY-MM-DD HH:MM:SS UTC}164 **Reporter**: {user/system/alert}165 **Detection Method**: {automated-alert | user-report | monitoring | manual}166167 ## Initial Description168 {1-2 sentence summary of reported issue}169170 **User Impact**: {description of user-facing symptoms}171 **Affected Systems**: {list systems/components based on description}172 **Affected User Count**: {estimated count | UNKNOWN}173174 ## Initial Classification175 **Severity**: {P0 | P1 | P2 | P3 | TBD}176 **Category**: {availability | performance | functionality | security | data-integrity}177178 ## Assigned Team179 **Incident Commander**: {TBD - to be assigned based on severity}180 **On-Call Engineer**: {TBD - from on-call rotation}181 **Status**: DETECTED182183 Save to: .aiwg/incidents/{incident-id}/incident-record.md184185 Also create initial timeline entry:186 | Time | Event | Actor | Notes |187 |------|-------|-------|-------|188 | {HH:MM UTC} | Incident detected | {reporter} | {initial symptoms} |189190 Save to: .aiwg/incidents/{incident-id}/timeline.md191 """192 )193 ```1941953. **Create Incident Communication Channel**:196 ```197 Task(198 subagent_type="incident-responder",199 description="Create incident alert and communication template",200 prompt="""201 Generate initial incident alert template:202203 ## Incident Alert: {incident-id}204205 **Status**: DETECTED206 **Severity**: {P0/P1/P2/P3}207 **Time**: {HH:MM UTC}208209 **Issue**: {brief description}210 **User Impact**: {high-level impact}211212 **Assigned**: {on-call engineer}213 **Next Update**: {estimated time}214215 **Incident Channel**: #incident-{YYYY-MM-DD}-{ID}216 **Incident Dashboard**: {link to monitoring dashboard}217218 Save to: .aiwg/incidents/{incident-id}/communications/initial-alert.md219 """220 )221 ```222223**Communicate Progress**:224```225✓ Incident {incident-id} logged226✓ Initial record created227⏳ Proceeding to regression triage...228```229230### Step 1.5: Regression Triage231232**Purpose**: Determine if incident is a regression from recent changes to guide rollback decisions233234**Your Actions**:2352361. **Launch Regression Detection Agent**:237 ```238 Task(239 subagent_type="regression-analyst",240 description="Determine if incident is a regression from recent changes",241 prompt="""242 Read incident record: .aiwg/incidents/{incident-id}/incident-record.md243244 Execute Regression Triage:245246 ## Step 1: Identify Recent Deployments247248 Check for recent deployments/changes:249 - Use command: /regression-check --baseline last-deployment250 - Review git log for last 24-48 hours251 - Check deployment history from CI/CD252 - Review configuration changes253 - Check infrastructure updates254255 Document all recent changes with timestamps.256257 ## Step 2: Symptom Correlation258259 Compare incident symptoms against baseline:260261 **Symptom Pattern Matching**:262 - Did this functionality work before? {YES | NO | UNKNOWN}263 - When did it last work? {timestamp | UNKNOWN}264 - What changed between working and broken? {specific change | UNKNOWN}265266 **Regression Indicators** (Check all that apply):267 - [ ] Functionality worked in previous version268 - [ ] Issue appeared immediately after deployment269 - [ ] Issue correlates with specific commit/PR270 - [ ] Similar pattern in staging/canary deployment271 - [ ] Metrics show clear inflection point at deployment time272273 ## Step 3: Regression Verdict274275 **Is this a regression?**: {CONFIRMED | LIKELY | POSSIBLE | UNLIKELY | NOT_REGRESSION}276277 **Confidence**: {HIGH (>90%) | MEDIUM (70-90%) | LOW (<70%)}278279 **Evidence**:280 1. {evidence point 1}281 2. {evidence point 2}282 3. {evidence point 3}283284 Save initial assessment to: .aiwg/incidents/{incident-id}/regression-analysis.md (Step 1-3)285286 Append timeline:287 | {HH:MM UTC} | Regression triage initiated | regression-analyst | Verdict: {CONFIRMED|LIKELY|POSSIBLE|UNLIKELY|NOT_REGRESSION} |288 """289 )290 ```2912922. **If Regression Confirmed/Likely, Launch Regression Bisect**:293 ```294 # Only if regression verdict is CONFIRMED or LIKELY295 Task(296 subagent_type="regression-analyst",297 description="Identify introducing change via bisect",298 prompt="""299 Read regression analysis: .aiwg/incidents/{incident-id}/regression-analysis.md300301 Since regression is {CONFIRMED|LIKELY}, identify introducing change:302303 ## Step 4: Bisect to Find Introducing Commit304305 Use command: /regression-bisect306307 Execute bisect process:308 - Start: {last-known-good-commit}309 - End: {current-broken-commit}310 - Test: {reproduction steps or test case}311312 Document bisect process and result:313314 **Bisect Results**:315 - **Introducing Commit**: {SHA}316 - **Author**: {name}317 - **Timestamp**: {YYYY-MM-DD HH:MM:SS}318 - **PR/MR**: {PR-number} - {PR-title}319 - **Commit Message**: {message}320 - **Files Changed**: {count} files321 - **Risk Assessment**: {LOW | MEDIUM | HIGH based on scope}322323 **Commit Details**:324 ```325 {git show {SHA} --stat output}326 ```327328 **Related Changes**:329 - [ ] Code changes in affected component330 - [ ] Configuration changes331 - [ ] Database migrations332 - [ ] Dependency updates333 - [ ] Infrastructure changes334335 Append to: .aiwg/incidents/{incident-id}/regression-analysis.md (Step 4)336337 Append timeline:338 | {HH:MM UTC} | Introducing commit identified | regression-analyst | Commit: {SHA}, PR: {PR-number} |339 """340 )341 ```3423433. **Rollback Feasibility Assessment**:344 ```345 Task(346 subagent_type="reliability-engineer",347 description="Assess rollback feasibility and calculate blast radius",348 prompt="""349 Read regression analysis: .aiwg/incidents/{incident-id}/regression-analysis.md350351 Since introducing change identified, assess rollback options:352353 ## Step 5: Rollback Feasibility354355 **Rollback Options**:356357 ### Option A: Full Rollback to Previous Version358 - **Target Version**: {version before introducing commit}359 - **Feasibility**: {SAFE | RISKY | BLOCKED}360 - **Risk Factors**:361 - [ ] Database migrations in between (incompatible schema)362 - [ ] External API contract changes (breaking)363 - [ ] Data written in new format (can't be read by old version)364 - [ ] Dependent services already updated (coordination required)365 - **Rollback Time**: {estimated minutes}366 - **Data Loss Risk**: {NONE | MINIMAL | SIGNIFICANT}367368 ### Option B: Revert Specific Commit(s)369 - **Commits to Revert**: {SHA1, SHA2, ...}370 - **Feasibility**: {SAFE | RISKY | BLOCKED}371 - **Conflicts**: {count} potential merge conflicts372 - **Testing Required**: {minimal | moderate | extensive}373 - **Revert + Deploy Time**: {estimated minutes}374375 ### Option C: Feature Flag Disable376 - **Applicable**: {YES | NO}377 - **Feature Flags Involved**: {flag-names}378 - **Disable Time**: {estimated minutes} (near-instant)379 - **Partial Rollback**: {which features disabled}380381 ### Option D: Hotfix Forward382 - **Feasibility**: {VIABLE | NOT_VIABLE}383 - **Fix Complexity**: {SIMPLE | MODERATE | COMPLEX}384 - **Estimated Fix Time**: {minutes}385 - **Testing Time**: {minutes}386 - **Total Time**: {minutes}387388 **Recommended Option**: {A | B | C | D}389 **Rationale**: {why this option is best given constraints}390391 ## Step 6: Blast Radius Calculation392393 **Scope of Introducing Change**:394 - **Components Affected**: {list all components touched by change}395 - **Services Impacted**: {list all services}396 - **Dependencies**: {downstream systems affected}397 - **Users Impacted**: {estimated count or percentage}398 - **Geographic Scope**: {all regions | specific regions}399 - **User Segments**: {all users | specific segments}400401 **Rollback Impact Assessment**:402 - **Services Affected by Rollback**: {list}403 - **Data Loss Risk**: {NONE | MINIMAL | ACCEPTABLE | UNACCEPTABLE}404 - **Downtime Required**: {NONE | <5 min | 5-15 min | >15 min}405 - **Coordination Required**: {list teams/services needing notification}406407 **Blast Radius Score**: {LOW | MEDIUM | HIGH}408409 Append to: .aiwg/incidents/{incident-id}/regression-analysis.md (Steps 5-6)410411 Append timeline:412 | {HH:MM UTC} | Rollback feasibility assessed | reliability-engineer | Recommended: {option}, Blast radius: {score} |413 """414 )415 ```4164174. **Immediate Action Recommendation**:418 ```419 Task(420 subagent_type="regression-analyst",421 description="Recommend immediate action based on regression analysis",422 prompt="""423 Read complete regression analysis: .aiwg/incidents/{incident-id}/regression-analysis.md424425 ## Step 7: Immediate Action Decision Matrix426427 Use decision matrix to recommend action:428429 | Regression Confidence | Rollback Risk | User Impact | Recommendation |430 |-----------------------|---------------|-------------|----------------|431 | CONFIRMED + HIGH | LOW | HIGH | **ROLLBACK IMMEDIATELY** |432 | CONFIRMED + HIGH | LOW | MEDIUM | **ROLLBACK** |433 | CONFIRMED + HIGH | MEDIUM | HIGH | **ROLLBACK with validation** |434 | CONFIRMED + HIGH | HIGH | HIGH | **HOTFIX (rollback blocked)** |435 | LIKELY + MEDIUM | LOW | HIGH | **ROLLBACK after quick validation** |436 | LIKELY + MEDIUM | MEDIUM | HIGH | **INVESTIGATE + prepare rollback** |437 | POSSIBLE + LOW | ANY | HIGH | **INVESTIGATE (parallel to Tier 1)** |438 | UNLIKELY | ANY | ANY | **STANDARD TRIAGE (continue to Step 2)** |439440 **Current Situation**:441 - Regression Confidence: {from Step 3}442 - Rollback Risk: {from Step 5}443 - User Impact: {from incident record}444445 **Recommended Immediate Action**: {action from matrix}446447 **Action Details**:448 - **Action Type**: {ROLLBACK | HOTFIX | INVESTIGATE | STANDARD_TRIAGE}449 - **Urgency**: {IMMEDIATE (<5 min) | URGENT (<15 min) | NORMAL (standard SLA)}450 - **Prerequisites**: {any validation or approval needed}451 - **Execution Steps**: {high-level steps}452 - **Fallback Plan**: {if this action fails}453454 **Communication**:455 - Notify Incident Commander: {key finding summary}456 - Notify Deployment Manager: {rollback decision if applicable}457 - Update status: "Regression {CONFIRMED|LIKELY|POSSIBLE}, {action} in progress"458459 Append to: .aiwg/incidents/{incident-id}/regression-analysis.md (Step 7)460461 Append timeline:462 | {HH:MM UTC} | Immediate action recommended | regression-analyst | Action: {ROLLBACK|HOTFIX|INVESTIGATE|STANDARD_TRIAGE} |463 """464 )465 ```4664675. **Update Regression Register**:468 ```469 Task(470 subagent_type="regression-analyst",471 description="Record regression in regression register",472 prompt="""473 If regression is CONFIRMED or LIKELY, update regression register:474475 Read regression analysis: .aiwg/incidents/{incident-id}/regression-analysis.md476477 Update regression register with incident:478479 **Regression Entry**:480 ```yaml481 regression_id: REG-{YYYY-MM-DD}-{sequence}482 incident_id: {incident-id}483 detection_date: {YYYY-MM-DD}484 severity: {P0|P1|P2|P3}485486 introducing_change:487 commit_sha: {SHA}488 pr_number: {PR-number}489 author: {name}490 merge_date: {YYYY-MM-DD}491 deployment_date: {YYYY-MM-DD}492493 regression_category: {functional | performance | security | data-integrity}494495 affected_functionality:496 component: {component-name}497 feature: {feature-name}498 user_facing: {YES|NO}499500 detection_gap:501 escaped_testing: {unit | integration | e2e | manual | staging}502 detection_time: {hours from deployment to detection}503 reason: {why tests didn't catch this}504505 mitigation_action: {rollback | hotfix | feature-flag-disable}506 mitigation_time: {minutes from detection to resolution}507508 preventive_actions:509 - {action 1 to prevent recurrence}510 - {action 2 to improve detection}511512 status: {OPEN | MITIGATED | ANALYZED | CLOSED}513 ```514515 Save to: .aiwg/regression/register/{regression-id}.yaml516517 Also update regression summary:518 Append one-line entry to: .aiwg/regression/regression-register-summary.md519520 | {regression-id} | {incident-id} | {YYYY-MM-DD} | {P0|P1|P2} | {commit-SHA} | {category} | {status} |521522 Cross-reference in incident:523 Append to: .aiwg/incidents/{incident-id}/regression-analysis.md524525 ## Regression Register Entry526527 This incident has been registered as: **{regression-id}**528529 See: @.aiwg/regression/register/{regression-id}.yaml530531 Append timeline:532 | {HH:MM UTC} | Regression registered | regression-analyst | Registered as: {regression-id} |533 """534 )535 ```536537**Decision Flow**:538```539Regression Triage Decision Tree:5405411. Is this a regression?542 ├─ CONFIRMED/LIKELY → Proceed to rollback assessment543 │ ├─ Rollback SAFE + HIGH user impact → Execute rollback immediately544 │ ├─ Rollback RISKY or BLOCKED → Proceed to hotfix path545 │ └─ Rollback SAFE + LOW user impact → Prepare rollback, investigate in parallel546 │547 ├─ POSSIBLE → Continue standard triage in parallel with regression investigation548 │549 └─ UNLIKELY/NOT_REGRESSION → Continue to standard triage (Step 2)550```551552**Communicate Progress**:553```554✓ Incident logged555⏳ Regression triage in progress...556 ✓ Recent deployments identified: {count} in last {hours}h557 ✓ Regression verdict: {CONFIRMED|LIKELY|POSSIBLE|UNLIKELY|NOT_REGRESSION}558 {✓ Introducing commit identified: {SHA}, PR: {PR-number}}559 {✓ Rollback feasibility: {SAFE|RISKY|BLOCKED}}560 ✓ Recommended action: {ROLLBACK|HOTFIX|INVESTIGATE|STANDARD_TRIAGE}561 {✓ Regression registered: {regression-id}}562⏳ {Executing immediate rollback | Proceeding to hotfix development | Continuing to standard triage}...563```564565### Step 2: Triage and Severity Assessment566567**Purpose**: Rapidly assess severity and assign priority using Impact × Urgency matrix568569**Your Actions**:5705711. **Launch Triage Agents** (parallel):572 ```573 # Agent 1: Impact Assessment574 Task(575 subagent_type="incident-responder",576 description="Assess incident impact (user effect)",577 prompt="""578 Read incident record: .aiwg/incidents/{incident-id}/incident-record.md579580 Assess Impact Level:581582 **User Impact Assessment**:583 - Affected Users: {count or percentage}584 - Severity of Effect: {complete outage | severe degradation | minor issue}585 - Impact Level: {HIGH | MEDIUM | LOW}586587 Criteria:588 - HIGH: Complete service outage OR >50% users affected OR data loss/corruption589 - MEDIUM: Severe degradation OR 10-50% users affected OR critical feature unavailable590 - LOW: Minor degradation OR <10% users affected OR cosmetic issue591592 **Business Impact**:593 - Revenue Impact: {$amount | NONE}594 - Compliance Risk: {YES | NO}595 - Reputation Risk: {HIGH | MEDIUM | LOW}596 - User Safety Risk: {YES | NO}597598 **Affected Systems**: {list all affected components, services, integrations}599600 Save to: .aiwg/incidents/{incident-id}/triage-assessment.md (Impact section)601 """602 )603604 # Agent 2: Urgency Assessment605 Task(606 subagent_type="reliability-engineer",607 description="Assess incident urgency (time sensitivity)",608 prompt="""609 Read incident record: .aiwg/incidents/{incident-id}/incident-record.md610611 Assess Urgency Level:612613 **Urgency Assessment**:614 - Time Sensitivity: {immediate | hours | days}615 - Worsening Trend: {rapidly degrading | stable | improving}616 - Urgency Level: {HIGH | MEDIUM | LOW}617618 Criteria:619 - HIGH: Immediate resolution required, worsening rapidly, SLA breach imminent620 - MEDIUM: Resolution needed within hours, stable degradation621 - LOW: Resolution can be scheduled, no time pressure622623 **SLA Breach Risk**:624 - Current Availability: {percentage}%625 - SLA Target: {percentage}%626 - Error Budget Remaining: {percentage}%627 - Time to SLA Breach: {estimated time}628629 Append to: .aiwg/incidents/{incident-id}/triage-assessment.md (Urgency section)630 """631 )632 ```6336342. **Synthesize Priority Classification**:635 ```636 Task(637 subagent_type="incident-responder",638 description="Determine incident priority from Impact × Urgency",639 prompt="""640 Read triage assessment: .aiwg/incidents/{incident-id}/triage-assessment.md641642 Determine Priority using matrix:643644 | Impact/Urgency | High Urgency | Medium Urgency | Low Urgency |645 |----------------|--------------|----------------|-------------|646 | High Impact | P0 (Critical) | P1 (High) | P2 (Medium) |647 | Medium Impact | P1 (High) | P2 (Medium) | P3 (Low) |648 | Low Impact | P2 (Medium) | P3 (Low) | P3 (Low) |649650 **Priority**: {P0 | P1 | P2 | P3}651652 **Response SLA**:653 - P0: Acknowledgment immediate, Engage 15 min, Resolve 1-2h, Updates every 15 min654 - P1: Acknowledgment 5 min, Engage 30 min, Resolve 4h, Updates every 30 min655 - P2: Acknowledgment 30 min, Engage 4h, Resolve 24h, Updates daily656 - P3: Acknowledgment 1 business day, Standard backlog process657658 **Escalation Path**:659 - P0: Page on-call → Incident Commander → Deployment Manager → Executive (30 min)660 - P1: Alert on-call → Incident Commander → Component Owner → Management (2h)661 - P2: Create ticket → On-call triage → Component Owner if needed662 - P3: Standard backlog663664 **Incident Commander Assignment** (P0/P1 only):665 - Assign Incident Commander: {name or role}666 - Assign Technical Lead: {on-call engineer or component owner}667 - Assign Communications Lead: {support lead or PM}668669 Update incident record with priority and assignments670 Save to: .aiwg/incidents/{incident-id}/incident-record.md671672 Append timeline:673 | {HH:MM UTC} | Triage complete, severity {P0/P1/P2/P3} assigned | incident-responder | Impact: {HIGH/MED/LOW}, Urgency: {HIGH/MED/LOW} |674 | {HH:MM UTC} | Incident Commander assigned | {name} | {P0/P1 only} |675676 Append to: .aiwg/incidents/{incident-id}/timeline.md677 """678 )679 ```680681**Communicate Progress**:682```683✓ Incident detected684⏳ Assessing impact and urgency...685 ✓ Impact: {HIGH/MEDIUM/LOW}686 ✓ Urgency: {HIGH/MEDIUM/LOW}687✓ Priority assigned: {P0/P1/P2/P3}688✓ Incident Commander assigned: {name} (P0/P1)689⏳ Initiating functional escalation (Tier 1)...690```691692### Step 3: Functional Escalation (Tier 1 → Tier 2 → Tier 3)693694**Purpose**: Engage appropriate expertise based on incident complexity695696**Your Actions**:6976981. **Tier 1 Response (First 15-30 minutes)**:699 ```700 Task(701 subagent_type="reliability-engineer",702 description="Tier 1 response: Runbook execution and data gathering",703 prompt="""704 Read incident record: .aiwg/incidents/{incident-id}/incident-record.md705706 Execute Tier 1 Response:707708 ## Initial Actions (First 5 minutes)709 - [ ] Acknowledge incident710 - [ ] Confirm user impact (reproduce if possible)711 - [ ] Check recent deployments/changes (last 24h)712 - [ ] Review monitoring dashboards for anomalies713 - [ ] Identify applicable runbook: deployment/runbook-{scenario}.md714715 ## Data Gathering716 Collect diagnostic data:717 - System health (pods, nodes, services status)718 - Recent deployments (git log, rollout history)719 - Logs (last 500 lines from affected services)720 - Metrics (error rate, latency, throughput)721 - Database health (active connections, slow queries)722723 Document actions taken and results.724725 ## Escalation Decision (Tier 1 → Tier 2)726 Escalate if:727 - Runbook not available OR issue unresolved after {15 min P0 | 30 min P1}728 - Requires deep component knowledge or code changes729 - Database, network, or infrastructure issue suspected730731 If escalation needed, document:732 - Why escalating (specific reason)733 - Data collected (attach logs, metrics)734 - Hypotheses tested (what was tried)735736 Save diagnostic data to: .aiwg/incidents/{incident-id}/diagnostics/tier1-data.md737738 Append timeline with all actions taken.739 """740 )741 ```7427432. **Tier 2 Response (If escalated)**:744 ```745 Task(746 subagent_type="component-owner",747 description="Tier 2 response: Advanced troubleshooting and code review",748 prompt="""749 Read incident record: .aiwg/incidents/{incident-id}/incident-record.md750 Read Tier 1 data: .aiwg/incidents/{incident-id}/diagnostics/tier1-data.md751752 Execute Tier 2 Response:753754 ## Handoff from Tier 1755 - Review incident summary and diagnostic data756 - Review actions already taken by Tier 1757 - Review relevant runbooks and recent changes758759 ## Advanced Troubleshooting760 - Deep log analysis (error patterns, stack traces)761 - Code review for recent changes (git diff last 48h)762 - Reproduce issue in non-prod environment (if possible)763 - Check component dependencies (upstream/downstream services)764 - Analyze performance profiles (CPU, memory, query execution plans)765766 ## Root Cause Hypothesis767 Formulate hypothesis:768769 **Hypothesis**: {statement of suspected root cause}770771 **Evidence**:772 1. {log pattern or metric anomaly}773 2. {recent deployment or config change}774 3. {external dependency status}775776 **Test Plan**:777 - [ ] {validation step 1}778 - [ ] {validation step 2}779780 ## Escalation Decision (Tier 2 → Tier 3)781 Escalate if:782 - Architectural issue or design flaw suspected783 - Vendor/third-party dependency issue784 - Unresolved after {30 min P0 | 1 hour P1}785 - Emergency code fix required (hotfix approval needed)786787 Save hypothesis and findings to: .aiwg/incidents/{incident-id}/diagnostics/tier2-analysis.md788789 Append timeline with advanced troubleshooting results.790 """791 )792 ```7937943. **Tier 3 Response (If escalated)**:795 ```796 Task(797 subagent_type="architecture-designer",798 description="Tier 3 response: Architectural analysis and emergency decisions",799 prompt="""800 Read all prior diagnostics:801 - .aiwg/incidents/{incident-id}/diagnostics/tier1-data.md802 - .aiwg/incidents/{incident-id}/diagnostics/tier2-analysis.md803804 Execute Tier 3 Response:805806 ## Architectural Analysis807 - Review system design for fundamental issues808 - Evaluate scalability/capacity constraints809 - Consider architectural trade-offs (CAP theorem, consistency models)810 - Engage vendor support if third-party dependency issue811812 ## Emergency Decision Authority813 Provide decisions on:814 - Emergency architecture changes (approve/reject)815 - Vendor escalation (initiate if needed)816 - Hotfix deployment outside normal process (approve with conditions)817 - Temporary workaround vs. full fix (recommend approach)818819 Document architectural assessment and decisions:820 Save to: .aiwg/incidents/{incident-id}/diagnostics/tier3-architecture-assessment.md821822 Append timeline with architectural decisions.823 """824 )825 ```826827**Communicate Progress**:828```829✓ Priority assigned: {P0/P1/P2/P3}830⏳ Tier 1 response initiated...831 ✓ Runbook executed: {runbook-name}832 ✓ Diagnostic data collected833 ⚠️ Escalating to Tier 2 (reason: {escalation-reason})834⏳ Tier 2 response: Component Owner engaged...835 ✓ Root cause hypothesis: {hypothesis}836 {✓ Hypothesis confirmed | ⚠️ Escalating to Tier 3}837```838839### Step 4: Hierarchical Escalation (Management / Executive)840841**Purpose**: Notify leadership when business impact warrants executive involvement842843**Your Actions**:8448451. **Management Notification (P0/P1)**:846 ```847 Task(848 subagent_type="project-manager",849 description="Notify management per escalation matrix",850 prompt="""851 Read incident record: .aiwg/incidents/{incident-id}/incident-record.md852853 Determine if management notification required:854855 **Trigger**:856 - P0: Within 30 minutes of detection (automatic)857 - P1: Within 2 hours if unresolved858 - P2: If user impact escalates or SLA breach imminent859860 Generate management notification:861862 Subject: [{P0 | P1} INCIDENT] {brief-title} - {status}863864 **Incident ID**: {incident-id}865 **Severity**: {P0/P1}866 **Start Time**: {HH:MM UTC}867 **Duration**: {elapsed-time}868869 **User Impact**: {high-level description}870 **Affected Users**: {count | percentage}871 **Business Impact**: {revenue loss | compliance risk | reputation impact}872873 **Current Status**: {INVESTIGATING | MITIGATING | RESOLVED}874 **Root Cause**: {hypothesis or confirmed}875 **ETA to Resolution**: {estimated time | UNKNOWN}876877 **Incident Commander**: {name}878 **Next Update**: {time}879880 Save to: .aiwg/incidents/{incident-id}/communications/management-notification.md881882 Append timeline: Management notified883 """884 )885 ```8868872. **Executive Escalation (P0 Critical)**:888 ```889 Task(890 subagent_type="project-manager",891 description="Notify executive leadership for P0 or major business impact",892 prompt="""893 Read incident record: .aiwg/incidents/{incident-id}/incident-record.md894895 Determine if executive notification required:896897 **Trigger**:898 - P0: If unresolved after 2 hours OR major business impact899 - Security breach or data loss (immediate)900 - Public/media attention likely901 - Regulatory reporting required902903 Generate executive notification:904905 Subject: [EXECUTIVE ALERT] P0 Incident - {brief-title}906907 **Business Impact Summary**:908 - Revenue Impact: {$amount estimated}909 - User Impact: {count} users / {percentage}% of user base910 - Compliance Risk: {YES/NO - describe}911 - Reputation Risk: {HIGH/MEDIUM/LOW}912913 **Incident Summary**:914 {2-3 sentence summary of issue and response}915916 **Current Status**: {status}917 **ETA to Resolution**: {time}918 **Incident Commander**: {name}919920 **Executive Action Needed**:921 {NONE | DECISION REQUIRED | AWARENESS ONLY}922923 **Next Update**: {time}924925 Save to: .aiwg/incidents/{incident-id}/communications/executive-notification.md926927 Append timeline: Executive leadership notified928 """929 )930 ```9319323. **Status Page Communication (P0/P1)**:933 ```934 Task(935 subagent_type="incident-responder",936 description="Generate status page update template",937 prompt="""938 Create public-facing status page update:939940 {YYYY-MM-DD HH:MM UTC} - Investigating941 We are currently investigating an issue affecting {service/feature}.942 Users may experience {specific symptoms}. We will provide updates every {15|30|60} minutes.943944 Save template to: .aiwg/incidents/{incident-id}/communications/status-page-update.md945946 Note: Update within 30 minutes for P0, 1 hour for P1947 """948 )949 ```950951**Communicate Progress**:952```953✓ Tier 2 analysis complete954⏳ Escalating per severity matrix...955 ✓ Management notified (P0/P1)956 {✓ Executive notified (P0 >2h or critical business impact) | ⊘ Executive notification not required}957 ✓ Status page update template created958⏳ Proceeding to root cause analysis and mitigation...959```960961### Step 5: Root Cause Analysis962963**Purpose**: Identify root cause using structured methodologies (5 Whys, Fishbone)964965**Your Actions**:9669671. **Launch RCA Agents** (parallel):968 ```969 # Agent 1: 5 Whys Analysis970 Task(971 subagent_type="incident-responder",972 description="Conduct 5 Whys root cause analysis",973 prompt="""974 Read diagnostics:975 - .aiwg/incidents/{incident-id}/diagnostics/tier1-data.md976 - .aiwg/incidents/{incident-id}/diagnostics/tier2-analysis.md977 - .aiwg/incidents/{incident-id}/diagnostics/tier3-architecture-assessment.md (if exists)978979 Conduct 5 Whys Analysis:980981 **Problem Statement**: {what happened}982983 1. **Why did {problem} occur?**984 - Because {reason-1}985986 2. **Why did {reason-1} occur?**987 - Because {reason-2}988989 3. **Why did {reason-2} occur?**990 - Because {reason-3}991992 4. **Why did {reason-3} occur?**993 - Because {reason-4}994995 5. **Why did {reason-4} occur?**996 - Because {root-cause}997998 **Root Cause**: {final answer from 5th why}9991000 **Validation**: {test to confirm root cause}10011002 Save to: .aiwg/incidents/{incident-id}/root-cause-analysis.md (5 Whys section)1003 """1004 )10051006 # Agent 2: Contributing Factors (Fishbone)1007 Task(1008 subagent_type="reliability-engineer",1009 description="Identify contributing factors using Ishikawa diagram",1010 prompt="""1011 Read diagnostics and 5 Whys analysis10121013 Analyze Contributing Factors:10141015 **Problem**: {incident title}10161017 ### People1018 - {factor 1: e.g., insufficient training}1019 - {factor 2: e.g., on-call fatigue}10201021 ### Process1022 - {factor 1: e.g., inadequate testing}1023 - {factor 2: e.g., unclear runbook}10241025 ### Technology1026 - {factor 1: e.g., database connection pool exhaustion}1027 - {factor 2: e.g., monitoring gap}10281029 ### Environment1030 - {factor 1: e.g., traffic spike}1031 - {factor 2: e.g., resource constraints}10321033 **Primary Root Cause**: {from 5 Whys}1034 **Contributing Factors**: {list key factors from above}10351036 Append to: .aiwg/incidents/{incident-id}/root-cause-analysis.md (Contributing Factors section)1037 """1038 )1039 ```10401041**Communicate Progress**:1042```1043✓ Hierarchical escalation complete1044⏳ Conducting root cause analysis...1045 ✓ 5 Whys analysis: Root cause identified as {root-cause}1046 ✓ Contributing factors analysis: {count} factors identified1047✓ Root cause analysis complete: .aiwg/incidents/{incident-id}/root-cause-analysis.md1048⏳ Implementing mitigation strategy...1049```10501051### Step 6: Mitigation and Resolution10521053**Purpose**: Implement workaround or fix to restore service and eliminate user impact10541055**Your Actions**:105610571. **Select Mitigation Strategy**:1058 ```1059 Task(1060 subagent_type="incident-responder",1061 description="Select mitigation strategy based on root cause",1062 prompt="""1063 Read root cause analysis: .aiwg/incidents/{incident-id}/root-cause-analysis.md10641065 Evaluate Mitigation Options:10661067 **Option 1: Rollback** (fastest, safest for deployment-related incidents)1068 - Use Case: Recent deployment caused issue, old version was stable1069 - Time to Mitigate: 5-15 minutes1070 - Risk: Low (return to known-good state)10711072 **Option 2: Hotfix** (targeted code fix)1073 - Use Case: Bug fix required, rollback not viable1074 - Time to Mitigate: 30 minutes - 2 hours1075 - Risk: Medium (new code, limited testing)10761077 **Option 3: Configuration Change** (parameter adjustment)1078 - Use Case: Resource limits, timeouts, feature flags1079 - Time to Mitigate: 10-30 minutes1080 - Risk: Low-Medium (no code change)10811082 **Option 4: Workaround** (temporary user-side solution)1083 - Use Case: Fix requires significant time, need immediate relief1084 - Time to Mitigate: Immediate (communication)1085 - Risk: Low (no system change)10861087 **Option 5: Infrastructure Scaling** (resource addition)1088 - Use Case: Capacity issue, traffic spike1089 - Time to Mitigate: 10-20 minutes1090 - Risk: Low-Medium (cost implications)10911092 **Selected Strategy**: {option}1093 **Rationale**: {why this option was chosen}1094 **Implementation Plan**: {specific steps}1095 **Rollback Plan**: {if mitigation fails, how to revert}10961097 Save to: .aiwg/incidents/{incident-id}/mitigation-report.md (Strategy section)1098 """1099 )1100 ```110111022. **Execute Mitigation** (agent depends on strategy):1103 ```1104 # If Rollback1105 Task(1106 subagent_type="devops-engineer",1107 description="Execute rollback procedure",1108 prompt="""1109 Execute rollback based on deployment strategy:11101111 Use existing deployment command:1112 /flow-deploy-to-production --rollback11131114 Document rollback execution:1115 - Rollback timestamp1116 - Previous version: {old-version}1117 - Rolled back to: {stable-version}1118 - Verification: smoke tests, metrics11191120 Append to: .aiwg/incidents/{incident-id}/mitigation-report.md (Execution section)1121 Append timeline: Rollback executed1122 """1123 )11241125 # If Hotfix1126 Task(1127 subagent_type="devops-engineer",1128 description="Deploy emergency hotfix",1129 prompt="""1130 Execute hotfix deployment:11311132 1. Create hotfix branch: hotfix/INC-{incident-ID}-{brief-description}1133 2. Implement minimal fix (code change already identified)1134 3. Test in staging (smoke tests, regression tests)1135 4. Deploy to production using standard flow1136 5. Monitor for 15 minutes (metrics validation)11371138 Get Deployment Manager approval before production deploy.11391140 Document hotfix deployment:1141 - Hotfix commit SHA1142 - Deployment timestamp1143 - Validation results11441145 Append to: .aiwg/incidents/{incident-id}/mitigation-report.md (Execution section)1146 Append timeline: Hotfix deploye11471148…(truncated)