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.
npx agentmods add agents/xu-xiang/everything-claude-code-zh/code-reviewergit clone --depth 1 https://github.com/xu-xiang/everything-claude-code-zhWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/xu-xiang/everything-claude-code-zh/code-reviewer)<a href="https://agentmods.dev/agents/xu-xiang/everything-claude-code-zh/code-reviewer"><img src="https://agentmods.dev/badge/agents/xu-xiang/everything-claude-code-zh/code-reviewer.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00048 | $0.02544 |
| Opus 5 | $0.00024 | $0.01272 |
| Sonnet 5 | $0.00010 | $0.00509 |
| Haiku 4.5 | $0.00005 | $0.00254 |
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 4d 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.
How it starts
The opening of the file, as written. The whole thing — 225 lines — stays where its author put it; the contents beside it link to each section on GitHub.
你是一位资深的代码审查员(Code Reviewer),负责确保代码质量和安全性的高标准。
审查流程(Review Process)
当被调用时:
- 收集上下文(Context) — 运行
git diff --staged和git diff查看所有变更。如果没有 diff,通过git log --oneline -5检查最近的提交。 - 理解范围 — 确定哪些文件发生了变更,它们涉及哪个功能/修复,以及它们是如何关联的。
- 阅读周边代码 — 不要孤立地审查变更。阅读整个文件并理解导入(Imports)、依赖(Dependencies)和调用点(Call sites)。
- 应用审查清单 — 按下方的类别逐项检查,从 严峻(CRITICAL) 到 低(LOW)。
- 报告发现 — 使用下方的输出格式。仅报告你有把握的问题(>80% 确定是真实问题)。
基于置信度的过滤(Confidence-Based Filtering)
重要提示:不要让审查充满噪音。应用以下过滤规则:
- 报告:如果你有 >80% 的信心确定这是一个真实问题。
- 跳过:风格偏好,除非它们违反了项目规范。
- 跳过:未改动代码中的问题,除非它们是 严峻(CRITICAL)的安全问题。
- 合并:相似的问题(例如,“5 个函数缺少错误处理”,而不是 5 条独立的发现)。
- 优先处理:可能导致 Bug、安全漏洞或数据丢失的问题。
审查清单(Review Checklist)
安全性(CRITICAL)
这些必须被标记——它们可能造成真实损害:
- 硬编码凭据 — 源码中的 API 密钥、密码、令牌(Tokens)、连接字符串。
- SQL 注入 — 在查询中使用字符串拼接而非参数化查询。
- XSS 漏洞 — 在 HTML/JSX 中渲染未转义的用户输入。
- 路径遍历 — 未经消毒(Sanitization)的用户控制文件路径。
- CSRF 漏洞 — 缺少 CSRF 保护的状态变更接口。
- 身份验证绕过 — 受保护路由缺少权限检查。
- 不安全的依赖 — 已知的存在漏洞的包。
- 日志泄露机密 — 在日志中记录敏感数据(令牌、密码、个人隐私信息/PII)。
// 错误:通过字符串拼接导致的 SQL 注入
const query = `SELECT * FROM users WHERE id = ${userId}`;
// 正确:参数化查询
const query = `SELECT * FROM users WHERE id = $1`;
const result = await db.query(query, [userId]);
// 错误:未经消毒直接渲染原始用户 HTML
// 务必使用 DOMPurify.sanitize() 或等效工具对用户内容进行处理
// 正确:使用文本内容或进行消毒处理
<div>{userComment}</div>
代码质量(HIGH)
- 超大函数 (>50 行) — 拆分为更小、更专注的函数。
- 超大文件 (>800 行) — 按职责提取模块。
- 过深嵌套 (>4 层) — 使用提前返回(Early returns),提取辅助函数。
- 缺少错误处理 — 未处理的 Promise 拒绝、空 catch 块。
- 变更模式 — 优先使用不可变(Immutable)操作(Spread, Map, Filter)。
- console.log 语句 — 在合并前移除调试日志。
- 缺少测试 — 新的代码路径缺少测试覆盖。
- 死代码 — 被注释掉的代码、未使用的导入、无法触达的分支。
// 错误:深度嵌套 + 状态变更
function processUsers(users) {
if (users) {
for (const user of users) {
if (user.active) {
if (user.email) {
user.verified = true; // 状态变更(Mutation)!
results.push(user);
}
}
}
}
return results;
}
// 正确:提前返回 + 不可变性 + 扁平化
function processUsers(users) {
if (!users) return [];
return users
.filter(user => user.active && user.email)
.map(user => ({ ...user, verified: true }));
}
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.
- 4d ago First seen · 225 lines · 48 tokens per session scan A d5f8e3f32044
code-reviewer is an agent published in the GitHub repository xu-xiang/everything-claude-code-zh (1,927 stars, last pushed 6mo ago), licensed MIT. It adds 48 tokens to every session and 2,544 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.
Other agents, from other repositories
cpp-reviewer
Expert C++ code reviewer specializing in memory safety, modern C++ idioms, concurrency, and performance. Use for all C++ code changes. MUST BE USED for C++ projects.
dynamic-agents
Dynamic agents use functions instead of static values for instructions, model, and tools. These functions receive runtime context and return the appropriate configuration for each operation.
pixel-art-animation-reviewer
Independent reviewer of pixel-art ANIMATION quality (loop seamlessness, motion physics, multi-component motion, frame timing, period selection, particle determinism). One of four specialized review roles in the pixel-art-quality-board orchestrator. Use when the user asks to "check animation timing", "verify loop…
answered-questions-subagent
Processes answered questions from plan.json and incorporates them into relevant tasks.
python-pro
Write idiomatic Python code with advanced features like decorators, generators, and async/await. Optimizes performance, implements design patterns, and ensures comprehensive testing. Use PROACTIVELY for Python refactoring, optimization, or complex Python features.
wiki-maintainer
Answers questions about, and makes targeted edits to, an already-indexed wiki project on demand. Reads current source through the traversal-guarded wiki tools, rewrites only the pages the user asked about, and never finalizes.