code-review-standards

提供标准化的代码审查框架,涵盖架构一致性验证、设计原则合规性检查、测试驱动开发落实评估、安全与性能隐患识别等核心维度,并定义分级严重性标准及结构化问题记录方式,支撑高质量、可追溯的协作式代码质量保障流程。

快捷安装

在终端运行此命令,即可一键安装该 Skill 到您的 Claude 中

npx skills add groupzer0/vs-code-agents --skill "code-review-standards"

Code Review Standards

Systematic approach to code review. Use this skill when:

  • Performing code reviews
  • Defining review criteria for a project
  • Understanding severity levels for findings
  • Creating code review documents

Review Focus Areas

Use this checklist when reviewing implementation code:

CategoryWhat to Review
Architecture AlignmentDoes implementation match Architect’s design? Follows system-architecture.md patterns?
SOLID PrinciplesSRP, OCP, LSP, ISP, DIP violations (load engineering-standards for detection patterns)
DRY/YAGNI/KISSDuplication, speculative generalization, over-complexity
TDD ComplianceTDD Compliance table present in implementation doc? All rows show test-first?
Code SmellsLong Method, Large Class, Feature Envy, etc. (see engineering-standards)
Documentation & CommentsAppropriate inline comments explaining “why” (not “what”), function docstrings, module-level docs, complex logic explained
Naming & ClaritySelf-documenting names, appropriate abstractions, readable code
Error HandlingDefensive coding, graceful failures, appropriate exceptions
Security Quick ScanObvious vulnerabilities (injection, exposed secrets, hardcoded creds)
PerformanceObvious inefficiencies, N+1 patterns, memory leaks
ObservabilityAppropriate logging, telemetry for debugging

Severity Levels

SeverityDefinitionAction
CRITICALSecurity vulnerability, data loss risk, architectural violationREJECT - must fix
HIGHAnti-pattern, significant maintainability issue, missing testsREJECT - must fix
MEDIUMCode smell, minor design issue, unclear codeFix recommended, may approve with comments
LOWStyle preference, minor optimization opportunityNote for future, approve
INFOObservation, suggestion for improvementFYI only

When to Reject

  • Any CRITICAL finding → REJECT
  • Any HIGH finding → REJECT
  • 3+ MEDIUM findings in same file → Consider REJECT
  • Pattern of MEDIUM findings across files → Consider REJECT

Finding Format

When documenting findings, use this format:

**[SEVERITY] [Category]**: [Brief title]
- **Location**: `path/to/file.py:L42-L55`
- **Issue**: [What's wrong and why it matters]
- **Recommendation**: [Specific fix suggestion]

Example:

**[HIGH] Documentation**: Missing docstrings on public API
- **Location**: `src/api/handlers.py:L15-L45`
- **Issue**: Public functions `create_user()` and `delete_user()` lack docstrings. Future maintainers won't understand expected inputs/outputs.
- **Recommendation**: Add Google-style docstrings with Args, Returns, and Raises sections.

Code Review Document Template

Create in agent-output/code-review/ matching plan name:

# Code Review: [Plan Name]

**Plan Reference**: `agent-output/planning/[plan-name].md`
**Implementation Reference**: `agent-output/implementation/[plan-name]-implementation.md`
**Date**: [date]
**Reviewer**: Code Reviewer

## Changelog

| Date | Agent Handoff | Request | Summary |
|------|---------------|---------|---------|
| YYYY-MM-DD | [Who handed off] | [What was requested] | [Brief summary] |

## Architecture Alignment

**System Architecture Reference**: `agent-output/architecture/system-architecture.md`
**Alignment Status**: ALIGNED / MINOR_DEVIATIONS / MAJOR_DEVIATIONS

[Assessment of how implementation aligns with architectural decisions]

## TDD Compliance Check

**TDD Table Present**: Yes / No
**All Rows Complete**: Yes / No
**Concerns**: [Any issues with TDD compliance]

## Findings

### Critical
[List of critical findings, or "None"]

### High
[List of high findings, or "None"]

### Medium
[List of medium findings, or "None"]

### Low/Info
[List of low/info findings, or "None"]

## Positive Observations

[Acknowledge good patterns, well-written code, or improvements]

## Verdict

**Status**: APPROVED / APPROVED_WITH_COMMENTS / REJECTED
**Rationale**: [Brief explanation]

## Required Actions

[If rejected: specific list of fixes required]
[If approved with comments: optional improvements]

## Next Steps

[Handoff to Implementer for fixes / Handoff to QA for testing]

Review Best Practices

  1. Be constructive: Explain WHY something is an issue, not just THAT it’s an issue
  2. Be specific: File paths, line numbers, code snippets
  3. Provide solutions: Concrete fix suggestions, not just criticism
  4. Acknowledge good work: Note positive patterns when you see them
  5. Prioritize: Focus on impactful issues, not nitpicks
  6. Context matters: Consider the plan’s constraints and timeline