{"id":35135352,"url":"https://github.com/vignesh07/oncall-agent","last_synced_at":"2026-01-13T22:02:03.428Z","repository":{"id":330799215,"uuid":"1123873205","full_name":"vignesh07/oncall-agent","owner":"vignesh07","description":"AI-powered on-call agent that responds to production alerts with analysis and fixes. Supports PagerDuty, Datadog, CloudWatch, Sentry, and more.","archived":false,"fork":false,"pushed_at":"2025-12-28T04:46:43.000Z","size":4272,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-30T11:05:07.955Z","etag":null,"topics":["ai","alerting","automation","claude","datadog","devops","github-actions","incident-response","oncall","pagerduty"],"latest_commit_sha":null,"homepage":null,"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/vignesh07.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":"SECURITY.md","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":"2025-12-27T20:14:31.000Z","updated_at":"2025-12-28T04:43:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/vignesh07/oncall-agent","commit_stats":null,"previous_names":["vignesh07/oncall-agent"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/vignesh07/oncall-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vignesh07%2Foncall-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vignesh07%2Foncall-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vignesh07%2Foncall-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vignesh07%2Foncall-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vignesh07","download_url":"https://codeload.github.com/vignesh07/oncall-agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vignesh07%2Foncall-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28400552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","alerting","automation","claude","datadog","devops","github-actions","incident-response","oncall","pagerduty"],"created_at":"2025-12-28T08:54:03.880Z","updated_at":"2026-01-13T22:02:03.423Z","avatar_url":"https://github.com/vignesh07.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oncall-agent\n\nA GitHub Action that responds to production alerts with AI-powered analysis and fixes.\n\nWhen an alert fires from PagerDuty, Datadog, CloudWatch, Sentry, Opsgenie, or Prometheus, this action:\n\n1. Parses the alert into a normalized format\n2. Checks for duplicate/similar existing issues\n3. Creates a GitHub issue to track the alert\n4. Uses Claude Code to investigate the codebase\n5. Either creates a PR with a fix, or posts an analysis comment\n6. Updates the source system (e.g., adds a note to PagerDuty)\n\n## Requirements\n\n- **Anthropic API key** - Get one at [console.anthropic.com](https://console.anthropic.com)\n- **GitHub repository** - Where your code lives\n- **Webhook forwarder** - To send alerts to GitHub (see setup guides)\n\n## Features\n\n- **Multi-source support**: PagerDuty, Datadog, CloudWatch, Sentry, Opsgenie, Prometheus\n- **Automatic fixes**: Claude analyzes code and creates PRs with fixes\n- **Test integration**: Run tests after fixes to verify they work\n- **PR review mode**: Respond to PR comments and push updates\n- **Slack notifications**: Get notified when oncall-agent responds\n- **Deduplication**: Prevents duplicate issues for similar alerts\n- **Safety first**: Never auto-merges, configurable protected paths\n\n## Quick Start\n\n### Option A: One-line Setup\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/vignesh07/oncall-agent/main/setup.sh | bash\n```\n\nThis downloads the workflow files and creates a config template.\n\n### Option B: Manual Setup\n\n#### 1. Add the workflow\n\nCreate `.github/workflows/oncall.yml`:\n\n```yaml\nname: On-Call Agent\n\non:\n  repository_dispatch:\n    types: [pagerduty-alert, datadog-alert, cloudwatch-alert, alert]\n\npermissions:\n  contents: write\n  issues: write\n  pull-requests: write\n\njobs:\n  respond:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: vignesh07/oncall-agent@v1\n        with:\n          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n          alert_payload: ${{ toJson(github.event.client_payload) }}\n          alert_source: ${{ github.event.action }}\n          # Run tests after fixing to verify changes\n          test_command: 'npm test'\n          # Create ready-to-merge PRs (not drafts)\n          draft_pr: 'false'\n```\n\n#### 2. Add your API key\n\nGo to **Settings** → **Secrets and variables** → **Actions** → **New repository secret**\n\nAdd `ANTHROPIC_API_KEY` with your Anthropic API key.\n\n#### 3. Enable PR creation permission\n\nGo to **Settings** → **Actions** → **General** → Check **\"Allow GitHub Actions to create and approve pull requests\"**\n\n#### 4. Configure webhook forwarding\n\nSee [Webhook Setup Guides](./examples/webhook-setup/) for your alert source:\n- [PagerDuty](./examples/webhook-setup/pagerduty.md)\n- [Datadog](./examples/webhook-setup/datadog.md)\n- [CloudWatch](./examples/webhook-setup/cloudwatch.md)\n\n## PR Review Mode\n\noncall-agent can also respond to PR review comments and push fixes. When someone mentions `@oncall-agent` in a PR comment, it will:\n\n1. Check out the PR branch\n2. Analyze the review feedback\n3. Make the requested changes\n4. Run tests (if configured)\n5. Commit and push to the PR\n6. Comment with what it did\n\n### Setup PR Review Workflow\n\nCreate `.github/workflows/oncall-pr-review.yml`:\n\n```yaml\nname: oncall-agent PR Review\n\non:\n  issue_comment:\n    types: [created]\n\npermissions:\n  contents: write\n  pull-requests: write\n  issues: write\n\njobs:\n  respond-to-review:\n    if: |\n      github.event.issue.pull_request \u0026\u0026\n      contains(github.event.comment.body, '@oncall-agent')\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n\n      - uses: vignesh07/oncall-agent@v1\n        with:\n          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}\n          mode: review\n          pr_number: ${{ github.event.issue.number }}\n          comment_body: ${{ github.event.comment.body }}\n          test_command: 'npm test'\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n## How It Works\n\n```\nAlert Source (PagerDuty/Datadog/etc)\n        ↓\nWebhook → Forwarder → GitHub repository_dispatch\n        ↓\noncall-agent Action\n        ↓\n┌─────────────────────────────────┐\n│ 1. Parse alert                  │\n│ 2. Check for duplicates         │\n│ 3. Create tracking issue        │\n│ 4. Invoke Claude Code           │\n│ 5. Run tests (if configured)    │\n│ 6. Create PR or post analysis   │\n│ 7. Update source system         │\n└─────────────────────────────────┘\n```\n\n## Inputs\n\n| Input | Required | Default | Description |\n|-------|----------|---------|-------------|\n| `anthropic_api_key` | Yes | - | Anthropic API key |\n| `alert_payload` | Yes* | - | JSON alert payload (*not required for review mode) |\n| `alert_source` | No | `auto` | Source: pagerduty, datadog, cloudwatch, sentry, opsgenie, prometheus, generic, auto |\n| `mode` | No | `auto` | Mode: pr, analyze, auto, **review** |\n| `create_issue` | No | `true` | Create GitHub issue |\n| `pagerduty_api_key` | No | - | PagerDuty API key for updates |\n| `confidence_threshold` | No | `medium` | Minimum confidence for PR: high, medium, low |\n| `timeout_minutes` | No | `10` | Max time for Claude |\n| `max_files_changed` | No | `10` | Max files in a fix |\n| `draft_pr` | No | `true` | Create PRs as drafts |\n| `test_command` | No | - | Command to run tests (e.g., `npm test`, `pytest`) |\n\n### Review Mode Inputs\n\n| Input | Required | Default | Description |\n|-------|----------|---------|-------------|\n| `pr_number` | Yes* | - | PR number to respond to (*required for review mode) |\n| `comment_body` | Yes* | - | Comment text to respond to (*required for review mode) |\n| `comment_id` | No | - | Comment ID for threading |\n\n## Outputs\n\n| Output | Description |\n|--------|-------------|\n| `action_taken` | What happened: pr_created, analysis_only, duplicate, error |\n| `pr_number` | PR number if created |\n| `issue_number` | Issue number |\n| `analysis` | Claude's analysis |\n| `confidence` | Confidence level |\n| `duplicate_of` | Issue number if duplicate |\n\n## Configuration\n\nCreate `.oncall-agent/config.yml` in your repository:\n\n```yaml\n# Services this repo handles\nservices:\n  - user-service\n  - auth-service\n\n# Paths that should never be modified\nprotected_paths:\n  - src/core/security/**\n  - migrations/**\n\n# Context for Claude\ncontext: |\n  This is a Node.js monorepo using TypeScript.\n  Feature flags are in src/config/flags.ts.\n\n# Runbook mappings\nrunbooks:\n  high-memory: docs/runbooks/high-memory.md\n  database-connection: docs/runbooks/db-connections.md\n\n# Deduplication\ndeduplication:\n  enabled: true\n  similarity_threshold: 0.7\n  lookback_hours: 24\n```\n\n## Supported Alert Sources\n\n| Source | Parser | Webhook Docs |\n|--------|--------|--------------|\n| PagerDuty | V3 Webhooks | [Setup](./examples/webhook-setup/pagerduty.md) |\n| Datadog | Webhooks | [Setup](./examples/webhook-setup/datadog.md) |\n| CloudWatch | SNS → Lambda | [Setup](./examples/webhook-setup/cloudwatch.md) |\n| Sentry | Webhooks | Coming soon |\n| Opsgenie | Webhooks | Coming soon |\n| Prometheus | Alertmanager | Coming soon |\n| Generic | Auto-detect | Any JSON payload |\n\n## Safety Features\n\n- **Never auto-merges**: PRs always require human review\n- **Protected paths**: Configurable paths that won't be modified\n- **Confidence thresholds**: Only creates PRs when confident\n- **Deduplication**: Prevents alert spam\n- **Timeout limits**: Bounded execution time\n- **Test verification**: Run tests before creating PRs\n\n## Slack Notifications\n\nGet notified in Slack when oncall-agent responds to an alert. Add this step to your workflow:\n\n```yaml\n- name: Notify Slack\n  if: always()\n  uses: slackapi/slack-github-action@v1\n  with:\n    payload: |\n      {\n        \"text\": \"oncall-agent responded to alert\",\n        \"blocks\": [\n          {\n            \"type\": \"section\",\n            \"text\": {\n              \"type\": \"mrkdwn\",\n              \"text\": \"*oncall-agent*\\n• Action: ${{ steps.oncall.outputs.action_taken }}\\n• Confidence: ${{ steps.oncall.outputs.confidence }}\\n• \u003chttps://github.com/${{ github.repository }}/issues/${{ steps.oncall.outputs.issue_number }}|Issue #${{ steps.oncall.outputs.issue_number }}\u003e\"\n            }\n          }\n        ]\n      }\n  env:\n    SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}\n```\n\nTo set up:\n1. Create a [Slack Incoming Webhook](https://api.slack.com/messaging/webhooks)\n2. Add `SLACK_WEBHOOK_URL` to your repository secrets\n3. Add the step above after the oncall-agent step\n\nSee [examples/workflows/oncall-advanced.yml](./examples/workflows/oncall-advanced.yml) for a complete example.\n\n## Examples\n\n### Basic Workflow\n\nSee [examples/workflows/oncall.yml](./examples/workflows/oncall.yml)\n\n### Advanced Workflow with Slack\n\nSee [examples/workflows/oncall-advanced.yml](./examples/workflows/oncall-advanced.yml)\n\n### PR Review Workflow\n\nSee [examples/workflows/oncall-pr-review.yml](./examples/workflows/oncall-pr-review.yml)\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Run tests\nnpm test\n\n# Type check\nnpm run typecheck\n\n# Build\nnpm run build\n```\n## Claudereview\nIf you're interested in how this was built using claude ❤️ here's a [claudereview link](https://claudereview.com/s/ofOZn1CuOa6H#key=dJxgf1UR7bR9dLQzIl4gnYB38zKmSNLfKxL-ctlp2No)\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvignesh07%2Foncall-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvignesh07%2Foncall-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvignesh07%2Foncall-agent/lists"}