Prompt Engineering Basics
Core Principles
Be specific — "write a haiku about autumn rain" beats "write a poem"
Provide context — who the audience is, what tone you want, what format
Show examples — one good example is worth a paragraph of instructions
Specify the output format — JSON, markdown, bullet list, table
Techniques
Chain-of-thought — ask the model to "think step by step"
Few-shot examples — include 2-3 input/output pairs in your prompt
Role-playing — "You are a senior backend engineer reviewing this code"
System prompts — set persistent behavior and constraints up front
Common Mistakes
Vague instructions — "make it better" gives you vague results
No constraints on length — you'll get a 2000-word essay when you wanted 3 sentences
Not iterating — first prompt is a draft, refine based on output
Trusting output without verification — always fact-check critical claims