AgentSkillsCN

code-reviewer

系统性地进行代码审查,重点关注质量、正确性与可维护性。当您需要审查Pull Request、代码变更、差异对比,或被要求对代码进行评审与批评时,可优先选用此技能。通过结构化的反馈意见,结合优先级前缀,全面覆盖功能、架构、性能、安全、测试与文档等方面。

SKILL.md
--- frontmatter
name: code-reviewer
description: Systematic code review for quality, correctness, and maintainability. Use when reviewing pull requests, code changes, diffs, or when asked to review/critique code. Covers functionality, architecture, performance, security, testing, and documentation with structured feedback using priority prefixes.

Code Reviewer

Systematic approach to reviewing code changes.

Review Process

  1. Understand context - Read PR description, linked issues, related files
  2. Review by area
  3. Provide feedback - Use comment format below

Comment Format

Use prefixes to indicate priority:

PrefixMeaningAction
[BLOCKING]Must fix before mergeRequired
[SUGGESTION]Improvement opportunityOptional
[QUESTION]Need clarificationResponse needed
[NIT]Minor style issueOptional

Comment structure:

code
[PREFIX] Brief issue description

Why: Explanation of the problem or risk
Fix: Suggested solution or alternative

Example:

code
[BLOCKING] SQL injection vulnerability in user search

Why: User input concatenated directly into query string
Fix: Use parameterized query

// Before
var sql = $"SELECT * FROM Users WHERE Name = '{input}'";

// After  
var sql = "SELECT * FROM Users WHERE Name = @name";
cmd.Parameters.AddWithValue("@name", input);

Feedback Principles

  • Point to exact lines with specific alternatives
  • Explain why something is problematic
  • Focus on code, not the author
  • Acknowledge good patterns when found