An AI model cannot reliably follow details that were never provided. When a request is vague, the model fills the empty spaces with assumptions: who the answer is for, how detailed it should be, which facts matter, and what format would be useful. Sometimes those guesses work. Often they do not.
Prompt engineering is the practice of reducing that unnecessary guesswork. OpenAI describes it as writing effective instructions so a model can produce results that meet your requirements. Google similarly emphasizes clear, specific instructions and examples, while Anthropic recommends defining success criteria before trying to improve a prompt. The common idea is simple: first decide what success looks like, then make that visible to the model.
The central principle
Do not make a prompt longer just to make it look advanced.
Add only the information that changes how the task should be understood, executed, or delivered.
The four-part prompt structure
A reliable starting point is to organize the request into four layers. They do not have to be labeled every time, but each one answers a question the model otherwise has to guess.
Role
What useful perspective or expertise should guide the response?
Objective
What concrete outcome must the model achieve, and for whom?
Constraints
Which facts, limits, preferences, risks, and exclusions must be respected?
Required output
What format, depth, tone, language, and completion criteria define a usable result?
1. Role: use expertise, not theatre
A role can set the working perspective: “Act as an accessibility-focused UX reviewer” is useful because it changes what the model should inspect. “Act as the greatest genius who has ever lived” adds drama but little operational value. The role should be relevant to the task and narrow enough to guide decisions.
2. Objective: describe the result, audience, and purpose
“Write a landing page” leaves major decisions open. “Write the hero section for a landing page that persuades independent designers to start a free trial” defines the deliverable, audience, and intended effect. If the task has a real-world use, say what the answer must help someone do.
3. Constraints: protect what matters
Constraints are not only restrictions. They include the facts that must remain true, details that must not be invented, required technologies, budget or length limits, accessibility requirements, and the user’s existing visual or writing preferences. Strong constraints reduce avoidable revisions.
4. Required output: define what “finished” looks like
Ask for the structure you can actually use: a table, a concise email, a complete runnable file, a prioritized action plan, or three alternatives with trade-offs. Specify depth and tone when they matter. A clear output contract helps both the model and the human evaluate whether the task is complete.
Context is different from instruction
Instructions tell the model what to do. Context supplies the material needed to do it. This distinction becomes important when you paste notes, documents, data, brand guidelines, or source text. Use headings, Markdown, or XML-style tags to separate the two. OpenAI and Google both recommend clear boundaries for complex prompts; Anthropic’s guidance also uses XML structure extensively for Claude.
“Create a website for my car wash. Make it cool.”
Role: Act as a senior web designer and frontend developer. Objective: Build a responsive website for a local car wash that helps new customers understand the services and request an appointment. Constraints: - Use the business details below; do not invent prices, reviews, or opening hours. - Clean, trustworthy visual style with blue and white. - Accessible navigation, visible focus states, and mobile-first layout. - Include light and dark themes only if both remain readable. Required output: Deliver the complete runnable website code and short setup instructions. Include a homepage, services section, appointment form with validation, and contact area. Use clear placeholders for missing business information.
The second prompt is not better merely because it is longer. It is better because every additional line changes an important decision: the audience, conversion goal, truthfulness rule, visual direction, accessibility standard, and final deliverable.
When examples improve a prompt
If formatting, tone, or classification boundaries are difficult to explain, show one or more examples of the desired input and output. This is commonly called few-shot prompting. Google recommends specific and varied examples; OpenAI notes that examples help a model learn a response pattern. Examples should be consistent with the written rules—conflicting examples can steer the model in the wrong direction.
- Use examples when the desired style is easier to demonstrate than describe.
- Include edge cases when the model repeatedly fails on the same boundary.
- Keep examples representative of the real task, not perfect but irrelevant demonstrations.
- For straightforward reasoning tasks, try a clear zero-shot instruction before adding more material.
Five prompt mistakes that waste effort
- Requesting “better” without defining better. Name the success criteria: accuracy, brevity, persuasion, completeness, or another measurable quality.
- Combining unrelated tasks. Separate complicated work into stages when one answer would have too many competing goals.
- Repeating the same instruction. Repetition adds tokens but does not necessarily add clarity.
- Demanding certainty from missing information. Tell the model to identify unknowns, use placeholders, ask questions, or cite provided sources.
- Treating one output as proof. Generative models are non-deterministic. Test important prompts with representative inputs and evaluate the pattern, not one lucky answer.
A 30-second prompt checklist
✓Is the requested outcome concrete?
✓Is the audience or use case visible?
✓Did I include only the context needed for this task?
✓Are important facts and preferences protected?
✓Did I say what the model must not invent?
✓Is the desired format and level of detail explicit?
✓Could I recognize a successful answer when I see it?
What a better prompt cannot guarantee
Prompt quality can improve direction, consistency, and usefulness. It cannot guarantee that every factual claim is correct, give a model access to information it does not have, or make the wrong model ideal for every task. Important answers still need appropriate sources, tools, testing, and human review. Sometimes the best improvement is not a longer prompt—it is better context, a different model, or a clearer definition of success.
In one sentence
A strong prompt makes the desired decision-making process and finished result visible without burying the task in unnecessary words.