PR Review Agent
Project Description
PR Review Agent transforms any public GitHub Pull Request URL into a fully interactive code review interface — generated entirely at runtime by an AI agent. There are no pre-built screens or dashboards. Every UI element is decided, composed, and rendered dynamically based on what the agent finds in the PR.
The user pastes a GitHub PR URL. The agent fetches the diff, changed files, commit messages, and PR metadata via a GitHub MCP tool. It then analyzes the code using an LLM (Gemini Pro / Claude) and renders a complete review interface: a colored diff viewer with line-level annotations, inline comment cards anchored to specific problematic lines, a risk badge (HIGH / MEDIUM / LOW) with a one-sentence justification, and actionable suggestion chips the user can apply with a single click — triggering a human-in-the-loop confirmation before any change is made.
This is impossible as a plain chatbot. A chatbot returns text. This returns a living, interactive interface — unique to every PR, never pre-designed, built from scratch by the agent every time.
Stack:
- AG-UI protocol (via CopilotKit) — transport layer for streaming agent-to-frontend communication and generative UI rendering
-
CopilotKit (
@copilotkit/react-core,@copilotkit/react-ui) —useCopilotActionhook enables the agent to render React components dynamically at runtime - MCP Apps — GitHub REST API exposed as a Model Context Protocol tool, called by the agent to fetch PR data
- Gemini Pro (Google DeepMind credits) — LLM powering the code analysis, risk classification, and suggestion generation
- Next.js + React — frontend runtime
- Python / FastAPI — agent backend