Skip to content

Repository files navigation

AI DevOps Agent

An autonomous AI DevOps agent built with Next.js, Gemini 3 Flash, and the Vercel AI SDK. It monitors your Vercel deployments, scans for security issues, manages incidents, raises GitHub PRs for fixes, responds to Slack slash commands, and runs automated checks on a schedule.

Features

Deployment Management

  • List all Vercel projects and recent deployments in real time
  • Trigger new deployments to production or preview
  • Cancel in-progress deployments
  • Rollback/devops rollback <project-name> instantly rolls back to the last successful production deployment
  • View deployment logs and error summaries

Security Scanning

  • Scan project configs and vercel.json for misconfigurations
  • Detect exposed secrets and insecure headers
  • Log security events with severity classification (low / medium / high / critical)
  • Env var drift detection — compare environment variable keys between two projects and surface missing or extra vars

Incident Management

  • Create, update, and resolve incidents with severity levels
  • Correlate incidents across multiple projects
  • Link incidents to the PRs that fix them
  • View all open incidents on the dashboard

GitHub Automation

  • Create fix branches, commit changes, and open pull requests automatically
  • Label agent-raised PRs with agent-fix and automated
  • Search repository code for patterns and vulnerabilities
  • Stale PR cleanup — syncs all open PRs against GitHub, marks merged/closed ones in the database

Slack Integration

  • Use /devops <request> in any Slack channel to interact with the agent
  • Receive alerts for critical incidents and deployment failures
  • Get notified when the agent raises a PR
  • Weekly digest — posts every Saturday at 5pm EST: deployments, incidents resolved, PRs raised, security findings

Automated Monitoring (Hourly Cron)

  • Deployment failure detection — finds new failed deployments and creates incidents, deduped so you only get alerted once per failure
  • Uptime checks — pings every monitored project URL; creates a critical incident and Slack alert if a project is unreachable
  • All monitoring runs automatically every hour via Vercel Cron

Tech Stack

  • Framework — Next.js 16 (App Router)
  • AI — Google Gemini 3 Flash via @ai-sdk/google
  • AI SDK — Vercel AI SDK v6 (streamText, generateText, useChat, stepCountIs)
  • Database — Supabase (PostgreSQL)
  • Deployment — Vercel
  • UI — Tailwind CSS + Shadcn UI

Getting Started

1. Clone and install

git clone https://github.com/RonitGandhi/v0-ai-dev-ops-agent
cd v0-ai-dev-ops-agent
pnpm install

2. Set up environment variables

Create a .env.local file in the root:

# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key

# Google AI (Gemini)
GOOGLE_GENERATIVE_AI_API_KEY=your_google_ai_key

# GitHub
GITHUB_TOKEN=your_github_pat

# Vercel
VERCEL_TOKEN=your_vercel_token

# Slack (ZeroToAgent app)
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/...
SLACK_VERIFICATION_TOKEN=your_verification_token
SLACK_BOT_TOKEN=xoxb-...

# Cron security
CRON_SECRET=your_random_secret

# App
NEXT_PUBLIC_APP_URL=http://localhost:3000

3. Run locally

pnpm dev

Open http://localhost:3000.

4. Deploy to production

./deploy.sh

Prints all env vars, builds the app, and deploys to Vercel production.


Slack Setup

  1. Go to api.slack.com/apps → your app
  2. Slash Commands/devops → set Request URL to:
    https://v0-ai-dev-ops-agent.vercel.app/api/slack
    
  3. Install App → Reinstall to workspace

Example commands

/devops scan all projects for security issues
/devops show me all open incidents
/devops check deployment failures and raise PRs
/devops rollback financial-planner
/devops sync all open PR statuses
/devops check env var drift between financial-planner and chatbot
/devops list all open pull requests

Automated Schedule

Job Schedule What it does
Monitor Every hour Deployment failure checks + uptime pings for all projects
Weekly Digest Saturday 5pm EST Posts a weekly summary to Slack

Project Structure

app/
├── (dashboard)/          # Main UI pages
│   ├── page.tsx          # Overview / command center
│   ├── agent/            # AI chat interface
│   ├── deployments/      # Vercel deployments
│   ├── incidents/        # Incident tracker
│   ├── pull-requests/    # Agent-raised PRs
│   └── security/         # Security scan results
├── api/
│   ├── agent/            # Streaming chat endpoint
│   ├── slack/            # Slack slash command handler
│   ├── monitor/          # Hourly cron — uptime + deployment checks
│   ├── digest/           # Weekly Slack digest
│   └── conversations/    # Chat session persistence (24hr)
lib/
├── agent/tools/
│   ├── deployment-tools.ts   # Vercel API — list, deploy, rollback, env drift
│   ├── github-tools.ts       # GitHub API — branches, commits, PRs, stale sync
│   ├── security-tools.ts     # Incident management, security event logging
│   └── slack-tools.ts        # Slack alerts and notifications
└── vercel.ts                 # Vercel API utilities

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages