The complete guide to prompt engineering
Prompt engineering isn't a secret art. It's a handful of habits that make the difference between a vague answer and a genuinely useful one. This guide covers the anatomy of a strong prompt, the frameworks worth knowing, and a template you can reuse for any model.
What prompt engineering actually is
A large language model doesn't read your mind — it reads your words and predicts a useful continuation. The quality of that continuation is bounded by how clearly you've described what you want. Prompt engineering is the practice of giving a model enough of the right context to do the job well, without burying it in noise.
That's it. You're not tricking the model or finding magic words. You're doing the same thing a good brief does for a freelancer: stating the goal, the audience, the constraints, and what "done" looks like. Everything below is a way to do that more reliably.
The anatomy of a great prompt
Most strong prompts contain some combination of five ingredients. You rarely need all five, but knowing them means you can diagnose why an answer missed and add the piece that was absent.
1. Role
Tell the model who it should be. "You are an experienced copywriter" or "Act as a senior Python engineer" primes it toward the right vocabulary, depth and defaults. Roles are shorthand for a whole cluster of expectations.
2. Context
Give the background the model can't infer: who the output is for, what came before, what you've already tried. A prompt to "write a follow-up email" is transformed by knowing it's a second nudge to a warm lead who went quiet after a demo.
3. Task
State the single, specific thing you want done — the verb matters. "Summarize", "rewrite", "compare", "critique" and "brainstorm" all lead somewhere different. Vague verbs like "help with" leave the model guessing.
4. Constraints
Constraints are where good prompts win. Length ("under 150 words"), tone ("plain, no jargon"), things to avoid ("don't invent statistics"), and reading level all steer the output hard. A model given no constraints will pick average ones.
5. Format
Say how you want it back: a bulleted list, a table, JSON, a three-paragraph essay, a subject line plus body. Naming the format removes an entire round of "actually, can you put that in a table?"
Role + Context + Task + Constraints + Format. If an answer disappoints, one of these five was probably missing. Add it and try again.
Here's the same request with and without those ingredients:
write something about our new feature
You are a product marketer. Context: we just shipped one-tap prompt enhancement in our keyboard app; the audience is existing users who haven't tried it. Task: write an in-app announcement. Constraints: under 60 words, friendly and concrete, one clear benefit, no exclamation marks. Format: a headline plus two short sentences.
Frameworks worth knowing
Frameworks are just memorable orderings of those same ingredients. Two are worth keeping in your head.
RTF — Role, Task, Format
The fastest useful pattern. "Act as a [role]. [Task]. Give it to me as [format]." It's perfect for quick, everyday requests where context is obvious. Example: "Act as a technical recruiter. Write three screening questions for a junior Kotlin developer. Format as a numbered list."
CO-STAR — Context, Objective, Style, Tone, Audience, Response
A heavier framework for output that has to land with a specific reader. You spell out the Context, the Objective (what success looks like), the Style and Tone, the Audience, and the Response format. It's overkill for a quick summary, but excellent for marketing copy, sensitive emails, or anything customer-facing.
Don't collect frameworks like trophies. Pick RTF for speed and CO-STAR when the stakes are higher; both are just scaffolding for the five ingredients above.
Five mistakes that weaken prompts
- Being polite instead of specific. "Could you maybe help me a bit with my resume?" wastes the model's attention. State the job, the seniority, and what to emphasize.
- Asking for everything at once. A prompt that wants a strategy, a schedule, and the copy will do all three shallowly. Chain them: get the plan, then ask for each piece.
- Leaving out the audience. "Explain vector databases" for a CTO and for a curious teenager are different answers. Name the reader.
- No examples when you have a style in mind. If you want output to match a voice, paste one short example of that voice. Models imitate well.
- Never iterating. The first answer is a draft. "Make it shorter and cut the marketing tone" is often the highest-leverage prompt you'll write.
A reusable template
Copy this, fill the brackets, and delete any line you don't need:
Role: You are a [role/expertise].
Context: [background the model can't infer — audience, history, goal].
Task: [one specific thing, strong verb].
Constraints: [length, tone, things to avoid].
Format: [list / table / JSON / word count].
Once this becomes second nature you'll do it without thinking — which is exactly what the Enhance key in Prompt AI Keyboard does for you: it takes your rough line and rebuilds it with the right role, context, constraints and format for the model you're talking to.
Practice prompting without the busywork
Type a rough idea, tap Enhance, and watch it become a structured prompt — in any app, on iOS & Android.