Code Review Standards
Ensure all code changes are reviewed before merging. Reviews catch defects, share knowledge, and maintain codebase quality. Optimise for small, focused pull requests with timely, constructive feedback.
Principles
- All changes reviewed before merge — no code reaches a protected branch without at least one approval from a reviewer who was not the author
- Small PRs get better reviews — large diffs lead to superficial reviews. Keep pull requests focused and digestible.
- Review for correctness, test coverage, and maintainability — style issues are handled by linters; security is handled separately by
do-cybersecurity-review as a pre-push gate
- Automated checks supplement, not replace, human review — linting, type checking, and AI review catch mechanical issues; humans assess design, intent, and edge cases
Mandatory Review Requirements
- At least one approval before merging to any protected branch (e.g.,
main)
- No self-approvals — the author cannot approve their own pull request
- Stale approvals dismissed on new pushes — if the author pushes new commits after approval, the approval is invalidated and a re-review is required
- All CI checks passing — do not merge with failing lints, tests, or type checks
Review Scope
Every review should evaluate the change against these dimensions:
| Dimension |
What to check |
| Correctness |
Does the code do what it claims? Are edge cases handled? Are assumptions documented? |
| Maintainability |
Is the code readable? Are names clear? Is complexity justified? Will the next developer understand it? |
| Test coverage |
Are new code paths tested? Are edge cases covered? Do tests actually assert meaningful outcomes? |
| Documentation |
Are public APIs documented? Are non-obvious decisions explained? Is the PR description clear? |
Security is out of scope for the PR review process. It runs as a separate pre-push gate via do-cybersecurity-review (in update mode against the diff and impact set) before the PR is opened. By the time a reviewer sees a PR, security findings have already been surfaced and folded into the PR body.
Reviewer Responsibilities
- Understand the change — read the PR description, linked issue, and relevant context before reviewing code
- Check edge cases — think about what happens with empty inputs, nulls, concurrent access, large data sets, and failure modes
- Be timely — complete reviews within one business day (see Review SLA below)
- Be constructive — explain why something is a problem, not just that it is. Suggest alternatives.
- Distinguish blocking from non-blocking — prefix optional suggestions with "nit:" or "optional:" so the author knows what must be addressed
- Approve when satisfied — do not hold PRs hostage for perfection. If the code is correct, well-tested, and maintainable, approve it.
Author Responsibilities
- Self-review first — review your own diff before requesting review. Catch obvious issues yourself.
- Write clear descriptions — explain what the PR does, why it is needed, and how to test it. Link the relevant issue.
- Keep PRs small and focused — one logical change per PR. Do not bundle unrelated changes.
- Respond to feedback promptly — address comments, push fixes, or explain your reasoning within one business day
- Do not take feedback personally — review comments are about the code, not the author
PR Size Guidance
| Size |
Lines changed |
Review quality |
Recommendation |
| Small |
< 100 |
Excellent |
Ideal. Aim for this size. |
| Medium |
100 - 400 |
Good |
Acceptable for most feature work. |
| Large |
400 - 800 |
Declining |
Split if possible. Flag to reviewers. |
| Too large |
> 800 |
Poor |
Must split. Reviewers cannot effectively review this. |
How to Split Large PRs
- By layer — separate backend and frontend changes
- By feature slice — implement one endpoint or one UI component per PR
- By phase — refactor first (separate PR), then add new functionality
- By dependency — extract shared utilities or models into a preparatory PR
Review SLA
| Action |
Target |
| First review comment |
Within 1 business day |
| Follow-up after author responds |
Within 4 business hours |
| Final approval |
Within 2 business days of PR creation |
If a review will be delayed, communicate proactively. A quick "I'll review this tomorrow" is better than silence.
Automated Review Integration
Automated tools handle mechanical checks so human reviewers can focus on design and logic:
| Tool |
What it catches |
| Linters |
Style violations, unused imports, formatting |
| Type checkers |
Type mismatches, null safety, missing returns |
| Test suites |
Regressions, broken functionality |
| AI code review (agent-code-reviewer) |
Spec compliance, correctness, test coverage, maintainability |
| AI security review (do-cybersecurity-review) |
Pre-push gate scoped to changed code + impact set |
Rules for Automated Reviews
- Automated checks must pass before human review — do not waste reviewer time on code that does not compile or pass lint
- AI review findings require human judgement — AI reviewers may flag false positives. The human reviewer makes the final call.
- Do not disable checks to merge faster — if a check is wrong, fix the check configuration, do not skip it
What NOT to Review
Human review time is expensive. Do not spend it on issues that automated tools handle:
- Style and formatting — linters and formatters enforce this. Do not comment on brace placement, indentation, or trailing commas.
- Personal preferences — if both approaches are correct, readable, and maintainable, do not request a change to match your personal style
- Trivial naming — unless a name is actively misleading, do not bikeshed over whether
getData should be fetchData
- Generated code — auto-generated files (protobuf, GraphQL codegen, lockfiles) do not need line-by-line review
Detecting Code Review Anti-Patterns
| Pattern |
Issue |
Fix |
| PR merged without any review |
No review gate |
Enable branch protection requiring approvals |
| PR with 1000+ lines changed |
Too large to review effectively |
Split into smaller, focused PRs |
| Review pending for 3+ business days |
SLA violation |
Escalate or reassign reviewer |
| All review comments are style nits |
Wasted review effort |
Configure linters to catch style; focus on logic |
| Reviewer approves without comments on large PR |
Rubber-stamp review |
Reviewers must demonstrate understanding of the change |
| Author pushes "fix review" commits without context |
Lost review trail |
Explain what was changed in response to which comment |
| Self-approval on protected branch |
Missing review gate |
Configure branch protection to disallow self-approval |
| Skipping CI to merge faster |
Bypassing quality gates |
CI must pass; fix failures, do not skip them |
Source: thermiteau/maverick — distributed by TomeVault.
1---2name: mav-bp-code-review3description: Code review conventions for all projects. Covers mandatory review requirements, review scope, PR sizing, reviewer and author responsibilities, and automated review integration. Applied when creating or reviewing pull requests. Use when this capability is needed.4---56# Code Review Standards78Ensure all code changes are reviewed before merging. Reviews catch defects, share knowledge, and maintain codebase quality. Optimise for small, focused pull requests with timely, constructive feedback.910## Principles11121. **All changes reviewed before merge** — no code reaches a protected branch without at least one approval from a reviewer who was not the author132. **Small PRs get better reviews** — large diffs lead to superficial reviews. Keep pull requests focused and digestible.143. **Review for correctness, test coverage, and maintainability** — style issues are handled by linters; security is handled separately by `do-cybersecurity-review` as a pre-push gate154. **Automated checks supplement, not replace, human review** — linting, type checking, and AI review catch mechanical issues; humans assess design, intent, and edge cases1617## Mandatory Review Requirements1819- **At least one approval** before merging to any protected branch (e.g., `main`)20- **No self-approvals** — the author cannot approve their own pull request21- **Stale approvals dismissed on new pushes** — if the author pushes new commits after approval, the approval is invalidated and a re-review is required22- **All CI checks passing** — do not merge with failing lints, tests, or type checks2324## Review Scope2526Every review should evaluate the change against these dimensions:2728| Dimension | What to check |29| ------------------ | ----------------------------------------------------------------------------------------------------- |30| **Correctness** | Does the code do what it claims? Are edge cases handled? Are assumptions documented? |31| **Maintainability** | Is the code readable? Are names clear? Is complexity justified? Will the next developer understand it? |32| **Test coverage** | Are new code paths tested? Are edge cases covered? Do tests actually assert meaningful outcomes? |33| **Documentation** | Are public APIs documented? Are non-obvious decisions explained? Is the PR description clear? |3435**Security is out of scope** for the PR review process. It runs as a separate pre-push gate via `do-cybersecurity-review` (in update mode against the diff and impact set) before the PR is opened. By the time a reviewer sees a PR, security findings have already been surfaced and folded into the PR body.3637## Reviewer Responsibilities3839- **Understand the change** — read the PR description, linked issue, and relevant context before reviewing code40- **Check edge cases** — think about what happens with empty inputs, nulls, concurrent access, large data sets, and failure modes41- **Be timely** — complete reviews within one business day (see Review SLA below)42- **Be constructive** — explain *why* something is a problem, not just that it is. Suggest alternatives.43- **Distinguish blocking from non-blocking** — prefix optional suggestions with "nit:" or "optional:" so the author knows what must be addressed44- **Approve when satisfied** — do not hold PRs hostage for perfection. If the code is correct, well-tested, and maintainable, approve it.4546## Author Responsibilities4748- **Self-review first** — review your own diff before requesting review. Catch obvious issues yourself.49- **Write clear descriptions** — explain what the PR does, why it is needed, and how to test it. Link the relevant issue.50- **Keep PRs small and focused** — one logical change per PR. Do not bundle unrelated changes.51- **Respond to feedback promptly** — address comments, push fixes, or explain your reasoning within one business day52- **Do not take feedback personally** — review comments are about the code, not the author5354## PR Size Guidance5556| Size | Lines changed | Review quality | Recommendation |57| ----------------- | ------------- | -------------- | --------------------------------------------- |58| **Small** | < 100 | Excellent | Ideal. Aim for this size. |59| **Medium** | 100 - 400 | Good | Acceptable for most feature work. |60| **Large** | 400 - 800 | Declining | Split if possible. Flag to reviewers. |61| **Too large** | > 800 | Poor | Must split. Reviewers cannot effectively review this. |6263### How to Split Large PRs6465- **By layer** — separate backend and frontend changes66- **By feature slice** — implement one endpoint or one UI component per PR67- **By phase** — refactor first (separate PR), then add new functionality68- **By dependency** — extract shared utilities or models into a preparatory PR6970## Review SLA7172| Action | Target |73| ------------------------------ | ------------------------- |74| First review comment | Within 1 business day |75| Follow-up after author responds | Within 4 business hours |76| Final approval | Within 2 business days of PR creation |7778If a review will be delayed, communicate proactively. A quick "I'll review this tomorrow" is better than silence.7980## Automated Review Integration8182Automated tools handle mechanical checks so human reviewers can focus on design and logic:8384| Tool | What it catches |85| -------------------------------------------- | ---------------------------------------------------- |86| **Linters** | Style violations, unused imports, formatting |87| **Type checkers** | Type mismatches, null safety, missing returns |88| **Test suites** | Regressions, broken functionality |89| **AI code review** (agent-code-reviewer) | Spec compliance, correctness, test coverage, maintainability |90| **AI security review** (do-cybersecurity-review) | Pre-push gate scoped to changed code + impact set |9192### Rules for Automated Reviews9394- **Automated checks must pass before human review** — do not waste reviewer time on code that does not compile or pass lint95- **AI review findings require human judgement** — AI reviewers may flag false positives. The human reviewer makes the final call.96- **Do not disable checks to merge faster** — if a check is wrong, fix the check configuration, do not skip it9798## What NOT to Review99100Human review time is expensive. Do not spend it on issues that automated tools handle:101102- **Style and formatting** — linters and formatters enforce this. Do not comment on brace placement, indentation, or trailing commas.103- **Personal preferences** — if both approaches are correct, readable, and maintainable, do not request a change to match your personal style104- **Trivial naming** — unless a name is actively misleading, do not bikeshed over whether `getData` should be `fetchData`105- **Generated code** — auto-generated files (protobuf, GraphQL codegen, lockfiles) do not need line-by-line review106107## Detecting Code Review Anti-Patterns108109| Pattern | Issue | Fix |110| ------------------------------------------------- | ---------------------------------- | ---------------------------------------------------- |111| PR merged without any review | No review gate | Enable branch protection requiring approvals |112| PR with 1000+ lines changed | Too large to review effectively | Split into smaller, focused PRs |113| Review pending for 3+ business days | SLA violation | Escalate or reassign reviewer |114| All review comments are style nits | Wasted review effort | Configure linters to catch style; focus on logic |115| Reviewer approves without comments on large PR | Rubber-stamp review | Reviewers must demonstrate understanding of the change |116| Author pushes "fix review" commits without context | Lost review trail | Explain what was changed in response to which comment |117| Self-approval on protected branch | Missing review gate | Configure branch protection to disallow self-approval |118| Skipping CI to merge faster | Bypassing quality gates | CI must pass; fix failures, do not skip them |119120<!-- maverick-plugin-version: 3.3.5 -->121122---123> Source: [thermiteau/maverick](https://github.com/thermiteau/maverick) — distributed by [TomeVault](https://tomevault.io).124<!-- tomevault:4.0:skill_md:2026-05-22 -->