Code Review
Perform a thorough, multi-perspective code review of the most recent commit (git show HEAD).
Process
Step 1: Inspect the change
git show HEAD
Read every line of the diff and commit message carefully.
Step 2: Gather context
Before launching review agents, gather all context they will need:
- Read all modified files in full — not just the diff. Understand the surrounding code.
- Find callers and dependencies — use Grep/Glob to find callers of modified functions, related interfaces, and types.
- Check the commit stack —
git log --oneline -10 for recent context.
- Read AGENTS.md or CLAUDE.md for project-specific rules the change must follow.
Step 3: Launch 5 review agents in parallel
Each agent reviews from a specific perspective. Provide each agent with:
- The full diff
- The full content of modified files
- Relevant caller/dependency excerpts
- Project conventions from AGENTS.md or CLAUDE.md
Perspective 1: Correctness
- Is the algorithm correct? Are there off-by-one errors, integer overflow risks?
- Does the code do what the commit message claims?
- Are edge cases handled? NULL inputs, empty collections, boundary values, maximum sizes?
- For DuckDB extensions: are logical plan transformations semantics-preserving? Are column bindings correct after rewrites?
Perspective 2: Reliability
- Are there tests? Do they cover edge cases and error paths?
- Could the tests pass while the code is still broken? (e.g., too-wide thresholds, missing assertions)
- Are errors handled or silently swallowed?
- What happens if this code fails mid-execution? Is state left consistent?
- For DuckDB extensions: are SQL test cross-checks bidirectional (
EXCEPT ALL both ways)?
Perspective 3: Performance
- Are there allocations in hot paths? Unnecessary copies or clones?
- Could this cause memory pressure or unbounded growth?
- Are there O(n²) or worse algorithms that could be O(n) or O(n log n)?
- For DuckDB extensions: does the change affect query plan compilation time? Are there unnecessary plan tree traversals?
Perspective 4: Simplicity
- Is there dead code, unused imports, or unreachable branches?
- Are there abstractions with only one implementation that add indirection without value?
- Is there speculative "just in case" code that handles scenarios that cannot occur?
- Could verbose patterns be replaced with idiomatic equivalents?
- Is there excessive nesting that could be flattened with early returns?
Perspective 5: Style & conventions
- Does the code follow the project's AGENTS.md or CLAUDE.md rules?
- Are naming conventions followed? (CamelCase functions, lower_case variables, UPPER_CASE constants)
- Are debug print statements added at major flow points?
- Does this change need documentation updates? New tests?
- Is the commit message accurate and complete?
Step 4: Collect and categorize findings
Each agent reports findings with:
- Severity: CRITICAL / MAJOR / MINOR / NIT
- Confidence: 0-100 (likelihood this is a real issue vs false positive)
- Location: file, line number, code snippet
- Explanation: why it's a problem
- Fix: concrete, actionable suggestion
Severity definitions:
| Level |
Meaning |
| CRITICAL |
Must fix. Bugs, data corruption, security issues. |
| MAJOR |
Should fix. Design problems, missing error handling, inadequate testing. |
| MINOR |
Recommended. Style inconsistencies, suboptimal patterns, documentation gaps. |
| NIT |
Optional. Minor preferences, micro-optimizations. |
Step 5: Synthesize and report
After collecting all findings:
- Merge related issues — combine findings that point to the same root cause.
- Filter false positives — re-check each finding against the actual code.
- Prioritize — CRITICAL first, then MAJOR, MINOR, NIT.
- Number findings sequentially for easy reference.
- Present the report with: severity, confidence, location, explanation, and fix for each finding.
Mindset
Be direct. Be specific. Every issue missed is a bug that reaches production.
Do not:
- Add empty praise ("Great job overall!")
- Soften criticism ("Maybe consider...")
- Ignore small issues (they accumulate)
- Assume the author knew better
Do:
- Question everything
- Demand evidence and justification
- Provide concrete alternatives
- Hold the code to the highest standard
1---2name: code-review3description: Multi-perspective code review of the most recent commit. Launches 5 parallel review agents covering correctness, reliability, performance, simplicity, and style. Reports findings with severity and confidence scores.4---56# Code Review78Perform a thorough, multi-perspective code review of the most recent commit (`git show HEAD`).910## Process1112### Step 1: Inspect the change1314```bash15git show HEAD16```1718Read every line of the diff and commit message carefully.1920### Step 2: Gather context2122Before launching review agents, gather all context they will need:23241. **Read all modified files in full** — not just the diff. Understand the surrounding code.252. **Find callers and dependencies** — use Grep/Glob to find callers of modified functions, related interfaces, and types.263. **Check the commit stack** — `git log --oneline -10` for recent context.274. **Read AGENTS.md or CLAUDE.md** for project-specific rules the change must follow.2829### Step 3: Launch 5 review agents in parallel3031Each agent reviews from a specific perspective. Provide each agent with:32- The full diff33- The full content of modified files34- Relevant caller/dependency excerpts35- Project conventions from AGENTS.md or CLAUDE.md3637#### Perspective 1: Correctness3839- Is the algorithm correct? Are there off-by-one errors, integer overflow risks?40- Does the code do what the commit message claims?41- Are edge cases handled? NULL inputs, empty collections, boundary values, maximum sizes?42- For DuckDB extensions: are logical plan transformations semantics-preserving? Are column bindings correct after rewrites?4344#### Perspective 2: Reliability4546- Are there tests? Do they cover edge cases and error paths?47- Could the tests pass while the code is still broken? (e.g., too-wide thresholds, missing assertions)48- Are errors handled or silently swallowed?49- What happens if this code fails mid-execution? Is state left consistent?50- For DuckDB extensions: are SQL test cross-checks bidirectional (`EXCEPT ALL` both ways)?5152#### Perspective 3: Performance5354- Are there allocations in hot paths? Unnecessary copies or clones?55- Could this cause memory pressure or unbounded growth?56- Are there O(n²) or worse algorithms that could be O(n) or O(n log n)?57- For DuckDB extensions: does the change affect query plan compilation time? Are there unnecessary plan tree traversals?5859#### Perspective 4: Simplicity6061- Is there dead code, unused imports, or unreachable branches?62- Are there abstractions with only one implementation that add indirection without value?63- Is there speculative "just in case" code that handles scenarios that cannot occur?64- Could verbose patterns be replaced with idiomatic equivalents?65- Is there excessive nesting that could be flattened with early returns?6667#### Perspective 5: Style & conventions6869- Does the code follow the project's AGENTS.md or CLAUDE.md rules?70- Are naming conventions followed? (CamelCase functions, lower_case variables, UPPER_CASE constants)71- Are debug print statements added at major flow points?72- Does this change need documentation updates? New tests?73- Is the commit message accurate and complete?7475### Step 4: Collect and categorize findings7677Each agent reports findings with:78- **Severity**: CRITICAL / MAJOR / MINOR / NIT79- **Confidence**: 0-100 (likelihood this is a real issue vs false positive)80- **Location**: file, line number, code snippet81- **Explanation**: why it's a problem82- **Fix**: concrete, actionable suggestion8384**Severity definitions:**8586| Level | Meaning |87|---|---|88| CRITICAL | Must fix. Bugs, data corruption, security issues. |89| MAJOR | Should fix. Design problems, missing error handling, inadequate testing. |90| MINOR | Recommended. Style inconsistencies, suboptimal patterns, documentation gaps. |91| NIT | Optional. Minor preferences, micro-optimizations. |9293### Step 5: Synthesize and report9495After collecting all findings:96971. **Merge related issues** — combine findings that point to the same root cause.982. **Filter false positives** — re-check each finding against the actual code.993. **Prioritize** — CRITICAL first, then MAJOR, MINOR, NIT.1004. **Number findings** sequentially for easy reference.1015. **Present the report** with: severity, confidence, location, explanation, and fix for each finding.102103## Mindset104105Be direct. Be specific. Every issue missed is a bug that reaches production.106107Do not:108- Add empty praise ("Great job overall!")109- Soften criticism ("Maybe consider...")110- Ignore small issues (they accumulate)111- Assume the author knew better112113Do:114- Question everything115- Demand evidence and justification116- Provide concrete alternatives117- Hold the code to the highest standard