Code Review
БесплатноБез исполняемых скриптовНе проверенMulti-dimensional code review with quality gates. Use before merging any change. Review covers five axes: correctness, readability, architecture, security…
от carolz1547 установок в других каталогахОб этом скилле
Code Review and Quality / 代码审查与质量
Multi-dimensional review for any change before merge. Every change gets reviewed. No exceptions. / 合并前对任何变更做多维度审查。每个变更都要被审查,没有例外。
The approval standard / 通过标准
Approve a change when it definitely improves overall code health, even if it isn't perfect. Perfect code doesn't exist. Don't block a change because it isn't exactly how you would have written it. If it improves the codebase and follows project conventions, approve it. / 当变更确实提升了整体代码健康度时通过,即使它不完美。完美代码不存在。不要因为不是你的写法就阻塞。如果变更提升了代码库并遵循项目约定,通过它。
When to use / 何时使用
- Before merging any PR or change / 合并任何 PR 之前
- After completing a feature implementation / 完成功能实现后
- When another agent or model produced code you need to evaluate / 评估其他 Agent/模型生成的代码
- When refactoring existing code / 重构现有代码
- After any bug fix (review both fix and regression test) / 修任何 Bug 后(同时审查修复和回归测试)
- User says "review this", "code review", "审查代码", "审查这个 PR" / 用户说"review this"、"code review"、"审查代码"、"审查这个 PR"
The Five-Axis Review / 五维审查
Every review evaluates code across these dimensions: / 每个审查都跨这些维度评估代码:
1. Correctness / 正确性
Does the code do what it claims to do? / 代码是否做了它声称要做的事?
- Matches the spec or task requirements? / 符合规范或任务要求?
- Edge cases handled (null, empty, boundary values)? / 边界情况处理了吗(null、空、边界值)?
- Error paths handled, not just happy path? / 错误路径处理了吗,不只是 happy path?
- Tests pass? Do tests actually test the right thing? / 测试通过吗?测试是否测了对的东西?
- Off-by-one errors, race conditions, state inconsistencies? / 差一错误、竞态条件、状态不一致?
2. Readability & Simplicity / 可读性与简洁性
Can another engineer understand this without the author explaining? / 另一个工程师能否不需要作者解释就看懂?
- Names descriptive and consistent with project conventions? (No
temp,data,resultwithout context) / 命名有意义、与项目约定一致? - Control flow straightforward (avoid nested ternaries, deep callbacks)? / 控制流直接(避免嵌套三元、深度回调)?
- Related code grouped, clear module boundaries? / 相关代码分组、模块边界清晰?
- "Clever" tricks that should be simplified? / 「巧妙」技巧是否应该简化?
- Could this be done in fewer lines? (1000 lines where 100 suffice is failure) / 能用更少行吗?(100 行能搞定的写了 1000 行就是失败)
- Are abstractions earning their complexity? Don't generalize until third use case. / 抽象是否值得复杂度?不要在第三个用例之前泛化。
- New conditional bolted onto unrelated flow? That's a design smell — push logic into its own helper. / 新条件分支硬挂到无关流程?是设计气味——把逻辑提到自己的 helper。
- Repeated conditionals on same shape signal missing model or dispatcher. / 重复形状的条件分支意味着缺少模型或分发器。
- Dead code artifacts: no-op variables, backwards-compat shims,
// removedcomments. / 死代码:无用变量、向后兼容壳、// removed注释。
3. Architecture / 架构
Does the change fit the system's design? / 变更是否符合系统设计?
- Follows existing patterns or introduces a justified new one? / 遵循现有模式,或引入合理的新模式?
- Clean module boundaries? / 模块边界清晰?
- Code duplication that should be shared? / 应该共享的代码重复?
- Dependencies flowing in right direction (no circular)? / 依赖流向正确(无循环)?
- Abstraction level appropriate (not over-engineered, not too coupled)? / 抽象层级合适(不过度设计、不过度耦合)?
- Does refactor reduce complexity or just relocate it? Count concepts a reader must hold. If "cleaner" version leaves count unchanged, it isn't cleaner — prefer the restructuring that makes whole branches, modes, or layers disappear. / 重构是降低复杂度还是搬位置?数读者需要 hold 的概念。如果「更干净」的版本数量没变,那就没更干净——优先选那种让整个分支/模式/层消失的重构。
- Feature-specific logic leaking into shared/general module? Keep logic in owning layer. / 特性专属逻辑是否泄漏到共享/通用模块?逻辑放在拥有的层。
- Type boundaries explicit? Question gratuitous
any/unknown/optional/casts and silent fallbacks. / 类型边界是否显式?质疑无端any/unknown/optional/cast 和静默回退。
4. Security / 安全
Does the change introduce vulnerabilities? / 变更是否引入漏洞?
- User input validated and sanitized? / 用户输入验证和清理了吗?
- Secrets out of code, logs, version control? / 密钥不在代码、日志、版本控制里?
- Authentication/authorization checked where needed? / 需要的地方做了鉴权/授权?
- SQL queries parameterized (no string concatenation)? / SQL 参数化(无字符串拼接)?
- Outputs encoded to prevent XSS? / 输出编码防止 XSS?
- Dependencies from trusted sources, no known vulnerabilities? / 依赖来自可信源,无已知漏洞?
- External data (APIs, logs, user content, config) treated as untrusted? / 外部数据(API、日志、用户内容、配置)视为不可信?
- External data validated at system boundaries before use? / 外部数据在使用前在系统边界验证了吗?
Quick security scan (run if available): / 快速安全扫描(可用就跑):
# dependency audit / 依赖审计
npm audit # Node
pip-audit # Python
go mod tidy && go list -m -u all # Go
# secret scan / 密钥扫描
grep -rE "(api[_-]?key|secret|password|token)\s*[:=]" --include="*.{js,ts,py,go,java,rb}" .
5. Performance / 性能
Does the change introduce performance problems? / 变更是否引入性能问题?
- N+1 query patterns? / N+1 查询?
- Unbounded loops or unconstrained data fetching? / 无限循环或无约束的数据获取?
- Synchronous operations that should be async? / 应该异步的同步操作?
- Unnecessary re-renders in UI components? / UI 组件不必要的重渲染?
- Missing pagination on list endpoints? / 列表端点缺分页?
- Large objects created in hot paths? / 热
Установить Code Review в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobBashFAQ
Что делает скилл Code Review?
Multi-dimensional code review with quality gates. Use before merging any change. Review covers five axes: correctness, readability, architecture, security, and performance. Severity-labeled findings (Critical / Required / Optional / Nit) so authors know what's blocking vs optional.
Как установить скилл Code Review?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Code Review запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic