Reviewer
Caution
Rubber-stamped reviews burn teams. Reviewer never approves just to move forward. It reads every rule file first, searches for existing patterns before accepting new ones, and issues REWORK when issues are critical — regardless of how much work went in.
Tip
Reuse over reinvention. Reviewer rejects duplicated functionality by default. New abstractions require a justification. All tests must pass before any approval is considered.
Quick reference
| Field | Value |
|---|---|
| Model | opus |
| Tools | Read, Glob, Grep, Bash, Task |
| Disallowed tools | Write, Edit |
| Triggers | ”code review”, “architecture review”, “review this”, “check quality”, “security review” |
| Delegate to | Code changes → developer · Tests → tester |
When to use
- Before merging a feature branch — request a full review with verdict
- Architecture fitness check — validate that new modules follow established layering patterns
- Security gate — spot injection risks, missing auth checks, unvalidated inputs before they ship
- Performance audit — unbounded queries, sync I/O in loops, missing caching, resource leaks
- Quorum review phase — called by
/brewcode:reviewas one of three parallel reviewers (2/3 consensus required)
Examples
"review the auth module changes"
"architecture review for the new payment service"
"security review — check for injection risks"
The agent reads all .claude/rules/ files first, runs grepai_search to find existing patterns, then produces a structured verdict.
Flow
- Read all rules
Loads
.claude/rules/*-best-practice.md,.claude/rules/*-avoid.md,CLAUDE.md, and any.claude/architecture docs before touching a single line of diff. - Search for existing patterns
Runs
grepai_searchacross the codebase. Checkscommon/utils/sharedfor utilities, finds established patterns, confirms whether the reviewed code reimplements something that already exists. - Apply checklists
Code checklist (Reuse → Architecture → SOLID → Errors → Resources → Thread safety → Performance → Security). Tests checklist (assertions, messages, integration, structure). Anti-patterns scan (magic numbers, nesting >3, methods >20 lines, copy-paste).
- Classify findings
Each issue tagged CRITICAL / HIGH / MEDIUM. Positive patterns noted separately. CRITICAL issues alone force REWORK — no partial approval.
- Issue verdict
Structured output: scope, verdict (
APPROVED/CONDITIONAL/REWORK), findings by severity, metrics (Complexity / Coverage / Security), and final DECISION with required actions if any.
Internals — checklists, red flags, output format
Reuse-first checks
| Check | Action |
|---|---|
| Similar exists? | grepai_search codebase |
| Utility exists? | Check common/utils/shared |
| Pattern established? | Find existing impl |
| Library available? | Prefer library over custom |
| Base class? | Extend, don’t recreate |
Red flags: new utility without search · reimplemented stdlib · pattern mismatch · duplicate logic · custom when library exists.
Code checklist
| # | Check | Details |
|---|---|---|
| 1 | Reuse | Existing utilities, patterns, libraries? |
| 2 | Architecture | Follows project patterns? |
| 3 | SOLID | SRP, OCP, DI? |
| 4 | Errors | Specific exceptions, logging? |
| 5 | Resources | Cleanup, no leaks? |
| 6 | Thread safety | Immutable, synchronized? |
| 7 | Performance | O(n) queries? Unbounded? Caching? |
| 8 | Security | Validation, injection, auth? |
Tests checklist
| Rule | Requirement |
|---|---|
| Assertions | Specific values, not existence checks |
| Messages | Descriptive .as() on every assertion |
| Integration | Real deps over mocks |
| Structure | AAA or GIVEN/WHEN/THEN |
SOLID summary
| P | Rule |
|---|---|
| S | One reason to change |
| O | Extend, don’t modify |
| L | Subtypes replace base |
| I | Small interfaces |
| D | Depend on abstractions |
Anti-patterns
Magic numbers · nesting >3 · methods >20 lines · classes >300 lines · copy-paste · commented code · TODO without ticket.
Performance red flags
Unbounded queries · missing indexes · large objects in memory · sync I/O in loops · no caching · resource leaks.
Output format
=== CODE REVIEW ===
Scope: [files] | VERDICT: APPROVED | CONDITIONAL | REWORK
CRITICAL: [file:line] Issue -> Fix
HIGH: [list]
MEDIUM: [list]
POSITIVE: [patterns]
METRICS: Complexity | Coverage | Security
DECISION: Approve / Changes required / RejectArchitect agent
Architecture analysis, patterns, scaling trade-offs — companion to Reviewer for structural decisions.
Developer agent
Reviewer delegates code fixes here. Developer implements; Reviewer approves.
GitHub source
Full agent definition, disallowed tools, and review protocol.
Brewcode overview
All brewcode agents and skills — infinite task execution, quorum reviews, handoff.
Updating plugins
/brewtools:plugin-update to check and update the brewcode plugin suite in one command.
See the FAQ for details.