Skip to content

Prompt Engineering Fundamentals

How to talk to AI to get from it what a senior analyst would deliver. No fluff.

8 min · Beginner · 1 of 2

TL;DR

A good prompt has 5 parts: context + role + task + format + example. Whoever masters this gets structured analysis from AI — not vague guesses — in 30 seconds.

Why a well-crafted prompt makes a real difference

Anthropic measured this in internal benchmarks: prompts with clear structure (XML tags, role, chain of thought) raise output quality by +22% to +37% on complex analysis tasks — official source in the prompting docs. In practice: the same model, with a senior prompt, returns analysis that feels like it’s from another level.

The difference between an amateur prompt and a senior prompt

Amateur prompt:

“Analyze my sales spreadsheet”

Amateur response (predictable):

“Your spreadsheet appears to contain sales data. For deeper analysis, I recommend a specialist…”

Senior prompt:

“You are my Head of Sales. Attached is the Q1 sales spreadsheet with 8 reps and 1,247 deals. Compare conversion rate and average ticket per rep. Find 3 non-obvious patterns. For each pattern, quantify the impact in R$ per month. Format: a table followed by 3 actionable recommendations for this week.”

Senior response:

Structured analysis, with numbers, with an action plan. You save 4 hours of analyst work.

The 5-element structure

1 · Role

Tell it who it is before asking what to do. This activates a whole set of behaviors.

“You are an experienced CFO in B2B SaaS with R$ 100M ARR…”

“Act as a tax attorney specialized in Simples Nacional (Brazilian small-business tax regime)…”

“You are my Marketing Director focused on performance…“

2 · Context

What it needs to know before starting. Company background, constraints, decisions already made.

“My company sells SaaS for dental clinics. Average monthly ticket R$ 380. CAC of R$ 1,200. We’re growing 8% per month, but churn went from 3% to 4.8%.“

3 · Task

What you want. Specific. Action verb.

  • ❌ “Help me with sales”
  • ✅ “Identify the 3 most likely reasons for the churn increase”

4 · Output format

How you want to receive it. List, table, JSON, plain text, deck, ready-made email.

“Respond in: 1) table with the 3 reasons · 2) column with hypothesis · 3) column with how to validate in 7 days”

5 · Example (when it makes a difference)

If you have an example of what you want, show it. AI learns much more from example than from description.

“Example of what I want:

ReasonHypothesisValidation
Bad onboardingCustomer doesn’t use feature XCall 10 churned customers

Techniques that double quality

XML tags — for long prompts

When the prompt is large, separate the blocks with XML tags. Claude was trained to understand this.

<context>
Company: dental clinic
Ticket: R$ 380/month
Churn: 4.8%
</context>

<task>
Find 3 patterns in the attachment that explain the churn.
</task>

<format>
Markdown table with columns: pattern | evidence | impact in R$
</format>

Chain-of-Thought — for tricky problems

Ask it to think before answering. Magic phrase:

“Think step by step before answering. Show your reasoning. Only then give the conclusion.”

Result: responses with 2x fewer logical errors.

Prefill — to force format

Start the response in its place. Useful when you want pure JSON, with no preamble.

In tools/API: prefill = {"reasons":[

Result: it continues from where you left off.

Examples (Few-shot) — to standardize voice

Show 2-3 examples of the style you want before asking for the new one.

Master prompt for spreadsheet analysis

Copy, paste, adjust the context:

You are a senior business analyst with 15 years of experience, specialized in [SECTOR].

<context>
Company: [NAME] — [DESCRIPTION IN 1 LINE]
Revenue: R$ [X] / month
Team: [N] people
Main pain right now: [PAIN]
</context>

<data>
[ATTACH SPREADSHEET]
</data>

<task>
1. Read the entire spreadsheet. Identify columns, types, integrity.
2. Calculate the 5 most critical KPIs for this sector.
3. Find 3 non-obvious patterns.
4. Identify 2 silent risks (things nobody has seen).
5. For each finding, quantify impact in R$ per month.
</task>

<format>
- Executive summary in 5 bullets (R$ involved in each)
- KPI table
- "Hidden patterns" section with 3 items
- "Silent risks" section with 2 items
- Action plan for the next 30 days
</format>

Think step by step before answering. Show reasoning before the conclusion.

Common gotchas

  • Don’t ask “what do you think?” The AI will say “it depends.” Ask: “what’s the best option considering X, Y, Z?”
  • Don’t use a giant master prompt right out of the gate. Go in parts. Refine.
  • Always review numbers. Even with code execution, check that a random row in the spreadsheet matches the analysis.
  • Switch Project to switch context. Don’t mix “Sales” and “Legal” in the same thread.

Next step

Learn advanced techniques: Tree of Thoughts, ReAct, Reflexion in advanced prompting.

Or jump to Claude Skills — where you teach AI to execute repetitive tasks without re-explaining every day.

Entrega da lição
10 min

Tarefa

Take a short prompt you've already used (even a bad one). Rewrite it applying the 5 parts — role, context, task, format, example. Paste before/after side by side in a document.

Como saber que entregou

Before version (1-2 lines) and after version (with the 5 XML parts separated) pasted in. The after version has at least 4 of the 5 parts.

Auto-validável · você sabe se entregou
Compartilhar resultado ↗
Fontes oficiais