Aerostack
robot_2

Slack Incident Response — AI Bot Template for Internal

Bot
aerostack @aerostack verified
· Updated Mar 18, 2026

Slack incident response bot. Sentry error → stack trace analysis → Linear issue → deployment check → #incidents summary.

star 94 stars content_copy 37 deploys slack v1.0.0

Template Slack Incident Response bundles a ready-to-deploy workspace for internal workflows. Install in one click from the Aerostack dashboard or via aerostack init --template=slack-incident-response.

What It Does

Automated incident response in Slack. When Sentry fires an error alert, the bot grabs the full stack trace, searches GitHub for the affected file and recent commits, checks Railway deployment logs, creates a Linear issue with all context, and posts a structured summary to #incidents.

From alert to actionable incident ticket in under 30 seconds.

What's Built In

  • Error analysis — pulls full Sentry event: stack trace, affected users count, first/last seen timestamps
  • Code context — searches GitHub for the file in the stack trace and finds recent commits that may have introduced the bug
  • Deployment correlation — checks Railway logs for the time window of the error
  • Ticket creation — creates a Linear issue with stack trace, affected users, recent commits, and suggested priority
  • Incident summary — posts a formatted summary to #incidents with error, impact, source file, last commit author, and suggested owner

Best For

  • Engineering teams with 5+ developers shipping daily where incident response time matters
  • On-call rotations that need structured incident context instead of raw Sentry alerts
  • Teams using Sentry + GitHub + Linear that want their incident workflow automated end-to-end

psychology System Prompt

The instructions that define how this bot behaves. It ships pre-configured — edit it anytime in your workspace.

You are an incident response bot in Slack for an engineering team.

## WHEN AN ALERT ARRIVES
When notified of a Sentry error or manually triggered with an error:
1. Get the full Sentry event: error message, stacktrace, affected users count, first/last seen
2. Search GitHub for the file mentioned in the stacktrace — find recent commits
3. Check Railway deployment logs for the time window of the error
4. Create a Linear issue with all context pre-filled:
   - Title: "[ERROR] {error_message}"
   - Description: stacktrace, affected users, recent commits, deployment status
   - Priority: based on affected user count (>100: Urgent, >10: High, else Medium)
   - Labels: "incident", "auto-created"

## POST INCIDENT SUMMARY
Post to #incidents channel:
"INCIDENT DETECTED
Error: [error message]
Impact: [X users affected]
Source: [file:line] — last changed by @[author] in PR #[number]
Deploy: [deployment status at time of error]
Linear: [issue link]
Sentry: [event link]

Suggested owner: @[last commit author]"

## ONGOING INCIDENT MANAGEMENT
- If same error recurs within 1 hour: update the existing Linear issue, don't create duplicate
- Track error rate over time
- When error count drops to 0: post resolution update

## THREAD MANAGEMENT
- All incident discussion should happen in the incident thread
- Post updates as thread replies, not new channel messages
- Pin active incidents in #incidents

## RULES
- NEVER auto-deploy fixes — only humans deploy
- NEVER close incidents automatically — require human confirmation
- For P0 (>1000 users): also send DM to on-call engineer
- Keep summaries factual — no speculation about root cause

## TONE
- Calm, factual, structured
- No alarm language — just data
- Clear ownership suggestions
- Concise — engineers need to scan quickly

checklist Setup Guide

Setup Guide — Slack Incident Response Bot

Step 1: Create Slack App

  1. Go to api.slack.com/apps
  2. Create new app > From scratch
  3. Add Bot Token Scopes: chat:write, channels:read, channels:history, users:read
  4. Install to workspace, copy Bot Token (xoxb-...)
Step 2: Sentry
  1. Go to Settings > Developer Settings > Internal Integrations
  2. Create integration with event:read, issue:read scopes
  3. Copy the Auth Token
Step 3: GitHub
  1. Create Personal Access Token with repo scope
Step 4: Linear
  1. Create API key from Settings > API
Step 5: Railway
  1. Go to Account Settings > Tokens
  2. Create a new token
Step 6: Connect
  1. Create #incidents channel in Slack
  2. Invite the bot to the channel
  3. Set up Sentry webhook to trigger the bot on new errors

Metadata

upgrade Version 1.0.0
description Type Bot
category Category Internal
code Platform slack

What's Included

check_circle 5 API keys needed
check_circle System Prompt
check_circle Setup Guide

Tags

No tags added yet.
robot_2

Deploy this bot in minutes

Slack incident response bot. Sentry error → stack trace analysis → Linear issue → deployment check → #incidents summary.

More Internal Templates

Browse Internal Templates →

Frequently asked questions

What does the Slack Incident Response bot automate from alert to resolution? +

It receives a Sentry error, analyzes the stack trace, creates a Linear issue, checks the latest Railway deployment, and posts a structured summary to your #incidents channel automatically.

Which MCPs are wired into the Slack Incident Response template? +

@aerostack/mcp-slack for channel posting, @aerostack/mcp-sentry for error ingestion, @aerostack/mcp-github for commit context, @aerostack/mcp-linear for issue creation, and @aerostack/mcp-railway for deployment checks.

How do I change which Slack channel or Linear team the incident bot targets? +

Update the channel name and Linear team ID in the workspace agent config. Each MCP scope is independently adjustable, so you can route critical vs. low-priority incidents to different channels.

Is the Slack Incident Response bot suitable for small engineering teams? +

Yes. It requires Sentry, Linear, and Railway accounts plus a Slack workspace. Teams without all five MCPs can disable unused ones; the bot degrades gracefully to the connected tools.