How to Write Prompts That Actually Work: A Beginner’s Framework

Illustration of a person typing on a laptop with four puzzle pieces labeled Role, Context, Task, and Format combining into a document

Two people type a request into the same chatbot. The first writes “help me with my resume” and gets a page of generic advice about action verbs. The second writes four sentences: who they are, what job they want, what the resume is for, and how they want the output shaped. They get a rewrite they can actually send. Same model, same day, wildly different results. The difference is not luck. It is the prompt. Prompts are also the steering wheel behind every workflow in our AI automation guide.

A prompt is the text input that starts a conversation with a language model or triggers its response, as OpenAI’s help center defines it. Prompt engineering is simply the process of designing and improving that input so the model’s answer matches what you need. The phrase sounds technical, but the core skill is closer to briefing a colleague than to programming: you are telling a very capable, very literal assistant what you want.

This guide gives you a four-part framework you can reuse for almost any request: role, context, task, and format. It comes from the official documentation of the three biggest AI vendors, and it works in ChatGPT, Claude, and Gemini alike. Once your prompts produce good answers, the next skill is checking those answers before you trust them, which we cover in our guide to fact-checking chatbot responses.

Key takeaways

  • A prompt is just the input you give the model, and prompt engineering is the habit of improving that input. No coding required.
  • Vague prompts fail for a predictable reason: the model has to guess what you want, and its guess is shaped by the average request, not your situation.
  • Four parts cover almost every request: a role for the model, the context it cannot know, the task in specific terms, and the format you want back.
  • Showing beats telling. One short example of the output you want does more than a paragraph of description, and delimiters like triple quotes keep your instructions separate from your material.
  • Big requests work better as a sequence of small prompts, and the first answer is a draft to refine, not a verdict to accept.

Why vague prompts get vague answers

A language model does one thing: it produces the most likely continuation of your text. When your prompt is “write something about marketing,” the most likely continuation is the average of everything the model has seen about marketing, which is exactly the bland, middle-of-the-road answer that frustrates people. The model is not being lazy. It is filling the gaps you left with the most generic filler available, because nothing in your input points anywhere more specific.

Anthropic’s documentation offers the most useful mental model here: think of Claude as a brilliant new employee who has no context on your norms and workflows. A new hire with no briefing will produce work that is plausible but misaligned, not because they lack ability but because they lack your context. The more precisely you explain what you want, the better the result.

Anthropic even suggests a test you can run before sending any prompt: show it to a colleague who knows nothing about the task and ask them to follow it. If a competent human would be confused about what you want, the model will be too. Most bad prompts fail this test in the first sentence.

The four-part framework: role, context, task, format

You do not need all four parts in every prompt, and you do not need them in this order. But when an answer disappoints you, one of the four is almost always missing. Here is each part, with the official guidance behind it.

1. Role Who the model should be 2. Context Background it cannot know 3. Task What to do, in specific terms 4. Format The shape of the answer Missing part? That is usually why the answer disappointed you. 1. Role Who the model should be 2. Context Background it cannot know 3. Task What to do, in specific terms 4. Format The shape of the answer
The four-part prompt framework. You rarely need all four parts in every prompt, but a disappointing answer is almost always missing one of them.

Role: who the model should be

A role is one sentence that tells the model what perspective to answer from: “You are a patient math tutor for a 10-year-old” or “You are a direct, no-fluff copy editor.” Anthropic’s documentation notes that setting a role focuses the model’s behavior and tone for your use case, and that even a single sentence makes a difference. The role works because it narrows the range of likely continuations: a tutor explains differently than a consultant.

Keep the role relevant to the task. Asking the model to be a “world-class expert” adds nothing, because every answer then claims expertise. A role earns its place when it changes the vocabulary, the assumed audience, or the level of detail.

Context: what the model cannot know

Context is everything true about your situation that the model has no way to guess: who the output is for, why you need it, what you have already tried, any constraints like length, budget, or tools. Google’s Gemini documentation puts it plainly: the more context you give, the better Gemini can understand your request and generate a useful response.

Anthropic adds a subtler point: explaining why you want something helps as much as explaining what you want. Their documentation contrasts a bare rule like “never use ellipses” with the same rule plus its reason, “your response will be read aloud by a text-to-speech engine that cannot pronounce them.” The version with the reason generalizes better, because the model can apply the underlying goal to cases your rule did not mention.

Task: what to do, in specific terms

The task is the verb of your prompt, and specificity is everything. OpenAI’s best practices say to be as specific and descriptive as possible about the desired context, outcome, length, format, and style, and to avoid ambiguity. Compare “summarize this article” with “summarize this article in three bullet points, each under 20 words, for a reader who has not opened it.” The second version can fail in only a few ways; the first can fail in hundreds.

One practical habit from OpenAI’s guide: put the instruction at the beginning of the prompt, not buried at the end after your material. A task stated up front frames everything that follows.

Format: the shape of the answer

Format is the part beginners skip most often, and it is the cheapest win. If you want a table, say “as a table with columns for X and Y.” If you want an email, say so, with a subject line. OpenAI’s documentation recommends describing the desired output format explicitly, even down to length and style. Google’s guide shows the same pattern: “give me 12 thoughtful questions” outperforms “marketing talking points.”

Tone belongs in this part too. OpenAI’s help center suggests naming the tone directly with adjectives: formal, informal, friendly, professional, humorous, or serious. “Explain this in a friendly and engaging tone” is a complete instruction the model can follow.

Before and after: one request, four upgrades

Watch a single weak prompt gain each part. Say you run a small online bakery and want ideas for social media.

Version 1, no parts: “Give me social media post ideas.” You will get a list that could belong to any business on earth: quotes, giveaways, behind-the-scenes photos. Technically an answer, practically useless.

Version 2, add context: “I run a small online bakery in a city of about 200,000 people. Most of my customers order custom birthday cakes, and I want more weekday orders for cupcakes and cookies. Give me social media post ideas.” The ideas now orbit your actual problem: weekday orders, not engagement in the abstract.

Version 3, add role and format: “You are a social media manager who works with small food businesses. I run a small online bakery in a city of about 200,000 people. Most of my customers order custom birthday cakes, and I want more weekday orders for cupcakes and cookies. Give me 10 Instagram post ideas as a table with two columns: the post concept, and the caption’s first line.” Now you have a usable artifact instead of a brainstorm.

Version 4, add the task’s edges: keep everything from version 3 and append: “Avoid generic ideas like quotes or giveaways. At least three ideas should work without new photography, using only pictures I already take of cakes in progress.” The edges, meaning what to avoid and what constraints apply, are where a decent prompt becomes a good one.

Four moves that level up any prompt

The framework fixes most weak prompts. These four techniques, all drawn from the official guides, handle most of what remains.

Show the output you want with one example

Examples are the strongest steering tool you have. OpenAI recommends articulating the desired format through examples, because models respond better when shown the shape rather than told about it. Anthropic agrees, calling a few well-crafted examples one of the most reliable ways to steer format, tone, and structure, and suggesting three to five examples for the best results.

In practice: if you want product descriptions in a particular style, paste one description you love and say “write five more in exactly this style.” One good example replaces paragraphs of abstract description like “punchy but warm.”

Separate your instructions from your material

When your prompt includes text for the model to work on, mark the boundary clearly. OpenAI suggests putting instructions at the beginning and using separators like triple quotes or hash marks around the material: Summarize the text below, then Text: “”” followed by the actual text and closing quotes. Anthropic’s equivalent advice is to wrap each type of content in consistent, descriptive XML-style tags.

The reason is simple: a model reads your prompt as one continuous stream. Without a clear boundary, a sentence inside your material can be mistaken for a new instruction, and your actual instruction can be mistaken for content to summarize.

Split big requests into a sequence of small prompts

Google’s Gemini guidance lists this directly: break down complex tasks into separate prompts. A request like “plan my product launch” bundles research, writing, scheduling, and budgeting into one blob, and the answer will be shallow in all of them. A sequence, such as “list the tasks a small online shop needs for a launch,” then “turn the first five into a two-week schedule,” then “draft the announcement email,” produces depth at each step because every prompt has one job.

Treat the first answer as a draft

OpenAI’s help center describes prompt engineering as iterative: start with an initial prompt, review the response, then refine by adjusting wording, adding context, or simplifying the request. The people who get the most from chatbots are not writing perfect first prompts. They are having short, directed follow-ups: “shorter,” “more concrete,” “drop the third idea and expand the fifth.”

A follow-up costs seconds and keeps the conversation’s full context. Rewriting your prompt from scratch throws that context away. Refine first; restart only when the direction itself was wrong.

What the official guides agree on

ChatGPT, Claude, and Gemini compete, but their prompting documentation converges on the same short list. The table below compresses each vendor’s official guidance into the rule you can use today.

Source What it emphasizes A rule you can use today
OpenAI (ChatGPT) Clear, specific, unambiguous prompts; instructions first; desired context, outcome, length, format, and style spelled out; refine iteratively State the task at the start, name the format and tone, then improve the answer with short follow-ups instead of rewriting from zero
Anthropic (Claude) Clear, direct, explicit instructions; context including the reason behind rules; well-crafted examples; roles; structured prompts Brief the model like a brilliant new employee, and add why you want something, not just what you want
Google (Gemini) Natural language; clear and concise requests; rich context; specific, relevant keywords; complex tasks broken into separate prompts Write to the model like a colleague, and split any request that contains the word “and” into two prompts

Notice what is absent from all three: magic words, politeness formulas, and secret syntax. The vendors do not ask you to flatter their models. They ask you to be specific, give context, show examples, and iterate.

Common mistakes beginners make

Writing prompts like search queries. “Resume tips” works in Google because search returns pages for you to judge. A chatbot must generate one answer, so it needs the details a search engine never asked for. Write in full sentences, as Google’s guide puts it, the way you would talk to a colleague.

Bundling three tasks into one prompt. “Research my competitors, write my tagline, and plan my content calendar” guarantees three shallow answers. One prompt, one job, then continue the conversation.

Accepting the first answer as final. The first response is a draft. The gap between “usable” and “good” is usually one follow-up: name what is wrong and ask for the fix.

Describing the style instead of showing it. Abstract adjectives like “professional yet fun” mean different things to everyone, including the model. Paste a sample of what you like and ask for more of exactly that.

Blaming the model for a missing part. When an answer disappoints, check the framework before you retry: did you give a role, context, a specific task, and a format? The missing part is usually the fix, not a different chatbot.

Writing prompts: quick answers

Do I need to learn “prompt engineering” as a technical skill?

For everyday use, no. OpenAI defines prompt engineering as designing and refining your input to guide the model’s responses, and everything a beginner needs fits the four parts in this guide. Advanced techniques exist for developers building on APIs, but clarity and context carry most of the value.

Should I be polite to the chatbot?

Politeness does no harm, but none of the official guides list it as a performance factor. Clarity outperforms courtesy: “please” is optional, specific is not.

Is there one perfect prompt template?

No. OpenAI’s own best practices note that the formats they present work well but that you should feel free to explore others that fit your task better. Treat the framework as a checklist, not a script.

Why does the same prompt give different answers on different days?

Language models generate fresh text each time rather than retrieving a stored answer, and the vendors update their models regularly. OpenAI even recommends using the latest model because newer ones tend to be easier to prompt. Save prompts that work well so you can reuse and adapt them.

Sources

  • OpenAI Help Center, “Prompt engineering best practices for ChatGPT” – definitions of prompt and prompt engineering, the advice to be clear and specific, tone adjectives, and iterative refinement: https://help.openai.com/en/articles/10032626-prompt-engineering-best-practices-for-chatgpt
  • OpenAI Help Center, “Best practices for prompt engineering with the OpenAI API” – instructions first with separators, specificity about context and format, articulating format through examples, and the recommendation to use the latest model: https://help.openai.com/en/articles/6654000-prompt-engineering
  • Anthropic, “Prompting best practices” – the brilliant-new-employee framing, the colleague test, context with motivation, examples (three to five), structure, and role prompting: https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices
  • Google Workspace Learning Center, “Tips to write prompts for Gemini” – natural language, clear and concise requests, context, specific keywords, and breaking complex tasks into separate prompts: https://support.google.com/a/users/answer/14200040?hl=en

Similar Posts

4 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *