Code Review Playbooks

Objective

Ensure every code change is reviewed for correctness, design quality, maintainability and consistency before being merged.

Code review is the primary mechanism for maintaining engineering quality and spreading knowledge across the team.

Inputs

Prerequisites

Before requesting a review, the author should verify:

Workflow

Step 1: Prepare the Review

The reviewer begins by understanding the context of the change.

Step 2: Review the Design

Before examining implementation details, evaluate the design.

QuestionWhy It Matters
Does the approach solve the right problem?Avoids wasted effort on wrong solution
Is the design consistent with the system architecture?Prevents architectural drift
Does the change follow separation of concerns?Ensures maintainability
Are the interfaces clear and well-defined?Supports future change
Are there simpler alternatives?Defends against over-engineering
Does the change introduce unnecessary dependencies?Controls coupling

If design issues are found, address them before proceeding to the implementation review. Design issues are the most expensive to fix later.

Step 3: Review the Implementation

Examine the implementation for correctness and quality.

Correctness

Maintainability

Testing

Step 4: Provide Feedback

Write clear, constructive review comments.

Good Feedback

Good:

This method handles both validation and persistence. Consider splitting it into two methods to follow single responsibility. The validation logic could go into a separate validator class that this method calls.

Avoid:

This is wrong. Fix it.

Prioritization

Use labels to indicate severity:

LabelMeaning
BLOCKERMust be fixed before merge. Design flaw, correctness
issue, security vulnerability.
SHOULD FIXImportant but not blocking. Could be addressed in a
follow-up.
NICE TO HAVESuggestion for improvement. Can be deferred.
QUESTIONClarification needed. Not necessarily a change request.

Step 5: Author Responds

The author should:

Step 6: Approval and Merge

The change is ready to merge when:

Checklist

The reviewer should verify:

Escalation Points

SituationAction
Reviewer and author disagree on approachEscalate to a senior engineer or
tech lead for third-party review.
Change is large and difficult to reviewRequest the author split into
smaller, incremental changes.
Security concern identifiedInvolve security engineer in review.
Performance concern identifiedRequest performance review or
benchmark results.

AI Workflow

AI assistants can participate in code review by:

Automated Analysis

Review Assistance

Limitations

When using AI for code review, provide:

Expected Outputs

Related Documents