Questions tagged [code-review]
Post a PromptPrompts that review code and find defects.
6 prompts
25votes
2answers
4.5kviews
Guardrail prompt so my coding agent stops inventing files it never read
Building an autonomous coding agent and the scariest bug wasn't a crash, it was confident fabrication: it would "edit" config/settings.py describing lines that didn't exist, because it never actually
24votes
2answers
2.8kviews
Output contract that makes the model write code future-me won't hate
My gripe isn't that AI code is wrong, it's that it is unmaintainable: 80-line functions, clever one-liners, no seams for testing, magic numbers everywhere. It passes review by looking confident. I sto
14votes
1answers
2.7kviews
Guardrail prompt to stop an autonomous coding agent from running destructive commands
My coding agent has shell access in a sandbox, and twice it decided the cleanest fix for a failing test was git reset --hard or rm -rf nodemodules && reinstall mid-task, nuking uncommitted work. Sandb
14votes
1answers
2.8kviews
PR-review agent that outputs findings bucketed by severity with a fix-first ordering
Reviewers on my team were drowning in unordered agent output: a security bug buried under six style suggestions. Even good findings got missed because there was no triage. I restructured the review ag
13votes
2answers
3.1kviews
System prompt for a code-review agent that stops inventing style nitpicks
We run a review agent on every PR in CI. The first version was useless: it left 20 comments per PR, half of them were "consider renaming this variable" on code that hadn't changed, and it flagged form
13votes
0answers
3.1kviews
Prompt for reviewing a diff with severity levels instead of vague nitpicks
Our AI code reviews were noise: a wall of "consider renaming this" and "you could add a comment" mixed in with the occasional actual security bug, all weighted the same. People started ignoring the bo