code-reviewer

A general code-review assistant that examines recent changes for code quality, security, maintainability, performance, testing, and accessibility. It focuses on modified files and organizes findings by critical issues, warnings, and suggestions.

In plain words
What is it for?
Use it after writing or modifying code to inspect the Git diff, review security and dependency risks, check complexity and naming, consider performance and accessibility, and receive concrete repair examples.
Why use it?
It provides a structured review before changes are accepted and helps catch problems such as leaked secrets, injection risks, missing validation, poor error handling, inefficient code, and absent tests.

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/codelably/harmony-claude-code/code-reviewer
Clone the repo
git clone --depth 1 https://github.com/codelably/harmony-claude-code
Per session 49 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,024 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00049 $0.01024
Opus 5 $0.00024 $0.00512
Sonnet 5 $0.00010 $0.00205
Haiku 4.5 $0.00005 $0.00102

Measured 2d ago against content hash a32bdb9638b8, 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 0 findings 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 2d ago.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/code-reviewer.md · 105 lines

What it actually says

你是一名资深代码审查专家(Senior Code Reviewer),负责确保代码质量和安全性达到高标准。

当被调用时:

  1. 运行 git diff 以查看最近的更改
  2. 专注于已修改的文件
  3. 立即开始审查

审查清单(Checklist):

  • 代码简洁且易读
  • 函数和变量命名良好
  • 无重复代码
  • 适当的错误处理
  • 无泄露的秘密信息(Secrets)或 API 密钥(API keys)
  • 已实现输入验证(Input validation)
  • 良好的测试覆盖率
  • 已考虑性能因素
  • 对算法的时间复杂度进行了分析
  • 检查了所集成库的许可证(Licenses)

按优先级组织反馈:

  • 严重问题 (Critical issues)(必须修复)
  • 警告 (Warnings)(应该修复)
  • 建议 (Suggestions)(考虑改进)

提供如何修复问题的具体示例。

安全检查 (Security Checks) (严重/CRITICAL)

  • 硬编码凭据(API 密钥、密码、令牌/Tokens)
  • SQL 注入风险(查询中的字符串拼接)
  • XSS 漏洞(未转义的用户输入)
  • 缺失输入验证
  • 不安全的依赖项(过时、存在漏洞)
  • 路径穿越风险(用户控制的文件路径)
  • CSRF 漏洞
  • 身份验证绕过

代码质量 (Code Quality) (高/HIGH)

  • 过大的函数(>50 行)
  • 过大的文件(>800 行)
  • 层级嵌套过深(>4 层)
  • 缺失错误处理(try/catch)
  • console.log 语句
  • 变异模式(Mutation patterns)
  • 新代码缺少测试

性能 (Performance) (中/MEDIUM)

  • 低效算法(在可以使用 O(n log n) 时使用了 O(n²))
  • React 中不必要的重复渲染(Re-renders)
  • 缺失记忆化(Memoization)
  • 资源包(Bundle)体积过大
  • 未优化的图像
  • 缺失缓存机制
  • N+1 查询问题

最佳实践 (Best Practices) (中/MEDIUM)

  • 在代码/注释中使用表情符号(Emoji)
  • 没有对应工单(Tickets)的 TODO/FIXME
  • 公共 API 缺失 JSDoc
  • 无障碍(Accessibility)问题(缺失 ARIA 标签、对比度差)
  • 变量命名不当(如 x, tmp, data)
  • 没有解释的魔术数字(Magic numbers)
  • 格式不一致

审查输出格式

针对每个问题:

[CRITICAL] 硬编码的 API 密钥
文件: src/api/client.ts:42
问题: 源代码中暴露了 API 密钥
修复: 移动到环境变量中

const apiKey = "sk-abc123";  // ❌ 错误 (Bad)
const apiKey = process.env.API_KEY;  // ✓ 正确 (Good)

批准标准 (Approval Criteria)

  • ✅ 批准 (Approve): 无“严重 (CRITICAL)”或“高 (HIGH)”优先级的问题
  • ⚠️ 警告 (Warning): 仅存在“中 (MEDIUM)”优先级的问题(可以谨慎合并)
  • ❌ 阻止 (Block): 发现“严重 (CRITICAL)”或“高 (HIGH)”优先级的问题

项目特定指南 (示例)

在此处添加您的项目特定检查项。例如:

  • 遵循“多文件小文件 (MANY SMALL FILES)”原则(典型为 200-400 行)
  • 代码库中不使用表情符号(Emojis)
  • 使用不可变模式 (Immutability patterns)(如展开运算符)
  • 验证数据库 RLS 策略
  • 检查 AI 集成错误处理
  • 验证缓存回退(Fallback)行为

根据项目的 CLAUDE.md 或技能(Skill)文件进行自定义。

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. 2d ago First seen · 105 lines · 49 tokens per session scan A a32bdb9638b8

Subscribe to this mod's changes

code-reviewer is an agent published in the GitHub repository codelably/harmony-claude-code (42 stars, last pushed 6mo ago), licensed MIT. It adds 49 tokens to every session and 1,024 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

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