{"slug": "a-code-review-prompt-that-makes-the-ai-prove-its-findings", "title": "A code review prompt that makes the AI prove its findings", "summary": "A developer published a code-review prompt that forces AI assistants to make every finding falsifiable, requiring a file and line, a triggering input, the expected result, the predicted result, and the smallest test that would fail today. The prompt instructs the model to label unverifiable items as \"question\" rather than \"bug\" and to write \"not traced\" for anything it did not follow through the code. A worked example shows a topScores function whose default string sort returns [9, 3, 25] instead of [100, 25, 9], with the fix being .sort((a, b) => b - a).", "body_md": "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.\n\n```\nReview the diff below as a skeptical senior engineer. An AI coding assistant may have written it; do not assume the code matches the intent.\n\nIntent: <what this change must do, and what it must not change>\n\nRules:\n- Report only problems that change behavior, security, data, or what a reader must understand. Skip style issues a formatter or linter would catch.\n- 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.\n- If you cannot name a triggering input, label the item \"question\", not \"bug\".\n- 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.\n- Write \"not traced\" for anything you did not follow through the code. Do not claim that you ran code or tests.\n- End with the three highest-risk findings, what you did not review, and one decision: approve, request changes, or need more information.\n\nDiff:\n<paste the diff>\n```\n\nThe intent line matters most. Nobody, human or model, can call code wrong without knowing what it was supposed to do.\n\nSynthetic patch: return the top three scores, highest first.\n\n```\nfunction topScores(scores, limit = 3) {\n  return [...scores].sort().reverse().slice(0, limit);\n}\n```\n\nA finding in the requested shape:\n\n```\nbug: leaderboard.mjs:6\nTrigger: [9, 100, 25, 3]\nExpected: [100, 25, 9]\nPredicted: [9, 3, 25], because sort() without a comparator compares strings\n```\n\nDon't accept it on reading. A test with `[40, 75, 62, 18]` passes, because with two-digit numbers string order equals numeric order. `[9, 100, 25, 3]` fails with actual `[9, 3, 25]`. Fix it with `.sort((a, b) => b - a)` and the test passes.\n\nThat is the point: the prompt narrows where to look, the test decides.\n\nReady-to-copy files for a Claude Code `/review-diff` skill (it injects `git diff HEAD` automatically), a manual Cursor rule (`@ai-review`), and GitHub Copilot code review instructions are in this repo: [https://github.com/itscloud0/ai-code-review-prompt](https://github.com/itscloud0/ai-code-review-prompt)\n\nThe full write-up, including what an AI review cannot settle (callers, production data, its own assumptions), is here: [https://manualmode.dev/guides/ai-code-review-prompt](https://manualmode.dev/guides/ai-code-review-prompt)\n\n*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.*", "url": "https://wpnews.pro/news/a-code-review-prompt-that-makes-the-ai-prove-its-findings", "canonical_source": "https://dev.to/itscloud0/a-code-review-prompt-that-makes-the-ai-prove-its-findings-1m9b", "published_at": "2026-10-31 23:07:28+00:00", "updated_at": "2026-10-31 23:21:47.705854+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "developer-tools", "large-language-models"], "entities": ["ManualMode", "GitHub Copilot", "Cursor", "Claude Code"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/a-code-review-prompt-that-makes-the-ai-prove-its-findings", "markdown": "https://wpnews.pro/news/a-code-review-prompt-that-makes-the-ai-prove-its-findings.md", "text": "https://wpnews.pro/news/a-code-review-prompt-that-makes-the-ai-prove-its-findings.txt", "jsonld": "https://wpnews.pro/news/a-code-review-prompt-that-makes-the-ai-prove-its-findings.jsonld"}}