Tips

How to write better AI prompts

A good prompt has four parts: a role, a task, context and a format. Here is how each one works, with before and after examples.

By Trivx Solutions · 30 November 2026 · 3 min read

To write better AI prompts, tell the AI who to be, what to do, what it needs to know and how to shape the answer. That's four parts: role, task, context and format. Vague prompts get generic answers because the AI fills every gap with an average guess. Each part you add closes one of those gaps.

The four parts of a good prompt

PartWhat it doesExample
RoleSets the expertise and tone"You are a friendly maths tutor."
TaskSays exactly what you want"Explain how to solve quadratic equations."
ContextGives the facts the AI can't guess"I'm a Class 10 student and I get confused by the formula."
FormatShapes the answer"Use 5 short steps, one worked example and a 3-question quiz."

You don't need all four every time. A quick question may need only a task. The longer and more personal the job, the more each part helps.

Before and after: three examples

A work email. Before: "Write a leave email." After: "You're an HR-savvy assistant. Write a polite email to my manager asking for leave on 5 and 6 December for my sister's wedding. I've finished my report early. Keep it under 120 words with a clear subject line."

A shop caption. Before: "Write an Instagram caption." After: "You're a social media writer for a small Karachi bakery. Write 3 Instagram captions for our new chocolate cake. Our customers are young families. Keep each under 30 words, warm in tone, with 3 hashtags."

A logo image. Before: "Make a logo." After: "A minimalist flat vector logo for a Lahore tutoring centre called Roshan. Use navy and gold, an open book shape, on a plain white background, with no extra text."

Notice that the image prompt has no role. Image tools respond best to a clear subject, a style, colours and constraints such as the background or aspect ratio.

How to write a prompt step by step

  1. Start with the task in one plain sentence. If you can't say it in one line, the AI won't guess it.
  2. Add the role that would do this job well, such as a tutor, editor or recruiter.
  3. Add context: who it's for, why you need it, and any facts, names or dates.
  4. Set the format: length, bullet points or paragraphs, tone and number of options.
  5. Read the answer and refine. Ask for changes in a follow-up, such as "shorter" or "more formal".

Don't want to write it from scratch? The AI prompt generator has 12 templates, including emails, blog outlines, captions, CV summaries, study notes, logos and thumbnails. You fill in the blanks and copy a full prompt. Nothing you type leaves your device.

Common prompt mistakes

  • Asking for too much at once. Split a big job into steps: outline first, then each section.
  • Leaving out the audience. "Explain inflation" reads differently for a Class 8 student and a finance graduate.
  • No length limit. Say "under 150 words" or "5 bullet points". If you're writing a long brief, check its length in the word counter first.
  • Trusting facts blindly. AI tools can state wrong facts with confidence. Check dates, fees and figures yourself before you send or publish.
  • Pasting private data. Leave out CNIC numbers, passwords and bank details. You can describe the situation without them.

Prompt writing is a handy skill for freelancers too. If you're deciding what to learn next, take the IT skills quiz. Already selling design or writing work? Use the freelance price calculator to quote your jobs.

Questions

What makes a good AI prompt?
A good prompt gives a clear task, plus the role, context and format the AI needs. The more specific you are about audience, length and tone, the less the AI has to guess.
Do I need to give ChatGPT a role?
No, but it often helps. A role such as "experienced editor" or "friendly tutor" sets the tone and level of detail. For quick factual questions, the task alone is usually enough.
How long should an AI prompt be?
As long as it needs to cover the task, context and format. A few clear sentences beat one vague line. Long prompts can bury the main request, so put the task first.
Do these prompt tips work with Gemini and Claude?
Yes. Role, task, context and format work with any chat assistant, including ChatGPT, Gemini, Claude and Copilot. Image tools respond best to subject, style and constraints.