Barefoot AI HubTHE BAREFOOT FREELANCER
Start learning
◆ AI Foundations · Lesson 4 of 5

04Prompt Engineering Fundamentals

A repeatable framework for writing prompts that get great results the first time — with before/after examples you can copy.

⏱ 22 min📶 Beginner🧪 3-question check

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

R

Role

Who should the AI act as? Sets expertise, vocabulary and perspective. “You are a senior bookkeeper for small cafés.”

T

Task

One clear action with a verb and a definition of done. “Categorize these 40 expenses into the 8 categories below.”

C

Context

Audience, purpose, background, constraints, source data, examples. The more relevant context, the better.

F

Format

Exactly what the output should look like: length, structure, tone, file type, table columns, JSON schema.

Before → after

Weak
promptprompt
Write a post about our new drink.

Result: generic, wrong tone, invented details, random length.

Strong
promptprompt
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>
Weak
promptprompt
Reply to this client saying the project is late.
Strong
promptprompt
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>
Weak
promptprompt
Organize these expenses.
Strong
promptprompt
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

  1. 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.

  2. 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.

  3. 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.

  4. 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.)

  5. Say what to do, not only what not to do

    “Write in plain, flowing paragraphs” works better than “don't use bullet points.”

  6. 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.

  7. Specify the format precisely

    Table columns, headings, JSON keys, word count, tone, language. If it's going into a system, describe the exact structure.

  8. 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:

1Write v1RTCF
2Run on 3–5 real inputsinclude a tricky one
3Diagnosewhat exactly is wrong?
4Change one thingadd rule / example
5Save the winnerprompt library

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 / 3

Q1What does the “C” in RTCF stand for?

Q2Why wrap a pasted email in tags?

Q3Your outputs keep inventing prices. Best first fix?

Finished this lesson?Your progress is saved in this browser.