Skill
Agent Orchestration
Skill
/code-review
审查代码中的错误、风格问题和最佳实践
Install
$ npx -y skills add HOPPINZQ/hoppinai-agent --skill code-review --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/code-review
Context preview
The summary Claude sees to decide when to auto-load this skill.
审查代码中的错误、风格问题和最佳实践
SKILL.md
code-review.SKILL.mdname: code-review description: 审查代码中的错误、风格问题和最佳实践 tags: review,quality
代码审查技能
目标
审查代码变更中的潜在错误、风格违规和最佳实践违规。
审查检查清单
1. 功能性
- 代码是否实现了所需功能?
- 是否存在明显的错误或逻辑错误?
- 边界情况是否得到妥善处理?
2. 代码质量
- 代码是否可读且结构良好?
- 变量和函数名称是否具有描述性?
- 是否存在不必要的复杂性?
3. 最佳实践
- 代码是否遵循特定语言的最佳实践?
- 设计模式的使用是否恰当?
- 代码是否符合DRY原则(不要重复自己)?
4. 安全性
- 是否存在任何安全漏洞?
- 用户输入是否得到适当验证?
- 敏感数据是否得到妥善处理?
5. 性能
- 是否存在明显的性能问题?
- 算法和数据结构是否合适?
- 是否存在不必要的计算?
审查流程
1. **阅读差异**:理解变更内容和原因 2. **检查功能**:验证实现是否按预期工作 3. **检查风格**:确保格式和命名一致 4. **检查测试**:验证测试覆盖率和测试质量 5. **提供反馈**:提供建设性、具体的反馈
输出格式
审查代码时,请按以下结构组织反馈:
## 总结 [审查的简要总结] ## 发现的问题 ### 严重 - [列出必须修复的严重问题] ### 重要 - [列出应该修复的重要问题] ### 轻微 - [列出轻微问题和风格建议] ## 优点 - [突出好的实践和实现良好的部分] ## 建议 - [具体的改进建议]
示例
// 修改前
public void process(List<String> items) {
for (int i = 0; i < items.size(); i++) {
String item = items.get(i);
System.out.println(item);
}
}
// 修改后 - 使用增强型for循环
public void process(List<String> items) {
for (String item : items) {
System.out.println(item);
}
}提示
- 建设性:专注于改进代码,而不是批评作者
- 具体:指出确切的行并解释为什么存在问题
- 友善:记住代码审查是每个人的学习机会
- 优先级:首先关注严重和重要问题
Ships withhoppinai-agent
使用[ OR explicitly…
Skill
lover-mode
ONLY enabled when the user's input explicitly CONTAINS "亲爱的" (dear/darling) or "老公" (husband) or "老婆" (wife) or equivalent terms…

