Code Reviewer LangGraph
blueprint · 4 agents · 1 MCP server
1300★ stars
210forks
4.8rating
What it does
A diff-aware reviewer with a built-in skeptic. A reader pulls the pull request, a finder proposes issues, a skeptic tries to refute each one, and a reporter writes up only the findings that survived. Fewer false positives than a single pass.
The cast · 4 agents
Finderfinderreasoning
Read the diff and propose specific findings: bugs, risks, and smells.
no tools · reasoning only
Readerreaderfast
Fetch the pull request and its diff.
gh.get_pr
Skepticskepticreasoning
Try to refute each finding. Drop the ones that don't hold up.
no tools · reasoning only
Reporterreporterreasoning
Write up the surviving findings as a review comment.
gh.comment
Flow
→ Reader → diff
→ Finder → findings
→ Skeptic → confirmed
→ Reporter → review
Interface
Inputs
prstring
The pull request to review.
Outputs
reviewstring
The posted review.
Depends on · 1 MCP server
io.github.github/github-mcpnot in the registry yetgh⤓ Export runnable code
# Generated by @socketcat/compiler for target: langgraph
# blueprint: com.socketcat/code-reviewer v1.0.0 schema: socketcat.dev/blueprint/v0
# This code is yours. Edit it freely. The socketcat_runtime helper is optional and can be vendored.
from typing import TypedDict
from langgraph.graph import StateGraph, START, END
import socketcat_runtime as _rt
class State(TypedDict, total=False):
pr: object
review: object
diff: object
findings: object
confirmed: object
def node_AgentInvoke_0(state):
return _rt.run_agent("reader", state, {"pr":"pr"}, "diff")
def node_AgentInvoke_1(state):
return _rt.run_agent("finder", state, {"diff":"diff"}, "findings")
def node_AgentInvoke_2(state):
return _rt.run_agent("skeptic", state, {"findings":"findings"}, "confirmed")
def node_AgentInvoke_3(state):
return _rt.run_agent("reporter", state, {"confirmed":"confirmed"}, "review")
def build():
b = StateGraph(State)
b.add_node("AgentInvoke_0", node_AgentInvoke_0)
b.add_node("AgentInvoke_1", node_AgentInvoke_1)
b.add_node("AgentInvoke_2", node_AgentInvoke_2)
b.add_node("AgentInvoke_3", node_AgentInvoke_3)
b.add_edge(START, "AgentInvoke_0")
b.add_edge("AgentInvoke_0", "AgentInvoke_1")
b.add_edge("AgentInvoke_1", "AgentInvoke_2")
b.add_edge("AgentInvoke_2", "AgentInvoke_3")
b.add_edge("AgentInvoke_3", END)
return b.compile()
INPUTS = ["pr"]
OUTPUTS = ["review"]
if __name__ == "__main__":
_rt.main(build, INPUTS, OUTPUTS)
▸blueprint.json (the portable format)
{
"id": "com.socketcat/code-reviewer",
"flow": {
"type": "sequence",
"blocks": [
{
"in": {
"pr": "pr"
},
"out": "diff",
"use": "reader",
"type": "agent"
},
{
"in": {
"diff": "diff"
},
"out": "findings",
"use": "finder",
"type": "agent"
},
{
"in": {
"findings": "findings"
},
"out": "confirmed",
"use": "skeptic",
"type": "agent"
},
{
"in": {
"confirmed": "confirmed"
},
"out": "review",
"use": "reporter",
"type": "agent"
}
]
},
"tags": [
"code-review",
"verification"
],
"title": "Code Reviewer",
"agents": {
"finder": {
"model": {
"hint": "reasoning"
},
"title": "Finder",
"instructions": "Read the diff and propose specific findings: bugs, risks, and smells."
},
"reader": {
"model": {
"hint": "fast"
},
"title": "Reader",
"tools": [
"gh.get_pr"
],
"instructions": "Fetch the pull request and its diff."
},
"skeptic": {
"model": {
"hint": "reasoning"
},
"title": "Skeptic",
"instructions": "Try to refute each finding. Drop the ones that don't hold up."
},
"reporter": {
"model": {
"hint": "reasoning"
},
"title": "Reporter",
"tools": [
"gh.comment"
],
"instructions": "Write up the surviving findings as a review comment."
}
},
"estate": {
"diff": {
"type": "object",
"description": "The pull request diff and metadata the reader fetched."
},
"review": {
"type": "string",
"description": "The review comment the reporter wrote up."
},
"findings": {
"type": "object",
"description": "Issues the finder proposed, before verification."
},
"confirmed": {
"type": "object",
"description": "The findings that survived the skeptic's refutation pass."
}
},
"$schema": "socketcat.dev/blueprint/v0",
"authors": [
{
"url": "https://socketcat.com",
"name": "SocketCat"
}
],
"license": "MIT",
"servers": [
{
"ref": "io.github.github/github-mcp",
"alias": "gh"
}
],
"summary": "Reads a diff, proposes findings, verifies each with a skeptic, and reports only survivors.",
"targets": [
"langgraph",
"crewai",
"*"
],
"version": "1.0.0",
"interface": {
"inputs": {
"pr": {
"type": "string",
"description": "The pull request to review."
}
},
"outputs": {
"review": {
"type": "string",
"description": "The posted review."
}
}
},
"description": "A diff-aware reviewer with a built-in skeptic. A reader pulls the pull request, a finder proposes issues, a skeptic tries to refute each one, and a reporter writes up only the findings that survived. Fewer false positives than a single pass."
}