Code Review Standard
:::note Map + pointer
How we review a change β adapted from Google's Engineering Practices β "How to do a code review"
and mapped onto this platform's real review machinery. The decision of record is the rule
.claude/rules/code-review.md;
this page is its published map.
:::
The one principle above allβ
Approve a change once it definitely improves the overall code health of the system β even if it isn't perfect. There is no perfect code, only better code. The reviewer stops health from degrading; they do not block forward progress on polish.
A merely-preferred tweak β Nit: (non-blocking). Facts & data beat opinion; design is engineering, not
taste; linters/style-guide are authoritative; consistency wins unless it degrades health. Never
deadlock a change over a disagreement β resolve on principle or escalate.
Our three review layers (where this applies)β
Code here is largely written by AI agents, reviewed in three layers (bmad-compliance.md), scaled by
delivery path (A/B/C/E):
| Layer | What | Who |
|---|---|---|
| 1 β self-review | /bmad-build's own review + the test pyramid | the build agent |
| 2 β independent AI pass | /bmad-code-review in a FRESH context β no memory of writing it (the real "second pair of eyes") | a fresh agent |
| 3 β maintainer review | The PR author reviews the diff and confirms release intent; required CI checks gate merge | the solo maintainer |
Google's reviewer principles apply to layers 2 + 3. /bmad-walkthrough adds a risk-focused pass for
auth / schema / public-API / security diffs.
In the solo-maintainer setup, when the author is also the maintainer, this layer is self-review and release confirmationβnot independent maker-checker approval. CI and a fresh-context AI review provide additional evidence, but neither is represented as a human approver. Record that role overlap for compliance-sensitive changes; restore independent human approval when a second maintainer is available.
The reviewer checklist (priority order)β
Design (does it fit / belong here?) Β· Functionality (intent + users; edge cases, concurrency β backstopped by the live QA gate) Β· Complexity (no over-engineering / YAGNI) Β· Tests (right layers, in the same CL, fail when the code breaks) Β· Naming / Comments (comments say why, not what) Β· Style (linter-clean; keep style out of a logic CL) Β· Consistency Β· Documentation (updated in the same effort β the DoD gate) Β· Every line (read all of it; ask when unclear; pull a specialist) Β· Context (judge against the whole system) Β· Good things (call out what was done well β mentoring value).
How to review (order) + speedβ
- Broad view β should this change exist at all? If not, say so now, with an alternative.
- Main parts first β review the core logic + send major design feedback immediately; ask to split an over-large change.
- The rest in sequence β read the tests first to learn intent.
Speed: respond within one business day (respond β finish); fast responses beat fast turnaround;
LGTM + comments when you trust the author on the minors; never trade the standard for imagined velocity.
Writing commentsβ
- Comment on the code, not the person; explain why; it's the author's job to fix, so prefer pointing out the problem over prescribing.
- Label severity:
Nit:(trivial) Β·Optional:/Consider:(not required) Β·FYI:(informational). Unlabelled = expected to address. - Unclear code β ask for a rewrite, not an explanation in the thread β the next reader needs the clarity in the code, not the PR.
Pushbackβ
The author may be right (they're closer to the code) β concede if their reasoning holds on health grounds;
otherwise keep advocating, politely. "Clean it up in a later CL" β no: new complexity is cleaned up
before submission unless it's an emergency; genuinely out-of-scope problems get recorded (deferred-work.md
/ a filed issue + TODO(#issue)), not waved through.
The merge path β solo-maintainer policyβ
The author cannot approve their own GitHub pull request. This repository therefore does not require
CODEOWNER approval: CODEOWNERS records ownership and suggests reviewers, while a single maintainer
reviews and merges their PR after automated checks pass. The maintainer does not use --admin for the
normal release path, and the merge keeps the same required branch protections.
For minicloud-gitops, merge-gate is always required; production changes also run the path-relevant
architecture, Checkov, and kubeconform workflows. Checkov and kubeconform are conditional checks, not
global required contexts. The ruleset requires signed commits and blocks force pushes. Kargo promotions
must produce GitHub-verified commits before they can merge. Keep a fresh-context AI review as a quality
practice, but do not represent it as a GitHub approval or as an independent human reviewer.
This policy applies to every CODEOWNERS-covered path because GitHub's repository branch ruleset applies CODEOWNER review at the ruleset level, not selectively by file path. Re-enable required CODEOWNER review when a second maintainer is available.
Don't double-count the gatesβ
Review (judgement) + CI (L0βL4) + the live QA gate (L5) + CODEOWNERS (ownership map) are distinct evidence β none replaces another.