Enterprise-grade code review agent. Reviews PRs, diffs, or code files for security vulnerabilities, performance issues, error handling gaps, architecture smells, and test coverage. Works with any language, any repo, no dependencies required.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install afrexai-code-reviewer或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install afrexai-code-reviewer⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/afrexai-code-reviewer/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: afrexai-code-reviewer description: Enterprise-grade code review agent. Reviews PRs, diffs, or code files for security vulnerabilities, performance issues, error handling gaps, architecture smells, and test coverage. Works with any language, any repo, no dependencies required. auto_trigger: false ---
Enterprise-grade automated code review. Works on GitHub PRs, local diffs, pasted code, or entire files. No dependencies — pure agent intelligence.
Review PR #42 in owner/repo
Review the staged changes in this repo
Review src/auth/login.ts for security issues
Just paste code and say "review this"
---
Every review follows the SPEAR framework — 5 dimensions, each scored 1-10:
| Check | Severity | Example | |-------|----------|---------| | Hardcoded secrets | CRITICAL | API keys, passwords, tokens in source | | SQL injection | CRITICAL | String concatenation in queries | | XSS vectors | HIGH | Unsanitized user input in HTML/DOM | | Path traversal | HIGH | User input in file paths without validation | | Insecure deserialization | HIGH | eval(), pickle.loads(), JSON.parse on untrusted input | | Auth bypass | CRITICAL | Missing auth checks on endpoints | | SSRF | HIGH | User-controlled URLs in server requests | | Timing attacks | MEDIUM | Non-constant-time string comparison for secrets | | Dependency vulnerabilities | MEDIUM | Known CVEs in imported packages | | Sensitive data logging | MEDIUM | PII, tokens, passwords in log output | | Insecure randomness | MEDIUM | Math.random() for security-sensitive values | | Missing rate limiting | MEDIUM | Auth endpoints without throttling |
| Check | Severity | Example | |-------|----------|---------| | N+1 queries | HIGH | DB call inside a loop | | Unbounded queries | HIGH | SELECT * without LIMIT on user-facing endpoints | | Missing indexes (implied) | MEDIUM | Frequent WHERE/ORDER on unindexed columns | | Memory leaks | HIGH | Event listeners never removed, growing caches | | Blocking main thread | HIGH | Sync I/O in async context, CPU-heavy in event loop | | Unnecessary re-renders | MEDIUM | React: missing memo, unstable refs in deps | | Large bundle imports | MEDIUM | import _ from 'lodash' vs import get from 'lodash/get' | | Missing pagination | MEDIUM | Returning all records to client | | Redundant computation | LOW | Same expensive calc repeated without caching | | Connection pool exhaustion | HIGH | Not releasing DB/HTTP connections |
| Check | Severity | Example | |-------|----------|---------| | Swallowed errors | HIGH | Empty catch blocks, Go _ := on error | | Missing error boundaries | MEDIUM | React components without error boundaries | | Unchecked null/undefined | HIGH | No null checks before property access | | Missing finally/cleanup | MEDIUM | Resources opened but not guaranteed closed | | Generic error messages | LOW | catch(e) { throw new Error("something went wrong") } | | Missing retry logic | MEDIUM | Network calls without retry on transient failures | | Panic/exit in library code | HIGH | panic(), os.Exit(), process.exit() in non-main | | Unhandled promise rejections | HIGH | Async calls without .catch() or try/catch | | Error type conflation | MEDIUM | All errors treated the same (4xx vs 5xx, retriable vs fatal) |
| Check | Severity | Example | |-------|----------|---------| | God functions (>50 lines) | MEDIUM | Single function doing too many things | | God files (>300 lines) | MEDIUM | Monolithic module | | Tight coupling | MEDIUM | Direct DB calls in request handlers | | Missing abstraction | LOW | Repeated patterns that should be extracted | | Circular dependencies | HIGH | A imports B imports A | | Wrong layer | MEDIUM | Business logic in controllers, SQL in UI | | Magic numbers/strings | LOW | Hardcoded values without named constants | | Missing types | MEDIUM | any in TypeScript, missing type hints in Python | | Dead code | LOW | Unreachable branches, unused imports/variables | | Inconsistent patterns | LOW | Different error handling styles in same codebase |
| Check | Severity | Example | |-------|----------|---------| | Missing tests for changes | HIGH | New logic without corresponding test | | Test quality | MEDIUM | Tests that only check happy path | | Missing edge cases | MEDIUM | No handling for empty arrays, null, boundary values | | Race conditions | HIGH | Shared mutable state without synchronization | | Non-idempotent operations | MEDIUM | Retrying could cause duplicates | | Missing validation | HIGH | User input accepted without schema validation | | Brittle tests | LOW | Tests depending on execution order or timing | | Missing logging | MEDIUM | Error paths with no observability | | Configuration drift | MEDIUM | Hardcoded env-specific values | | Missing migrations | HIGH | Schema changes without migration files |
---
CRITICAL → -3 points from dimension score
HIGH → -2 points
MEDIUM → -1 point
LOW → -0.5 points
INFO → 0 (suggestion only)
Raw Score = (S×3 + P×2 + E×2 + A×1.5 + R×1.5) / 10
Final Score = Raw Score × 10 (scale 0-100)
| Score | Verdict | Action | |-------|---------|--------| | 90-100 | ✅ EXCELLENT | Ship it | | 75-89 | 🟢 GOOD | Minor suggestions, approve | | 60-74 | 🟡 NEEDS WORK | Address findings before merge | | 40-59 | 🟠 SIGNIFICANT ISSUES | Major rework needed | | 0-39 | 🔴 BLOCK | Critical issues, do not merge |
---
Use this structure for every review:
# Code Review: [PR title or file name]
## Summary
[1-2 sentence overview of what this code does and overall quality]
## SPEAR Score: [X]/100 — [VERDICT]
| Dimension | Score | Key Finding |
|-----------|-------|-------------|
| 🔴 Security | X/10 | [worst finding or "Clean"] |
| 🟡 Performance | X/10 | [worst finding or "Clean"] |
| 🟠 Error Handling | X/10 | [worst finding or "Clean"] |
| 🔵 Architecture | X/10 | [worst finding or "Clean"] |
| 📊 Reliability | X/10 | [worst finding or "Clean"] |
## Findings
### [CRITICAL/HIGH] 🔴 [Title]
**File:** `path/to/file.ts:42`
**Category:** Security
**Issue:** [What's wrong]
**Impact:** [What could happen]
**Fix:**
// suggested fix
### [MEDIUM] 🟡 [Title]
...
## What's Done Well
- [Genuinely good patterns worth calling out]
## Recommendations
1. [Prioritized action items]
---
any type usage → Architecture findingas type assertions → potential runtime errorconsole.log in production code → Style== instead of === → Reliabilityasync/await error handlinguseEffect missing cleanup returnexcept: or except Exception: → Error Handlingeval() / exec() → Security CRITICALimport * → Architecture__init__.py type hints_ := discarding errors → Error Handling HIGHpanic() in library code → Reliability HIGHdefer for resource cleanupinterface{} / any overuseException or Throwable → Error Handling@Override annotationsSystem.out.println in production...
安装 Code Review Engine 后,可以对 AI 说这些话来触发它
Help me get started with Code Review Engine
Explains what Code Review Engine does, walks through the setup, and runs a quick demo based on your current project
Use Code Review Engine to enterprise-grade code review agent
Invokes Code Review Engine with the right parameters and returns the result directly in the conversation
What can I do with Code Review Engine in my developer & devops workflow?
Lists the top use cases for Code Review Engine, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/afrexai-code-reviewer/ 目录(个人级,所有项目可用),或 .claude/skills/afrexai-code-reviewer/(项目级)。重启 AI 客户端后,用 /afrexai-code-reviewer 主动调用,或让 AI 根据上下文自动发现并使用。
Code Review Engine 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Code Review Engine 可免费安装使用。请查阅仓库了解许可证信息。
Enterprise-grade code review agent. Reviews PRs, diffs, or code files for security vulnerabilities, performance issues, error handling gaps, architecture smells, and test coverage. Works with any language, any repo, no dependencies required.
Code Review Engine 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Code Review Engine
Identifies repetitive steps in your workflow and sets up Code Review Engine to handle them automatically