Prompt Engineering for Beginners: The 6-Part Prompt Formula
Role, task, context, format, examples and constraints — a simple formula that improves answers from ChatGPT, Claude, Gemini and more.
Most bad AI output is not the model's fault. It is the result of a prompt that leaves the model guessing: who the answer is for, how long it should be, what "good" looks like. Prompt engineering is simply the habit of removing that guesswork.
This guide gives you a six-part formula that works across ChatGPT, Claude, Gemini and most other chat models, plus the mistakes that quietly ruin results.
Why prompts matter more than model choice
Large language models predict the most likely continuation of the text you give them. A vague request such as "write about marketing" has millions of plausible continuations, so the model picks a safe, generic one. A specific request narrows the space of good answers until the model has little room to drift.
In practice, rewriting a prompt usually improves output more than switching to a more expensive model.
The six-part prompt formula
You rarely need all six parts, but checking your prompt against them is the fastest way to spot what is missing.
1. Role
Tell the model who it should be. A role sets vocabulary, depth and point of view.
You are a senior tax accountant who explains things to first-time freelancers.
2. Task
State the job with a clear verb: summarize, draft, compare, rewrite, classify, brainstorm. One prompt, one main task.
Draft a checklist of the documents a freelancer needs before filing their first annual tax return.
3. Context
Give the facts the model cannot know: your audience, your constraints, what you have already tried.
The reader is based in the UK, earns under £50,000, and has never used accounting software.
4. Format
Describe the exact shape of the answer: bullet list, table, numbered steps, word count, headings, JSON.
Return a Markdown table with three columns: Document, Where to get it, Deadline.
5. Examples
One short example of the output you want is often worth a paragraph of instructions. This is called few-shot prompting.
Example row: | P60 | Your employer | 31 May |
6. Constraints
Say what to avoid and where the boundaries are.
Do not give legal advice. Keep the whole answer under 250 words. If something depends on the reader's situation, say so instead of guessing.
Putting it together
Here is the same request before and after applying the formula.
Before
Tell me about freelancer taxes.
After
You are a senior tax accountant who explains things to first-time freelancers.
Draft a checklist of the documents a freelancer needs before filing their
first annual tax return. The reader is based in the UK, earns under £50,000
and has never used accounting software.
Return a Markdown table with three columns: Document, Where to get it,
Deadline. Keep the answer under 250 words and do not give legal advice.
If something depends on the reader's situation, say so instead of guessing.
The second prompt is longer, but every sentence removes a decision the model would otherwise make for you.
Seven common prompt mistakes
- Stacking several tasks in one prompt. Split "research, outline and write" into three turns. Each step gets the model's full attention and you can correct course in between.
- Asking for "the best" without criteria. Best for whom? Cheapest, fastest, easiest to learn? Name the criteria.
- Negative-only instructions. "Don't be boring" is weaker than "use short sentences and one concrete example per paragraph."
- Hiding the important part at the end of a long paste. Put instructions before long documents, or repeat the key instruction after them.
- No output format. Without one you get whatever structure the model prefers, which changes from answer to answer.
- Accepting the first answer. Treat the first response as a draft. Follow up with "make it shorter", "add a counter-argument" or "rewrite for a 12-year-old".
- Trusting facts without checking. Models can state wrong facts confidently. Ask for sources and verify anything that matters.
Iterate, don't restart
When an answer is close but not right, reply with a precise correction instead of starting a new chat:
- "Keep the structure, but cut each bullet to one line."
- "The tone is too formal. Rewrite as if talking to a colleague."
- "Point 3 is wrong because… Please fix only that point."
The model keeps the earlier context, so small corrections are cheaper and more reliable than a brand-new prompt.
Let a generator do the first draft
Writing all six parts every time is tedious. Our free prompt generators turn a one-line idea into a structured prompt that already includes a role, clear instructions and an output format. You can then edit the draft to add your own context.
Start with the generator for the model you use, then read the model-specific guide to fine-tune the result.
Try the ChatGPT Prompt Generator
Structured prompts with role, skills and output format. Free, no sign-up.