These 5 techniques are used by all prompt engineering pros โ from Anthropic to OpenAI. Each is tailored to its own task type. Master them, and you'll cover 90% of business use cases.
The most basic form: you provide a task, and the model responds. No examples.
Example: "Translate to Spanish: Welcome to our store"
When to use: simple, straightforward tasks. Translation, summarization, obvious classification.
When it DOES NOT work: custom formats, specific style, edge cases.
You show 2-5 examples of the correct output, then ask a new question. The model copies the pattern.
Example:
Classify customer reviews into categories: POSITIVE / NEGATIVE / NEUTRAL.
Example 1: "Fast delivery, great product!" โ POSITIVE
Example 2: "The order arrived broken, support is not responding" โ NEGATIVE
Example 3: "Bought it, using it, nothing special" โ NEUTRAL
Classify: "The price is fine, but the packaging is bad, the product itself is OK"
โ
When to use: when you need a specific response format. Classification, data extraction, custom formatting.
Pro tip: 3-5 examples is the sweet spot. Fewer and the model guesses; more and it loses focus.
You ask the model to reason step-by-step first, then provide the answer. The magic phrase is: "Think step-by-step."
Example:
I have a coffee shop in Kyiv. 50 orders/day, average ticket $8.
Rent expense is $1200/month, coffee+milk is $0.80/order, barista salary is $800.
What is my monthly profit, and is it worth expanding to a second location?
Think step-by-step, then provide a conclusion.
When to use: calculations, multi-step analysis, logic problems. Without CoT, the model often "guesses" the final answer and gets it wrong. With CoT, it reasons and hits the mark more often.
๐ฏ Fact: a Google study (2022) showed that Chain-of-Thought increases accuracy on complex tasks from 17.9% to 58.1%. This is the highest-impact pattern.
You assign an expert role to the model. It starts using the terminology, frameworks, and tone of that profession.
Example:
You are an experienced CFO with 15 years in SaaS companies. I am an early-stage founder,
my MRR is $8k, monthly churn is 6%, monthly growth rate is 12%.
Evaluate the health of my business using three metrics: LTV/CAC, magic number,
and Rule of 40. Give a recommendation: focus on growth or retention?
When to use: when you need an expert perspective. Finance, law, marketing strategy, code review.
Pro tip: combine it with CoT: "You are a CFO. Think step-by-step how a CFO would reason about this situation."
Strictly define the output format. JSON, tables, Markdown with specific sections.
Example:
Analyze this email from a client: "[email text]"
Return strictly JSON in the format:
{
"intent": "purchase | complaint | question | other",
"urgency": "high | medium | low",
"sentiment": "positive | neutral | negative",
"suggested_action": "string"
}
No text before or after the JSON.
When to use: when your code / pipeline will parse the response programmatically. The model is great at generating JSON, CSV, or XML.
Pro tip: Claude and GPT-4 support "JSON mode" โ where it's virtually impossible to get non-JSON output.
[Role] You are an experienced sales analyst with a focus on B2B SaaS.
[Few-Shot] Examples of my successful emails:
1. "{example 1}" โ conversion 23%
2. "{example 2}" โ conversion 18%