How to Write Effective AI Prompts: A Practical Framework
Learn a repeatable prompt structure (role, context, task, format and constraints) plus a simple iteration loop for getting useful answers from AI tools.

Before you start
- Access to any AI chat assistant (a free account is enough)
- A real task you want help with, such as an email, summary or plan
- 10–15 minutes to test prompts and compare the results
By the end of this guide you will have a reusable five-part structure for writing prompts that works across chat assistants such as ChatGPT, Claude and Gemini. You will learn what each part does, see how a vague request becomes a precise one, and practice a simple iteration loop for improving weak answers without rewriting your whole prompt each time.
Why structure beats clever wording
Most disappointing AI answers come from missing information, not from the model. A language model only knows what it learned in training and what you put in the conversation. If you ask it to "write a product update", it has to guess the audience, the length, the tone and what the product even is. A prompt structure is simply a checklist that stops you leaving those gaps.
The framework in this guide has five parts: role, context, task, format and constraints. You will not need all five for every request (a quick factual question needs none of them), but for anything you plan to reuse, publish or send, working through the list takes a minute and saves several rounds of corrections.
Step 1: Set the role and context
The role tells the model which perspective and expertise to adopt. The context gives it the facts it cannot know: who the audience is, what has already happened and why the task matters. Of the two, context does most of the work. A role without context produces generic text in a confident voice.
Role: You are an experienced customer success manager at a B2B software company.
Context: We are changing our support hours from 24/7 to 8am-8pm Eastern Time,
Monday to Friday. Most customers are small marketing agencies in the US and Canada.
Some have complained about slow responses in the past.Step 2: State the task in one clear sentence
The task is the instruction itself. Start it with a specific verb (draft, summarize, compare, rewrite, classify, outline) and name the deliverable. "Help with an email" is a topic; "Draft an email announcing the new support hours" is a task.
If the job has several parts, number them. Models follow an explicit sequence more reliably than a paragraph that mixes several instructions together.
Task: Draft an email to all customers that:
1. Announces the new support hours and the date they start.
2. Explains the reason in one or two sentences.
3. Tells customers how to get urgent help outside those hours.Step 3: Specify the output format
Format describes what the answer should look like. Without it, you usually get the model's default, which is often longer and more heavily formatted than you need. Be concrete about:
- Length: "under 150 words" or "three bullet points" is clearer than "short".
- Structure: a subject line plus body, a table with named columns, or JSON with specific keys.
- Tone: plain and friendly, formal, or matched to an example you paste in.
- Reading level: for example, "suitable for non-technical readers".
Step 4: Add constraints and examples
Constraints are the rules the answer must respect: things to include, things to avoid and facts that must not change. They are where you prevent the most common problems, such as invented details, the wrong terminology or promises you cannot keep.
Constraints:
- Do not apologize or imply the change is negative.
- Do not mention staffing or costs.
- Use "support team", never "helpdesk".
- If you need information that is not provided above, ask me instead of guessing.Examples are the most effective constraint of all. If you have a past email whose tone you liked, paste it and say "match the tone and length of this example, but not its content". One good example usually communicates style better than a paragraph of adjectives.
Step 5: Iterate on the answer, not from scratch
Treat the first response as a draft. Rather than rewriting your prompt, tell the model specifically what to change. Targeted feedback keeps everything that already works.
- Read the response and identify the single biggest problem: wrong tone, a missing point, too long.
- Give one or two specific corrections, such as "cut the second paragraph and keep the subject line under 50 characters".
- Ask for alternatives when you are unsure what you want, for example "give me three different subject lines".
- Once the output is right, copy the improved instructions back into your saved prompt so the next run starts from the better version.
If a conversation has gone through many revisions and the model starts mixing up instructions, open a new chat and paste in your refined prompt. Long threads tend to drift.
Putting it together: a complete prompt
Here is the full prompt assembled from the steps above. Save prompts like this in a shared document so your team can reuse them with small edits.
Role: You are an experienced customer success manager at a B2B software company.
Context: We are changing our support hours from 24/7 to 8am-8pm Eastern Time,
Monday to Friday, starting December 1. Most customers are small marketing agencies
in the US and Canada. Urgent issues can still be reported through our status page.
Task: Draft an email to all customers that:
1. Announces the new support hours and the start date.
2. Explains the reason in one or two sentences (we are focusing the team on
faster, more thorough responses during working hours).
3. Tells customers how to get urgent help outside those hours.
Format: A subject line, then a plain-text email under 150 words.
Friendly, direct tone. No bullet points.
Constraints:
- Do not apologize or imply the change is negative.
- Use "support team", never "helpdesk".
- If anything above is unclear, ask me before drafting.If you would rather not assemble this by hand, our prompt generator builds a structured starting point from a few form fields. The same pattern works for other jobs too: our guide to summarizing meetings with AI includes a ready-made summary template built the same way.
Troubleshooting common prompt problems
- The answer is generic. Add context: the audience, the situation and what makes your case different. Pasting a real example helps most.
- It ignores an instruction. Move the instruction nearer the end of the prompt, make it a numbered requirement, or repeat it in your follow-up message.
- It is too long. Set a hard limit in words, sentences or bullet points rather than asking for something "concise".
- It invents facts. Supply the facts yourself, tell it to ask when information is missing, and verify anything you will publish.
- Results vary between runs. That is normal. Save the prompt version that works and compare outputs side by side before choosing one.
The fastest way to improve is to keep a small library of prompts that have worked for you, with a note on what you changed and why.
- #Prompt engineering
- #ChatGPT
- #Claude
- #Beginners
WebAIAutomation Editorial Team
Editors
Our editors test AI tools hands-on, document real workflows and keep every guide focused on practical, verifiable advice.
More guides

How to Choose the Right AI Tool for Your Work
A practical framework for choosing an AI tool: define the job, check data sensitivity, integrations and pricing, then run a structured, side-by-side trial.

How to Automate Email Follow-Ups with Zapier and AI
Build a Zapier workflow that sends a personalized follow-up email when a form is submitted or a row is added, with an optional AI step to draft the text.

How to Self-Host n8n with Docker and Docker Compose
Run n8n on your own server with the official Docker image: a quick docker run test, a Compose setup, HTTPS behind a reverse proxy, backups and updates.
Newsletter
Stay ahead of AI and automation
A concise weekly brief with new tools worth trying, practical workflows and the technology shifts that matter.