Esc

Giving a model a role and constraints

How naming the audience, the format and the exclusions turns unpredictable answers into repeatable ones.

AI Place Hub 55

A role is not decoration. Act as a senior engineer changes the answer because it changes the standard the model measures itself against: what is worth mentioning, what can be assumed, which register to write in.

Roles that do work

A useful role names a standard. A job title alone does not. A senior engineer on this codebase implies familiarity and raises the bar for what counts as a finding. A copy editor with a light touch says how much to change. A teacher explaining to a beginner fixes the assumed knowledge.

You are a world-class expert does none of that. It names no standard, so all it changes is the confidence of the tone, the one thing you did not want turned up.

Constraints are exclusions

The clause that improves an answer most is usually the one saying what to leave out. Skip style opinions. No installation instructions. Do not explain language basics.

This works because the default answer is the average of everything written on the topic, and most of that average you already know. Cut it and the rest becomes readable.

Name the output shape

Say the length, the structure, and what each section holds. Three sections: decisions, actions, open questions is a shape. A summary is not.

If the shape is unusual, show it. One worked example, covered under few-shot-prompting, removes more ambiguity than a paragraph of description.

Leave an escape hatch

Every list of constraints needs one line for when they cannot be met: if the diff is fine, say so in one line. If a field is missing, set it to null. If the schema does not cover this, ask instead of writing a query.

Leave it out and the model meets the shape you demanded by inventing content to fill it. That one line separates a prompt you can run unattended from one you must check every time.

Try it

Open the code review prompt and read it as four decisions. The role sets the bar, the filter defines a finding, the format makes it usable and the escape hatch allows silence. Every prompt in the library is built the same way.

For information only, not professional advice. You use it at your own risk and we are not liable for any loss or damage. See the disclaimer.

Fork

Did this work for you?

Sign in to flag it

Related