code-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCode Review Skill
Code Review Skill
Skill for code quality analysis and review
用于代码质量分析与审查的Skill
Arguments
参数
| Argument | Description | Example |
|---|---|---|
| Review specific file | |
| Review entire directory | |
| PR review (PR number) | |
| 参数 | 描述 | 示例 |
|---|---|---|
| 审查指定文件 | |
| 审查整个目录 | |
| PR审查(PR编号) | |
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
审查输出格式
undefinedundefinedCode 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
- [FILE:LINE] Issue description Suggestion: ...
- [FILE:LINE] Issue description Suggestion: ...
Major Issues
Major Issues
...
...
Minor Issues
Minor Issues
...
...
Recommendations
Recommendations
- ...
undefined- ...
undefinedAgent Integration
Agent集成
This Skill calls the Agent for in-depth code analysis.
code-analyzer| Agent | Role |
|---|---|
| code-analyzer | Code quality, security, performance analysis |
本Skill会调用 Agent进行深度代码分析。
code-analyzer| Agent | 角色 |
|---|---|
| code-analyzer | 代码质量、安全性、性能分析 |
Usage Examples
使用示例
bash
undefinedbash
undefinedReview 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
undefinedConfidence-Based Filtering
基于置信度的过滤
code-analyzer Agent uses confidence-based filtering:
| Confidence | Display | Description |
|---|---|---|
| High (90%+) | Always shown | Definite issues |
| Medium (70-89%) | Selectively shown | Possible issues |
| Low (<70%) | Hidden | Uncertain 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