pr-guardian

πŸ›‘οΈ PR Guardian

AI-powered code review system. Point it at a GitHub URL or drop local files β€” parallel AI agents find bugs, security issues, and test gaps, then propose fixes.


Quick Start (one command)

1. Get a free Groq API key

Go to console.groq.com/keys β†’ Create API Key β†’ copy it.
It’s free, no credit card required.

2. Add your key

Create backend/.env:

GROQ_API_KEY=gsk_your_key_here

3. Run

cd pr-guardian
python start.py

That’s it. Opens http://localhost:3000 automatically.
Press Ctrl+C to stop both servers.

Windows: double-click start.bat instead.


What it does

Paste GitHub URL  OR  drop local files
         ↓
3–4 AI agents run in parallel (Code Β· Security Β· Tests Β· Performance)
         ↓
Flappy Guardian game plays while you wait
         ↓
Results appear after game ends (or skip)
         ↓
Fix issues β†’ download patched files (local) or commit to GitHub (PAT required)

AI Provider

Provider Cost Set up
Groq βœ… default Free GROQ_API_KEY=gsk_... in backend/.env
OpenAI fallback Paid (~$0.05–0.20/analysis) OPENAI_API_KEY=sk-... in backend/.env

Groq runs Llama 3.1 70B β€” fast and free, no credit card needed.


GitHub token (optional)

Only needed to:

The app prompts for it only when you click β€œApply Fix” β€” never upfront.
Get one: GitHub β†’ Settings β†’ Developer settings β†’ Personal access tokens β†’ Generate new (classic) with repo scope.


Deployment


Architecture

β‘  GitHub URL  /  β‘‘ Local files  /  β‘’ File path
                    ↓
             FastAPI Backend
                    ↓ asyncio.gather (parallel)
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  Code       Security   Test       Performance
  Agent      Agent      Agent      Agent
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    ↓
         Fix Agent + Regression Check
                    ↓
         Risk Score + GitHub Report
                    ↓
      Download fix (local) or Commit to branch (GitHub)

”# pr-guardian”