Proj Review logo

Proj Review

Community
zhangloveyan
proj-review

代码审查检查清单和流程。用于代码提交前的自检、PR审查、代码质量检查。

Overview

Publisherzhangloveyan
Repositorybackend-skill
Skill nameproj-review
Stars
102
Forks
31
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by zhangloveyan on GitHub. Read the source before you install it.

Installation

Install the Proj Review AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/zhangloveyan/backend-skill/tree/main/.claude/skills/proj-review
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zhangloveyan/backend-skill.git /tmp/backend-skill
mkdir -p .claude/skills
cp -r /tmp/backend-skill/.claude/skills/proj-review .claude/skills/proj-review
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Proj Review in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Proj Review on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Proj Review is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

代码审查

适用场景

  • 代码提交前自检
  • Pull Request 审查
  • 代码质量检查

审查流程

前置: 任务文档校验 → Step 0: 编译检查 → Step 1: 功能检查 → Step 2: 代码规范 → Step 3: 安全检查 → Step 4: 性能检查 → Step 5: 自动修复 → Step 6: 测试检查 → Step 7: 输出报告

前置:任务文档校验

  • 确认全流程任务文档存在
  • 若缺失,先创建任务文档骨架并补齐流程状态与上下文快照
  • 将“代码审查”状态标记为进行中

Step 0: 编译检查(前置)

执行 mvn compile 检查:

  • 类名与文件名是否匹配
  • 语法错误
  • 依赖缺失

如有编译错误,先修复再继续审查。


审查清单

1. 功能检查

  • 功能是否符合需求
  • 边界条件是否处理
  • 异常情况是否处理
  • 是否有遗漏的场景

2. 代码规范

  • 命名是否符合规范(参考 CLAUDE.md)
  • 新增或重命名的表、字段是否按 SQL 命名规范 检查目标 MySQL 版本全部关键字(含非保留关键字),并记录版本、来源和结果;反引号不能豁免,未核验不得判为通过
  • 已有冲突名称是否具有经确认的迁移方案,DDL、Entity 映射、Mapper SQL、索引引用、测试和文档是否同步;禁止自动重命名已有表或字段
  • 代码格式是否统一
  • 注释是否清晰必要
  • 是否有重复代码
  • 方法是否过长(建议不超过50行)
  • 类是否过大(建议不超过500行)

3. 安全检查(安全红线)

强制规则 - 违反必须修复:

  • 禁止明文存储密码(必须 BCrypt)
  • 禁止日志打印敏感信息(密码、手机号、身份证)
  • 禁止 SQL 拼接(必须使用 #{} 参数化查询)
  • 禁止信任前端传入的用户ID(必须从 Token 获取)

其他安全检查:

  • 是否有 XSS 风险
  • 敏感信息是否脱敏
  • 权限校验是否完整

4. 性能检查(性能红线)

强制规则 - 违反必须修复:

  • 禁止循环内查询数据库(N+1 问题)
  • 禁止深度分页(offset > 10000)
  • 禁止不带条件的全表查询
  • 禁止单次查询超过 1000 条不分批

其他性能检查:

  • 是否在循环中执行数据库操作
  • 是否有不必要的数据库查询
  • 大数据量是否分页处理(单次 ≤ 1000)
  • 批量操作是否分批执行(每批 ≤ 500)
  • 是否有全表扫描(缺少索引)
  • 是否有内存泄漏风险

5. 日志检查

  • 关键操作是否有日志
  • 日志格式是否规范
  • 是否打印了敏感信息
  • 是否在循环中打印日志

6. 异常处理

  • 异常是否被正确捕获
  • 异常信息是否有意义
  • 是否有空的 catch 块
  • 事务是否正确回滚

Step 5: 自动修复

对于以下问题,直接修复而非仅报告:

问题类型修复方式
NPE 风险(Integer/Long 比较)改用 equals() 或 Objects.equals()
类名与文件名不匹配修改类名与文件名一致
缺少 @ApiLog 注解添加注解
硬编码常量提取为常量或使用 BaseConstant

Step 6: 测试检查

  • 是否有单元测试
  • 测试覆盖率是否足够
  • 边界条件是否测试

常见问题

命名问题

java
// ✗ 错误
int a = 1;
String str = "hello";
public void process() {}

// ✓ 正确
int userCount = 1;
String userName = "hello";
public void processOrder() {}

空指针风险

java
// ✗ 风险
User user = userMapper.selectById(id);
return user.getName();  // user 可能为 null

// ✓ 正确
User user = userMapper.selectById(id);
if (user == null) {
    throw new BusinessException(ErrorCode.DATA_NOT_EXIST);
}
return user.getName();

SQL 注入风险

java
// ✗ 危险
@Select("SELECT * FROM sys_user WHERE user_name = '" + name + "'")

// ✓ 安全
@Select("SELECT * FROM sys_user WHERE user_name = #{name}")

N+1 查询

java
// ✗ N+1 问题
List<Order> orders = orderMapper.selectList();
for (Order order : orders) {
    User user = userMapper.selectById(order.getUserId());  // N次查询
}

// ✓ 正确 - 批量查询
List<Order> orders = orderMapper.selectList();
Set<Long> userIds = orders.stream().map(Order::getUserId).collect(toSet());
Map<Long, User> userMap = userMapper.selectBatchIds(userIds)
    .stream().collect(toMap(User::getId, Function.identity()));

深度分页

java
// ✗ 深度分页问题
SELECT * FROM sales_order LIMIT 100000, 10;  // 扫描 100010 行

// ✓ 游标分页
SELECT * FROM sales_order WHERE id > #{lastId} ORDER BY id LIMIT 10;

批量操作

java
// ✗ 未分批
mapper.insertBatch(largeList);  // 可能超时或内存溢出

// ✓ 分批处理
List<List<Entity>> batches = Lists.partition(largeList, 500);
for (List<Entity> batch : batches) {
    mapper.insertBatch(batch);
}

Step 7: 输出报告

使用模板生成审查报告:审查报告模板

同步更新任务文档:

  • 产物清单记录审查报告路径
  • 流程状态总览标记“代码审查”为已完成
  • 更新下一步指令(生成测试或运行测试)

注意事项

  1. 客观公正 - 基于规范和最佳实践
  2. 具体明确 - 指出具体问题和位置
  3. 提供建议 - 不只指出问题,也给出解决方案
  4. 区分级别 - 严重问题必须修复,建议可选

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Proj Review AI skill do?

代码审查检查清单和流程。用于代码提交前的自检、PR审查、代码质量检查。

Why use Proj Review on TypingMind?

Because you install it once and use it with any model. Proj Review is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Proj Review in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/zhangloveyan/backend-skill/tree/main/.claude/skills/proj-review. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Proj Review?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Proj Review?

As many as you like. As long as a model supports skills, you can use Proj Review with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Proj Review AI skill free?

Yes. It is published on GitHub by zhangloveyan under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇