04Prompt Engineering Fundamentals
A repeatable framework for writing prompts that get great results the first time — with before/after examples you can copy.
What you'll learn
- Use the RTCF framework: Role, Task, Context, Format
- Turn vague requests into specific, checkable instructions
- Use examples, delimiters and constraints
- Iterate on a prompt systematically instead of randomly
Prompting is delegation
A prompt is a brief to a very capable colleague who has zero background on your situation. Most bad AI output comes from under-specified prompts, not bad models. Ask yourself: “If I handed this exact message to a smart human freelancer, would they know exactly what to deliver?”
The RTCF framework
Role
Who should the AI act as? Sets expertise, vocabulary and perspective. “You are a senior bookkeeper for small cafés.”
Task
One clear action with a verb and a definition of done. “Categorize these 40 expenses into the 8 categories below.”
Context
Audience, purpose, background, constraints, source data, examples. The more relevant context, the better.
Format
Exactly what the output should look like: length, structure, tone, file type, table columns, JSON schema.
Before → after
Write a post about our new drink.
Result: generic, wrong tone, invented details, random length.
You are the social media copywriter for Barefoot Café, a cozy co-working
coffee shop in Iloilo City.
<task>
Write 3 Facebook post options announcing our new Sea-Salt Cold Brew
(₱160), available starting this Friday.
</task>
<context>
Audience: freelancers and students aged 18–35.
Brand voice: warm, witty, a little Taglish is welcome.
Selling points: less acidic, made with local Guimaras sea salt.
</context>
<rules>
- Max 60 words each, 1–2 emojis
- End each with a clear call to action
- Do not invent promos, discounts or prices not listed above
</rules>
Reply to this client saying the project is late.
You're my account manager. Draft a reply to the client email below.
<situation>
The website launch will move from Oct 3 to Oct 10 because the client
sent product photos 9 days late. We still want a great relationship.
</situation>
<goals>
1. Explain the new date clearly and without blame
2. Show the launch checklist is otherwise on track
3. Offer one small goodwill gesture: a free 30-min training session
</goals>
Tone: calm, professional, friendly. Under 150 words. Include a subject line.
<client_email>
{{paste email here}}
</client_email>
Organize these expenses.
Categorize each expense line below into exactly one of these categories:
Software, Hardware, Internet & Phone, Travel, Meals, Office Supplies,
Contractors, Other.
Return a markdown table with columns: Date | Vendor | Amount (PHP) | Category | Confidence (high/low).
Mark "low" when the vendor name is ambiguous — don't guess silently.
After the table, give the total per category.
<expenses>
{{paste lines}}
</expenses>
Eight rules that consistently improve results
Be specific about the outcome
Replace “make it better” with “shorten to 100 words, lead with the benefit, remove jargon.” Numbers, audiences and deadlines all help.
Give the reason behind rules
“Keep it under 60 words because it's for a mobile push notification” lets the model make smart trade-offs you didn't anticipate.
Separate instructions from content with tags
Wrap pasted material in tags like
<email>…</email>or<data>. The model won't confuse your instructions with the document — and it's harder for text inside the document to hijack the task.Show, don't just tell
One or two examples of the output you want beat a paragraph of description. (More on this “few-shot” technique in the next lesson.)
Say what to do, not only what not to do
“Write in plain, flowing paragraphs” works better than “don't use bullet points.”
Allow uncertainty
Add: “If information is missing, ask me or say you don't know instead of guessing.” This is the single cheapest hallucination fix.
Specify the format precisely
Table columns, headings, JSON keys, word count, tone, language. If it's going into a system, describe the exact structure.
Put long documents first, question last
With long inputs, place the document at the top and your instructions/question at the end. Models tend to handle this layout better.
Iterate like an engineer
Your first prompt is a draft. Improve it systematically:
Common fixes: output too long → give a word limit and the reason; wrong tone → add a short sample of your voice; invented facts → provide the facts and allow “I don't know”; inconsistent format → give an exact template or example.
Key takeaways
- Use RTCF: Role, Task, Context, Format — and explain the why behind rules.
- Wrap pasted content in tags to separate it from instructions.
- Examples beat descriptions; positive instructions beat prohibitions.
- Always allow “I don't know.” Test prompts on several real inputs and change one thing at a time.
Knowledge check
0 / 3Q1What does the “C” in RTCF stand for?
Context: audience, purpose, background, data and examples.
Q2Why wrap a pasted email in
Delimiters make clear what's instruction vs. material to work on.
Q3Your outputs keep inventing prices. Best first fix?
Ground the model with facts and give it permission to not know.