How to Write a Good AI Prompt: A 5-Part Framework for Any Tool

Learn how to write a good AI prompt with five parts: role, task, context, format, and examples. Includes before-and-after prompts for everyday work tasks.

You ask an AI tool for help, and what comes back is generic, too long, or written for the wrong reader. The tool usually isn't the problem. The prompt left out information that only you have. In this article you'll learn a simple five-part framework (role, task, context, format, and examples) that works in ChatGPT, Claude, Gemini, Copilot, or whatever tool your company uses. You'll see before-and-after prompts for common work tasks and get a template you can reuse.

The five parts of a good prompt

Each major AI company publishes its own prompting advice, and they all say much the same thing. Google's guide to writing effective prompts for Gemini in Workspace is built around persona, task, context, and format. Microsoft's Copilot framework, as described in a Microsoft Press excerpt, uses goal, context, source, and expectations. Anthropic and OpenAI stress clear instructions and examples. Combine them and you get five parts:

  • Role: who you are, or who the AI should act as. For example, "I'm an office manager at a small accounting firm."
  • Task: the one thing you want done, starting with a verb. For example, "Write a reply to this client's question about our holiday office hours."
  • Context: the background the AI can't guess, such as the audience, purpose, limits, and the material to work from.
  • Format: what the result should look like, including length, structure, and tone.
  • Examples: a sample of what good looks like, when you have one.

You don't need all five every time. A quick question may need only a clear task. But when an answer disappoints you, one of these parts is often missing.

Before and after: prompts for everyday work

Here's how the framework changes three common requests. Two of them involve pasting in real work material, so read the note on sensitive information in the next section before you try them with your own emails or reports.

Replying to an upset customer

Before: Write a reply to this complaint. You'll get something polite and generic. It may apologize for things that didn't happen or promise things you can't offer.

After: customer complaint reply
I'm a customer service lead at a regional internet provider. Write a reply to the customer email pasted below.

Context: The customer was charged a late fee after an outage in our billing system. We are waiving the fee and adding a one-month service credit. The customer is frustrated but polite.

Format: Under 150 words. Warm and professional, in plain language. Acknowledge the problem in the first sentence. Address the customer as [CUSTOMER NAME]. End with: "If you have questions, call me directly at [PHONE]."

Only offer the fee waiver and the credit. Do not invent a reason for the outage.

[paste customer email here, with the name, account number, and contact details removed]

Summarizing a long report

Before: Summarize this report. This is one of the most-cited prompting mistakes: a request for "a summary" with no length, format, or focus. The AI has to guess what matters to you.

After: report summary for a meeting
I'm a finance manager preparing for a budget meeting with department heads who haven't read this report. Summarize the report below for them.

Focus on spending that is over or under budget and any risks flagged for next quarter.

Format: Five bullet points, one sentence each. Then a short list of open questions the report doesn't answer.

If the report doesn't state something, write "not stated" instead of guessing.

[paste report text here, only in a company-approved tool]

Planning a project

Google's Workspace help shows this pattern with Create project plan. as the weak version. The improved version begins "Create a project plan for the launch of a brand new product…" and adds specifics from there, so the AI knows what kind of project it's planning.

Separately, the Gemini team's prompt tips post shows how much fits in a single sentence: "I'm a project manager" (role) "and need to create a detailed project tracker" (task) "for a website redesign project" (context) "in a simple table with fields for dates, status and tasks" (format). A good prompt doesn't have to be long. It has to be complete.

How to get each part right

Role: useful, but optional

You've probably seen prompts that start with "You are an expert with 20 years' experience." Concrete instructions do more than a made-up bio, according to this breakdown of prompt anatomy. Often the most useful role is yours. "I'm a new HR coordinator" tells the AI what you already know and what you need explained.

Task: one clear verb

Anthropic recommends starting with an action verb such as "Write" or "Analyze." Google's Workspace help suggests splitting complex tasks into separate prompts. If you want a summary, a follow-up email, and a slide outline, ask for them one at a time. Each result will be better, and you can fix one without redoing the others.

Context: give it the material it needs

The AI can't read your mind or your inbox unless you give it access. Paste the relevant email, notes, or data, or point to them. In Gemini for Workspace you can type @ to pull in files. In Copilot, Microsoft's framework calls this the source: say "based on this doc" or point to specific files. Also say who will read the result and why. "For a client who's never used our software" changes the answer a lot.

Format: say what done looks like

State the length, the structure (bullets, table, email, numbered steps), and the tone. OpenAI's ChatGPT guidance suggests tone words like "formal" or "friendly." Don't assume a format either: Anthropic notes that Claude now uses less Markdown by default, so ask if you want bullets or a table.

Phrase instructions as what to do, not what to avoid. "Write in plain language for a general audience" works better than "Don't use jargon."

Examples: show, don't just tell

An example is often the fastest way to get the style you want. Anthropic says its recent models pay close attention to details and examples, so your example will be copied closely. That's helpful, but it means a sloppy example produces sloppy results. If you give several examples, format them identically and include a tricky case.

Using an example: meeting notes to action items
Turn the meeting notes below into a list of action items. Use exactly this format for each one, with nothing else:

Owner – Task – Due date

Example:
Dana – Send revised budget to finance – Friday

If a task has no clear owner or due date, write "unassigned" or "no date" in that spot.

[paste meeting notes here]

Common mistakes that weaken a prompt

  • Being vague. "Make this better" leaves the AI guessing. Say better how: shorter, friendlier, clearer for a customer.
  • Asking for too much at once. Five tasks in one prompt usually means five mediocre results. Split them up.
  • Piling on every detail up front. Start with the five parts, then add more only when the answer misses something.
  • Not leaving room for "I don't know." Tell the AI it can say it doesn't know or that the information isn't in the material. This reduces made-up answers.
  • Trusting polish. A neatly formatted answer can still rest on a wrong assumption. Check names, numbers, dates, and anything you'll send to a customer.
  • Pasting sensitive details without thinking. Strip out personal and confidential information first, and stick to approved tools.

Treat it as a conversation

Every vendor's guide gives the same advice: iterate. Your first prompt rarely gets a perfect answer, and that's fine. Stay in the same chat so the AI keeps the context you've already given it, and tell it what to change.

Follow-up prompts that refine a draft
That's close. Cut it to under 100 words and move the refund details to the first paragraph.

The tone is too stiff. Rewrite it as if you're talking to a longtime customer you like.

Good. Now give me two alternative subject lines.

You can also ask the AI to improve your prompt. Google's Workspace guide suggests letting Gemini act as your prompt editor, and Anthropic offers a prompt generator and improver in its Claude Console, a tool aimed at developers. In any assistant, you can try this:

Ask the AI to improve your prompt
Here's a prompt I plan to use. Before answering it, ask me up to five questions that would help you do this task better. Then rewrite the prompt using my answers.

[paste your prompt here]

A template you can reuse

Save this in a note or document and fill in the blanks. Delete any line you don't need.

Five-part prompt template
Role: I'm a [your job] at [type of organization]. (Or: Act as a [role].)

Task: [Verb] [what you want], for example "Draft an email" or "Summarize this report."

Context: This is for [audience]. The goal is [purpose]. Key facts: [details]. Use only the material below. If something isn't in it, say so.

Format: [length], [structure such as bullets, table, or email], [tone].

Example of what I want:
[paste a sample, if you have one]

Material:
[paste your notes, email, or data, with personal and confidential details removed]

This framework works the same way in every major assistant, so you don't have to relearn prompting when you switch tools. If you're still choosing one, see Which AI Assistant Should I Use?. If you're just getting started, How to Start Using AI at Work gives you a plan for your first week.

Questions people ask

How do you write a good AI prompt?

Cover five parts: who you are or who the AI should act as (role), what you want done (task), the background it needs (context), what the result should look like (format), and a sample if you have one (examples). Then refine the answer with follow-up requests in the same chat.

Do I need different prompts for ChatGPT, Claude, Gemini, and Copilot?

Mostly no. Google, Microsoft, OpenAI, and Anthropic all recommend the same core ideas: be specific, give context, describe the format you want, and iterate. Small differences matter, though. Gemini and Copilot can pull in your own files, and Claude may need you to ask for bullets or tables.

How long should an AI prompt be?

Long enough to include what the AI can't guess, and no longer. One sentence can be enough if it covers the task, context, and format. Start simple and add detail only when the answer misses something.

Why does AI give me generic answers?

Usually the prompt is too vague. Without an audience, purpose, length, or source material, the AI has to fall back on safe, general wording. Adding context and relevant material, with personal and confidential details removed, is the quickest fix.

Sources

  1. Google Workspace: Writing effective prompts
  2. Google blog: Gemini for Workspace prompt tips
  3. Google Workspace Help: Tips for writing prompts
  4. Microsoft Press: Prompting Microsoft 365 Copilot
  5. OpenAI Help: Prompt engineering best practices for ChatGPT
  6. Anthropic: Best practices for prompt engineering
  7. Anthropic docs: Prompting best practices for Claude
  8. DigitalOcean: Prompt engineering best practices
  9. AI Expert: Anatomy of a prompt
  10. Prompt Architects: Prompt engineering cheat sheet

Written with AI assistance and checked against the sources above. AI tools change quickly, so confirm features and prices on each vendor's site.

What did you think?

Join the conversation

Which part of a prompt makes the biggest difference in your results: role, task, context, format, or examples?

Want help putting this to work?

Promptly Taught offers hands-on AI training for people and teams, online or in person. Bring a real problem and leave with something that works.

Keep learning