AINow
📢 赞助位招租 · 月访问 XXXX · 联系 weixin_xxx
了解详情
返回 Skill 列表
编程开发进阶

代码审查 Skill

自动审查代码变更,检查安全性、性能、可维护性。

📋 SKILL.md 完整代码

---
name: code-review-skill
description: >-
  自动审查代码变更,检查安全性、性能、可维护性。
  Use when working on code review skill tasks.
allowed-tools: Read,Write,Bash
---

# 代码审查 Skill

## Quick Start
1. Save as `~/.claude/skills/code-review-skill/SKILL.md`
2. Restart Claude Code
3. Type `/code-review-skill` or describe your task naturally
4. Claude auto-triggers when your task matches the description

## Instructions
- Understand the user's specific context and needs
- Apply domain best practices consistently
- Provide actionable, specific guidance with examples
- Verify all outputs before presenting to user

## Gotchas
- Test with a fresh Claude instance after changes
- Keep SKILL.md under 500 lines; use references/ for details
- Description is the trigger key — make it specific and keyword-rich

🚀 怎么用

1. 复制上面的 SKILL.md 代码
2. 保存为 ~/.claude/skills/code-review-skill/SKILL.md
3. 重启 Claude Code
4. 输入 /code-review-skill 或直接描述任务触发
5. AI 自动按 Skill 流程执行

审查维度

安全性(SQL注入/XSS/敏感信息泄露)→性能(N+1查询/内存泄漏/不必要的重渲染)→可维护性(命名规范/函数长度/重复代码)→最佳实践(错误处理/测试覆盖/边界情况)。按严重程度排序,每个问题标注具体行号和修改建议。