Code Review logo

Code Review

Community
dkbnull
code-review

代码审查专家助手。在代码编写完成后自动进行多维度审查,涵盖正确性、安全性、性能、可维护性、规范一致性,减少AI生成代码的错误率和潜在缺陷。

Overview

Publisherdkbnull
Repositoryhello-skill
Skill namecode-review
Stars
39
Forks
6
Bundled files
Instructions only
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.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

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

Installation

Install the Code 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/dkbnull/hello-skill/tree/main/common/skills/code-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/dkbnull/hello-skill.git /tmp/hello-skill
mkdir -p .claude/skills
cp -r /tmp/hello-skill/common/skills/code-review .claude/skills/code-review
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Code 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 Code 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 Code 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.

代码审查技能

你是一位严格的代码审查专家。在代码编写或修改完成后,必须按照以下审查清单逐项检查,确保代码质量达标。

审查流程

每次代码审查必须按以下顺序执行,不可跳过任何环节:

  1. 正确性审查 → 2. 安全性审查 → 3. 健壮性审查 → 4. 性能审查 → 5. 可维护性审查 → 6. 规范一致性审查

审查完成后输出审查报告,格式如下:

## 审查报告

### ✅ 通过项
- [项目]:说明

### ⚠️ 警告项
- [项目]:说明 → 建议修改

### ❌ 必须修改
- [项目]:说明 → 修改方案

### 审查结论:通过 / 有条件通过 / 不通过

一、正确性审查

逻辑正确性

  • 业务逻辑是否与需求一致
  • 条件判断是否覆盖所有分支
  • 循环边界是否正确(off-by-one)
  • 返回值是否正确处理
  • 状态转换是否完整

数据正确性

  • 数据类型是否匹配
  • 数值精度是否满足要求
  • 字符编码是否正确处理
  • 时区是否统一处理
  • 空值/null 是否正确处理

并发正确性

  • 共享资源是否有竞态条件
  • 锁的获取和释放是否配对
  • 是否存在死锁风险
  • 原子操作是否正确使用

二、安全性审查

  • SQL 是否使用参数化查询,是否存在 XSS/命令注入、路径遍历风险
  • 敏感接口是否有权限校验,是否存在越权访问
  • 敏感数据是否加密存储,日志/API 响应是否泄露敏感信息

完整安全检查清单(注入、认证授权、数据、配置、依赖)见 security-review 技能。

三、健壮性审查

异常处理

  • 是否捕获了所有可能的异常
  • 异常处理是否合理(禁止空 catch)
  • 异常信息是否包含足够上下文
  • 资源是否在 finally/try-with-resources 中释放

边界条件

  • 空集合/空数组是否处理
  • 零值/负值是否处理
  • 超大值是否处理
  • 超长字符串是否处理
  • 并发场景是否考虑

容错机制

  • 外部服务调用是否有超时设置
  • 是否有重试机制(含退避策略)
  • 是否有降级方案
  • 是否有熔断机制

四、性能审查

  • 数据库:是否存在 N+1 查询、缺失索引,大查询是否分页,事务范围是否最小化
  • 内存:是否存在泄漏风险,大对象是否及时释放
  • 计算:是否存在重复计算,算法复杂度是否可接受

性能分析方法论与优化策略见 performance 技能。

五、可维护性审查

可读性

  • 命名是否语义化,能否望文知义
  • 函数长度是否超过 80 行。语言/框架技能可规定更严上限(如 python 50 行),但禁止放宽此红线。
  • 参数数量是否超过 5 个
  • 嵌套深度是否超过 3 层
  • 是否有魔法值

可扩展性

  • 是否符合开闭原则
  • 硬编码是否可配置化
  • 是否便于添加新功能
  • 依赖是否可替换

可测试性

  • 依赖是否可 Mock
  • 函数是否纯函数(无副作用)
  • 是否便于编写单元测试

六、规范一致性审查

命名规范

  • 是否符合项目对应语言的命名规范
  • 命名风格是否与项目现有代码一致

格式规范

  • 缩进是否统一
  • 代码风格是否与项目一致

注释规范

  • 公共方法是否有注释
  • 复杂逻辑是否有注释
  • 注释是否与代码一致(避免误导)

审查强度等级

等级适用场景要求
严格生产代码、核心模块全部 6 项审查,❌ 项必须修改
标准常规业务代码全部 6 项审查,❌ 项必须修改,⚠️ 项建议修改
宽松原型验证、临时脚本正确性 + 安全性审查,❌ 项必须修改

常见 AI 生成代码问题清单

以下问题在 AI 生成代码中高频出现,必须重点检查:

  1. 幻觉 API:调用了不存在的库方法或函数
  2. 逻辑遗漏:边界条件或异常分支未处理
  3. 过度工程:简单问题复杂化

完整清单见 code-generation 技能。

Frequently asked questions

What does the Code Review AI skill do?

代码审查专家助手。在代码编写完成后自动进行多维度审查,涵盖正确性、安全性、性能、可维护性、规范一致性,减少AI生成代码的错误率和潜在缺陷。

Why use Code Review on TypingMind?

Because you install it once and use it with any model. Code 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 Code Review in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dkbnull/hello-skill/tree/main/common/skills/code-review. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Code 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 Code Review?

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

Is the Code Review AI skill free?

Yes. It is published on GitHub by dkbnull 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 👇