Home/Guides/How to Write Better AI Prompts (Step-by-Step)
Prompt Engineering Basics

How to Write Better AI Prompts (Step-by-Step)

A step-by-step guide to writing AI prompts that get better results from ChatGPT, Claude, Gemini, and any other model.

9 min read

Most people write prompts the same way they type search queries — a few words that describe what they want, submitted and hoped for the best. That approach works for search engines because search engines retrieve existing content. AI generates new content, and what it generates is determined almost entirely by how you described what you wanted. Here's the step-by-step process that produces better AI output from the very first try.

Step 1 — Start With the Goal, Not the Request

Before writing a word, spend 30 seconds clarifying what a successful output actually looks like. Not what you want to ask the AI, but what a perfect response would contain, how long it would be, who would read it, and how it would be used. Starting from the desired output and working backwards prevents the most common failure: prompts that are technically reasonable but strategically wrong. 'I want the AI to write something about our onboarding process' is a request. 'I need a 200-word onboarding welcome email for new enterprise customers, written warmly, that gets them to log in within 48 hours' is a goal. The goal-first approach produces a fundamentally better prompt.

Step 2 — Assign a Role

The first line of your prompt should tell the model who it's acting as. 'Act as a [specific expert with relevant experience]' activates the vocabulary, reasoning style, and domain knowledge of that type of person. Be specific: 'Act as a direct-response copywriter with e-commerce experience' outperforms 'Act as a marketing expert.' The role should match the nature of the task — a technical writing task benefits from a technical writer role, not a marketing expert role, even if both involve writing. If you're unsure what role to use, think about the professional you'd hire to do this task in the real world and describe that person.

Step 3 — Provide Context in 2-4 Sentences

After the role, add the specific background the model needs to produce a useful response for your actual situation rather than a generic one. This includes: who the output is for (audience, knowledge level, relationship to you), what situation it's in (the specific circumstances, constraints, starting point), and what goal it serves (what you're ultimately trying to achieve). Two to four focused sentences of context almost always outperforms a long paragraph — the goal is to eliminate guesswork, not to provide complete backstory. Ask yourself: if I removed this context sentence, would the model's output change significantly? If yes, keep it. If no, cut it.

Step 4 — State the Task Explicitly

Write the action instruction clearly and specifically: what to produce, how long it should be, and what the key requirements are. Use an action verb — write, generate, list, summarize, analyze, compare, rewrite — and then describe the scope of the action. 'Write a 3-section technical blog post' is better than 'write a technical blog post.' 'List exactly 7 specific and distinct actionable tips' is better than 'give me some tips.' If the task has multiple required components, list them as numbered steps: the model handles numbered multi-part instructions much more reliably than long run-on sentences describing multiple requirements.

Step 5 — Add Constraints and Format

End your prompt with the boundaries: what to avoid, how to structure the output, and any technical requirements. Length constraint (max 150 words), format instruction (3 bullet points, no headers), and exclusion rules (no corporate jargon, no passive voice, do not mention pricing) are the three most valuable constraint types for most tasks. Format instructions work best when they describe the exact structure you need rather than just naming a format. 'Three bullet points, each starting with an action verb, max 15 words each' is more precise and more effective than 'bullet points.'

Step 6 — Review, Submit, and Iterate

Before submitting, read your prompt aloud. If any part of it is ambiguous to you, it's ambiguous to the model. Cut anything that doesn't directly help the AI produce the right output — filler, pleasantries, and redundant context all dilute the signal. Submit the prompt and evaluate the output critically. If something is wrong, identify the specific dimension where the output failed (wrong tone? wrong length? wrong content?) and add one targeted fix. Don't rewrite the entire prompt — surgical additions outperform wholesale rewrites for iterative improvement. After 2-3 refinements, save the working prompt as a template for similar future tasks.

Prompt examples

✗ Weak prompt
Help me write something for our website about our new feature.

No role, no audience, no feature description, no goal, no format. The model will produce something technically functional and practically useless — requiring near-total rewriting.

✓ Strong prompt
Act as a SaaS product copywriter. Write a 120-word feature announcement section for our website introducing an AI meeting summary feature for enterprise teams. Audience: heads of operations and IT at 200-500 person companies. Lead with the time saved (teams report 3 hours/week). Tone: confident and direct, no buzzwords. End with one sentence linking to the documentation. No passive voice. Format: one headline + two short paragraphs.

Role, audience, word count, specific angle to lead with, tone instruction, exclusion rule, specific format, and a structural endpoint. This prompt will produce a usable first draft in a single pass.

Practical tips

  • Follow the sequence: goal → role → context → task → constraints → format. Order matters.
  • Read your prompt aloud before submitting — ambiguity you can hear is ambiguity the model will fill with wrong assumptions.
  • When output fails, identify the specific dimension that failed and fix only that — surgical edits beat rewrites.
  • Save every prompt that produces a result you're happy with — a library of 15 tested prompts is more valuable than unlimited guessing.
  • If a prompt works for a task you'll repeat, invest 5 minutes making it into a parameterized template with [PLACEHOLDERS].

Continue learning

Best Practices for AI PromptsPrompt Debugging GuideUsing Constraints in Prompts

Skip the 6-step process — PromptIt builds a structured, expert-quality prompt from your one-line idea.

PromptIt applies these prompt engineering principles automatically to build better prompts for your specific task.

✦ Try it free

More Prompt Engineering Basics guides

What is Prompt Engineering?

Learn what prompt engineering is and why it matters for getting better

9 min · Read →

How to Use Role in AI Prompts

Discover how assigning a role to an AI model shapes its tone, expertis

8 min · Read →

How to Add Context to AI Prompts

Learn how providing background context in your prompts leads to more a

8 min · Read →

Defining the Task in Your AI Prompt

Find out how clearly stating the task in your prompt is the single big

8 min · Read →
← Browse all guides