Prompt: Senior Code Review with Severity Triage

Get a structured, prioritized code review on a pull request, function, or module — without the noise of nitpicks drowning out real bugs.

by Nobodylovesyou ▲ 0 📋 1 copies 👁 172
Tested on: Claude

Fill in the variables

Prompt


            

Example input

<language>Python 3.11</language>
<framework>FastAPI</framework>
<purpose>Endpoint that fetches a user's recent orders by user_id query parameter.</purpose>
<environment>production</environment>
<reviewer_focus>all</reviewer_focus>

<code>
@app.get("/orders")
async def get_orders(user_id: str, db=Depends(get_db)):
    query = f"SELECT * FROM orders WHERE user_id = '{user_id}' ORDER BY created_at DESC"
    results = db.execute(query).fetchall()
    orders = []
    for r in results:
        order = db.execute(f"SELECT * FROM order_items WHERE order_id = {r['id']}").fetchall()
        orders.append({"order": r, "items": order})
    return orders
</code>

Why this works & how to customize

Severity rubric in the prompt eliminates noise. Without explicit severity definitions, Claude tends to flag everything at equal weight — useful for a junior reviewer, useless for a PR queue. The rubric forces triage.
The "do not flag / do flag" lists shape behavior more than positive instructions alone. Claude follows negative constraints well when they're explicit and grouped.
Concrete fix requirement (code, not prose) prevents the "consider refactoring" non-answers that plague AI code reviews.
The "if the code is solid, say so" escape hatch prevents fabrication. Without it, Claude will invent issues to meet an implied quota.
Max 8 findings cap matches how senior engineers actually review — depth over breadth.

Example output

Open in Claude → 🍴 Fork

Comments (0)

Sign in to comment.

No comments yet.