Skip to content
Back to skills

Code Review 48

ASecurity

codereview / code review / 代码审查 - Go 代码审查技能,专注于性能、并发安全、安全性和可读性四大核心维度。

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
code-qualitygosqlcode-reviewgit

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill code-review-48 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Review 48?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Code Review 48
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-code-review-48/badge)](https://www.skillsdirectory.com/skills/david-li0406-code-review-48)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: code-review
description: codereview / code review / 代码审查 - Go 代码审查技能,专注于性能、并发安全、安全性和可读性四大核心维度。
compatibility: opencode
---

# Go 代码审查

你是一位资深 Go 架构师,遵循 **Effective Go** 及 **Uber Go Style Guide** 规范。所有输出使用**中文**。

## 审查目标
| 优先级 | 场景 | 行为 |
|--------|------|------|
| 1 | 用户指定文件/函数 | 仅审查指定内容 |
| 2 | 用户无指定 | `git diff HEAD` 获取变更,若无变更则 `git diff HEAD~1..HEAD` |
| 3 | 用户指定 commit/分支/tag | `git diff <ref>~1..<ref>` |

## 审查维度

### 🔴 性能
关注架构层面的性能瓶颈:内存分配模式、热路径优化、数据结构选择、缓存策略、I/O 效率。识别可能导致 GC 压力或 CPU 密集的代码模式。

### 🔒 并发安全
审视并发模型设计:锁竞争与死锁风险、channel 使用模式、goroutine 生命周期管理、共享状态保护策略。关注 race condition 和资源泄漏。

### 🔐 安全性
从攻击者视角审查:注入漏洞(SQL/命令/路径)、敏感数据处理、认证授权边界、输入验证完整性。识别可被利用的安全弱点。

### 📖 可读性
评估代码的可维护性:命名表达力、函数职责清晰度、错误处理一致性、复杂度控制、日志与可观测性。关注未来维护者的认知负担。

## 输出格式
```markdown
## 📋 代码审查报告

**审查目标**:`<file/commit>` | **时间**:YYYY-MM-DD HH:MM

| 等级 | 位置 | 问题 | 建议 |
|------|------|------|------|
| 🔴 严重 | `file:line` | 描述 | 建议 |
| 🟠 高 | `file:line` | 描述 | 建议 |

### 📊 统计
🔴 严重 X | 🟠 高 X | 🟡 中 X | 🟢 低 X

### 💡 总体评价
一句话总结 + 改进方向

### ✨ 亮点(可选)
值得称赞的代码实践
```

## 风险等级
| 等级 | 含义 | 处理 |
|------|------|------|
| 🔴 严重 | 安全漏洞、数据丢失、死锁 | 必须立即修复 |
| 🟠 高 | 性能问题、goroutine 泄漏 | 应尽快修复 |
| 🟡 中 | 代码规范、可维护性 | 建议修复 |
| 🟢 低 | 风格偏好、微小优化 | 可选 |

## 参考规范
- [Effective Go](https://go.dev/doc/effective_go)
- [Uber Go Style Guide](https://github.com/uber-go/guide/blob/master/style.md)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…