Anatomy of a Well-Crafted Prompt
Click each block to learn what it does. A strong prompt is built from layered components β each one sharpens the model's output.
Prompt Builder β click a block to inspect π Click any block on the left
Each colour-coded block represents a different component of an effective prompt. Select one to see a detailed explanation, common mistakes, and tips for improvement.
π§© The Six Blocks
A complete prompt typically contains:
Role β Who is the AI?
Context β What background info?
Task β What should it do?
Format β How should it respond?
Examples β Show don't just tell
Constraints β What to avoid?
π Token Economy
Every word costs tokens. Good prompts are specific, not verbose. Aim for clarity over length β a 50-token prompt with a clear role + task often outperforms a 300-token vague essay.
Core Techniques at a Glance
πChain of Thought
Ask the model to reason step-by-step before answering. Dramatically improves accuracy on logic, math, and multi-step tasks.
πΈFew-Shot Examples
Provide 2β5 input/output examples before your actual request. Shows the model the exact pattern you want.
πRole Prompting
"You are an expert Xβ¦" primes the model to adopt a persona, vocabulary, and depth of knowledge appropriate to that role.
πOutput Formatting
Specify structure: JSON, markdown, numbered list, table. Structured output is easier to parse and use programmatically.
πSelf-Consistency
Generate multiple responses and pick the most common answer. Reduces variance on reasoning tasks with a single prompt.
π²Tree of Thought
Explore multiple reasoning paths simultaneously. The model evaluates branches and backtracks β better for complex planning.
Before & After β Real Prompt Comparisons
The same request, rewritten with proper prompt engineering. The difference in output quality is dramatic.
Prompt Engineering Techniques