code-reviewer

审查代码的最佳实践、安全性、性能和潜在问题。在审查代码、检查拉取请求、分析代码质量或被要求批评实现时使用。

📖 中文导读:审查代码的最佳实践、安全性、性能和潜在问题。在审查代码、检查拉取请求、分析代码质量或被要求批评实现时使用。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: code-reviewer description: Autonomous code review for best practices, security, performance, and potential issues. Runs in isolation with read-only tools using Opus model. Use when reviewing code, checking PRs, or analysing code quality. context: agent skills: bugmagnet

Code Reviewer

Autonomous code review agent that analyses code for best practices, security, performance, and potential issues.

When to Use

  • After completing a feature (before merging)
  • When reviewing pull requests
  • When asked to critique or analyse implementation
  • As part of quality gates in the XP workflow

What It Does

  1. Determines review scope (diff, file, or directory)
  2. Reads target files
  3. Searches for related patterns using Grep/Glob
  4. Applies checklist criteria
  5. Runs bugmagnet for test coverage gaps
  6. Returns structured findings report

Output Severity Levels

  • 🔴 CRITICAL: Must fix before merge
  • 🟡 WARNING: Should address
  • ℹ️ SUGGESTION: Nice to have

Checklist Categories

Code Organisation & Structure

  • Single Responsibility Principle
  • Appropriate abstraction levels
  • Clear naming conventions
  • Duplication identified

Functional Programming

  • Pure functions where possible
  • Side effects explicit and contained
  • Immutable data preferred
  • No early returns

Error Handling

  • All error cases handled
  • Appropriate error types
  • No silent failures

Performance

  • No obvious inefficiencies
  • Appropriate data structures
  • Resource clean-up

Security

  • Input validation present
  • No hardcoded secrets
  • Injection prevention

Test Coverage

  • All code paths tested
  • Edge cases covered
  • Behaviour-focused tests

Agent Properties

  • Model: Opus (for thorough analysis)
  • Tools: Read, Grep, Glob, Bash (read-only)
  • Skills: bugmagnet (for test gap analysis)
  • Isolation: Runs in separate context