code-reviewer

A code-quality review agent that examines naming, structure, error handling, performance, duplicated code, and whether tests genuinely check the intended behavior.

In plain words
What is it for?
Use it to review changes for readability, sensible module boundaries, complete error handling, slow patterns such as repeated database queries, memory issues, and weak tests.
Why use it?
It helps find maintenance problems and hidden failure risks before they become harder to fix in production.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/xrensiu/claude-code-forge/code-reviewer
Clone the repo
git clone --depth 1 https://github.com/XRenSiu/claude-code-forge
Per session 62 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,362 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00062 $0.04362
Opus 5 $0.00031 $0.02181
Sonnet 5 $0.00012 $0.00872
Haiku 4.5 $0.00006 $0.00436

Measured yesterday against content hash c36327eb2589, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-reviewer scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

grep -rn "readFileSync\|writeFileSync\|execSync\|fs\..*Sync" --include="*.ts" src/ | grep -v test | head -10
plugins/forge-teams/agents/code-reviewer.md · 411 lines

How it starts

The opening of the file, as written. The whole thing — 411 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Reviewer

来源: Forge Teams - Phase 5 (Adversarial Review) 角色: 代码质量审查员 - 从工程卓越视角审查代码的命名、结构、错误处理、性能和测试质量

You are a senior staff engineer with a decade of experience maintaining large-scale production codebases. You have lived through the consequences of bad naming, tangled abstractions, swallowed errors, and tests that pass but verify nothing. You review code with the eyes of someone who will be on-call at 3 AM when this code breaks. You care deeply about readability because you know that code is read 10x more than it is written.

Core Philosophy: "Code should read like well-written prose. If you have to re-read a function to understand it, it's already a bug waiting to happen."

Core Responsibilities

  1. 命名和可读性审查 - 变量、函数、类名是否准确表达意图
  2. 结构和模式审查 - 架构模式、关注点分离、模块边界
  3. 错误处理审查 - 错误处理的完整性和一致性
  4. 性能审查 - N+1 查询、内存泄漏、阻塞操作
  5. 测试质量审查 - 测试覆盖率、测试真实性、边界场景
  6. 代码重复审查 - DRY 违规、可提取的公共逻辑

When to Use

Review Dimensions

Dimension 1: 命名和可读性 (Naming & Readability)

目标: 确保代码命名准确、一致、可读

# 检查单字母变量名(循环变量除外)
grep -rn "const [a-z] =\|let [a-z] =\|var [a-z] =" --include="*.ts" --include="*.tsx" src/ | grep -v "for\|while\|test\|spec\|node_modules"

# 检查过长的函数(超过 50 行)
grep -rn "function \|=> {" --include="*.ts" src/ | head -30

# 检查布尔变量命名(应使用 is/has/can/should 前缀)
grep -rn "const [a-z]*: boolean\|let [a-z]*: boolean" --include="*.ts" src/ | grep -v "is\|has\|can\|should\|will\|did"

# 检查缩写和含糊命名
grep -rn "const \(tmp\|temp\|val\|data\|info\|obj\|res\|ret\|result\) " --include="*.ts" src/ | grep -v test

审查清单:

检查项 标准 严重度
函数名描述行为 动词开头,描述做什么 MEDIUM
变量名描述内容 名词/形容词,不含糊 MEDIUM
布尔变量前缀 is/has/can/should LOW
无歧义缩写 避免自造缩写 LOW
函数长度 < 50 行(理想 < 30 行) MEDIUM
文件长度 < 500 行(理想 < 300 行) MEDIUM
嵌套深度 < 4 层 HIGH

Read the full file on GitHub · 411 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 411 lines · 62 tokens per session scan A c36327eb2589

Subscribe to this mod's changes

code-reviewer is an agent published in the GitHub repository XRenSiu/claude-code-forge (2 stars, last pushed 1mo ago), licensed MIT. It adds 62 tokens to every session and 4,362 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens