
Prompt Structure: Role, Context, Format, and Rules
A prompt is a brief. The model cannot see the document on your desk, the audience you have in mind, or the format your editor requires. It can only work from what you write. Most disappointing answers are not a failure of intelligence; they are a failure of briefing.
The AI Prompt Optimizer turns a rough request into a structured brief. The structure below explains what each part is for, so you can check the result rather than accepting it on faith.
Quick answer
Give the model a role, a task, the context that changes the answer, and the rules that must not be broken. Then state the output format. Put the most important instruction near the top, repeat a easily missed constraint at the end, and keep the whole brief specific enough that a competent colleague could follow it.
Role: what it changes and what it does not
A role sets the perspective and the kind of language the model should use. “You are a copy editor” produces a different answer from “You are a product manager”, even when the task is the same. The role is useful because it narrows the space of plausible answers.
It does not give the model specialist knowledge it does not have, and it does not make an answer authoritative. A model told to act as a lawyer will still produce text that needs a lawyer to check it. Use a role to set tone and priorities, not to borrow credentials.
Task and context
State the task in one sentence with a verb: summarise, compare, rewrite, extract, classify, draft. Then add the context that would change the answer: who will read it, what they already know, what decision it supports, and what material the model may use.
If the answer must come only from supplied notes, say so: “Use only the notes below. If they do not cover a point, say the notes do not cover it.” Without that instruction, a model may fill gaps with plausible general knowledge. That is useful for brainstorming and dangerous for a factual summary.
Rules and constraints
Rules are the boundaries: length, tone, things to avoid, facts that must not change, and format requirements. Good rules are testable. “Make it engaging” is not testable. “Use no more than 120 words and do not use exclamation marks” is.
Put the rules that matter most near the top. If a rule is easy to overlook, repeat it at the end in a short checklist. Do not bury a critical constraint in the middle of a long paragraph; the model is more likely to follow a short, separate instruction.
Output format
Describe the shape of the answer: a table with named columns, a bulleted list with a maximum of five items, three paragraphs with a heading for each, or a single paragraph. If you need a specific structure, show one example. An example is often clearer than a description of the format.
For a comparison, ask for the criteria first and then the comparison. For a summary, ask for the main claim, the evidence, and the caveat. For a rewrite, ask for the new version and a short note listing what changed. The format should make the answer easy to check, not just easy to read.
A reusable template
Role: who the model is writing as. Task: one sentence with a verb. Context: reader, purpose, and source material. Rules: what must stay true and what must be avoided. Format: the exact shape of the output. Check: a final instruction to list assumptions or flag gaps.
That is the structure the AI Prompt Optimizer applies. For the general method, read How to Write a Prompt That Gets a Useful Answer. If the output is an image rather than text, the constraints are different; see How to Write Prompts for Image Generators.
Common questions
What is the most important part of a prompt?
The task and the context that changes the answer. A role and a format help, but a model cannot produce a useful answer if it does not know what it is being asked to do or who will read it. State the task with a verb and name the reader or decision it supports.
Does giving the model a role make it an expert?
No. A role sets perspective, tone, and priorities; it does not add verified knowledge or authority. A model told to act as a lawyer can still produce a plausible but wrong statement of law. Use roles to shape the answer, then check factual claims against a reliable source.
Is the prompt optimizer private?
The AI Prompt Optimizer runs in your browser, so the text you type is not uploaded by the tool. The finished prompt may later be sent to a different service with its own terms. Remove passwords, personal details, and anything you would not put in an email before pasting it anywhere.
