“Prompt engineering” sounds fancy, but the core job is simple: turn vague intent into instructions the model can execute.
Technique 1: Role and Background
❌ Write me an email
✅ You are a B2B sales rep with 10 years of experience. Write a follow-up email
to a CTO who attended our demo last week but hasn't replied.
Professional tone, no pressure, under 150 words.
Role setting is not mysticism—it activates domain-appropriate patterns from training data.
Technique 2: Specify Output Format
❌ Analyze this competitor
✅ Analyze the competitor below as a table with columns:
Features, Pricing, Strengths, Weaknesses, Target Users
| Features | Pricing | Strengths | Weaknesses | Target Users |
|----------|---------|-----------|------------|--------------|
| ... | ... | ... | ... | ... |
Models excel at structured output. Specify format and you avoid wall-of-text prose.
Technique 3: Examples (Few-Shot)
Often better to show one example than describe at length:
Classify user feedback as: Feature Request / Bug Report / Usage Question
Examples:
Input: "Can you add dark mode?" → Feature Request
Input: "Login page keeps spinning" → Bug Report
Now classify:
Input: "Where is your API documentation?"
One example often beats three paragraphs of description.
Technique 4: Step by Step (Chain of Thought)
For complex tasks, ask the model to proceed in steps:
❌ Should I change jobs?
✅ Analyze my job-change decision in steps:
1. List pros/cons of current role (3 each)
2. List pros/cons of new offer (3 each)
3. Compare on career growth, income, work-life balance
4. Give analysis and recommendation (mark inferences clearly)
Benefits: structured output and visible reasoning (easier to spot logic gaps).
Technique 5: System Prompt as Standing Rules
When building AI apps, the system prompt is the model’s job description:
You are a code review assistant. Rules:
- Review only security and performance; ignore style
- Every issue must include line number and fix suggestion
- If no issues, reply "LGTM"
- Do not invent problems that don't exist
System prompts persist across the conversation—more efficient than repeating rules every turn.
Common Pitfalls
| Pitfall | Cause | Fix |
|---|---|---|
| Generic answers | Question too open | Add constraints: length, format, audience |
| Contradictions | Context truncated | Trim history or summarize |
| Fabricated facts | Prediction, not lookup | Provide source material or RAG |
| Unstable output | Temperature too high | Lower temperature; add format constraints |
A Complete Prompt Template
[Role] You are…
[Background] The situation is…
[Task] Please…
[Format] Output as…
[Constraints] Do not…; must…
[Example] For instance…
You need not fill every slot—but when nothing works, check what’s missing.
Summary
Prompts are not spells—they are clear requirements. Role + format + examples + steps cover ~80% of daily use.
Next: how to make AI read your documents before answering—RAG.