The 10-minute code review I run before every merge
Most review comments are noise: style nits, hypothetical concerns, "consider adding a comment". A useful review answers three questions in order — does it break anything, does it handle the edges, is it understandable three months from now — and says nothing else. Here is the sequence I run (with AI assistance) before every merge, condensed. Pass 1: behavior Read the diff as a spec change, not as…
Every developer knows the agony of sifting through countless review comments that often amount to nothing more than style nits or hypothetical concerns. To streamline this process and ensure a more efficient code review, a developer has devised a ten-minute code review checklist that they run before every merge, aided by artificial intelligence.
The first pass of the review focuses on behavior. Rather than scrutinizing the code itself, the reviewer must read the diff as a spec change and articulate in one sentence what the system will do differently after the merge. If the description is too vague to convey this behavior succinctly, the PR should be sent back for further refinement. This simple yet powerful rule effectively eliminates a significant portion of unnecessary review time.
The second pass centers on the code's ability to handle edge cases. For each input the code processes, the reviewer is asked to consider various scenarios such as empty values, extremely large inputs, negative numbers, duplicates, concurrent operations, and expired data. Leveraging AI assistance, the reviewer can generate a table of edge cases, comparing expected versus actual behavior, instead of relying on vague bug reports. This structured approach produces testable claims and significantly enhances the review's quality.
The third and final pass evaluates whether a new teammate could understand the module without any prior knowledge of the author's work. Key elements to examine include the use of names that obscure functionality, boolean variables with dual meanings, and error paths that fail to convey context. In this phase, AI review proves particularly valuable as it is devoid of personal biases.
By explicitly instructing the AI to rank findings by severity and exclude style-related comments, the review process becomes more focused and efficient.
Over time, refining these prompts has yielded senior-quality reviews with a few key elements in common. First, the reviewer must assume a defined role with the authority to make decisions. Second, an explicit severity scale should be established to prioritize findings effectively. Third, a forbidden-topics list must be created to exclude style, formatting, and hypothetical comments that do not contribute to the core review.
Lastly, a required output format, such as a table or ranked list, should be mandated to ensure consistency and clarity in the reviewer's findings.
To assist developers in implementing this process, a Prompt Pack for Developers has been compiled. This comprehensive resource includes 150 developer prompts, organized across 15 different categories, with precise wording that has been proven effective. While developers can create their own prompts from scratch, the Prompt Pack offers a ready-made solution with 147 additional prompts tailored for various aspects of the development workflow, including refactoring, testing, debugging, SQL, migrations, and more.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.