Skip to content
Code Review for AI Agents
The Trove library

Code Review for AI Agents

Complete reference for AI coding agents performing code reviews.

You can read the contents and the first 2,000 characters.
Free accounts get the whole book.

  • By Sahar Carmel
  • 22 chapters
  • Updated Nov 1, 2026
  • 179 readers

What’s inside

  • Naming & Readability
  • Functions & Methods
  • Classes & Modules
  • Code Smells & Refactoring
  • Type Safety & Data Integrity
  • Error Handling

What is Code Review for AI Agents?

Complete reference for AI coding agents performing code reviews. 18 chapters + appendices, 231 rules with concrete thresholds, TypeScript and Python examples, machine-checkable verification criteria, and book-grounded citations. Covers naming, functions, classes, code smells, type safety, error handling, performance, testing, concurrency, security, API design, dependencies, database/ORM patterns, observability, and diff-scanning heuristics.

Read more

markdown · Listed Mar 31, 2026

  • code
  • code-review
  • best-practices
  • books-for-agents

From the first page

This book is a lookup reference, not a narrative. It is designed for AI agents performing code reviews. Do not read it sequentially during a review — use the decision matrix (Chapter 2) to jump to the relevant chapter.

Page lookup: Chapter N is on page N + 1 (page 1 is the cover). Rule X.Y is in Chapter X, so it is on page X + 1 — for example, Rule 16.5 is on page 17.

Preview · 2,000 of 819,875 characters

Contents

  1. 01Code Review for AI Agentsp.1
  2. 02How to Use This Bookp.2
    1. Workflowp.2
    2. Severity Scalep.2
    3. Chapter Mapp.2
    4. Cross-References to Other Agent Booksp.2
    5. Per-Chapter Structurep.2
  3. 03Master Decision Matrixp.3
    1. Path 1: Pattern-Based — "I See This in the Code"p.3
    2. Path 2: Task-Based — "I'm Reviewing a PR That Does X"p.3
    3. Path 3: Severity-Based — Quick Filterp.3
  4. 04Naming & Readabilityp.4
    1. Red Flag Tablep.4
    2. Rulesp.4
    3. Verificationp.4
    4. Common Mistakesp.4
  5. 05Functions & Methodsp.5
    1. Red Flag Tablep.5
    2. Rulesp.5
    3. Verificationp.5
    4. Common Mistakesp.5
  6. 06Classes & Modulesp.6
    1. Red Flag Tablep.6
    2. Rulesp.6
    3. Verificationp.6
    4. Common Mistakesp.6
  7. 07Code Smells & Refactoringp.7
    1. Smell Catalog — Master Lookup Tablep.7
    2. Rulesp.7
    3. Smell-to-Action Quick Referencep.7
    4. Refactoring Safety Checklistp.7
    5. Severity Decision Treep.7
    6. Verificationp.7
    7. Common Mistakesp.7
  8. 08Type Safety & Data Integrityp.8
    1. Red Flag Tablep.8
    2. Rulesp.8
    3. Verificationp.8
    4. Common Mistakesp.8
See all 22 parts
  1. 09Error Handlingp.9
    1. Red Flag Tablep.9
    2. Rulesp.9
    3. Verificationp.9
    4. Common Mistakesp.9
  2. 10Performance Red Flagsp.10
    1. Red Flag Tablep.10
    2. Rulesp.10
    3. Verificationp.10
    4. Common Mistakesp.10
  3. 11Test Qualityp.11
    1. Red Flag Tablep.11
    2. Rulesp.11
    3. Verificationp.11
    4. Common Mistakesp.11
  4. 12Concurrency & Asyncp.12
    1. Red Flag Tablep.12
    2. Rulesp.12
    3. Verificationp.12
    4. Common Mistakesp.12
  5. 13Security Smellsp.13
    1. Red Flag Tablep.13
    2. Rulesp.13
    3. Verificationp.13
    4. Common Mistakesp.13
  6. 14API Design Qualityp.14
    1. Red Flag Tablep.14
    2. Rulesp.14
    3. Verificationp.14
    4. Common Mistakesp.14
  7. 15Dependencies & Architecturep.15
    1. Red Flag Tablep.15
    2. Rulesp.15
    3. Verificationp.15
    4. Common Mistakesp.15
  8. 16Writing Review Commentsp.16
    1. Comment Structurep.16
    2. Comment Propertiesp.16
    3. Severity Calibrationp.16
    4. Comment Grouping and Priorityp.16
    5. Comment Typesp.16
    6. Review Summary Templatep.16
    7. Common Mistakes When Writing Reviewsp.16
  9. 17Database & ORM Patternsp.17
    1. Red Flag Tablep.17
    2. Rulesp.17
    3. Verificationp.17
    4. Common Mistakesp.17
  10. 18Observability & Loggingp.18
    1. Red Flag Tablep.18
    2. Rulesp.18
    3. Verificationp.18
    4. Common Mistakesp.18
  11. 19Diff-Scanning Heuristics for AI Agentsp.19
    1. Scopep.19
    2. Referencesp.19
    3. The 5-Pass Strategyp.19
    4. File Priority Matrixp.19
    5. Large PR Heuristicsp.19
    6. Context Expansion Rulesp.19
    7. Red Flags That Deserve Extra Scrutinyp.19
    8. Common Scanning Mistakesp.19
  12. 20Distributed Systems & Service Boundariesp.20
    1. Red Flag Tablep.20
    2. Rulesp.20
    3. Verificationp.20
    4. Common Mistakesp.20
  13. 21Appendices: False-Positive Guidance, Severity Overrides & Cheat Sheetp.21
    1. Section 1: "When NOT to Flag" Addendump.21
    2. Section 2: Severity Override Matrixp.21
    3. Section 3: Quick Reference Cheat Sheetp.21
  14. 22Putting This Book to Work — An Automated Review Skillp.22
    1. 20.1 The Idea: From Reference to Reviewerp.22
    2. 20.2 The Reviewer Agent — How It Reads This Bookp.22
    3. 20.3 The Skill That Drives It — An Automated PR Pipelinep.22
    4. 20.4 Companion Books and Trigger Signalsp.22
    5. 20.5 Operating Rulesp.22