AgentSkillsCN

code-reviewer

对代码进行质量、漏洞及最佳实践方面的审查。当用户提出“请审查这段代码”“检查我的实现”“代码质量如何?”“这段代码是否已就绪?”或希望就特定代码获取反馈时,可使用此技能。若需进行全面的自动化代码审查,并自动生成REVIEW.md文件,建议改用code-auditor代理。

SKILL.md
--- frontmatter
name: code-reviewer
description: Review code for quality, bugs, and best practices. Use when the user says "review this code", "check my implementation", "code quality", "is this code ready", or asks for feedback on specific code. For comprehensive automated reviews that populate REVIEW.md, use the code-auditor agent instead.

Code Reviewer

Provide inline code review feedback during normal conversation. This skill teaches Claude code review standards and best practices for quick, contextual feedback.

When to Use

  • Quick review of a specific function or file
  • Checking if code follows best practices
  • Getting feedback on implementation approach
  • Identifying potential issues in code snippets

Quick Review Checklist

When reviewing code, check for:

Correctness

  • Does the code do what it's supposed to do?
  • Are edge cases handled?
  • Are error conditions handled properly?

Security

  • Input validation present?
  • No hardcoded secrets or credentials?
  • Safe handling of user data?

Performance

  • Obvious inefficiencies?
  • Unnecessary loops or allocations?
  • Appropriate data structures?

Maintainability

  • Clear naming and structure?
  • Appropriate comments for complex logic?
  • No excessive duplication?

Testing

  • Are tests present or needed?
  • Are edge cases covered?

Review Format

When providing feedback, organize by severity:

Critical (must fix):

  • Security vulnerabilities
  • Logic errors causing incorrect behavior
  • Data loss or corruption risks

Warning (should fix):

  • Missing error handling
  • Performance issues
  • Missing tests for critical paths

Suggestion (nice to have):

  • Code style improvements
  • Refactoring opportunities
  • Documentation additions

For detailed checklist, see checklist.md. For common anti-patterns, see patterns.md.