AgentSkillsCN

review

从质量、安全性与可维护性角度对代码进行审查。针对近期的 Git 变更进行代码评审。

SKILL.md
--- frontmatter
name: review
description: Code review for quality, security, and maintainability. Reviews recent git changes.
disable-model-invocation: true
allowed-tools:
  - Read
  - Grep
  - Glob
  - Bash

Code Review

Review recent changes for quality, security, and maintainability.

Review Process

  1. Run git diff to see recent changes
  2. Focus on modified files
  3. Analyze changes against review checklist

Review Checklist

Code Quality

  • Code is clear and readable
  • Functions/methods are well-named (verb-first)
  • No duplicated code
  • Single responsibility principle followed
  • Methods under 20 lines

Error Handling

  • All errors properly handled
  • No silent failures
  • Error messages are actionable
  • Appropriate exception types used

Security

  • No hardcoded credentials/secrets
  • Input validation on all user inputs
  • No SQL injection vulnerabilities
  • No XSS vulnerabilities
  • Sensitive data not logged

Testing

  • Test coverage for new code
  • Edge cases tested
  • Tests follow naming convention

Performance

  • No N+1 query issues
  • Appropriate algorithm complexity
  • Proper use of caching where needed

Output Format

Organize feedback by priority:

🔴 Critical (Must Fix)

Issues that will cause bugs, security vulnerabilities, or data loss.

🟡 Warnings (Should Fix)

Issues that affect maintainability or could cause problems.

🟢 Suggestions (Consider)

Improvements for readability or best practices.

For each issue, provide:

  • File and line number
  • Current code snippet
  • Problem description
  • Suggested fix

Summary

Brief overview of changes reviewed.

🔴 Critical Issues

File:LineIssueFix
.........

🟡 Warnings

File:LineIssueSuggestion
.........

🟢 Suggestions

  • Suggestion 1
  • Suggestion 2

✅ What's Good

  • Positive observation 1
  • Positive observation 2