← 返回 Skills 市场
ericlooi504

Code Reviewer

作者 ericlooi504 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
36
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install eric-code-reviewer
功能描述
Automated code review for pull requests and code snippets. Analyzes code quality, security vulnerabilities, performance issues, and best practices across Pyt...
使用说明 (SKILL.md)

Code Reviewer

Automated code review analysis for quality, security, performance, and best practices.

When to Use

USE this skill when:

  • "Review this code for bugs"
  • "Check my PR before I submit it"
  • "Is there any security issue in this function?"
  • "Can you optimize this code?"
  • "Review this git diff"
  • "Does this follow [language] best practices?"
  • "Compare these two implementations"

DON'T use this skill when:

  • Need full test suite generation → use a testing skill
  • Need architectural design review → use architecture skills
  • Need deployment pipeline review → use CI/CD skills
  • The code is proprietary/sensitive and shouldn't be shared

Review Checklist

For every code review, the agent checks in this order:

1. 🔴 Critical (must fix)

Check What to look for
SQL Injection String concatenation in queries, unescaped user input
XSS Unsanitized output in HTML/templates, dangerouslySetInnerHTML
Command Injection os.system(), exec(), subprocess(shell=True) with user input
Path Traversal ../../ in file paths, unsanitized filenames
Sensitive Data Hardcoded API keys, passwords, tokens, secrets
Unvalidated Input Missing type checks, no boundary validation on arrays/buffers

2. 🟡 Important (should fix)

Check What to look for
Null/Undefined Missing null checks, no Optional/Maybe wrapping
Error Handling Bare except:, swallowed exceptions, no error context
Race Conditions Shared state without locks, async without mutexes
Resource Leaks Unclosed files, connections, handles
Type Safety Implicit casts, any types, missing generics
Dead Code Unused variables, imports, unreachable branches

3. 🟢 Nice to have

Check What to look for
Naming Vague names (data, tmp, foo), inconsistent casing
Comments Stale/no comments, commented-out code
Duplication Repeated logic that should be a function
Logging Missing context in log messages, wrong log level
Tests Missing edge cases, no test for the change

Workflow

Step 1: Accept Input

The agent accepts code in these forms:

  • Pasted code block: "Review this function: ```python ..."
  • File path: "Review src/app.js"
  • Git diff: "Review my uncommitted changes" → runs git diff
  • GitHub PR URL: "Review https://github.com/user/repo/pull/42"
  • Branch comparison: "Review changes between main and feature-branch"

Step 2: Analyze

For each code segment:

  1. Identify the language and framework
  2. Run the checklist above
  3. Cross-reference common anti-patterns for the language
  4. Check for performance traps (N+1 queries, O(n²) in loops, etc.)

Step 3: Report

Present findings in order of severity with:

## 🔴 Critical
- [Line 42] SQL Injection: f-string used in SQL query. Use parameterized queries.

## 🟡 Important
- [Line 15] Missing null check: `user.getName()` may throw if user is None

## 🟢 Suggestion
- [Line 88] Duplicate logic with lines 12-20 — extract to helper function

Step 4: Offer Fixes (Optional)

The agent can:

  • Show the fix inline
  • Generate a patch file
  • Apply changes directly (with confirmation)

Language-Specific Rules

Python

  • Prefer f-strings over .format() or %
  • Use with for resource management
  • Type hints on function signatures
  • List comprehensions over map/filter
  • Avoid mutable default arguments

JavaScript / TypeScript

  • const over let, never var
  • Prefer early returns over nested ifs
  • Use === not ==
  • Async/await over raw promises
  • Avoid any in TypeScript

Java

  • Use Optional over null returns
  • Prefer try-with-resources
  • Favor composition over inheritance
  • Use interface types, not concrete types

Go

  • Always check errors
  • Use go fmt conventions
  • Prefer defer for cleanup
  • Avoid global state

Shell / Bash

  • Quote all variable expansions
  • Use set -euo pipefail in scripts
  • Prefer [[ ]] over [ ]
  • Avoid parsing ls output

Examples

User: "Review this Python function" + code block Agent: Runs checklist → finds SQL injection. Reports 🔴 Critical with fix

User: "Check my current git diff" Agent: Runs git diff, reviews changes, lists findings

User: "Is this TypeScript safe?" + code block Agent: Checks types, null safety, anti-patterns → 🟡 reports any misuse

Notes

  • For large PRs, focus on changed lines only
  • Flag false positives transparently
  • If a file is too large, review the most critical areas first
安全使用建议
This skill appears safe for normal code-review use. Before installing, be aware that it may inspect local files or git diffs you provide, and only approve direct changes after reading the proposed edits. Do not use it with proprietary or sensitive code unless you are comfortable with the agent reviewing that code.
功能分析
Type: OpenClaw Skill Name: eric-code-reviewer Version: 1.0.0 The 'eric-code-reviewer' skill is a standard automated code review tool designed to analyze code for quality, security, and performance. The SKILL.md file provides clear, helpful instructions for the AI agent to identify common vulnerabilities (like SQL injection and command injection) and follow language-specific best practices. There are no indicators of malicious intent, data exfiltration, or unauthorized execution; the use of 'git' is appropriate for its stated purpose of reviewing code changes.
能力评估
Purpose & Capability
The requested capabilities—reviewing pasted code, file paths, git diffs, PR URLs, and branch comparisons—are coherent with an automated code-review skill.
Instruction Scope
The workflow is mostly read-and-report, with optional patch generation or direct edits only stated as requiring confirmation.
Install Mechanism
There is no install script or bundled executable code; the only declared requirement is the purpose-aligned git binary.
Credentials
Reading local files or git diffs is proportionate for code review, but users should avoid using it on code they do not want the agent/model to inspect.
Persistence & Privilege
The artifacts do not request credentials, persistent background execution, privileged access, or long-lived state.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install eric-code-reviewer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /eric-code-reviewer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: automated code review for Python, JS/TS, Java, Go, Rust, Shell
元数据
Slug eric-code-reviewer
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Code Reviewer 是什么?

Automated code review for pull requests and code snippets. Analyzes code quality, security vulnerabilities, performance issues, and best practices across Pyt... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 36 次。

如何安装 Code Reviewer?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install eric-code-reviewer」即可一键安装,无需额外配置。

Code Reviewer 是免费的吗?

是的,Code Reviewer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Code Reviewer 支持哪些平台?

Code Reviewer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Code Reviewer?

由 ericlooi504(@ericlooi504)开发并维护,当前版本 v1.0.0。

💬 留言讨论