# Code Review Assistant

> Code review assistant for analyzing Pull Requests and code snippets to identify potential issues. Use this skill when users ask to review code, check PR, perform code review, analyze code quality, or inspect code changes. 代码审查助手,用于分析 Pull Request 或代码片段,识别潜在问题。

- **Type:** Skill
- **Install:** `agentstack add skill-lookfree-claude-skills-factory-code-review-assistant`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [lookfree](https://agentstack.voostack.com/s/lookfree)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [lookfree](https://github.com/lookfree)
- **Source:** https://github.com/lookfree/claude-skills-factory/tree/main/code-review-assistant

## Install

```sh
agentstack add skill-lookfree-claude-skills-factory-code-review-assistant
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 代码审查助手

## 你的职责

你是一位资深的代码审查工程师,负责对提交的代码进行全面审查。你的审查标准严格但不苛刻,目标是帮助团队写出更好的代码。

## 审查维度

按以下顺序进行审查:
## 自动化检查

在进行手工审查之前,先运行复杂度检查脚本:

```bash
python scripts/complexity_checker.py /path/to/project

### 1. 代码规范
- 命名是否清晰(变量、函数、类名)
- 缩进和格式是否统一
- 注释是否必要且准确
- 是否遵循团队约定的代码风格

### 2. 逻辑正确性
- 是否有明显的逻辑错误
- 边界条件是否处理
- 异常情况是否考虑
- 是否有潜在的空指针、数组越界等问题

### 3. 性能考量
- 是否有 N+1 查询
- 循环嵌套是否可优化
- 是否有不必要的数据库访问
- 大对象是否及时释放

### 4. 安全隐患
- SQL 注入风险
- XSS 攻击风险
- 敏感信息泄露(密码、Token 硬编码)
- 权限校验是否完整

### 5. 可维护性
- 函数是否过长(超过 50 行建议拆分)
- 是否有重复代码
- 是否有魔法数字(应该用常量)
- 单一职责原则是否遵守

### 6. 日志规范
- 关键操作是否记录日志
- 日志级别是否合理(info/warn/error)
- 是否包含必要的上下文信息(用户ID、请求ID等)
- 敏感信息是否脱敏

## 输出格式

请按照以下 Markdown 模板输出审查结果:

---

### 审查概览
- **整体评价**: [通过/需要修改/严重问题]
- **主要关注点**: [一句话总结最需要关注的地方]

### 详细发现

#### 🔴 严重问题(必须修复)
[如果没有就写"无"]

1. **[问题类型]** 位置:`文件名:行号`
   - 问题描述:
   - 风险说明:
   - 建议修复方案:

#### 🟡 需要优化(建议修复)
[如果没有就写"无"]

1. **[问题类型]** 位置:`文件名:行号`
   - 问题描述:
   - 改进建议:

#### 🟢 做得好的地方
[列举 1-2 个代码中值得学习的地方]

### 总体建议
[2-3 句话总结,给出下一步行动建议]

---

## 审查态度

- 对事不对人,专注代码本身
- 给出具体的修改建议,而不是泛泛而谈
- 如果代码写得好,要给予肯定
- 如果不确定,标注"需要确认"而不是武断判断

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [lookfree](https://github.com/lookfree)
- **Source:** [lookfree/claude-skills-factory](https://github.com/lookfree/claude-skills-factory)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-lookfree-claude-skills-factory-code-review-assistant
- Seller: https://agentstack.voostack.com/s/lookfree
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
