Automated alert triage cloud agent that watches #system-alerts-prod, classifies new bugs, and runs a triage-to-PR loop autonomously.
Honeybadger detects an error → posts to #system-alerts-prod via its Slack app → Slack fires a webhook → Cloudflare Worker verifies the signature and forwards to the claude.ai routine → routine classifies, tickets, investigates, and opens a PR.
Fallback: the routine also runs hourly as a safety net.
system-alerts project, assigned to kfaham@youth.inckinano/auto-fix-*) and a PR with the minimal fixhttps://dash.cloudflare.com/sign-up — free tier is sufficient.
npm install -g wrangler
wrangler login
wrangler.toml is gitignored — copy the template and fill in your values:
cp routines/alert-triage/wrangler.toml.template routines/alert-triage/wrangler.toml
Get the #system-alerts-prod channel ID: right-click the channel in Slack → Copy link → last path segment (starts with C). Set it in wrangler.toml:
ALLOWED_CHANNEL_IDS = "C12345678" # replace with real ID
Secrets live exclusively in Cloudflare’s secret store — never commit real values to the repo.
Run these from the routines/alert-triage/ directory (where wrangler.toml lives):
cd routines/alert-triage
wrangler secret put CLAUDE_TOKEN
wrangler secret put ROUTINE_ID
wrangler secret put SLACK_SIGNING_SECRET
CLAUDE_TOKEN — a per-routine bearer token generated in the Claude Code web UI:
sk-ant-oat01-) — it’s shown once and cannot be retrieved laterROUTINE_ID — paste trig_0191VXjhXDQ7UFtsz5STs4wo
SLACK_SIGNING_SECRET — from your Slack App → Basic Information → Signing Secret (set up in step 6)
Stronger dedup that survives worker restarts. Without this, dedup falls back to dropping X-Slack-Retry-Num requests (weaker but usually sufficient for low-volume alert channels).
wrangler kv namespace create SEEN_EVENTS
Cloudflare prints a generated id — a unique identifier for your new KV namespace (e.g. a1b2c3d4e5f6789012345678abcdef01). Paste it into wrangler.toml and uncomment the [[kv_namespaces]] block:
[[kv_namespaces]]
binding = "SEEN_EVENTS"
id = "paste-the-id-here"
cd routines/alert-triage
wrangler deploy
# → https://alert-triage-webhook.YOUR_SUBDOMAIN.workers.dev
wrangler secret put SLACK_SIGNING_SECRETmessage.channelsmessage.groups#system-alerts-prod — type /invite @your-app-name in the channel#system-alerts-prod if it isn’t there already — it’s what posts the alerts the routine watches foralert-triage-routineroutine-prompt.md as the prompthttps://github.com/youth-inc/youthinc0 * * * * (hourly fallback)CLAUDE_TOKEN in step 4Routine ID: trig_0191VXjhXDQ7UFtsz5STs4wo
Manage: https://claude.ai/code/routines/trig_0191VXjhXDQ7UFtsz5STs4wo
Repo: https://github.com/youth-inc/youthinc
MCP connectors: Slack, Linear, PostHog
Security: Slack HMAC-SHA256 signature verification, 5-min replay window, constant-time compare.
Reliability: 3-attempt retry with backoff on 5xx; 4xx errors are not retried.
Dedup: Event-id deduplication via Cloudflare KV (optional); falls back to X-Slack-Retry-Num header drop.
Scope: Only messages from ALLOWED_CHANNEL_IDS pass through. Thread replies and non-Honeybadger bot messages are dropped.