Practical techniques, real examples, and battle-tested patterns. No fluff, no theory dumps. Just what works — whether you're using ChatGPT, Claude, Gemini, or open-source models.
Most bad AI outputs come from bad prompts, not bad models. A vague prompt like "write a blog post about AI" will get you a generic, lifeless result from even the smartest model. The same model, given a specific, well-structured prompt, can produce something genuinely good.
The good news: prompt engineering isn't magic, and it isn't a 40-hour certification course. It's a handful of habits that, once internalized, make every interaction with any AI model dramatically better.
Vague in, vague out. The model can't read your mind.
Background info, audience, format, constraints.
Treat prompts like code. Run, observe, fix, repeat.
Treating AI like a search engine. "Best CRM software" gets you a generic list. "I run a 15-person remote agency. We need a CRM that integrates with Slack, has good email tracking, and costs under $50/user/month. What are the best 3 options?" gets you a useful, tailored answer. The difference is specificity and context.
Each technique includes a bad prompt, a good prompt, and why the difference matters.
Just ask directly. No examples, no preamble. Modern models are smart enough to handle most tasks without hand-holding.
Best for: Quick tasks, straightforward questions
❌ Bad
Write something about Python decorators.
✅ Good
Write a 200-word tutorial on Python decorators for beginners. Include a simple example and explain what each part does.
Why it works: The bad prompt is vague — "write something" could mean anything. The good prompt specifies length, audience, format, and what to include.
Show the model 1-5 examples of what you want. The model picks up the pattern and applies it to your actual request.
Best for: When you need consistent formatting or style
❌ Bad
Extract the key information from this email.
✅ Good
Extract key information from emails. Email: "Hi, I can't make the 3pm meeting tomorrow. Can we reschedule?" Name: Unknown Action: Reschedule meeting Date: Tomorrow at 3pm Priority: Medium Email: "The server is down. Production is affected. This is urgent." Name: Unknown Action: Fix server Date: Now Priority: High Email: "[YOUR EMAIL HERE]" Name: ?
Why it works: By showing the model exactly what output format you want, you eliminate ambiguity. The model will follow the pattern consistently.
Ask the model to reason step by step before giving an answer. This dramatically improves accuracy on complex problems.
Best for: Math, logic, multi-step reasoning
❌ Bad
If a store offers 20% off a $150 jacket, and then an additional 15% off the discounted price, what's the final price?
✅ Good
Solve this step by step. If a store offers 20% off a $150 jacket, and then an additional 15% off the discounted price, what's the final price? Step 1: Calculate the first discount. Step 2: Calculate the second discount on the new price. Step 3: Give the final price.
Why it works: Explicitly asking for steps forces the model to show its work, which catches errors. Research shows this alone can improve accuracy by 20-40% on reasoning tasks.
Give the model a role or persona. This primes it to draw from relevant knowledge and adopt the right tone.
Best for: When you need domain-specific depth
❌ Bad
Review my startup's marketing copy.
✅ Good
You are a senior brand strategist who has worked with 50+ Series A startups. Review this marketing copy for clarity, tone, and conversion potential. Point out anything that would make a first-time visitor bounce.
Why it works: The role primes the model's knowledge base. 'Senior brand strategist' pulls in real marketing expertise and vocabulary that 'review this' simply doesn't activate.
Tell the model exactly what structure you want — JSON, table, bullet points, or a specific template. Don't leave format to chance.
Best for: When you need data in a specific format
❌ Bad
Summarize this meeting transcript.
✅ Good
Summarize this meeting transcript in the following format: ## Decisions - [Decision 1] - [Decision 2] ## Action Items | Task | Owner | Deadline | |------|-------|----------| ## Open Questions - [Question 1] Transcript: [YOUR TRANSCRIPT HERE]
Why it works: Without structure instructions, the model decides the format — and you'll get something different every time. Explicit templates guarantee consistency.
Add explicit constraints. Tell the model what NOT to do, how long to be, what tone to use. Constraints are where most prompts fail.
Best for: When you need to control length, tone, or scope
❌ Bad
Explain how HTTP works.
✅ Good
Explain how HTTP works in under 150 words. Use an analogy a 12-year-old would understand. Do not mention TCP/IP, handshakes, or packets. Focus on the request-response cycle.
Why it works: Constraints prevent the model from going off on tangents or over-explaining. 'Do not mention' is often more powerful than telling it what to do.
Structure your prompt so the model reasons about each step, takes an action (like searching or running code), observes the result, and repeats. This is the backbone of AI agents.
Best for: Multi-step tasks, tool use, agentic workflows
❌ Bad
Research the latest open-source AI models and recommend one for code generation.
✅ Good
Use the following loop to complete this task: Thought: I need to find recent benchmarks for open-source code models. Action: Search for "best open-source code models 2026 benchmarks" Observation: [results from search] Thought: I should compare the top 3 on code benchmarks specifically. Action: Search for "GLM-5.2 vs DeepSeek V4 coding benchmarks" Observation: [results] Thought: Now I can synthesize a recommendation. Action: Write final recommendation. Task: Research the latest open-source AI models and recommend one for code generation.
Why it works: ReAct turns a single prompt into an autonomous loop. Instead of asking the model to know everything upfront, it discovers information as needed. This is how real AI agents work.
Treat your prompt like code. Run it, look at the output, figure out what's wrong, and fix the prompt. Repeat until the output is right.
Best for: When your first prompt doesn't work (which is often)
❌ Bad
(Gives up after one try) The model just can't do this.
✅ Good
Attempt 1: "Summarize this article." Result: Too vague, model wrote 500 words. Attempt 2: "Summarize this article in exactly 3 bullet points, maximum 20 words each." Result: Better, but missed the key finding. Attempt 3: "Summarize this article in exactly 3 bullet points. The first bullet must state the main finding. Maximum 20 words per bullet." Result: Perfect.
Why it works: Nobody writes a perfect prompt on the first try. The difference between people who get great AI results and people who don't is that the first group iterates.
Once you've mastered the basics, these patterns unlock more reliable and powerful outputs.
After generating your response, review it for accuracy, completeness, and clarity. Flag any assumptions you made. Rate your confidence on a scale of 1-10.
Quality control on important outputs. The model is surprisingly good at catching its own errors when explicitly asked.
Answer the following question 3 times independently. Then compare your answers and select the one you are most confident in.
Math and logic problems. Generating multiple answers and picking the majority/most confident reduces errors significantly.
Break this complex problem into 3-5 smaller sub-problems. Solve each one. Then combine the solutions into a final answer.
Complex multi-part tasks. Models handle simple sub-tasks better than one giant task.
Take the output from a previous prompt and use it as input: 'Given the outline you just created, now write section 1.'
Long-form content, complex workflows. Each step builds on the last.
Different models respond to prompts differently. Here's what works best for each.
Responds well to direct, conversational prompts. Benefits from explicit formatting instructions. Its strength is general knowledge and creative work — give it freedom on creative tasks but be strict about format when you need structured output.
Excels with long, detailed prompts. Claude rewards context — the more background you give it, the better its output. Strong at following complex multi-part instructions. Use XML tags like <context> and <instructions> to structure long prompts.
Fast and efficient. Works well with concise prompts but needs clear structure. Excellent at multimodal tasks (images, video) — describe what you want analyzed when providing media.
Open-source models often need more explicit instructions. Don't assume they'll infer your intent — spell out every requirement. Few-shot examples are especially powerful here, as they help the model understand the exact pattern you want. Test prompts across models, as each handles instructions differently.
Fill in the brackets. These work across all models.
You are an expert [FIELD] analyst. Analyze the following [DATA/TEXT] and provide: 1. Key findings (3 bullet points) 2. Patterns or trends you notice 3. Potential risks or concerns 4. Your recommendation Context: [BACKGROUND] Data: [YOUR DATA]
Review this [LANGUAGE] code for: - Bugs or potential errors - Security vulnerabilities - Performance issues - Style/best practice violations Rate severity: Critical / Major / Minor / Suggestion. Code: ```[LANGUAGE] [YOUR CODE] ```
Write [TYPE OF CONTENT] about [TOPIC]. Audience: [WHO] Tone: [FORMAL / CASUAL / TECHNICAL / PERSUASIVE] Length: [WORD COUNT] Format: [BULLET POINTS / PARAGRAPHS / NUMBERED LIST] Requirements: - [REQUIREMENT 1] - [REQUIREMENT 2] Do NOT: [CONSTRAINTS]
I'm getting this error: Error: [ERROR MESSAGE] When I run: [COMMAND OR CODE] Expected: [WHAT SHOULD HAPPEN] Actual: [WHAT HAPPENS INSTEAD] Environment: [OS, LANGUAGE VERSION, FRAMEWORK] What I've already tried: [LIST] Help me find the root cause and fix it.
Help me decide between [OPTION A] and [OPTION B]. My situation: [CONTEXT] My priorities (in order): [LIST] My budget: [AMOUNT] Timeline: [DEADLINE] For each option, give me: - Pros (specific to my situation) - Cons (specific to my situation) - Total cost of ownership - Your recommendation and why
Break this project into a step-by-step plan: Project: [DESCRIPTION] Goal: [SUCCESS CRITERIA] Deadline: [DATE] Available resources: [LIST] Constraints: [ANY] For each step, tell me: 1. What to do 2. How long it should take 3. What the deliverable is 4. What could go wrong
Prompt engineering is the practice of structuring your inputs to an AI model to get the best possible outputs. It involves being specific, providing context, using constraints, and applying techniques like few-shot examples or chain-of-thought reasoning.
The most impactful techniques are: being specific, providing context, giving examples (few-shot prompting), breaking complex tasks into steps (chain-of-thought), assigning a role, and iterating based on results.
Yes. Prompt engineering works across all AI models — ChatGPT, Claude, Gemini, and open-source models like GLM, DeepSeek, Qwen, and MiniMax. Open-source models sometimes need more explicit instructions, but the core principles are the same.
As long as it needs to be and no longer. Simple tasks need one sentence. Complex tasks may need a detailed prompt with context, constraints, and examples. Every word should serve a purpose.
Zero-shot asks the model to perform a task without examples. Few-shot includes 1-5 examples of input-output pairs to show the pattern you want. Few-shot typically produces better formatting consistency.