Prompt Framework
The gap between a disappointing AI output and a genuinely useful one is rarely about the model. It is almost always about the prompt. Prompt engineering is the skill of writing instructions that get AI tools to produce the results you actually need, and it takes minutes to learn the fundamentals.
✨ Quick Summary: Learn the 5 core elements of effective prompts — Role, Context, Task, Format, and Constraints — with before/after examples and a reusable framework you can apply immediately.
This guide covers the five core elements every effective prompt needs, shows you exactly how each element transforms output quality with before-and-after examples, and gives you a reusable framework for writing prompts on any topic.
What Prompt Engineering Actually Is
Prompt engineering is the practice of structuring your input to an AI model so that the output matches your intent. Think of it as the difference between telling a new employee “handle the report” versus “create a one-page summary of Q1 sales data, comparing revenue against our $2M target, formatted as bullet points with a chart recommendation.”
Both instructions technically ask for the same thing. The second one produces useful work on the first try.
Every major AI model, from GPT-4o to Claude to Gemini, processes your prompt as its only source of understanding about what you want. The model has no access to your thoughts, priorities, or quality standards unless you state them. Prompt engineering is how you state them clearly.
This matters because a well-written prompt saves you from the most common AI workflow problem: generating output, reading it, realizing it missed the point, rewriting the prompt, generating again, and repeating three more times. A strong prompt gets you 80-90% of the way there on the first attempt.
The 5 Core Elements of an Effective Prompt
Every effective prompt is built from some combination of these five elements. You do not need all five every time, but knowing them lets you diagnose why a prompt is underperforming and fix it.
1. Role
Tell the AI who it should be when responding. This sets the expertise level, vocabulary, and perspective of the output.
Before (no role):
Explain blockchain.
Output: A generic Wikipedia-style overview that tries to cover everything and satisfies nobody.
After (with role):
You are a fintech consultant explaining blockchain to a small business owner who has never used cryptocurrency. Explain what blockchain is and why it might matter for their supply chain tracking.
Output: A focused explanation using business language, relevant use cases, and no unnecessary technical depth.
The role element works because it constrains the model’s response space. Instead of drawing from everything it knows about blockchain, it filters for the perspective and vocabulary that a fintech consultant would use with a non-technical audience.
2. Context
Provide the background information the AI needs to give a relevant answer. Context includes your situation, audience, constraints, and any details that shape what “good” looks like.
Before (no context):
Write a marketing email.
Output: A bland, generic template that could be for any product, any audience, any occasion.
After (with context):
Write a marketing email for our SaaS project management tool aimed at remote teams of 10-50 people. We are running a 20% discount for annual plans this month. Our main competitor is Asana, and our differentiator is built-in async video messaging. The email is going to existing free-tier users.
Output: A targeted email that speaks to remote team pain points, highlights the specific differentiator, and frames the discount as an upgrade incentive for people already using the product.
Context is often the element people skip because it feels like extra work. In practice, spending 30 seconds adding context saves 5 minutes of back-and-forth revisions.
3. Task
State exactly what you want the AI to do. Be specific about the action and the deliverable.
Before (vague task):
Help me with my resume.
Output: Generic resume tips or an offer to help without actually doing anything concrete.
After (specific task):
Rewrite the bullet points under my "Senior Developer" role to emphasize leadership and cross-team collaboration instead of individual technical contributions. Here are the current bullets: [paste bullets].
Output: Rewritten bullets that directly address what you asked, focusing on the exact shift in emphasis you need.
A clear task answers three questions: What action should the AI take? What is the input? What does the output look like?
4. Format
Specify how you want the output structured. Tables, bullet points, numbered lists, code blocks, specific lengths, and section headers all count as format instructions.
Before (no format):
Give me information about the best programming languages for data science.
Output: A 500-word essay that buries the useful comparisons inside paragraphs.
After (with format):
Compare the top 5 programming languages for data science in a table. Columns: Language, Best For, Learning Curve (1-5), Job Market Demand (1-5), Key Libraries. Below the table, write a 2-sentence recommendation for a beginner.
Output: A scannable table followed by a clear recommendation. Information is instantly usable.
Format instructions are especially powerful because they force the model to organize its knowledge into the structure you can actually work with, whether that is a table for a presentation, bullet points for a Slack message, or a numbered list for documentation.
5. Constraints
Set boundaries on what the AI should and should not do. Constraints include word limits, topics to avoid, tone requirements, and things to exclude.
Before (no constraints):
Write a blog post about remote work.
Output: A 1,000-word post that covers everything from productivity tips to loneliness to coworking spaces. Unfocused and too long.
After (with constraints):
Write a blog post about remote work productivity. Under 600 words. Focus only on async communication practices.
Do not mention video calls or coworking spaces. Tone: practical, no motivational fluff. Target reader: engineering team lead.
Output: A tight, focused post that stays on-topic and matches the word count. Ready to publish with minimal editing.
Constraints prevent the model from going broad when you need it to go deep. They are the most underused element in beginner prompts.
💡 Pro Tip: Spending 30 seconds adding context to your prompt saves 5 minutes of back-and-forth revisions. Context is the most underused element in beginner prompts.
Common Prompt Mistakes and How to Fix Them
These five patterns cause the majority of underwhelming AI outputs:
| Mistake | What Happens | Fix |
|---|---|---|
| Too vague | ”Write something about marketing” | Specify the topic, audience, format, and length |
| Too many tasks in one prompt | Output does everything poorly | Split into separate prompts, chain the results |
| No examples provided | Model guesses at your desired style | Add 1-2 examples of what good output looks like |
| Ignoring the output and starting over | Wasted context and tokens | Use follow-up messages to refine: “Make it shorter” or “Add more data” |
| Assuming the AI knows your context | Generic, irrelevant results | State your industry, audience, and situation explicitly |
The single most impactful fix for most beginners is adding specificity. Every adjective, number, and named detail you include pushes the output closer to what you actually need.
Quick-Reference Cheat Sheet
Keep this table handy when writing prompts:
| Element | Question It Answers | Example Phrase |
|---|---|---|
| Role | Who should the AI be? | ”You are a senior UX designer…” |
| Context | What is the situation? | ”I’m launching a B2B SaaS product for HR teams…” |
| Task | What exactly should it do? | ”Write 5 subject lines for our product launch email…” |
| Format | How should the output look? | ”Present as a table with 4 columns…” |
| Constraints | What are the boundaries? | ”Under 200 words, avoid jargon, formal tone…” |
Combining them in one prompt:
You are a senior UX designer [ROLE] reviewing a mobile app onboarding flow [CONTEXT]. Identify the top 3 usability issues [TASK] and present each as: Issue, Why It Matters, Suggested Fix in a numbered list [FORMAT]. Keep each issue description under 50 words and focus only on the first-time user experience [CONSTRAINTS].
This combined prompt will consistently produce focused, actionable output because every element is doing its job.
Temperature and Token Settings: A Brief Primer
Two settings affect how AI models generate output, and understanding them helps you troubleshoot unexpected results.
Temperature controls randomness. It typically ranges from 0 to 2:
- 0.0 to 0.3: Deterministic and focused. Best for factual tasks, code generation, data extraction, and anything where consistency matters. The model picks the most probable words.
- 0.4 to 0.7: Balanced. Good for most business writing, emails, and general content. Some variety without going off-track.
- 0.8 to 1.2: Creative and varied. Better for brainstorming, fiction, ad copy variations, and tasks where you want unexpected ideas.
- Above 1.2: Increasingly random. Outputs may become incoherent. Rarely useful in practice.
If ChatGPT gives you the same answer every time and you want more variety, raise the temperature. If it gives you wildly different (and sometimes wrong) answers each time, lower it.
Max tokens controls the length of the response. One token is roughly 0.75 English words. If your output gets cut off mid-sentence, the response hit the token limit. Set it higher for longer outputs, or explicitly state your desired length in the prompt itself (which is usually more reliable).
Most users will never need to adjust these settings directly, since specifying output length and creativity level in the prompt text itself (“be creative” or “keep it factual and concise”) achieves similar results. But knowing they exist helps when the default behavior does not match your expectations.
⚠️ Important: If your AI output keeps missing the mark, the fix is almost always more specificity. Every adjective, number, and named detail pushes the output closer to what you need.
The 5-Step Framework for Writing Any Prompt
Use this sequence every time you write a prompt from scratch. It takes about 60 seconds once you have practiced it a few times.
Step 1: Define the Output
Start from the end. What do you want to have when ChatGPT finishes responding? A table?
An email draft? A list of ideas? A code snippet? Name the specific deliverable before writing anything else.
Example: “I need a comparison table of 4 project management tools.”
Step 2: Assign a Role
Decide whose perspective produces the best version of that output. A product manager?
A technical writer? A marketing strategist? Add it to the prompt opening.
Example: “You are a project management consultant who advises startup CTOs.”
Step 3: Add Critical Context
What does the AI need to know about your situation to make the output relevant? Include your audience, industry, constraints, and any specific requirements.
Example: “The team is 15 engineers, fully remote, currently using spreadsheets. Budget: under $20/user/month.”
Step 4: Specify Format and Length
Tell the AI exactly how to structure the output. Tables, headers, bullet points, word counts, and section breakdowns all belong here.
Example: “Create a table with columns: Tool Name, Price per User, Key Feature for Remote Teams, Limitation, Your Rating (1-5). Below the table, write a 3-sentence recommendation.”
Step 5: Set Constraints
Add what to include, what to exclude, and any quality requirements. This is where you prevent the model from going off-track.
Example: “Only include tools with free tiers. Do not include Jira. Keep the recommendation under 50 words.”
The assembled prompt:
You are a project management consultant who advises startup CTOs. A team of 15 fully remote engineers is currently using spreadsheets and needs a project management tool under $20/user/month. Create a comparison table with columns: Tool Name, Price per User, Key Feature for Remote Teams, Limitation, Your Rating (1-5).
Only include tools with free tiers. Do not include Jira. Below the table, write a recommendation under 50 words.
This prompt will produce a directly usable comparison on the first try. No back and forth, no vague results, no “that’s not what I meant.”
What to Do Next
You now have a working framework for writing prompts that produce useful output on the first attempt. The fastest way to internalize it is to take one task you do this week, whether it is writing an email, summarizing a meeting, or researching a topic, and run it through the 5-step framework before typing it into ChatGPT.
Compare the output against what you would have gotten with your usual approach. The difference is where prompt engineering earns its value.
The core principle stays the same regardless of which AI model you use or how the technology evolves: the more precisely you describe what you want, the closer the output matches your intent. Everything in this guide is a structured way of achieving that precision.
References
- OpenAI. “Prompt Engineering Guide.”
- Google. “Introduction to Prompt Design.”
- Wikipedia. “Prompt Engineering.”