Prompt Engineering for Beginners: 4 Parts of a Great Prompt

Here is prompt engineering for beginners in one sentence: a good prompt is your task plus four pieces: a role (who Claude should be), context (the facts only you know, and why you need the answer), an example (one small sample of what good looks like) and the output format (the length, the shape and…

The YouTube player loads only when you press play. Open on YouTube

Here is prompt engineering for beginners in one sentence: a good prompt is your task plus four pieces: a role (who Claude should be), context (the facts only you know, and why you need the answer), an example (one small sample of what good looks like) and the output format (the length, the shape and the language of the answer). When Claude gives you a long, generic answer, one of those pieces is usually missing.

Watch the video: https://youtu.be/pHjPe7Haars

This is Episode 4 of Mastering Claude & Claude Code, my free 12-episode course. In Episode 1 you wrote your first prompts, in Episode 2 you gave Claude your files and rules once with Projects, and in Episode 3 you built tools you can click with Artifacts. Today we fix the thing behind every answer: the prompt.

I checked the advice in this post against Anthropic’s own prompting guide on 18 November 2026. Everything here works on the free Claude plan.

Why your Claude answers are generic

Claude only knows what you type. Everything you leave out, it has to guess: who the answer is for, how technical it should be, what you already tried, how long it should be. When it guesses, it plays safe, and “safe” means long and general.

The fix is not a magic phrase. It’s giving Claude the same information you’d give a new colleague.

The 4 pieces of a good prompt

PieceWhat it tells ClaudeExample
RoleWho to be, which sets the tone and the level“You’re a senior help desk technician.”
ContextThe facts only you know, and why you need the answer“The user isn’t technical. I’ve already unlocked the account.”
ExamplesOne small sample of what good looks like<example>abd.shamout, 2026-07-14, 127, Staff</example>
Output formatLength, shape and language“3 numbered steps, under 100 words.”

A few notes from Anthropic’s guide that are worth knowing:

  • Explain the why. Anthropic says context or motivation behind an instruction helps, because Claude can work out what you need from the explanation.
  • Wrap examples in tags. Put each example inside <example> tags so Claude knows it’s a sample, not real data. Anthropic suggests 3 to 5 examples for the best results on bigger tasks; for everyday IT work, one good example already makes a big difference.
  • A role goes first. If you use the same role every day, save it once in your Project instructions (Episode 2) instead of typing it every time.

You don’t always need all four. Add the pieces the answer is missing.

The new colleague test

How do you know a prompt is ready? Anthropic’s test: imagine you hand your prompt to a new colleague who knows nothing about your task. If they’d be confused, Claude will be too. “Fix the report” fails this test. “Fix the totals row in the October tickets report, the averages are wrong” passes.

Rebuild 1: a help desk ticket reply

The ticket: a user changed their password this morning, now their phone keeps asking for it, and their account is locked.

Weak prompt:

Reply to this ticket.

Claude wrote about 300 words on cached credentials and sign-in tokens. Correct, but the user would never read it.

Rebuilt prompt:

Reply to the ticket below.
You're a friendly help desk technician at mouhimen.dev.
The user isn't technical. Their phone still has the old password, that's
what locked the account. I've already unlocked it.
Under 100 words. 3 numbered steps for the mail app on their phone.
No jargon. Sign it "IT Support".

<ticket>
I changed my password this morning. Now my phone keeps asking for it,
and my account is locked!
</ticket>

The answer came back at 74 words: remove the work account on the phone, add it again with the new password, wait one minute before opening mail. Ready to send as it is.

Notice there’s no example here: this answer didn’t need one. Also notice the <ticket> tags. When a prompt gets long, tags keep your instructions apart from the user’s words.

Rebuild 2: a PowerShell script

Weak prompt:

Write a PowerShell script to find inactive users.

Claude’s first script found the users and then piped them into Disable-ADAccount. I never asked for that, but I never said not to, either. On a real domain that’s an outage.

Rebuilt prompt:

Write a PowerShell script to find inactive users.
Domain corp.mouhimen.dev. Users are in the Staff OU.
Inactive = no sign-in for 90 days.
It's a report for my manager: read only, change nothing.

<example>
abd.shamout, 2026-07-14, 127, Staff
</example>

One code block, then 3 short lines on how to run it.

The new script:

# Users in Staff with no sign-in for 90 days (report only)
$base = "OU=Staff,DC=corp,DC=mouhimen,DC=dev"
Search-ADAccount -AccountInactive -TimeSpan 90.00:00:00 `
  -UsersOnly -SearchBase $base |
  Get-ADUser -Properties LastLogonDate |
  Select-Object SamAccountName, LastLogonDate,
    @{n='DaysInactive';e={((Get-Date)-$_.LastLogonDate).Days}},
    @{n='OU';e={'Staff'}} |
  Export-Csv .\inactive-users.csv -NoTypeInformation

No disable line anywhere, and the CSV has exactly the four columns from my example. The example did the work. One rule I keep for every script from any AI: read every line before you run it, and try it on a test OU first. If you’re cleaning up Microsoft 365 accounts too, see my Microsoft 365 inactive users cleanup with PowerShell guide.

Rebuild 3: a server doc (the one line)

Weak prompt:

Document my web server.

Claude wrote a nice essay about web servers, with an IP address it made up and Apache instead of Nginx. It had to guess, because I gave it nothing.

Rebuilt prompt:

Document my web server.
You're writing for the junior tech who covers for me at night.
web01, Ubuntu 24.04, Nginx reverse proxy in front of my Laravel app on
port 8000, IP 10.10.0.20, SSL from Let's Encrypt, backup daily at 02:00.
Make it a table with 3 columns: Setting, Value, and What to do if it breaks.

The last line is the one most people never write. Same facts, but now every row is one fact I gave it, nothing guessed, and the “What to do if it breaks” column turns a description into a runbook my night tech can use at 2 in the morning. Most people describe the content and forget to describe the shape. (New to reverse proxies? Start with Nginx Reverse Proxy Explained.)

Prompting Claude in Arabic

You can write the whole prompt in Arabic, and Claude answers in Arabic. Or keep the prompt in English and add one line: “Write it in Arabic, keep the commands in English.” That’s great when your team reads Arabic but the commands must stay copy-and-paste ready.

4 mistakes and how to fix them

  1. Claude invents something. A cmdlet that doesn’t exist, or a setting your server doesn’t have. Give it the real facts and add: “If you’re not sure, say so.” An honest “I don’t know” beats a confident guess.
  2. You only say what not to do. “Don’t use jargon. Don’t make it long.” Anthropic’s guide says to tell Claude what to do instead: “Use words a new user knows. Keep it under 100 words.”
  3. You paste real secrets. Passwords, API keys and clients’ personal data don’t belong in a chat. Swap them for placeholders like <PASSWORD>, <API_KEY> or <CLIENT_PHONE>; the answer is just as good.
  4. Five tasks in one prompt. “Reply to the ticket, fix the script, document the server, and keep it short” gets you everything half done. Send one task per message, then build on the answer.

The line I add to almost every prompt

Before you start, ask me up to 3 questions if anything is missing.

Claude asks what it would otherwise guess. For the ticket above it asked: which phone, which mail app, and is the account unlocked yet? I answer in ten seconds and skip three rounds of fixing a wrong answer.

Quick checklist

  • [ ] Task in one clear sentence
  • [ ] Role: who should Claude be?
  • [ ] Context: who is it for, what’s done, and why do you need it?
  • [ ] Example: one sample of a good result, in <example> tags
  • [ ] Format: length, shape, language
  • [ ] No passwords, keys or personal data
  • [ ] Passes the new colleague test

FAQ

What is prompt engineering in simple words?

Prompt engineering is writing your request so the AI has everything it needs: who to be, the facts, a sample of a good result and the shape of the answer. For beginners it’s less about tricks and more about not leaving gaps for the AI to guess.

Do I need a paid Claude plan for this?

No. Everything in this post works on the free Claude plan. Projects (Episode 2) make it easier to reuse a role, and plan limits for features are covered in the earlier episodes.

Do these tips work with ChatGPT and Gemini too?

Yes. Role, context, examples and output format help with any chat AI. This post follows Anthropic’s guide for Claude, but the same four pieces improve answers in other tools.

Should I write prompts in English or Arabic?

Either. Claude understands and answers in Arabic. If the output contains commands, add “keep the commands in English” so they stay copy-and-paste ready.

How long should a prompt be?

As long as the task needs and no longer. A ticket reply might need four lines; a script that touches your domain deserves the full context and a format line. Use the new colleague test instead of counting words.

Keep learning

Watch the video: https://youtu.be/pHjPe7Haars

What’s the worst answer Claude ever gave you? And which topic do you want a video about next? Tell me in the comments on YouTube.

Sources

  • Anthropic, “Prompt engineering overview”: https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview
  • Anthropic, “Prompting best practices” (be clear and direct, add context, use examples, XML tags, give Claude a role, tell Claude what to do instead of what not to do): https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices
  • Microsoft, Search-ADAccount (ActiveDirectory module): https://learn.microsoft.com/powershell/module/activedirectory/search-adaccount

Leave a Reply

Your email address will not be published. Required fields are marked *