What Is Prompt Engineering? Writing Instructions AI Understands
Prompt engineering is the practice of writing clear, structured instructions that get useful results from AI tools like ChatGPT, Claude, and Google Gemini. The quality of what you get out of an AI model depends heavily on the quality of what you put in. Better prompts produce better outputs, consistently.
Prompt engineering is the practice of writing clear, structured instructions that get useful results from AI tools like ChatGPT, Claude, and Google Gemini. The quality of what you get out of an AI model depends heavily on the quality of what you put in. Better prompts produce better outputs, consistently.
Why prompts matter more than most people realize
When people try an AI tool for the first time and get a vague or unhelpful response, they often conclude the tool is not very good. Usually, the tool is fine. The prompt was the problem.
AI language models respond to patterns in your input. A vague prompt gives the model very little to work with, so it produces a generic response. A specific, well-structured prompt narrows the possibilities and guides the model toward exactly what you need.
This is not a minor difference. The gap between a lazy prompt and a well-crafted prompt can be the difference between a useless paragraph and a ready-to-send email, between a generic outline and a detailed project plan.
The good news is that prompt engineering is a learnable skill, not a talent you are born with. It follows principles you can practice and improve.
The core principles of good prompts
Before we get to the rewrites, here are the principles that make prompts work.
Be specific about what you want. "Write about marketing" is vague. "Write a 200-word Instagram caption for a Nairobi coffee shop announcing a new Ethiopian single-origin blend" is specific. Specificity gives the model constraints, and constraints produce focused output.
Provide context. The model does not know your situation unless you tell it. Include relevant background: who you are, who the audience is, what the goal is, what tone to use. The more context you provide, the more tailored the output.
Define the format. If you want bullet points, say so. If you want a table, say so. If you want three paragraphs with no more than 100 words each, say so. Models follow formatting instructions well when you state them clearly.
Give examples when possible. Showing the model what good output looks like is more effective than describing it abstractly. "Here is an example of the tone I want: [example]. Now write something similar for [new topic]."
Specify what to avoid. If you do not want the model to use jargon, or to include disclaimers, or to exceed a certain length, say so explicitly. Models tend to default to verbose, hedging responses unless told otherwise.
Rewrite one: the business email
Before (vague prompt):
"Write a follow-up email to a client."
What you get: A generic, overly formal email with placeholder text like "[Client Name]" and "[Project]." It reads like a template from 2005. You would need to rewrite most of it.
After (specific prompt):
"Write a follow-up email to James Kamau, a potential client in Nairobi who inquired about our graphic design services two weeks ago but has not responded to our quote. Tone: professional but warm, not pushy. Mention that the quote is valid for another two weeks. Keep it under 150 words. Do not use phrases like 'I hope this email finds you well.'"
What you get: A concise, personalized email that references the specific situation, uses natural phrasing, and stays within the word limit. It is ready to review and send with minimal edits.
What changed: The rewritten prompt provided the recipient's name, the context (design services, two-week silence), the tone (warm, not pushy), a specific detail to include (quote validity), a length constraint, and a phrase to avoid. Each addition narrowed the output toward something genuinely useful.
Rewrite two: the market research summary
Before (vague prompt):
"Tell me about the Kenyan e-commerce market."
What you get: A broad, textbook-style overview covering everything from mobile penetration to logistics challenges. It is accurate in general terms but not actionable. It reads like a Wikipedia article excerpt.
After (specific prompt):
"I run a small fashion brand in Nairobi selling through Instagram DMs. I am considering setting up a Shopify store. Summarize the current state of Kenyan e-commerce relevant to my decision. Focus on: payment methods Kenyan customers actually use, delivery logistics challenges for Nairobi and major towns, and whether Kenyan shoppers trust standalone e-commerce sites or prefer social commerce. Keep the summary under 400 words and use plain language, not consultant jargon."
What you get: A focused summary addressing the three specific questions, with practical observations about M-Pesa integration, last-mile delivery realities in Kenyan cities, and consumer behavior patterns around social commerce. It reads like advice from someone who knows the market, not a generic report.
What changed: The rewritten prompt established who you are (small fashion brand), what decision you are making (Shopify or not), what specific angles you need covered (payments, delivery, trust), a word limit, and a style instruction. The model now has enough context to write for your situation, not for a general audience.
Rewrite three: the content creation task
Before (vague prompt):
"Write social media posts for my business."
What you get: Five bland, generic posts with placeholder hashtags. They could apply to any business in any country. They use phrases like "Check out our amazing products!" that no real person would engage with.
After (specific prompt):
"You are writing Instagram captions for Mama Njeri's Kitchen, a home-based catering business in Westlands, Nairobi, specializing in traditional Kenyan dishes for corporate events. Write three captions:
- Announcing a new 'Luo Fish Festival' catering package for offices
- A behind-the-scenes post showing preparation for a 50-person corporate lunch
- A customer testimonial post (make up a realistic testimonial from a Nairobi office manager)
Tone: warm, conversational, proudly Kenyan. Each caption should be 50 to 80 words. Include 3 to 5 relevant hashtags per post. Do not use the word 'amazing' or the phrase 'order now.'"
What you get: Three distinct captions with specific details about the business, the food, and the Nairobi corporate catering context. They sound like a real business owner wrote them, not a marketing bot. Hashtags are relevant to Kenyan food culture and corporate catering.
What changed: The rewritten prompt defined the business identity, the three specific post types, the tone, a word range, relevant hashtag count, and banned words. Each constraint moved the output from generic to specific.
Advanced techniques worth knowing
Role assignment tells the model to adopt a specific perspective. "You are a Kenyan tax consultant explaining the new digital services tax to a small business owner." This frames the entire response through that lens.
Chain of thought asks the model to show its reasoning. "Walk me through your reasoning step by step before giving a final answer." This produces more accurate responses on complex questions because the model is less likely to skip logical steps.
Few-shot examples provide two or three sample inputs and outputs before your actual request. The model picks up on the pattern and replicates it. This is especially useful for tasks with a specific format or style you want followed consistently.
Iteration is part of the process, not a failure. Your first prompt rarely produces a perfect result. Read the output, identify what is off, and adjust the prompt. "Good, but make it shorter and remove the formal greeting" is a valid follow-up. Prompt engineering is a conversation, not a single shot.
How prompt engineering connects to AI and automation
Good prompts are the foundation for using AI effectively in any context, whether you are chatting with a tool manually or embedding AI into an automated workflow.
In automation, prompts become even more important because a human is not there to correct a bad response in real time. If your workflow sends customer emails through an AI model, the prompt template must be precise enough to produce good results every time, not just most of the time.
Understanding prompt engineering also helps you evaluate the difference between what AI can handle and what simple automation covers. Tasks that need nuanced language or judgment benefit from well-prompted AI. Tasks that follow fixed rules are better served by straightforward automation.
Our free welcome module includes hands-on prompt exercises so you practice these techniques immediately rather than just reading about them.
FAQ
Is prompt engineering a real job?
Yes. Companies hire prompt engineers to design and optimize prompts for AI products, customer service bots, content generation systems, and internal tools. The role is most common in tech companies and agencies that build AI-powered products. However, prompt engineering is also a skill that improves any job where you use AI tools, from marketing to accounting to project management. You do not need the job title to benefit from the skill.
How long should a prompt be?
Long enough to include all necessary context and constraints, and no longer. A prompt for a quick question might be one sentence. A prompt for a complex content task might be a paragraph. There is no optimal word count. The goal is precision, not brevity. A 50-word prompt that includes the right details will outperform a 10-word prompt every time.
Do different AI tools need different prompts?
The core principles (specificity, context, format, examples) work across all major language models. However, each model has strengths and quirks. Claude tends to follow long, detailed instructions well. ChatGPT responds well to role-based prompts. Google Gemini integrates well with web search context. Experimenting with each tool helps you learn its tendencies, but a well-structured prompt produces good results in any of them.
Will prompt engineering become obsolete as AI improves?
Models are getting better at handling vague prompts, but specificity will always produce better results. Even if future AI tools can infer more from less, telling the model exactly what you want will remain more reliable than hoping it guesses correctly. The techniques may evolve, but the principle of clear communication between human and machine is not going away.
Frequently Asked Questions
### Is prompt engineering a real job?
Yes. Companies hire prompt engineers to design and optimi
7-minute Welcome lesson, no purchase required
Bonaventure Ogeto
Founder, Mctaba Labs
Software engineer building products for the African market. Teaching 10,000+ students across multiple platforms. BSc Mathematics & Computer Science from JKUAT.