code-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Code Review Skill

Code Review Skill

Skill for code quality analysis and review
用于代码质量分析与审查的Skill

Arguments

参数

ArgumentDescriptionExample
[file]
Review specific file
/code-review src/lib/auth.ts
[directory]
Review entire directory
/code-review src/features/
[pr]
PR review (PR number)
/code-review pr 123
参数描述示例
[file]
审查指定文件
/code-review src/lib/auth.ts
[directory]
审查整个目录
/code-review src/features/
[pr]
PR审查(PR编号)
/code-review pr 123

Review Categories

审查分类

1. Code Quality

1. 代码质量

  • Duplicate code detection
  • Function/file complexity analysis
  • Naming convention check
  • Type safety verification
  • 重复代码检测
  • 函数/文件复杂度分析
  • 命名规范检查
  • 类型安全性验证

2. Bug Detection

2. Bug检测

  • Potential bug pattern detection
  • Null/undefined handling check
  • Error handling inspection
  • Boundary condition verification
  • 潜在Bug模式检测
  • Null/undefined处理检查
  • 错误处理检查
  • 边界条件验证

3. Security

3. 安全性

  • XSS/CSRF vulnerability check
  • SQL Injection pattern detection
  • Sensitive information exposure check
  • Authentication/authorization logic review
  • XSS/CSRF漏洞检查
  • SQL注入模式检测
  • 敏感信息泄露检查
  • 认证/授权逻辑审查

4. Performance

4. 性能

  • N+1 query pattern detection
  • Unnecessary re-render check
  • Memory leak pattern detection
  • Optimization opportunity identification
  • N+1查询模式检测
  • 不必要的重渲染检查
  • 内存泄漏模式检测
  • 优化机会识别

Review Output Format

审查输出格式

undefined
undefined

Code Review Report

Code Review Report

Summary

Summary

  • Files reviewed: N
  • Issues found: N (Critical: N, Major: N, Minor: N)
  • Score: N/100
  • Files reviewed: N
  • Issues found: N (Critical: N, Major: N, Minor: N)
  • Score: N/100

Critical Issues

Critical Issues

  1. [FILE:LINE] Issue description Suggestion: ...
  1. [FILE:LINE] Issue description Suggestion: ...

Major Issues

Major Issues

...
...

Minor Issues

Minor Issues

...
...

Recommendations

Recommendations

  • ...
undefined
  • ...
undefined

Agent Integration

Agent集成

This Skill calls the
code-analyzer
Agent for in-depth code analysis.
AgentRole
code-analyzerCode quality, security, performance analysis
本Skill会调用
code-analyzer
Agent进行深度代码分析。
Agent角色
code-analyzer代码质量、安全性、性能分析

Usage Examples

使用示例

bash
undefined
bash
undefined

Review specific file

Review specific file

/code-review src/lib/auth.ts
/code-review src/lib/auth.ts

Review entire directory

Review entire directory

/code-review src/features/user/
/code-review src/features/user/

PR review

PR review

/code-review pr 42
/code-review pr 42

Review current changes

Review current changes

/code-review staged
undefined
/code-review staged
undefined

Confidence-Based Filtering

基于置信度的过滤

code-analyzer Agent uses confidence-based filtering:
ConfidenceDisplayDescription
High (90%+)Always shownDefinite issues
Medium (70-89%)Selectively shownPossible issues
Low (<70%)HiddenUncertain suggestions
code-analyzer Agent采用基于置信度的过滤机制:
置信度显示规则描述
高(90%+)始终显示明确的问题
中(70-89%)选择性显示潜在的问题
低(<70%)隐藏不确定的建议

PDCA Integration

PDCA集成

  • Phase: Check (Quality verification)
  • Trigger: Auto-suggested after implementation
  • Output: docs/03-analysis/code-review-{date}.md
  • 阶段: 检查(质量验证)
  • 触发条件: 实施后自动推荐使用
  • 输出: docs/03-analysis/code-review-{date}.md