Prompt Engineering Techniques: Your Prompts Aren't the Problem—Fix It
Tired of vague AI answers? These 10 prompt engineering techniques—few-shot, chain-of-thought, role prompting—get better results from ChatGPT and Claude.
Getting mediocre results from AI? join the club. I went through a phase where I was convinced ChatGPT “just wasn’t that good” — turns out I was the problem. My prompts were lazy, vague, and expecting the AI to read my mind.
Learning to prompt well isn’t hard, but it is a skill. And like any skill, you get better by doing it, not by reading about it. That said, here are the 10 techniques that moved the needle most for me — the ones I actually use, not just the ones that sound smart in a blog post.
A Quick Confession
I used to think prompt engineering was fake. “Just talk to it normally,” I’d tell people. “It’s not that deep.”
I was wrong. The difference between a lazy prompt and a well-crafted one isn’t subtle — it’s the difference between getting a generic 500-word blob of text and getting exactly the paragraph you needed, in the right tone, with the right examples.
That said, don’t overthink it. You don’t need to memorize a framework or follow a template every time. The techniques below are tools, not rules. Use what fits.
1. Role Prompting: Give It a Persona (But Make It Specific)
This is the most overused technique in the world, and also the most misunderstood. Everyone says “act as a senior developer,” but that’s way too vague to be useful.
What doesn’t work:
You are a senior developer. Help me fix this bug.
What actually works:
You are a senior backend developer who's spent 10 years working
with Python and FastAPI. You prioritize code readability over
cleverness, and you always consider edge cases. You explain
your reasoning before showing code.
See the difference? The second one doesn’t just set a role — it sets constraints on how that role behaves. That’s what makes the output actually change.
One thing I’ve noticed: role prompting works better with Claude than with ChatGPT. Claude seems to “inhabit” the persona more deeply. ChatGPT sometimes gives you the knowledge of the role without the voice of it.
2. Few-Shot Prompting: Show, Don’t Tell (Seriously)
This one changed everything for me. Instead of describing what you want, you show examples of what “good” looks like.
I learned this the hard way when I was trying to get ChatGPT to write product descriptions for a client. I spent twenty minutes crafting the “perfect prompt” describing the tone, length, and style. The results were okay but not great.
Then I tried this instead:
Here are 3 product descriptions I like (from competitors I admire):
[PASTE DESCRIPTION 1]
[PASTE DESCRIPTION 2]
[PASTE DESCRIPTION 3]
Now write a product description for [MY PRODUCT] in the same
style. Match the sentence length, the tone, and how they handle
technical details.
The difference was… honestly, kind of scary. It matched the style so well I had to re-read to make sure I hadn’t accidentally pasted someone else’s work.
The catch: Your examples need to actually be good. If you give it three mediocre examples, you’ll get a mediocore output that matches the style of your mediocore examples. Garbage in, garbage out — even with AI.
3. Chain-of-Thought: Make It Think Out Loud
This sounds fancy but it’s dead simple: ask the AI to work through a problem step by step instead of jumping to the answer.
I use this most for anything math-related or logic-heavy. Like, I was helping my nephew with a word problem (don’t judge, I was stuck too):
Without chain-of-thought:
If a store sells shirts for $25 each, and you get 20% off
when you buy 3, and 30% off when you buy 5, what's
the cheapest way to buy 4 shirts?
ChatGPT gave me the right answer but I couldn’t tell how it got there, which meant I couldn’t explain it to a 12-year-old.
With chain-of-thought:
Think through this step by step:
1. First, calculate the cost of buying exactly 4 shirts
(no discount applies)
2. Then calculate the cost of buying 5 shirts (30% off)
3. Compare the two
4. Explain which is the better deal and why
Problem: [rest of problem]
Not only did it show its work, the explanation was actually teachable. That’s the real power of this technique — not just getting the right answer, but understanding why it’s right.
When it matters most: Math, logic puzzles, complex decision-making, code debugging (asking it to explain its reasoning before showing code), and anything where you need to verify the answer.
When it doesn’t matter: Simple factual questions (“what’s the capital of Peru”), creative tasks (you want surprise, not reasoning), and quick lookups.
4. Output Formatting: Don’t Leave It to Chance
This is such a small thing but it saves me so much time. If you want the response in a specific format, say so explicitly. Don’t hope it’ll “just know” what you want.
Vague (what I used to do):
Compare Python and JavaScript for web development.
You’ll get a wall of text. Maybe it’ll have headers. Maybe it won’t. Who knows.
Explicit (what I do now):
Compare Python and JavaScript for web development.
Format your response exactly like this:
- A 3-sentence summary at the top
- A comparison table with columns: Feature | Python | JavaScript
Include these features: Learning curve, Performance,
Job market, Frameworks, Best use case
- One paragraph recommendation: which should a beginner
learn in 2026 and why?
Every time, I get exactly what I need. No reformatting, no “actually can you put that in a table” follow-up.
One formatting trick that’s underrated: specify the length. “Write a 200-word summary” gets you something much more usable than “write a summary” (which might give you 800 words).
5. Constraint Setting: Tell It What NOT to Do
This is the technique that fixed my biggest annoyance with AI writing: the generic, over-the-top marketing voice.
Write a product description for [PRODUCT].
Rules (follow these strictly):
- No exclamation marks. Not one.
- Do not use any of these words: revolutionary, game-changing,
cutting-edge, empower, unleash, transform
- No hype. Write like you're recommending this to a friend,
not like you're selling it on a billboard
- Max 2 sentences per paragraph
- Include the price in the first paragraph
The constraints force the AI out of its default “SEO blog post” mode and into something that sounds like a person wrote it.
I also use constraints for tone control. If I want something professional but not stiff, I’ll say “write like a senior engineer explaining something to a junior colleague — respectful, but casual.”
6. Iterative Refinement: Build It Up, Don’t Sprint for the Finish
This is less of a “technique” and more of a workflow, but it’s how I actually use AI for anything substantial.
Turn 1: “Give me an outline for a blog post about [TOPIC]”
Turn 2: “Expand section 3 into a full draft. Make it conversational, around 300 words.”
Turn 3: “The second paragraph is too abstract. Replace the generic examples with specific ones — preferrably something a small business owner would recognize.”
Turn 4: “The tone in the conclusion feels too salesy. Rewrite it to sound like a genuine recommendation from someone who’s actually used this.”
Each turn builds on the last. The result is way better than what I’d get if I tried to cram all those instructions into one massive prompt.
The analogy I use: it’s like working with a designer. Your first brief gets you in the ballpark. The second round refines. The third round nails it. Don’t expect a home run on pitch one.
7. Context Priming: The AI Doesn’t Know Your Life Story
This mistake I see constantly: people asking for advice without explaining their situation. “How do I ask for a raise?” Well, that depends — how long have you been there? What’s the market rate? Did you just save the company or miss a deadline?
Without context:
Write an email asking my boss for a raise.
Good luck with that.
With context:
I've been a software engineer at a 200-person SaaS company
for 3 years. I started at $85K, now at $95K. In the
past year I led a project that saved the company about $200K
in infrastructure costs. My boss is data-driven and appreciates
metrics over feelings.
The market rate for someone with my experience in Austin
is $115-125K according to levels.fyi.
Write a concise email (under 200 words) requesting a raise
to $120K. Lead with the business impact, not how much
I need the money. Professional tone but not stiff.
The second one will give you something you can actually send. The first one gives you a generic template that might not even fit your situation.
8. Temperature Control (Without Touching Any Settings)
You can’t directly control “temperature” (randomness) in ChatGPT’s web interface — but you can steer the AI toward more factual or more creative responses just through how you prompt.
For factual, precise answers (low “temperature”):
Provide a factual summary of the causes of the 2008 financial
crisis. Stick to widely accepted historical consensus. If there's
disagreement among historians, mention that briefly. Do not
speculate. Do not offer unconventional interpretations.
For creative brainstorming (high “temperature”):
Brainstorm 20 unconventional marketing ideas for a new
coffee shop in a college town. I want weird, creative,
memorable ideas. Don't worry about feasibility right now —
we'll filter later. The wilder the better.
See what I did? The first prompt constrains creativity. The second one invites it. You’re controlling the “temperature” through instructions, not settings.
9. Self-Critique: Make It Review Its Own Work
This is a newer technique for me, but it’s genuinely useful. After the AI gives you a response, ask it to critique what it just wrote.
Review the response you just gave me. Be honest:
1. Are there any factual errors or claims that seem shaky?
2. Is anything vague that should be more specific?
3. Did you fully answer my question, or did you dodge
any part of it?
4. Rate your own response out of 10. What would make
it a 10?
Then give me an improved version.
I was skeptical of this at first — how can the AI catch its own errors? — but it actually works surprisingly well. It’s not perfect, but it’ll often spot things like “I claimed X but didn’t provide evidence” or “this section is too abstract.”
Think of it like proofreading your own writing. You’ll catch some issues, just not all of them. Still worth doing.
10. Build Prompt Templates for Repeated Tasks
If you find yourself asking the AI to do the same kind of task regularly, save a template. This has saved me hours.
Here’s my actual template for blog post outlines (I have it saved in a Notes folder):
TEMPLATE: Blog Post Outline
Topic: [INSERT]
Target audience: [INSERT]
Approximate word count: [INSERT]
Key points I want to cover: [INSERT]
Generate an outline with:
- 3 headline options (clicky but not clickbait)
- Introduction hook idea (something counterintuitive or
a specific statistic)
- 5-7 main sections, each with 2-3 bullet points
- A conclusion that includes a specific call-to-action
- 3 FAQs someone might have after reading
I probably use this template twice a week. Having it saved means I get consistent results without starting from scratch every time.
Pro tip: Keep your templates in a simple text file or note-taking app. Don’t over-engineer this — a plain text template you actually use is better than a fancy prompt library you forget exists.
Putting It All Together (A Real Example)
Here’s what these techniques look like combined — this is an actual prompt I used last month:
You are a content strategist for B2B SaaS who's good at
translating technical features into business value. (ROLE)
Here are two examples of intros I liked:
[PASTE EXAMPLE 1]
[PASTE EXAMPLE 2]
(FEW-SHOT)
Write a 150-word blog post intro about why remote engineering
teams need better async communication tools in 2026. (TASK)
Context: The audience is engineering managers at 50-200 person
companies. They're technical but busy. They don't need to be
convinced that remote work is real — they need to understand
why their current Slack+Zoom setup is costing them velocity.
Constraints:
- No "in today's rapidly evolving landscape"
- No exclamation marks
- Max 3 sentences per paragraph
- End with a question that makes the reader want to keep reading
(FORMAT + CONSTRAINTS)
Then, after you write it, review your own draft. Is it
specific enough? Would a real engineering manager recognize
their own problem in this? If not, revise. (SELF-CRITIQUE)
Is it a long prompt? Yeah. But I got exactly what I needed on the first try, which meant I didn’t waste twenty minutes going back and forth.
The Stuff Nobody Tells You
1. These techniques work better on some models than others. Claude is amazing at following complex instructions and maintaining tone. ChatGPT is better at following formatting requirements exactly. Gemini… is improving, but let’s be honest, it’s third place right now.
2. More techniques ≠ better results. Sometimes a simple, direct prompt is the right call. I don’t need chain-of-thought to ask “what’s the Python equivalent of JavaScript’s map function.” Save the fancy techniques for when the task is actually complex.
3. The AI has blind spots. It’s genuinely bad at anything requiring very recent information (even with search), anything highly subjective (“is this a good name for my startup?”), and anything that requires taste or cultural nuance. Know when to trust it and when to rely on your own judgment.
4. Prompt engineering is partly about knowing when not to use AI. If you need a legal opinion, medical advice, or financial guidance — don’t prompt-engineer your way out of talking to an actual human. The stakes are too high.
Where to Start
Don’t try to learn all 10 at once. That’s a recipe for prompt paralyis.
Pick two to start with:
- If you write a lot: Start with Role Prompting + Constraint Setting
- If you do analysis/research: Start with Chain-of-Thought + Context Priming
- If you create content: Start with Few-Shot + Output Formatting
Use those for a week. Get a feel for how they change the output. Then add another technique. It’s a skill — it builds over time.
And one last thing: the best prompt engineers I know aren’t the ones using the most complex techniques. They’re the ones who are clearest thinkers. If you can explain what you want to a human, you can explain it to an AI. The prompting is just the translation layer.
Frequently Asked Questions
What is prompt engineering?
Prompt engineering is the practice of crafting instructions for AI models to get more accurate, useful, and relevant responses. It involves techniques like providing context, examples, and specific formatting requirements.
Do I need to be a programmer to use prompt engineering?
No. Prompt engineering is about clear communication, not coding. Anyone can learn these techniques regardless of technical background.
Do these techniques work with both ChatGPT and Claude?
Yes. The techniques in this guide work with all major language models including ChatGPT, Claude, Gemini, and others.
Peng Zhou
AI Kit Guides is dedicated to helping you navigate the world of AI tools with honest, practical, and beginner-friendly content.
Tags: