Prompt Engineering: The Patterns That Actually Work (From Someone Who Writes Prompts Daily)
I've been writing AI prompts almost daily for the past two years. Not the "write me a poem about the ocean" kind — real work prompts. Analyze this document. Write this code. Review this draft. Plan this project. And after thousands of iterations, I've noticed that the prompts that work best follow a handful of patterns.
This isn't about "secret prompt tricks" or "one weird prompt that makes AI do anything." It's about structural patterns that consistently produce better, more reliable output. The kind of thing that saves you from the frustrating cycle of vague prompt, vague answer, rephrase prompt, slightly different vague answer.
Pattern 1: Give the AI a Role
"Tell me about climate change" gets you a generic overview. "You are a climate scientist explaining this to a skeptical but intelligent audience" gets you something focused, appropriately technical, and persuasive.
Giving the AI a role — an identity, a perspective, an expertise level — constrains the output in useful ways. It knows what depth to aim for, what terminology to use, and what assumptions to make.
I use this constantly. When I need code reviewed, I say "You are a senior developer reviewing this code for security vulnerabilities and performance issues." When I need writing feedback, I say "You are an editor at a major publication reviewing this article for clarity and impact."
The role doesn't have to be elaborate. Even a simple "You are an expert in X" measurably improves output quality for domain-specific tasks.
Pattern 2: Show, Don't Just Tell
Instead of "Write in a professional tone," give an example of what professional tone looks like to you. Instead of "Format the output as a table," show a sample row.
This is the single biggest improvement most people can make to their prompts. AI models are remarkably good at pattern matching. When you show them what you want, they can replicate the structure, tone, and format far more reliably than when you describe it abstractly.
I keep a small collection of example outputs for tasks I do regularly. When I need a blog post outline, I include a sample outline. When I need code in a specific style, I include a code snippet. The consistency improvement is dramatic.
Pattern 3: Break Complex Tasks into Steps
"Write a marketing plan for my product" gets you a generic template. "First, analyze the target audience for this product. Then, identify the three most effective marketing channels for that audience. Finally, draft a 30-day launch plan for each channel" gets you something you can actually use.
Complex tasks produce better results when you break them into sequential steps. This mirrors how humans solve complex problems — one piece at a time — and AI models handle step-by-step reasoning better than trying to produce a complete complex output in one shot.
I've found this especially useful for analytical tasks. Instead of "analyze this data," I'll ask the AI to first summarize the data, then identify patterns, then suggest explanations for those patterns, then recommend actions. Each step builds on the previous one, and the final output is much more coherent.
Pattern 4: Specify What You Don't Want
This one took me too long to learn. Telling the AI what to avoid is almost as important as telling it what to include.
"Don't use jargon" prevents the wall of technical terminology. "Don't include an introduction paragraph" saves you from cutting the same generic opening every time. "Don't make it sound like a press release" keeps the AI from defaulting to corporate-speak.
I now include negative constraints in most of my prompts. It's reduced my editing time significantly because the first draft is closer to what I actually need.
Pattern 5: Ask for Reasoning, Not Just Answers
"Should I use React or Vue for this project?" gets you an answer. "Compare React and Vue for a small team building a content-heavy website with mostly static pages. Consider learning curve, ecosystem, performance, and long-term maintenance. Explain your reasoning" gets you an answer you can actually evaluate.
When the AI shows its reasoning, you can assess whether its logic is sound. Sometimes the conclusion is right for the wrong reasons. Sometimes the reasoning reveals assumptions that don't apply to your situation. Either way, you make a better decision when you can see the thinking behind the answer.
This is especially important for anything you'll act on — technical decisions, strategic recommendations, code architecture. The reasoning is often more valuable than the conclusion.
Pattern 6: Use Structured Output Formats
Often you need the AI's response in a specific format — JSON, Markdown table, numbered list, or a particular template. Instead of hoping the AI produces the right format, request it explicitly.
For example: "Provide your analysis as a JSON object with keys for 'summary,' 'pros,' 'cons,' and 'recommendation.'" This eliminates the need to parse and reformat the output manually.
This pattern combines well with Pattern 2 — show an example of the output format you want, then specify that format in your prompt instructions. The combination produces remarkably consistent results.
The Meta-Pattern: Iterate
Even the best prompt rarely produces perfect output on the first try. The most effective prompt engineers I know treat prompting as a conversation, not a one-shot command.
Start with your best prompt. Read the output. Identify what's wrong or missing. Adjust the prompt. Repeat. Each iteration gets you closer, and the AI remembers the conversation context, so you can build on previous exchanges rather than starting from scratch.
I typically go through two or three iterations for important tasks. The first draft gets me 70% of the way there. The second gets me to 90%. The third polishes the remaining rough edges. This is faster than trying to write a perfect prompt upfront, and it teaches you what the AI needs for next time.
What Doesn't Work
Overly long prompts with contradictory instructions. If your prompt is 500 words of detailed requirements, the AI will struggle to prioritize. Keep it focused. If you have many requirements, break them into separate prompts.
Assuming the AI knows your context. It doesn't know your project, your audience, your constraints, or your preferences unless you tell it. The more context you provide, the better the output. "Write a blog post" is a weak prompt. "Write a 1000-word blog post for beginner developers explaining why they should learn Git, with a conversational tone and practical examples" is a strong one.
Treating the AI as an oracle. It's a tool that produces text based on patterns. It doesn't "know" things. It doesn't "understand" your business. It produces outputs that are statistically likely to be useful based on its training. The better your prompt, the more likely the output is to be what you need. But it's never magic — it's always probability.
The best prompt engineers aren't people who know secret phrases. They're people who are clear about what they want, specific about the format they need, and willing to iterate until the output matches their intent. That's the real skill — not prompt wizardry, but clear communication.
Putting It All Together: A Complete Example
To show how all these patterns combine, here's a real prompt I used recently. I needed a technical blog post outline about a specific programming topic.
You are a senior software engineer who writes clear, practical blog posts for junior developers. Outline a blog post about [topic].
Structure the post with:
1. A relatable opening paragraph that explains why this matters
2. Three main sections, each with a clear heading and key points
3. A practical code example (show a complete, runnable sample)
4. Common pitfalls section
5. A concise summary
The tone should be conversational but authoritative. Focus on practical application over theory. Use the following format for each section:
## [Section heading]
[Key points as bullet points]
Here's a sample outline for reference:
[Previous outline from another article]
This single prompt incorporates all six patterns: role assignment, exemplar output, step-by-step structure, negative constraints (implied by focusing on specifics), reasoning request (why it matters), and output format specification. The result was a solid first draft that took perhaps ten minutes to polish rather than starting from a blank page.
This completes the six core patterns — role, exemplar, stepwise, negative constraints, reasoning, and output format — that together form a reliable framework for communicating with AI systems.
Mastering these patterns doesn't require special talent — it requires practice. Start with one pattern, use it until it becomes natural, then add another. Within a month of deliberate practice, you'll find that writing effective prompts feels less like a skill and more like a habit.
