ImtiazAI

Prompt Engineering

Prompt Engineering, in Plain Terms: How to Get Better Results from AI

Prof. Dr. Muhammad Imtiaz ShafiqSeptember 14, 20267 min read

AI can write an email, summarize a paper, generate code, analyze a dataset, create a lesson plan, or help develop an application.

But there is a catch.

The quality of the result depends heavily on the quality of the instruction you give it. That instruction is usually called a prompt.

Prompt engineering is simply the practice of designing better prompts so that AI produces outputs that are more useful, relevant, consistent, and appropriate for the task.

It sounds technical, but the basic idea is surprisingly simple:

“Tell AI what you want, give it the information it needs, explain the constraints, and describe what a useful answer should look like.”

A prompt is more than a question

Consider this prompt:

“Write something about artificial intelligence.”

The AI has to guess almost everything:

  • Who is the audience?
  • How long should it be?
  • Is it academic or conversational?
  • What aspect of AI should it cover?
  • Should examples be included?
  • What is the intended purpose?

Now compare it with:

“Write a 500-word introductory article explaining generative AI to university students who have no technical background. Use simple language, include three practical examples, avoid mathematical terminology, and finish with five key takeaways.”

The second prompt gives the AI a much clearer specification.

Better prompting is often simply better communication.

The anatomy of a useful prompt

Five elements do most of the work.

01

Task

What do you want the AI to do?

“Summarize this research paper.”

02

Context

What does the AI need to know?

“The audience is undergraduate chemistry students.”

03

Constraints

What limitations or requirements should it follow?

“Keep the explanation below 500 words and avoid unnecessary technical terminology.”

04

Output

What should the result look like?

“Use headings and bullet points.”

05

Success criteria

What would make the answer useful?

“The final explanation should allow a beginner to understand the concept without reading the original paper.”

From vague prompts to useful prompts

Vague

“Make a presentation about climate change.”

Better

“Create a 10-slide presentation about climate change for first-year university students. Explain the causes, major effects, Pakistan-specific examples, possible solutions, and three key takeaways. Keep each slide concise and suggest a visual for each slide.”

The second prompt gives the AI task, audience, scope, context, format, and constraints. That is prompt engineering in practice.

Give AI the context it cannot guess

AI cannot reliably know information that has not been provided.

Instead of:

“Write an email to my students.”

Use:

“Write a professional but friendly email to undergraduate students informing them that tomorrow's class will start at 10:00 AM instead of 9:00 AM. Ask students to arrive five minutes early. Keep it below 120 words.”

Context reduces guessing.

Tell AI what not to do

Constraints matter just as much as instructions.

“Explain machine learning to beginners. Do not use equations, programming code, or highly technical terminology.”

“Rewrite this email professionally. Preserve the original meaning. Do not add new facts.”

Constraints are particularly useful when controlled or predictable output is required.

Examples can be powerful

Showing an example can sometimes be easier than describing the desired style.

“Generative AI & Prompt Engineering — Learn how modern AI systems work and how to communicate with them effectively through practical prompt engineering techniques.”

Then:

“Using the same structure and tone, write descriptions for Python Programming, Digital Marketing, and Graphic Design.”

This is often called few-shot prompting.

Don't make every prompt enormous

A longer prompt does not automatically mean a better prompt.

For simple tasks:

“Rewrite this email professionally and keep it below 150 words.”

For complex tasks, more structure and context may be necessary.

Use as much structure as the task requires, but no more.

Prompting is an iterative process

The first prompt does not need to be perfect.

First:

“Create a lesson plan on generative AI.”

Then improve it:

“Create a 90-minute lesson plan on generative AI for university students who already understand basic AI concepts. Include a 20-minute lecture, a 15-minute demonstration, and a 30-minute hands-on activity using a general-purpose AI assistant.”

Start. Inspect the result. Identify what is missing. Refine the prompt.

Prompt engineering is changing

Prompt engineering is moving beyond “magic words” and clever tricks. The more useful question is:

“How can I clearly specify the task and give the AI the information it needs to succeed?”

This is sometimes called context engineering. The goal is not merely to write a clever prompt — it is to provide the right instructions, information, examples, and constraints at the right time.

A practical prompt template

TASK:
What do I want AI to do?
CONTEXT:
What information does AI need?
AUDIENCE:
Who is the output for?
CONSTRAINTS:
What should it include or avoid?
OUTPUT:
What format should the response use?
SUCCESS:
What would make the result useful?

You do not need to copy these headings every time. Use them as a mental checklist.

One final example

Instead of

“Make a social media post for my course.”

Better

“Write an Instagram promotional post for a 6-week Generative AI and Prompt Engineering course for university students and early-career professionals. Highlight practical skills, hands-on learning, and career relevance. Keep the tone professional and energetic. Include a short headline, 3 benefits, a call to action, and 5 relevant hashtags. Do not make unsupported claims about jobs or income.”

Notice what changed.

The AI was not given a magical phrase.

It was given a clear specification. That is the essence of prompt engineering.

Try this

Take one prompt you regularly use with AI. Rewrite it by adding:

  • Task
  • Context
  • Constraints
  • Desired output

Then compare the original and revised results.

The takeaway

You don't need to become a programmer to become better at prompting. Start with five questions:

  • What do I want?
  • Why do I want it?
  • What does AI need to know?
  • What constraints matter?
  • What should the final result look like?

The better you answer those questions, the less AI has to guess.

Prompt engineering is the art of turning what you have in your head into instructions an AI system can work with.

About ImtiazAI

ImtiazAI explores the practical application of artificial intelligence in education, professional work, automation, and digital transformation. The focus is on applied intelligence rather than AI hype: understanding what AI can do, where it adds value, and how people and organizations can use it responsibly.

Author: Prof. Dr. Muhammad Imtiaz Shafiq