Master

How much a review is worth is set by the prompt

Give an AI review the same bare "review this" request every day and you'll get the same bare results. The quality of the feedback you receive is mostly a reflection of the context you put in. The master-level skill is knowing what context actually changes the output.

What you will see

Reviewing for security Goal: A system that charges customers and updates inventory. Focusing: Look for injection, secrets, untrusted input.

About 2 min of reading

Try It

Point the review at a goal and a priority

1

Tell the AI what the code is trying to do.

GOALS = { "order-processing": "A system that charges customers and updates inventory.", "log-parser": "A tool that reads log lines and counts errors.", } PRIORITIES = ["security", "speed", "clarity"] def review(goal, priority): intent = GOALS[goal] print() print("Reviewing for %s" % priority) print("Goal: %s" % intent) focus_map = { "security": "Look for injection, secrets, untrusted input.", "speed": "Look for repeated work and unnecessary copies.", "clarity": "Look for unclear names and long functions.", } print("Focusing: %s" % focus_map[priority])

Before you run it, say out loud what it will print. Then open the answer.

What it prints
GOALS = { "order-processing": "A system that charges customers and updates inventory.", "log-parser": "A tool that reads log lines and counts errors.", } PRIORITIES = ["security", "speed", "clarity"] def review(goal, priority): intent = GOALS[goal] print() print("Reviewing for %s" % priority) print("Goal: %s" % intent) focus_map = { "security": "Look for injection, secrets, untrusted input.", "speed": "Look for repeated work and unnecessary copies.", "clarity": "Look for unclear names and long functions.", } print("Focusing: %s" % focus_map[priority])
Without the goal, the review only sees the surface it can show.
2

Set which priority matters most and run the review.

review("order-processing", "security")

Before you run it, say out loud what it will print. Then open the answer.

What it prints
Reviewing for security Goal: A system that charges customers and updates inventory. Focusing: Look for injection, secrets, untrusted input.

Data Flow

Add a goal and priorities to your prompt, then the AI returns focused, expert-level feedback.
1 State the goal
↓
2 Name your priorities
↓
3 Share the code
↓
4 Get focused notes
Why this works
Share the goal

Tell the AI what the code is trying to do. Without the goal, it reviews only the surface it can see, and misses the things that matter for your specific purpose.

Name the priorities

Tell it whether security, speed, or clarity matters most right now. The AI channels its effort toward whichever you put first, which is exactly what you want when you're trying to fix a specific problem.

Examples

The difference one line of context makes

Weak: "Review this."
Strong: "Review this Python function for security, speed, and clarity. It's part of a public web API used by 10,000 people."

The weak version tells the AI nothing to weigh its judgment against, so it treats every issue as equally minor. The strong version tells it the stakes -- a bug here affects more people than a typo in a private script. Suddenly the AI starts sorting its own findings by severity before it even talks to you.

Telling it the environment it has to survive

Weak: "Review this function."
Strong: "Review this for memory leaks. It runs on a mobile device with very limited RAM."

def parse(data):
    buffer = allocate(len(data))
    return buffer

On a desktop this allocation is nothing. On a phone with tight memory it's the difference between an app that holds up and one that gets killed mid-task. Constraints focus the AI. Telling it the real limits makes it hunt for the problems that actually hurt you, not the generic ones it could spot anywhere.

Showing it the report format you want

Strong: "Review this and reply as a short list: issue, severity, fix. Like this:"
  - line 12: null risk, high, add a check

Your report:
  - line 12: null risk, high, add a check
  - line 30: naming, low, rename

If you don't specify a format, every review looks slightly different, and triaging them takes more effort. Show the AI the shape you want, and its output lines up -- easy to sort, easy to assign, easy to act on.

Words this lesson uses

Each one is defined here on this site. Open the entry for the full definition and the other words it points at.

← Style that reads years from now
Previous Lesson
Style that reads years from now
Next Lesson
Making review happen on every push
Making review happen on every push →