{"id":49676301,"url":"https://github.com/huseynovvusal/blamebot","last_synced_at":"2026-05-09T04:01:36.003Z","repository":{"id":355275593,"uuid":"1227421344","full_name":"huseynovvusal/blamebot","owner":"huseynovvusal","description":"AI on-call agent that detects deploy failures explains what broke pages the responsible team and rolls back automatically.","archived":false,"fork":false,"pushed_at":"2026-05-04T06:57:05.000Z","size":564,"stargazers_count":40,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-07T02:46:02.468Z","etag":null,"topics":["ai-agent","devops","hackathon","incident-management","nextjs","postmortem","redis","slack-bot","sre","upstash","vercel"],"latest_commit_sha":null,"homepage":"https://blamebot.huseynovvusal.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huseynovvusal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-02T16:57:00.000Z","updated_at":"2026-05-06T04:19:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/huseynovvusal/blamebot","commit_stats":null,"previous_names":["huseynovvusal/blamebot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/huseynovvusal/blamebot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huseynovvusal%2Fblamebot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huseynovvusal%2Fblamebot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huseynovvusal%2Fblamebot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huseynovvusal%2Fblamebot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huseynovvusal","download_url":"https://codeload.github.com/huseynovvusal/blamebot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huseynovvusal%2Fblamebot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32806692,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","devops","hackathon","incident-management","nextjs","postmortem","redis","slack-bot","sre","upstash","vercel"],"created_at":"2026-05-07T02:45:56.944Z","updated_at":"2026-05-09T04:01:35.991Z","avatar_url":"https://github.com/huseynovvusal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BlameBot — AI-Powered Incident Intelligence\n\n![BlameBot](./assets/image.png)\n\n\u003e **Vercel Zero to Agent Hackathon submission** · Solo · Deployed on Vercel\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Deployed on Vercel](https://img.shields.io/badge/Deployed_on-Vercel-black?logo=vercel)](https://blamebot.vercel.app)\n[![Built with Next.js](https://img.shields.io/badge/Built_with-Next.js-black?logo=next.js)](https://nextjs.org/)\n[![Upstash Redis](https://img.shields.io/badge/Database-Upstash_Redis-red)](https://upstash.com)\n[![AI by Claude](https://img.shields.io/badge/AI-Claude_3.5_Sonnet-purple)](https://anthropic.com)\n\nBlameBot is an autonomous on-call agent that closes the loop from deploy failure to resolved incident — without waking up your whole team at 3 AM. It ingests alerts from Vercel, Sentry, and UptimeRobot, uses AI to explain what broke and who owns it, pages the right person via Slack, and can roll back the deployment automatically.\n\n**[Live Demo](https://blamebot.huseynovvusal.dev)** · **[GitHub](https://github.com/huseynovvusal/blamebot)**\n\n---\n\n## Table of Contents\n- [The Problem](#the-problem)\n- [Built for Vercel Zero to Agent Hackathon](#built-for-vercel-zero-to-agent-hackathon)\n- [How It Works](#how-it-works)\n- [Features](#features)\n- [Tech Stack](#tech-stack)\n- [Setup](#setup)\n- [Webhook Setup](#webhook-setup)\n- [Slack App Setup](#slack-app-setup)\n- [Deployment](#deployment)\n- [API Reference](#api-reference)\n- [Project Structure](#project-structure)\n- [Contributing](#contributing)\n- [License](#license)\n\n---\n\n## The Problem\n\nEvery on-call rotation has the same failure loop:\n\n1. Alert fires at 2 AM\n2. Engineer scrambles to find the right Slack thread, the right commit, the right person\n3. 40 minutes later: \"oh it was that one deploy\"\n4. Team manually writes a postmortem (or doesn't)\n\nBlameBot collapses that 40-minute scramble into a 10-second AI summary with one-click rollback.\n\n---\n\n## Built for Vercel Zero to Agent Hackathon\n\nThis project was built as a solo submission for the [Vercel Zero to Agent Hackathon](https://community.vercel.com/hackathons/zero-to-agent) (April 24 – May 4, 2026).\n\n**Why BlameBot fits the \"Zero to Agent\" theme:**\n\n- It is a genuine autonomous agent, not a chatbot. It receives a signal, reasons about it, takes action, and reports back — all without human involvement.\n- The agent loop spans multiple tools: GitHub for code context, Vercel API for rollback actions, Slack for communication, and Claude for reasoning.\n- Autopilot mode lets it close the full loop: detect → analyze → act → report — zero human steps required.\n\n---\n\n## How It Works\n\n```mermaid\nflowchart TD\n    %% Styling\n    classDef webhook fill:#e1f5fe,stroke:#0288d1,stroke-width:2px,color:#01579b\n    classDef pipeline fill:#fff3e0,stroke:#f57c00,stroke-width:2px,color:#e65100\n    classDef db fill:#e8f5e9,stroke:#388e3c,stroke-width:2px,color:#1b5e20\n    classDef ai fill:#ffebee,stroke:#d32f2f,stroke-width:2px,color:#b71c1c\n    classDef slack fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px,color:#4a148c\n    classDef ui fill:#eceff1,stroke:#455a64,stroke-width:2px,color:#263238\n\n    %% Triggers\n    subgraph Triggers [\"External Events (Webhooks)\"]\n        direction LR\n        Vercel([Vercel Deploy]):::webhook\n        Sentry([Sentry Error]):::webhook\n        Uptime([UptimeRobot]):::webhook\n    end\n\n    %% Pipeline\n    subgraph Core [\"Incident Pipeline (Orchestrator)\"]\n        direction TB\n        N[\"1. Normalize Payload\"]:::pipeline\n        E[\"2. Enrich with GitHub Data\u003cbr/\u003e(Commits, PRs, Files)\"]:::pipeline\n        R[\"3. Resolve Code Owners\"]:::pipeline\n        Sev[\"4. Decide Severity\"]:::pipeline\n        H[\"5. Find Similar Incidents\"]:::pipeline\n        AI[\"6. Claude Sonnet AI Report\u003cbr/\u003e(Root Cause, Blast Radius)\"]:::ai\n        P[(\"7. Persist to Redis\")]:::db\n        Dev[\"8. Update Developer Scores\"]:::pipeline\n        S[\"9. Post to Slack Channel\"]:::slack\n        Esc[\"10. Schedule Escalation\"]:::pipeline\n        Health[\"11. Update Integration Health\"]:::pipeline\n\n        N --\u003e E --\u003e R --\u003e Sev --\u003e H --\u003e AI --\u003e P --\u003e Dev --\u003e S --\u003e Esc --\u003e Health\n    end\n\n    %% Routing\n    Vercel --\u003e N\n    Sentry --\u003e N\n    Uptime --\u003e N\n\n    %% UI \u0026 Actions\n    subgraph Presentation [\"Interaction \u0026 Presentation\"]\n        direction TB\n        SlackMsg[\"Slack Block Kit Alert\u003cbr/\u003eAction Buttons: Acknowledge, Rollback, Hotfix\"]:::slack\n        Dash[\"Next.js Dashboard\u003cbr/\u003eAnalytics, Trends \u0026 Postmortems\"]:::ui\n    end\n\n    S --\u003e SlackMsg\n    P -.-\u003e Dash\n    SlackMsg -.-\u003e Dash\n\n    %% Styling adjustments\n    style Triggers fill:transparent,stroke:#999,stroke-width:1px,stroke-dasharray: 5 5\n    style Core fill:transparent,stroke:#f57c00,stroke-width:2px\n    style Presentation fill:transparent,stroke:#455a64,stroke-width:1px,stroke-dasharray: 5 5\n```\n\n### Pipeline Steps\n\n| Step | What happens |\n|---|---|\n| **Normalize** | Converts raw webhook payloads into a standard incident format |\n| **Enrich** | Fetches commit SHA, PR info, and changed file list from GitHub |\n| **Resolve Owners** | Matches changed files against glob-pattern ownership rules |\n| **Decide Severity** | Applies configurable rules (site-down = critical, etc.) |\n| **Find Similar** | Queries Redis for incidents on the same files in the last 30 days |\n| **AI Report** | Claude Sonnet generates root cause, blast radius, recommended action |\n| **Persist** | Saves incident + timeline to Upstash Redis |\n| **Dev Scores** | Updates reliability scores for responsible developers |\n| **Post to Slack** | Sends rich Block Kit message to your incidents channel |\n| **Schedule Escalation** | Sets up timed escalation if incident goes unacknowledged |\n| **Health Check** | Stamps the last-seen time for the integration source |\n\n---\n\n## Features\n\n### Live Dashboard\n- Active incident count with severity breakdown\n- Real-time incident feed\n- Integration health status (Vercel, Sentry, UptimeRobot)\n- Top offenders — developers causing the most incidents\n- Activity feed across all ongoing incidents\n\n### AI-Powered Incident Reports\n- Root cause analysis written in plain English\n- Blast radius assessment (affected services, users, regions)\n- Recommended action (rollback, hotfix, monitor)\n- Automatic similarity detection against recent incidents\n- One-click postmortem generation\n\n### Slack-First Response\n- Rich Block Kit incident cards with all context in one message\n- Acknowledge / Rollback / Draft Hotfix PR buttons\n- Thread-based timeline updates\n- Escalation alerts when incidents go unacknowledged\n\n### Analytics\n- Incident trends over time charted by severity\n- MTTR (Mean Time to Resolution) tracking\n- Top problematic files and services\n- Developer reliability scores and leaderboard\n- Risk heatmap — incidents by day of week and hour\n- Service health scores\n\n### Configuration Panel\n- **Owner Rules** — file glob → Slack user/group mapping\n- **Severity Rules** — pattern-based auto-classification\n- **Escalation Policy** — per-severity delay and escalation contacts\n- **Blackout Windows** — timezone-aware quiet hours with fallback contact\n- **Autopilot** — auto-rollback thresholds per severity level\n- **Natural Language Config** — update any setting in plain English via AI\n\n### Autopilot Mode\nWhen enabled, BlameBot can automatically roll back a failing deployment via the Vercel API without any human intervention. Configurable per severity level with a confirmation grace window.\n\n---\n\n## Tech Stack\n\n| Layer | Technology |\n|---|---|\n| Framework | Next.js 16 (App Router) |\n| UI | React 19, Tailwind CSS v4, shadcn/ui |\n| AI | Vercel AI SDK 6, Claude Sonnet (Anthropic) — chosen over OpenAI for superior technical root cause reasoning |\n| Database | Upstash Redis |\n| Integrations | Vercel API, GitHub (Octokit), Slack |\n| Charts | Recharts |\n| Deployment | Vercel (with Cron Jobs) |\n\n---\n\n## Setup\n\n### Prerequisites\n\n- Node.js 18+\n- pnpm\n- Upstash Redis instance\n- Vercel project\n- Slack app (bot token + signing secret)\n- GitHub personal access token\n\n### 1. Clone and install\n\n```bash\ngit clone https://github.com/VusalHuseynov/blamebot\ncd blamebot\npnpm install\n```\n\n### 2. Configure environment variables\n\nCreate `.env.local` in the project root:\n\n```bash\n# ── App ────────────────────────────────────────────────\nAPP_URL=http://localhost:3000\nNEXT_PUBLIC_APP_URL=http://localhost:3000\n\n# ── Upstash Redis ───────────────────────────────────────\n# Create a database at https://console.upstash.com\nUPSTASH_REDIS_REST_URL=https://your-db.upstash.io\nUPSTASH_REDIS_REST_TOKEN=your_token\nKV_REST_API_URL=https://your-db.upstash.io\nKV_REST_API_TOKEN=your_token\n\n# ── GitHub ──────────────────────────────────────────────\n# PAT with repo + read:org scopes\nGITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx\nGITHUB_OWNER=your-org-or-username\nGITHUB_REPO=your-repo-name\n# For GitHub OAuth (optional)\nGITHUB_CLIENT_ID=Iv1.xxxxxxxxxxxx\nGITHUB_CLIENT_SECRET=your_secret\n\n# ── Slack ───────────────────────────────────────────────\n# Create an app at https://api.slack.com/apps\nSLACK_BOT_TOKEN=xoxb-xxxxxxxxxxxx\nSLACK_SIGNING_SECRET=your_signing_secret\nSLACK_INCIDENTS_CHANNEL_ID=C0XXXXXXXXX\n# For Slack OAuth (optional)\nSLACK_CLIENT_ID=your_client_id\nSLACK_CLIENT_SECRET=your_client_secret\n\n# ── Vercel ──────────────────────────────────────────────\n# API token from https://vercel.com/account/tokens\nVERCEL_API_TOKEN=your_vercel_token\nVERCEL_PROJECT_ID=prj_xxxxxxxxxxxx\n# VERCEL_TEAM_ID only needed for team projects\nVERCEL_TEAM_ID=team_xxxxxxxxxxxx\n\n# ── Webhook secrets ─────────────────────────────────────\n# Generate with: openssl rand -hex 32\nVERCEL_WEBHOOK_SECRET=your_secret\nSENTRY_WEBHOOK_SECRET=your_secret\nUPTIMEROBOT_WEBHOOK_SECRET=your_secret\n\n# ── Admin ───────────────────────────────────────────────\nADMIN_TOKEN=your_admin_token\nADMIN_COOKIE_SECRET=your_cookie_secret\n\n# ── Cron ────────────────────────────────────────────────\nCRON_SECRET=your_cron_secret\n```\n\n### 3. Run locally\n\n```bash\npnpm dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000).\n\n### 4. Seed demo data (optional)\n\n```bash\ncurl -X POST http://localhost:3000/api/seed\n```\n\nThis populates Redis with sample incidents, timeline events, and developer scores so the dashboard is populated immediately.\n\n---\n\n## Webhook Setup\n\nPoint these services at your deployed URL:\n\n### Vercel\nSettings → Webhooks → Add webhook\n```\nURL: https://your-app.vercel.app/api/webhooks/vercel\nEvents: deployment.error, deployment.canceled\n```\n\n### Sentry\nProject Settings → Developer Settings → Internal Integration → Webhooks\n```\nURL: https://your-app.vercel.app/api/webhooks/sentry\nEvents: issue (created, resolved)\n```\n\n### UptimeRobot\nMy Settings → Alert Contacts → Add Alert Contact\n```\nType: Web-hook\nURL: https://your-app.vercel.app/api/webhooks/uptime\n```\n\nAll webhook endpoints validate HMAC signatures. Set the corresponding `*_WEBHOOK_SECRET` env vars to match what each service sends.\n\n---\n\n## Slack App Setup\n\n1. Go to [api.slack.com/apps](https://api.slack.com/apps) → Create New App → From manifest\n\n2. Use this manifest:\n\n```yaml\ndisplay_information:\n  name: BlameBot\n  description: AI-powered incident intelligence\nfeatures:\n  bot_user:\n    display_name: BlameBot\n    always_online: true\n  slash_commands:\n    - command: /incident\n      url: https://your-app.vercel.app/api/slack/commands\n      description: Query BlameBot about incidents\n  interactivity:\n    is_enabled: true\n    request_url: https://your-app.vercel.app/api/slack/interactivity\noauth_config:\n  scopes:\n    bot:\n      - chat:write\n      - channels:history\n      - channels:read\n      - commands\nsettings:\n  event_subscriptions:\n    request_url: https://your-app.vercel.app/api/slack/events\n    bot_events:\n      - message.channels\n```\n\n3. Install to workspace, copy `Bot User OAuth Token` → `SLACK_BOT_TOKEN`\n4. Copy Signing Secret → `SLACK_SIGNING_SECRET`\n\n---\n\n## Deployment\n\nBlameBot is built for Vercel. Push to your repo and connect the project.\n\nThe included `vercel.json` configures the escalation cron:\n\n```json\n{\n  \"crons\": [\n    {\n      \"path\": \"/api/cron/escalations\",\n      \"schedule\": \"*/5 * * * *\"\n    }\n  ]\n}\n```\n\n\u003e **Note:** Vercel Hobby accounts are limited to daily cron jobs. The repo ships with `0 0 * * *` (once per day) to stay within the free tier. Upgrade to Pro and change the schedule to `*/5 * * * *` for every-5-minute escalation checks.\n\nSet all environment variables in the Vercel dashboard under Settings → Environment Variables.\n\n---\n\n## API Reference\n\n| Method | Path | Description |\n|---|---|---|\n| `GET` | `/api/incidents` | List incidents with optional status/severity filter |\n| `POST` | `/api/incidents` | Create incident manually |\n| `GET` | `/api/incidents/[id]` | Get single incident |\n| `GET` | `/api/incidents/[id]/timeline` | Get incident timeline events |\n| `GET/POST` | `/api/incidents/[id]/postmortem` | Get or generate AI postmortem |\n| `POST` | `/api/webhooks/vercel` | Vercel deployment webhook |\n| `POST` | `/api/webhooks/sentry` | Sentry error webhook |\n| `POST` | `/api/webhooks/uptime` | UptimeRobot downtime webhook |\n| `GET` | `/api/analytics` | Aggregated analytics data |\n| `GET/PUT` | `/api/config/owners` | Owner rule configuration |\n| `GET/PUT` | `/api/config/escalation` | Escalation policy |\n| `GET/PUT` | `/api/config/severity` | Severity classification rules |\n| `GET/PUT` | `/api/config/autopilot` | Autopilot settings |\n| `GET/PUT` | `/api/config/blackout` | Blackout windows |\n| `POST` | `/api/config/nl` | Natural language config update |\n| `GET` | `/api/health` | Health check |\n\n---\n\n## Project Structure\n\n```\nblamebot/\n├── app/\n│   ├── (pages)/          # Next.js App Router pages\n│   │   ├── dashboard/\n│   │   ├── incidents/\n│   │   ├── analytics/\n│   │   └── config/\n│   └── api/              # API routes\n│       ├── webhooks/     # Webhook receivers\n│       ├── incidents/    # Incident CRUD\n│       ├── config/       # Configuration endpoints\n│       ├── slack/        # Slack event/command/interactivity\n│       ├── analytics/    # Analytics aggregation\n│       └── cron/         # Scheduled jobs\n├── lib/\n│   ├── pipeline/         # Core incident processing\n│   │   ├── index.ts      # Orchestrator\n│   │   ├── normalize.ts  # Webhook normalization\n│   │   ├── enrich.ts     # GitHub enrichment\n│   │   ├── severity.ts   # Severity classification\n│   │   ├── history.ts    # Similar incident search\n│   │   ├── ai.ts         # Claude AI integration\n│   │   ├── devscore.ts   # Developer scoring\n│   │   └── actions.ts    # Rollback / hotfix actions\n│   ├── schemas.ts        # Zod schemas\n│   ├── types.ts          # TypeScript types\n│   └── redis.ts          # Redis client\n├── components/           # React components\n└── vercel.json           # Cron job config\n```\n\n---\n\n## Contributing\n\nContributions are welcome! Please check out the [Contributing Guidelines](CONTRIBUTING.md) for more details.\n\n---\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuseynovvusal%2Fblamebot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuseynovvusal%2Fblamebot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuseynovvusal%2Fblamebot/lists"}