AgentSkillsCN

code-review

进行结构化的代码审查,重点关注缺陷、安全、性能和最佳实践。在审查代码、拉取请求、差异或用户请求实施反馈时使用。

SKILL.md
--- frontmatter
name: code-review
description: Performs structured code reviews focusing on bugs, security, performance, and best practices. Use when reviewing code, pull requests, diffs, or when the user asks for feedback on implementations.

Code Review

Quick Start

When reviewing code, follow this structured approach:

code
Review Checklist:
- [ ] Correctness: Does it work as intended?
- [ ] Security: Any vulnerabilities or data exposure?
- [ ] Performance: Obvious inefficiencies?
- [ ] Readability: Clear naming, structure, comments?
- [ ] Edge cases: Null, empty, boundary conditions?

Review Process

Step 1: Understand Context

  • What problem does this code solve?
  • What are the requirements/constraints?

Step 2: Scan for Critical Issues

  • Security vulnerabilities (injection, auth, data exposure)
  • Logic errors and bugs
  • Resource leaks or performance bombs

Step 3: Evaluate Quality

  • Code organization and structure
  • Naming conventions
  • Error handling patterns
  • Test coverage (if applicable)

Step 4: Provide Feedback

  • Lead with positives
  • Categorize issues: Critical / Important / Suggestion
  • Include specific line references
  • Offer concrete alternatives

Output Format

Structure feedback as:

markdown
## Summary
[1-2 sentence overview]

## Critical Issues
[Must fix before merge]

## Recommendations  
[Should address]

## Suggestions
[Nice to have improvements]

## What's Working Well
[Positive observations]

Language-Specific Guidance

For detailed patterns by language, see:

Review Scope Guidelines

Review TypeFocus AreasDepth
Quick reviewBugs, securitySurface
Standard review+ Performance, readabilityThorough
Deep review+ Architecture, patternsComprehensive

Default to standard review unless specified otherwise.