DEV Community

Sungwoo Lee
Sungwoo Lee

Posted on • Originally published at my-blog.org

How to Write Better AI Prompts: The 5 Principles That Actually Work

Most AI prompts underperform because they're too vague. Here are the 5 principles that consistently improve results — applicable to ChatGPT, Claude, and Gemini alike.


Why Your Prompts Aren't Working

Most users type a single vague sentence and get a generic response. The root cause is straightforward: AI models generate statistically likely outputs given your input. Vague input produces generic output. Precise input produces targeted output.

Bad example:

"Write me a marketing email."

Good example:

(Role) You are a direct-response copywriter. (Context) I'm launching a B2B SaaS tool for HR managers at companies with 50–500 employees. (Task) Write a 150-word cold outreach email for decision-makers who've never heard of us. (Format) Subject line + 3 short paragraphs + CTA. Tone: direct, no fluff.

The second prompt gives the AI four anchors: role, context, task, and format. The difference in output quality is immediate.


Principle 1 — Specificity: Replace Vague with Concrete

The most common mistake is using words like "good," "short," "professional," or "better." These mean nothing to an AI without a baseline. Replace every vague adjective with a measurable equivalent:

  • "short""under 100 words"
  • "professional tone""formal, no contractions, suitable for a Fortune 500 executive"
  • "a few examples""exactly 3 examples"
  • "improve this""rewrite to be 20% shorter, keeping all key arguments"

Principle 2 — Context: Tell the AI Who You Are and Why

AI models don't know you. Without context, they write for everyone — which means they write for no one. Two sentences of context can transform output quality dramatically.

Context layers to include:

  • Who you are (role/profession)
  • Who the audience is
  • What platform or format the output will appear in
  • What constraints exist

Bad:

Explain machine learning.
Enter fullscreen mode Exit fullscreen mode

Good:

I'm a high school science teacher preparing a 5-minute class intro. My students are 16–17, no coding background. Explain machine learning in plain English with one real-world analogy.
Enter fullscreen mode Exit fullscreen mode

Principle 3 — Role: Give the AI an Expert Identity

When you assign a role, you invoke the model's relevant knowledge patterns. "You are a senior UX researcher" activates different reasoning paths than "you are a motivational speaker" — even for the same underlying task.

Effective role patterns:

  • Domain + seniority: "You are a senior software engineer specializing in Python performance optimization."
  • Audience-facing role: "You are a patient tutor explaining this to a complete beginner."
  • Style role: "You are a Wall Street Journal editor reviewing for clarity and concision."

Principle 4 — Format: Specify the Output Structure

Format instructions are the single fastest way to improve usability. If you don't specify format, the AI chooses — and it often chooses wrong for your context.

Format parameters to consider:

  • Length: word count, number of bullet points, number of paragraphs
  • Structure: table, numbered list, headers, prose
  • Tone: formal / casual / technical / conversational
  • Exclusions: "no jargon", "no preamble", "don't restate the question"

Principle 5 — Iteration: The First Response Is a Draft

Most people stop at the first response. High-value prompt users treat the first output as a rough draft. The real power of AI is the conversation — you can follow up immediately:

  • "That's good, but shorten the second section by half."
  • "Rewrite only the opening paragraph — make it more surprising."
  • "Now give me the same content but for an audience with no technical background."
  • "List 3 things I haven't considered yet."

The productivity gap between people who get a lot out of these tools and people who get little is rarely about model access — most of them are typing into the same chat box. It is about how they iterate on the prompt when the first answer misses.


One layer sits above all five principles and is easy to miss in a chat window: the difference between the system prompt and the user prompt. Put the durable parts — role, constraints, tone — in the system prompt, and you stop retyping them every turn.

Putting It Together: The 4-Element Prompt Formula

Combining all 5 principles produces a reliable structure:

(Role) + (Context) + (Task) + (Format)
Enter fullscreen mode Exit fullscreen mode

This isn't a rigid template — it's a checklist. Before sending any prompt, ask:

  1. Have I said who the AI should be?
  2. Have I given enough context?
  3. Is the task specific and clear?
  4. Have I specified the output format?

FAQ

How long should an AI prompt be?
As long as it needs to be. For simple tasks, 1–2 sentences is fine. For complex tasks, 4–6 lines with all four elements is typical. Avoid padding — every word carries signal.

Does the order of prompt elements matter?
Order matters less than completeness. That said, role first tends to work well — it frames everything that follows.

Should I use prompts differently for Claude vs ChatGPT?
The 4-element framework applies to both. Minor differences exist in how each model weights system prompts versus user prompts, but for everyday use, the same structure works across models.

Why does the same prompt give different results each time?
AI models have built-in randomness (controlled by a parameter called "temperature"). If you need consistent output, specify the exact format in detail — that constrains the variance.

How do I save and reuse good prompts?
Keep a plain-text prompt library — a simple Notion page or text file works. Tag prompts by use case. Reuse the structure; update the context brackets for each new task.


Originally published at my-blog.org.


Top comments (0)