Incident Response
Event Classification
Classify the incident by severity before acting:
| Severity |
Criteria |
Response time |
Action |
| Critical |
App completely down, all users affected |
Immediate |
Diagnose + attempt auto-fix + notify |
| High |
App degraded, errors for some users |
Within minutes |
Diagnose + attempt auto-fix + notify |
| Medium |
Non-user-facing failure (build failed, deploy failed) |
Within session |
Diagnose + fix suggestion + notify |
| Low |
Warning, non-critical issue detected |
Informational |
Notify only |
Severity signals
| Signal |
Severity |
Container exited, restart_count > 3 |
Critical |
| HTTP probe returns 502/503/504 |
Critical |
| Build failed |
Medium |
| Container OOM-killed once |
High |
| Health endpoint returns unhealthy |
High |
| Deployment succeeded but no traffic |
High |
| SSL certificate expiring soon |
Medium |
| Disk usage > 85% |
Medium |
Incident Workflow
1. GATHER
Collect context about the affected resource:
get_application — app details, current deployment, configured port
get_application_deployments — recent deployment history
get_deployment_logs — if build/deploy failed
list_containers → get_container — container status
get_container_logs — runtime errors
2. DIAGNOSE
Delegate to the diagnostic agent with full context:
- Include: application ID, deployment ID, error message, container status
- The diagnostic agent uses
failure-diagnosis skill for pattern matching
- Wait for diagnosis result: root cause + whether it's code-fixable
3. DECIDE
Based on diagnosis:
| Root cause type |
Action |
| Code error (syntax, missing dep, config) |
Auto-fix via PR |
| Dockerfile issue (wrong base image, missing file) |
Auto-fix via PR |
| Environment variable missing or wrong |
Notify user — env vars need manual input |
| Infrastructure (server resources, Docker daemon) |
Notify user — requires manual intervention |
| Database connection failed |
Notify user — check database status and credentials |
| External service down |
Notify user — nothing to fix on our side |
| Unknown |
Notify user with gathered evidence |
4. FIX (if code-fixable)
Delegate to the GitHub agent:
- Branch:
auto-fix/<short-description> (e.g. auto-fix/missing-prisma-schema)
- Read the problematic file, generate the minimal fix
- Commit with message:
fix: <description of what was fixed>
- Open PR from fix branch into default branch
- Never merge — return PR URL for user approval
5. NOTIFY
Send to all configured notification channels:
If fix PR created:
Failure detected for [app name].
Root cause: [one-line summary].
Auto-fix PR: [pr_url]
Review and merge to trigger redeploy.
If no fix possible:
Failure detected for [app name].
Root cause: [one-line summary].
Recommended action: [specific next step].
If diagnosis inconclusive:
Issue detected for [app name].
Findings: [what was observed].
Unable to determine root cause automatically.
Please investigate: [specific things to check].
6. VERIFY (after user merges fix)
If the fix PR is merged and a new deployment triggers:
- Run post-deploy-verification checks
- If healthy: notify "Issue resolved after fix merge"
- If still failing: escalate — "Fix did not resolve the issue, further investigation needed"
Rules
- Never merge PRs automatically — always require user approval
- Never push to main/master — always use fix branches
- Do not retry the same fix more than once
- Maximum 3 auto-fix attempts per incident before escalating to user
- Include all relevant context when delegating to sub-agents
- Every response must end with a concrete result or completed action
Anti-Patterns
- Fixing symptoms instead of root cause: If the container OOM-kills, don't just increase memory — investigate the memory consumer
- Auto-fixing infrastructure issues: Server-level problems (disk full, Docker daemon down) can't be fixed via code PR
- Notifying without actionable information: "Something went wrong" is useless — always include what failed, why, and what to do
- Cascading fixes: If fix A causes failure B, stop and escalate — don't chain auto-fixes
Related Skills
failure-diagnosis — Pattern tables for identifying root causes
rollback-strategy — When to rollback vs fix forward
post-deploy-verification — Verify fix worked after merge
Event Context
Your prompt contains the full incident context formatted by the event pipeline. This includes the event type, source details, error information, and any relevant identifiers (application, deployment, repository, etc.). Use all provided context to drive your investigation.
Safety Rules
- Never merge PRs. Always return the PR URL for user approval.
- Never push to main/master. Always create a fix branch.
- If you cannot determine the root cause, notify the user with what you found and stop.
- Do not retry the same fix more than once. Maximum 3 auto-fix attempts per incident before escalating.
- Include all relevant context identifiers when delegating to diagnostics or github.
- After delegation returns, immediately process the result. Never say work is "underway".
- Every response must end with concrete information or a completed action.
1---2name: incident-response3description: Structured incident response workflow — severity classification, diagnosis delegation, auto-fix decisions, notification, and post-incident review. Use when an automated failure event is received or when the user reports a production incident.4---56# Incident Response78## Event Classification910Classify the incident by severity before acting:1112| Severity | Criteria | Response time | Action |13|---|---|---|---|14| **Critical** | App completely down, all users affected | Immediate | Diagnose + attempt auto-fix + notify |15| **High** | App degraded, errors for some users | Within minutes | Diagnose + attempt auto-fix + notify |16| **Medium** | Non-user-facing failure (build failed, deploy failed) | Within session | Diagnose + fix suggestion + notify |17| **Low** | Warning, non-critical issue detected | Informational | Notify only |1819### Severity signals2021| Signal | Severity |22|---|---|23| Container exited, `restart_count` > 3 | Critical |24| HTTP probe returns 502/503/504 | Critical |25| Build failed | Medium |26| Container OOM-killed once | High |27| Health endpoint returns unhealthy | High |28| Deployment succeeded but no traffic | High |29| SSL certificate expiring soon | Medium |30| Disk usage > 85% | Medium |3132## Incident Workflow3334### 1. GATHER3536Collect context about the affected resource:3738- `get_application` — app details, current deployment, configured port39- `get_application_deployments` — recent deployment history40- `get_deployment_logs` — if build/deploy failed41- `list_containers` → `get_container` — container status42- `get_container_logs` — runtime errors4344### 2. DIAGNOSE4546Delegate to the diagnostic agent with full context:4748- Include: application ID, deployment ID, error message, container status49- The diagnostic agent uses `failure-diagnosis` skill for pattern matching50- Wait for diagnosis result: root cause + whether it's code-fixable5152### 3. DECIDE5354Based on diagnosis:5556| Root cause type | Action |57|---|---|58| Code error (syntax, missing dep, config) | Auto-fix via PR |59| Dockerfile issue (wrong base image, missing file) | Auto-fix via PR |60| Environment variable missing or wrong | Notify user — env vars need manual input |61| Infrastructure (server resources, Docker daemon) | Notify user — requires manual intervention |62| Database connection failed | Notify user — check database status and credentials |63| External service down | Notify user — nothing to fix on our side |64| Unknown | Notify user with gathered evidence |6566### 4. FIX (if code-fixable)6768Delegate to the GitHub agent:6970- Branch: `auto-fix/<short-description>` (e.g. `auto-fix/missing-prisma-schema`)71- Read the problematic file, generate the minimal fix72- Commit with message: `fix: <description of what was fixed>`73- Open PR from fix branch into default branch74- **Never merge** — return PR URL for user approval7576### 5. NOTIFY7778Send to all configured notification channels:7980**If fix PR created:**81```82Failure detected for [app name].83Root cause: [one-line summary].84Auto-fix PR: [pr_url]85Review and merge to trigger redeploy.86```8788**If no fix possible:**89```90Failure detected for [app name].91Root cause: [one-line summary].92Recommended action: [specific next step].93```9495**If diagnosis inconclusive:**96```97Issue detected for [app name].98Findings: [what was observed].99Unable to determine root cause automatically.100Please investigate: [specific things to check].101```102103### 6. VERIFY (after user merges fix)104105If the fix PR is merged and a new deployment triggers:106107- Run post-deploy-verification checks108- If healthy: notify "Issue resolved after fix merge"109- If still failing: escalate — "Fix did not resolve the issue, further investigation needed"110111## Rules112113- Never merge PRs automatically — always require user approval114- Never push to main/master — always use fix branches115- Do not retry the same fix more than once116- Maximum 3 auto-fix attempts per incident before escalating to user117- Include all relevant context when delegating to sub-agents118- Every response must end with a concrete result or completed action119120## Anti-Patterns121122- **Fixing symptoms instead of root cause**: If the container OOM-kills, don't just increase memory — investigate the memory consumer123- **Auto-fixing infrastructure issues**: Server-level problems (disk full, Docker daemon down) can't be fixed via code PR124- **Notifying without actionable information**: "Something went wrong" is useless — always include what failed, why, and what to do125- **Cascading fixes**: If fix A causes failure B, stop and escalate — don't chain auto-fixes126127## Related Skills128129- **`failure-diagnosis`** — Pattern tables for identifying root causes130- **`rollback-strategy`** — When to rollback vs fix forward131- **`post-deploy-verification`** — Verify fix worked after merge132133## Event Context134135Your prompt contains the full incident context formatted by the event pipeline. This includes the event type, source details, error information, and any relevant identifiers (application, deployment, repository, etc.). Use all provided context to drive your investigation.136137## Safety Rules138139- Never merge PRs. Always return the PR URL for user approval.140- Never push to main/master. Always create a fix branch.141- If you cannot determine the root cause, notify the user with what you found and stop.142- Do not retry the same fix more than once. Maximum 3 auto-fix attempts per incident before escalating.143- Include all relevant context identifiers when delegating to diagnostics or github.144- After delegation returns, immediately process the result. Never say work is "underway".145- Every response must end with concrete information or a completed action.