> 代码审查能力 - 调用 CodeReviewer 专家进行安全、性能、风格全面审查
调用CodeReviewer专家进行代码安全/性能/风格全面审查,输出问题列表和改进建议。
# 全面审查
/code-review /path/to/code --scope all
# 安全审查
/code-review /path/to/code --scope security --rules strict
# 性能审查
/code-review /path/to/code --scope performance
| 模式 | 能力 |
|---|---|
| ------ | ------ |
| 有EO插件 | 141专家库(CodeReviewer专家)、真实漏洞检测、重构建议 |
| 无插件(基础) | LLM代码审查、通用规范检查 |
🔍 代码审查报告
## 评分
| 维度 | 评分 | 等级 |
|------|------|------|
| 安全 | 85/100 | B+ |
| 性能 | 78/100 | B |
| 风格 | 92/100 | A- |
| **总体** | **85/100** | **B+** |
## 问题列表
### 🔴 高优先级 (3)
1. [安全] SQL 注入风险 - user input directly in query
2. [安全] XSS 漏洞 - 未转义用户输入
3. [性能] N+1 查询问题 - loop 内查询数据库
### 🟡 中优先级 (5)
1. [风格] 变量命名不规范
2. [性能] 缺少索引
## 建议
- 使用参数化查询防止 SQL 注入
- 添加输入验证和转义
- 使用 ORM 的 eager loading
interface CodeReviewInput {
codePath: string // 代码路径
scope?: 'security' | 'performance' | 'style' | 'all'
rules?: 'strict' | 'normal' | 'loose'
language?: string // 编程语言
}
interface CodeReviewOutput {
scores: {
security: number // 0-100
performance: number // 0-100
style: number // 0-100
overall: number // 0-100
}
issues: CodeIssue[]
suggestions: string[]
summary: string
}
🦞⚙️ 钢铁龙虾军团
共 1 个版本