The difference between someone who gets mediocre AI outputs and someone who gets jaw-dropping results almost always comes down to one skill: how they write their prompts.
It's not about having a better model. It's not about some secret API trick. People using the exact same AI — same model, same temperature, same everything — get wildly different results based on a few prompt engineering techniques that take minutes to learn.
This guide breaks down how to write AI prompts that actually work, covering frameworks you can use across every major model, examples for real tasks, mistakes that silently kill your output quality, and advanced techniques most people never try.

Key Takeaways
- Be specific, not vague. The #1 prompt engineering mistake is asking for "something good" instead of defining exactly what good means.
- Use frameworks. Structured prompts like RTF, RISEN, and Chain-of-Thought consistently outperform freeform requests.
- Every model responds to the same core principles. Whether you're using GPT-4, Claude, Gemini, or Llama, the fundamentals of how to write AI prompts stay the same.
- Iterate, don't regenerate. Refining a 70% answer is faster than starting from zero.
- Advanced techniques like few-shot examples and role assignment unlock capabilities most users never see.
What Is Prompt Engineering?
Prompt engineering is the practice of structuring your instructions to an AI model so it produces the most useful, accurate, and relevant output possible. Think of it as the difference between asking a new employee "make this better" versus handing them a detailed brief with examples, constraints, and success criteria.
Every AI model — GPT-4, Claude, Gemini, Llama, Mistral — processes your prompt as its entire understanding of what you want. There's no mind-reading. No context carried over from your last session (unless you're using memory features). Your prompt is the whole picture.
Bottom line: The quality of your output is directly proportional to the quality of your input. Prompt engineering is the skill that bridges that gap.
The Anatomy of an Effective AI Prompt
Before diving into frameworks, here's what every strong prompt contains:
| Component | What It Does | Example |
|---|---|---|
| Role | Tells the AI who to be | "You are a senior data analyst" |
| Task | Defines what to do | "Analyze this CSV and find trends" |
| Context | Provides background | "This is Q1 sales data for a SaaS startup" |
| Format | Specifies output shape | "Return a bulleted summary with top 3 insights" |
| Constraints | Sets boundaries | "Keep it under 200 words. No jargon." |
| Examples | Shows what good looks like | "Here's an example of the tone I want..." |
You don't need all six in every prompt. But the more of these you include, the better your results will be.
5 Proven Prompt Engineering Frameworks
1. RTF (Role, Task, Format)
The simplest framework that works. Assign a role, describe the task, specify the format.
Role: You are an experienced technical writer.
Task: Rewrite this error message so a non-technical user can understand it.
Format: One sentence, under 15 words, friendly tone.
Best for: Quick tasks where you need a specific output style.
2. RISEN (Role, Instructions, Steps, End Goal, Narrowing)
A more detailed framework for complex tasks.
Role: You are a product manager at a B2B SaaS company.
Instructions: Create a PRD for a new onboarding flow.
Steps: 1) Define the problem 2) List user stories 3) Outline MVP features 4) Define success metrics
End Goal: A document I can share with engineering this week.
Narrowing: Focus only on self-serve users, not enterprise.
Best for: Multi-step deliverables like documents, strategies, or plans.
3. Chain-of-Thought (CoT)
Instead of asking for the answer directly, ask the model to reason through the problem step by step.
A company's revenue grew 15% year-over-year, but profit margins
dropped from 22% to 18%. Walk through what could cause this,
step by step, then give me the three most likely explanations.
Best for: Analysis, math problems, debugging, anything requiring logic.
4. Few-Shot Prompting
Give the model 2-3 examples of the input-output pattern you want, then ask it to continue.
Convert these feature descriptions into user stories:
Feature: Dark mode toggle
User Story: As a user, I want to switch between light and dark themes so I can reduce eye strain at night.
Feature: Export to PDF
User Story: As a user, I want to export my reports as PDFs so I can share them with stakeholders who don't have app access.
Feature: Bulk tag editing
User Story:
Best for: Formatting consistency, style matching, pattern-based tasks.
5. Constraint-First Prompting
Lead with the rules before giving the task. This prevents the model from producing something you'll have to fix later.
Constraints:
- Maximum 100 words
- No buzzwords or jargon
- Written at an 8th-grade reading level
- Must include a specific call-to-action
Task: Write a product description for a wireless noise-cancelling
headphone aimed at remote workers.
Best for: Content with strict brand guidelines, word limits, or compliance requirements.
How to Write AI Prompts for Different Tasks
The same prompt engineering principles apply everywhere, but the specific approach shifts depending on what you're building.
Writing and Content Creation
Write a LinkedIn post about the ROI of investing in employee training.
Tone: Conversational, not corporate. Like talking to a colleague over coffee.
Length: 150-200 words.
Structure: Hook (first line grabs attention) → short personal story →
one data point → takeaway.
End with a question to drive comments.
Coding and Debugging
I'm getting a "TypeError: Cannot read properties of undefined" in my
React component. Here's the component code:
[paste code]
1. Explain what's causing this error.
2. Show me the fixed code.
3. Explain what you changed and why.
4. Tell me how to prevent this pattern in the future.
Research and Analysis
Compare PostgreSQL vs. MongoDB for a real-time analytics dashboard
that processes 10M events per day.
Evaluate on: query performance, scalability, operational complexity,
and cost at our scale.
Format: Comparison table first, then a 3-paragraph recommendation.
Assume a team of 2 backend engineers.
Email and Communication
Draft a follow-up email to a prospect who attended our demo last
Tuesday but hasn't responded.
Context: They're a VP of Engineering at a mid-size fintech.
Main concern was integration time.
Tone: Helpful, zero pressure. Reference a specific pain point
they mentioned (slow onboarding for new developers).
Length: Under 120 words.
Common Prompt Engineering Mistakes (And How to Fix Them)
Mistake 1: Being Too Vague
Bad: "Write something about marketing." Fixed: "Write a 500-word blog introduction about why B2B SaaS companies should invest in content marketing over paid ads in 2025. Include one statistic."
Mistake 2: Not Specifying the Format
Without format instructions, the model guesses. Sometimes you get a list when you wanted prose. Sometimes you get 1,000 words when you needed 100.
Always include: word count, structure (bullets vs. paragraphs), headers, and any specific elements you need.
Mistake 3: Asking for Too Much at Once
Prompts that try to accomplish five things in one shot usually do all five poorly. Break complex tasks into sequential prompts where each one builds on the last.
Mistake 4: Forgetting the Audience
The model writes differently for "explain machine learning to a CEO" versus "explain machine learning to a PhD student." If you don't specify who the output is for, you'll get a generic middle-ground that serves nobody well.
Mistake 5: Not Iterating
Your first prompt rarely produces a perfect result. The real skill in prompt engineering is refining:
- "Make the tone more direct"
- "Cut the second paragraph — it's redundant"
- "Add a concrete example in the introduction"
- "Rewrite this for someone who has never used the product"
Iteration is not failure. It's the process.
Advanced Prompt Engineering Techniques
System Prompts and Personas
Most platforms let you set a system-level instruction that persists across the conversation. This is where you define the AI's persona, rules, and defaults.
System prompt: You are a senior software architect with 15 years
of experience in distributed systems. You give concise, opinionated
answers. You always consider scalability, security, and
maintainability. When you don't know something, you say so.
Platforms like ZeroTwo let you set custom system prompts across multiple frontier models — so you can test the same persona against Claude, GPT-4, and Gemini to see which produces the best output for your use case.
Mega-Prompts
A mega-prompt bundles role, context, constraints, steps, examples, and output format into a single comprehensive instruction. These work well for tasks you'll repeat.
You are a conversion copywriter. I'll give you a product name and
target audience. You'll produce:
1. Three headline options (under 10 words each)
2. One paragraph of body copy (under 80 words)
3. A CTA button label (2-4 words)
Rules:
- No exclamation marks
- Focus on outcomes, not features
- Use second person ("you")
Example:
Product: Project management app for freelancers
Audience: Solo consultants
Headlines: ...
Self-Critique Prompting
Ask the model to evaluate and improve its own output.
Write a product launch email. Then critique your own draft:
what's weak? What could be clearer? Rewrite it based on
your critique.
This technique often produces noticeably better results than a single pass because it forces the model to engage in self-reflection.
Tree-of-Thought Prompting
Instead of one reasoning path, ask the model to explore multiple approaches and pick the best one.
I need a pricing strategy for a new developer tool.
Generate three different pricing models, list the pros
and cons of each, then recommend the best one for a
bootstrapped startup targeting individual developers.
How to Write AI Prompts That Work Across Models
One of the most common questions is whether prompts need to be rewritten for each model. Short answer: no. The core principles of prompt engineering are universal.
That said, models have different strengths:
| Model | Strengths | Prompt Tip |
|---|---|---|
| GPT-4 | Creative writing, broad knowledge | Give more creative freedom; it handles ambiguity well |
| Claude | Long documents, nuanced analysis, safety | Provide detailed context; it excels with thorough instructions |
| Gemini | Multimodal, Google integration | Leverage its ability to process images and structured data |
| Llama/Open Source | Customization, privacy | Be more explicit with instructions; less assumed context |
If you're regularly working across multiple models, using a platform like ZeroTwo that gives you access to multiple frontier models in one place lets you test the same prompt across different models and find which one handles your specific task best — without juggling separate subscriptions.
Quick-Reference Prompt Templates
Copy, customize, and use these immediately:
Content Brief:
Write a [content type] about [topic] for [audience].
Tone: [tone]. Length: [word count]. Include: [specific elements].
Avoid: [things to exclude].
Code Review:
Review this [language] code for: bugs, performance issues,
security vulnerabilities, and readability. Suggest fixes
with explanations. [paste code]
Decision Analysis:
I'm deciding between [Option A] and [Option B] for [context].
Compare them on [criteria 1], [criteria 2], and [criteria 3].
Give me a recommendation with reasoning.
Meeting Summary:
Summarize this meeting transcript. Include: key decisions made,
action items with owners, open questions, and next steps.
Format as bullet points. [paste transcript]
Start Writing Better Prompts Today
Prompt engineering isn't about memorizing templates. It's about building a habit: before you hit enter, ask yourself whether you've given the AI enough context, constraints, and clarity to produce something useful on the first try.
Start with the RTF framework (Role, Task, Format) for simple tasks. Graduate to RISEN or Chain-of-Thought for complex ones. Test your prompts across different models to find the best fit.
The gap between average AI users and power users isn't access to better tools — it's the quality of the instructions they write. And that's a skill you can build in an afternoon.
Next steps:
- Pick one prompt framework and use it for every AI interaction this week
- Save your best prompts as templates you can reuse
- Try the same prompt on two different models and compare results
Questions about prompt engineering? Share your best prompt tips — the community learns faster when we share what works.
