Review code changes or PRs for quality, correctness, and reviewability. Use when asked to "review", "check", "provide feedback", or "post a review". Dispatches specialized agents in parallel for thorough analysis.
Review the change and provide structured, actionable feedback.
The primary goal is correctness. This is a distributed database — read the code with a critical eye for concurrency issues, locking discipline, failure modes, and architectural soundness. The specialized agents below are a checklist of common patterns to verify, but they're secondary to understanding whether the code is actually correct.
Determine what to review based on context:
master is often stale — prefer remote-tracking
refs):
# Pick the most recently updated master-like ref (upstream/master, origin/master, etc.)
master_ref=$(git for-each-ref --sort=-committerdate --format='%(refname:short)' \
--count=1 'refs/remotes/*/master' 'refs/heads/master')
merge_base=$(git merge-base HEAD "$master_ref")
git log --oneline "$merge_base"..HEAD
git diff "$merge_base"..HEAD
git diff --cached.gh pr diff <number> and gh pr view <number>.Read enough surrounding code to understand context — don't review the diff in
isolation. When reviewing a PR, this may require checking out the branch
(gh pr checkout <number>) to read files at the PR's version. Before doing so,
check git status — if the user has uncommitted changes to tracked files, ask
before checking out.
Each aspect is handled by a specialized agent in .claude/agents/. Not every
aspect applies to every change — scan the diff, determine which apply, and skip
the rest.
| Aspect | Agent | Applies when |
|---|---|---|
| Correctness & safety | crdb-correctness-reviewer | Always for non-trivial changes |
| Error handling | crdb-error-reviewer | Code touches error paths, retry logic, or resource cleanup |
| Go conventions & comments | crdb-conventions-reviewer | Always — focuses on new/changed code |
| Test coverage | crdb-test-reviewer | Test files changed, or new behavior without tests |
| Commit structure & PR description | crdb-commit-reviewer | Reviewing a branch/PR with commits |
| Type design | crdb-type-reviewer | New structs/interfaces added or significantly modified |
| Metric hygiene | crdb-metric-reviewer | Diff adds or modifies metric.Metadata definitions or introduces new metrics |
| Simplification | crdb-simplifier | After other aspects pass — polish step |
The user can request specific aspects:
/review-crdb — run all applicable aspects (default)/review-crdb correctness tests — run only those two/review-crdb simplify — run only the simplifierValid aspect names: correctness, errors, conventions, tests, commits,
types, metrics, simplify, all.
Launch all applicable agents simultaneously using the Agent tool. Each agent