PREx
AI-powered PR reviews need integrated visual aids and inline interaction to simplify complex code and build engineering trust.
Project Description
PREx — Generative UI for AI-era Pull-Request Review
PREx turns any GitHub pull request into a live, evidence-bearing review experience built around generative UI rather than chat. A single CLI command — prex review
The agent is not a chatbox — it is the UI’s content provider. Anthropic’s Claude (Sonnet 4.5) streams responses over Server-Sent Events, and instead of replying in prose alone, it emits typed tool_use calls that the React layer renders as live A2GUI components: Treemap, CouplingMap (dashed accent for LLM-inferred edges), ClassDiff (before/after with added/removed fields), BlastRadius (1-hop neighborhood with inferred-edge badges), DataFlowChain, and Sequence diagrams. Each tool’s input is a Zod-validated schema, registered via CopilotKit’s useCopilotAction primitive so the same render functions will plug into a full A2UI runtime later — today they fire on synthesized streaming tool messages.
Stack: CopilotKit react-core for tool registration and the AG-UI-aligned action contract; Anthropic Messages API with native streaming + tool use as the agent runtime; Vite + React + TypeScript + Zustand on the front; a stdlib Python http.server inside the CLI that serves the static bundle and proxies an SSE chat endpoint. The “no agent yet” ramp is intentional — fixtures stand in until the runtime lands, then available: “disabled” flips and the same components render live data. Originality lies in three things: (1) the agent emits component descriptions, not markdown; (2) every prose field carries machine-checkable
Citations into the graph, making AI claims verifiable in one click; (3) it ships as a single pip install — the UI bundle rides inside the wheel, so
reviewers get the full generative experience with zero Node toolchain. Validated end-to-end on four real production PRs, where the system surfaced a hidden
Export-endpoint coupling, no diff-only review would catch.
Prior Work
None