Coldtea AI's PR Lens Draws Animated Architecture Maps for AI-Generated Code Reviews
PR Lens turns pull requests into animated architecture and data-flow diagrams that show the shape of a change before you read a single line of code.
Takeaways
- PR Lens draws every pull request as animated architecture and data-flow SVGs posted inside the PR comment.
- Open source under MIT, ~1.5k GitHub stars, available at github.com/coldteadotai/pr-lens.
- Four modes: GitHub App (hosted, free for OSS), agent skill, GitHub Action, and standalone CLI.
- Agent skill has your coding agent write the graph document itself, avoiding a second model bill.
- Custom deterministic renderer with zero dependencies; animation uses SVG animateMotion, survives GitHub's image proxy.
- Supports Gemini, OpenAI, and any /chat/completions-compatible endpoint including Ollama, DeepSeek, OpenRouter.
AI coding agents can produce a 400-line change across a dozen files in minutes. Human reviewers still have to reconstruct the affected system before deciding whether the code is safe to merge. PR Lens, an open-source project from Coldtea AI, generates animated architecture and data-flow diagrams for each pull request and posts them in a bot comment.
The repository has 2 stars. Its project site describes the goal succinctly: show the change before the reviewer reads each line. The diagrams identify affected components, unchanged boundaries, and new paths through the system.
Two maps from one graph
- Architecture view: Shows the blast radius, meaning the services, routes, data stores, and packages affected by the pull request. Lanes organize components, while green, amber, and red indicate additions, modifications, and removals.
- Data-flow view: Shows the ordered path of a request or event. Animated pulses trace how data moves through the changed system.
Both views come from the same JSON graph document, validated against a strongly typed schema. The renderer is a pure function that converts the validated document into SVG without a browser dependency, external layout engine, or JavaScript in the output. Animation uses SVG animateMotion, which continues to work through GitHub’s image proxy after scripts are stripped.
From diff to SVG
- Analyze the change. A configured model or the coding agent reads the diff and identifies components, relationships, and data paths.
- Write the graph. The analyzer produces the shared JSON document used by both views.
- Validate the schema. PR Lens rejects malformed graph documents before rendering.
- Render the views. The deterministic renderer produces an SVG for each selected view.
- Publish the result. The App, Action, or CLI attaches the diagrams to the pull request.
Four ways into a review
| Mode | Setup and runtime | Review behavior |
|---|---|---|
| GitHub App | Install the hosted GitHub App. Coldtea supplies the model key. | Maintains a sticky comment, rerenders after each push, and supports interactive view checkboxes. |
| Coding-agent skill | Run npx skills add coldteadotai/pr-lens. Supported agents include Claude Code, Codex, Cursor, and opencode. |
Uses the agent that produced the diff to write the graph, avoiding a separate model call for analysis. |
| GitHub Action | Add coldteadotai/pr-lens/packages/action@v0 to a workflow and provide a model key. |
Defaults to Gemini and also supports OpenAI or a /chat/completions-compatible endpoint such as Ollama, DeepSeek, or OpenRouter. |
| CLI | Run npx @coldtea/pr-lens-cli locally or in automation. |
Provides analyze, render, comment, validate, and export commands, including local rendering before a pull request exists. |
The hosted App is free for open-source repositories and uses Coldtea’s model account. The skill, Action, and CLI run through the user’s infrastructure or configured provider account.
Reuse the agent’s context
The coding-agent skill takes advantage of work the agent has already done while producing the diff. It writes the graph document, runs pr-lens-cli validate, corrects schema errors, and then renders the selected views. If a reviewer finds a mislabeled component, the workflow directs the agent to update .github/pr-lens.yml rather than edit generated SVG output.
The range and the failure modes
The renderer applies the same visual grammar to a one-file fix with one lane, one node, and no edges, as well as a monorepo refactor with six lanes, 37 nodes, and 49 edges. The project’s gallery includes reconstructed pull requests from React, Node.js, Kubernetes, and Rust to show how dense changes appear in both views.
- Action comments are static. A stateless CI run cannot preserve checkbox state between executions, so interactive drill-down is available only through the hosted App.
- Diagram accuracy depends on analysis quality. A model can misidentify components or infer the wrong relationship from a diff.
- Configuration carries corrections forward. Teams can record naming and structure fixes in
.github/pr-lens.ymlinstead of patching generated images. - The diagrams provide orientation. Code, tests, and runtime evidence remain the sources for deciding whether an implementation is correct.
A faster route into the diff
As coding agents increase the size and frequency of pull requests, reviewers spend more time reconstructing behavior across files. PR Lens adds a systems-level map before detailed inspection. The architecture view helps locate affected boundaries, while the data-flow view exposes changed request and event paths.
Its schema-first document and deterministic renderer suit diagrams that machines generate for a specific review and discard afterward. Reviewers can use that map to choose where to inspect interfaces, tests, failure handling, and security-sensitive paths, reducing the time spent assembling the change mentally.