ai-powered-code-review

ai-powered-code-review is a cursor rule for coding agents from Mr-chen-05/rules-2.1-optimized. It costs 0 tokens per session (3,020 once invoked), scanned A, original, MIT.

A set of Chinese rules for reviewing code with automated analysis and human checks. It covers formatting, logic, structure, architecture, business behaviour, security, performance, and review triggers such as commits and pull requests.

In plain words
What is it for?
Use it when reviewing commits or pull requests, checking code quality, looking for duplicated or complex code, assessing architecture, or examining security and performance risks.
Why use it?
It provides a review process for finding defects and risks at different levels instead of checking only whether code looks correctly formatted.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/mr-chen-05/rules-2.1-optimized/ai-powered-code-review
Clone the repo
git clone --depth 1 https://github.com/Mr-chen-05/rules-2.1-optimized

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-powered-code-review

README.md
[![agentmods](https://agentmods.dev/badge/rules/mr-chen-05/rules-2.1-optimized/ai-powered-code-review.svg)](https://agentmods.dev/rules/mr-chen-05/rules-2.1-optimized/ai-powered-code-review)
Your own site
<a href="https://agentmods.dev/rules/mr-chen-05/rules-2.1-optimized/ai-powered-code-review"><img src="https://agentmods.dev/badge/rules/mr-chen-05/rules-2.1-optimized/ai-powered-code-review.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 3,020 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.03020
Opus 5 $0.00000 $0.01510
Sonnet 5 $0.00000 $0.00604
Haiku 4.5 $0.00000 $0.00302

Measured 4d ago against content hash 9c24c703d89b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ai-powered-code-review scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

project-rules/ai-powered-code-review.mdc · 451 lines

How it starts

The opening of the file, as written. The whole thing — 451 lines — stays where its author put it; the contents beside it link to each section on GitHub.

🔍 AI驱动的智能代码审查规则

🎯 核心理念

基于最新AI代码审查技术,实现智能化、自动化的代码质量控制和审查流程。

🤖 智能审查引擎

核心能力:
  静态分析增强:
    - 语义理解和上下文分析
    - 设计模式识别和评估
    - 架构一致性检查
    - 性能影响预测
  
  动态行为分析:
    - 运行时行为预测
    - 资源使用模式分析
    - 并发安全性检查
    - 异常处理完整性
  
  学习和适应:
    - 团队编码风格学习
    - 历史缺陷模式识别
    - 最佳实践自动应用
    - 个性化建议生成

🚀 智能审查流程

📋 自动触发机制

触发条件:
  代码提交触发:
    - 每次commit自动触发
    - 差异分析和影响评估
    - 风险等级自动分类
    - 审查优先级排序
  
  Pull Request触发:
    - PR创建时全面审查
    - 变更影响范围分析
    - 冲突风险预测
    - 合并建议生成
  
  定期审查:
    - 技术债务定期扫描
    - 代码质量趋势分析
    - 安全漏洞定期检查
    - 性能回归检测

🎯 多层次审查策略

审查层次:
  L1 - 语法和格式:
    自动化程度: 100%
    检查内容:
      - 代码格式规范
      - 命名约定检查
      - 注释完整性
      - 文档同步性
    处理方式: 自动修复 + 通知
  
  L2 - 逻辑和结构:
    自动化程度: 80%
    检查内容:
      - 逻辑错误检测
      - 代码复杂度分析
      - 重复代码识别
      - 依赖关系检查
    处理方式: 智能建议 + 人工确认
  
  L3 - 架构和设计:
    自动化程度: 60%
    检查内容:
      - 设计模式应用
      - 架构一致性
      - 接口设计合理性
      - 扩展性评估
    处理方式: 专家建议 + 团队讨论
  
  L4 - 业务和安全:
    自动化程度: 40%
    检查内容:
      - 业务逻辑正确性
      - 安全漏洞检测
      - 性能影响评估
      - 合规性检查
    处理方式: 专家审查 + 安全团队确认

🔍 智能分析维度

📊 代码质量分析

质量维度:
  可读性分析:
    - 代码清晰度评分
    - 注释质量评估
    - 变量命名合理性
    - 函数复杂度分析
    评分权重: 25%
  
  可维护性分析:
    - 模块耦合度检查
    - 代码重复率分析
    - 修改影响范围评估
    - 测试覆盖率检查
    评分权重: 30%
  
  可靠性分析:
    - 异常处理完整性
    - 边界条件检查
    - 并发安全性验证
    - 资源管理检查
    评分权重: 25%
  
  性能分析:
    - 算法复杂度评估
    - 资源使用效率
    - 缓存策略检查
    - 数据库查询优化
    评分权重: 20%

🛡️ 安全性分析

安全检查:
  输入验证:
    - SQL注入风险检测
    - XSS攻击防护检查
    - 输入参数验证
    - 数据类型安全检查
  
  权限控制:
    - 访问控制检查
    - 权限提升风险
    - 敏感操作审计
    - 认证机制验证
  
  数据保护:
    - 敏感数据识别
    - 加密算法检查
    - 数据传输安全
    - 存储安全验证
  
  依赖安全:
    - 第三方库漏洞扫描
    - 依赖版本安全检查
    - 许可证合规性
    - 供应链安全评估

⚡ 性能分析

性能维度:
  算法效率:
    - 时间复杂度分析
    - 空间复杂度评估
    - 算法选择合理性
    - 数据结构优化建议
  
  资源使用:
    - 内存使用模式
    - CPU使用效率
    - I/O操作优化
    - 网络请求优化
  
  并发性能:
    - 线程安全检查
    - 锁竞争分析
    - 异步处理优化
    - 并发度评估
  
  缓存策略:
    - 缓存使用合理性
    - 缓存失效策略
    - 缓存穿透防护
    - 缓存一致性检查

Read the full file on GitHub · 451 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 451 lines · 0 tokens per session scan A 9c24c703d89b

Subscribe to this mod's changes

ai-powered-code-review is a cursor rule published in the GitHub repository Mr-chen-05/rules-2.1-optimized (172 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,020 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.