<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ilia Sorokin</title>
    <description>The latest articles on DEV Community by Ilia Sorokin (@itscloud0).</description>
    <link>https://dev.to/itscloud0</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4219750%2F63ebca33-1beb-47c5-bac0-31944fa056ff.png</url>
      <title>DEV Community: Ilia Sorokin</title>
      <link>https://dev.to/itscloud0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/itscloud0"/>
    <language>en</language>
    <item>
      <title>A code review prompt that makes the AI prove its findings</title>
      <dc:creator>Ilia Sorokin</dc:creator>
      <pubDate>Sat, 31 Oct 2026 23:07:28 +0000</pubDate>
      <link>https://dev.to/itscloud0/a-code-review-prompt-that-makes-the-ai-prove-its-findings-1m9b</link>
      <guid>https://dev.to/itscloud0/a-code-review-prompt-that-makes-the-ai-prove-its-findings-1m9b</guid>
      <description>&lt;p&gt;Most "review this code" prompts return style nits and a confident summary. A rule that helps: make every finding falsifiable. A location, an input that triggers it, the expected result, the result the model predicts, and the smallest test that would fail today.&lt;/p&gt;

&lt;h2&gt;
  
  
  The prompt
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Review the diff below as a skeptical senior engineer. An AI coding assistant may have written it; do not assume the code matches the intent.

Intent: &amp;lt;what this change must do, and what it must not change&amp;gt;

Rules:
- Report only problems that change behavior, security, data, or what a reader must understand. Skip style issues a formatter or linter would catch.
- Make every finding falsifiable. Give the file and line, the concrete input or state that triggers it, the expected result, the result you predict the code produces, and the smallest test that would fail today.
- If you cannot name a triggering input, label the item "question", not "bug".
- Check in this order: the stated intent; boundary inputs (empty, one, many, duplicates, mixed types, ordering); state and side effects (mutation, retries, partial failure); error paths; security-relevant input (authorization, injection, secrets); tests that pass without proving the intent.
- Write "not traced" for anything you did not follow through the code. Do not claim that you ran code or tests.
- End with the three highest-risk findings, what you did not review, and one decision: approve, request changes, or need more information.

Diff:
&amp;lt;paste the diff&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The intent line matters most. Nobody, human or model, can call code wrong without knowing what it was supposed to do.&lt;/p&gt;

&lt;h2&gt;
  
  
  Then verify one finding
&lt;/h2&gt;

&lt;p&gt;Synthetic patch: return the top three scores, highest first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;topScores&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;scores&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;limit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;scores&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;reverse&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A finding in the requested shape:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bug: leaderboard.mjs:6
Trigger: [9, 100, 25, 3]
Expected: [100, 25, 9]
Predicted: [9, 3, 25], because sort() without a comparator compares strings
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't accept it on reading. A test with &lt;code&gt;[40, 75, 62, 18]&lt;/code&gt; passes, because with two-digit numbers string order equals numeric order. &lt;code&gt;[9, 100, 25, 3]&lt;/code&gt; fails with actual &lt;code&gt;[9, 3, 25]&lt;/code&gt;. Fix it with &lt;code&gt;.sort((a, b) =&amp;gt; b - a)&lt;/code&gt; and the test passes.&lt;/p&gt;

&lt;p&gt;That is the point: the prompt narrows where to look, the test decides.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing it
&lt;/h2&gt;

&lt;p&gt;Ready-to-copy files for a Claude Code &lt;code&gt;/review-diff&lt;/code&gt; skill (it injects &lt;code&gt;git diff HEAD&lt;/code&gt; automatically), a manual Cursor rule (&lt;code&gt;@ai-review&lt;/code&gt;), and GitHub Copilot code review instructions are in this repo: &lt;a href="https://github.com/itscloud0/ai-code-review-prompt" rel="noopener noreferrer"&gt;https://github.com/itscloud0/ai-code-review-prompt&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The full write-up, including what an AI review cannot settle (callers, production data, its own assumptions), is here: &lt;a href="https://manualmode.dev/guides/ai-code-review-prompt" rel="noopener noreferrer"&gt;https://manualmode.dev/guides/ai-code-review-prompt&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: I build ManualMode, a practice tool for reviewing and debugging code without autopilot. This post was written and published by an AI agent working on my behalf; the example test was run before publishing.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>testing</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
