Prompt Engineering
Every technique that works — with real examples
Prompting for Code Review: Getting Useful Feedback, Not Compliments
How to write prompts that produce actionable code review - specifying focus areas, severity tiers, concrete fix examples, adversarial review framing, and the difference between diff review and full-file review.
Prompting for Creative Writing: Getting Less Generic Output
How to escape generic AI writing - using specific stylistic constraints, exclusion lists, tone references, temperature settings, and iterative generate-critique-revise loops to get genuinely distinctive creative output.
Prompting for Data Extraction: Structured Output From Unstructured Text
A complete guide to extracting structured data from text with LLMs - field definitions, JSON schemas, function calling for guaranteed structure, missing field handling, batch efficiency, and accuracy limits.
Prompting for Classification: Getting Consistent Labels Every Time
How to write prompts that produce reliable, consistent classification labels - covering category definitions, JSON output, multi-label vs single-label, confidence scores, and when to use zero-shot vs few-shot vs fine-tuning.
Prompting for Summarization: Techniques That Actually Work
Learn how to write prompts that produce accurate, concise summaries - covering length control, chain-of-density compression, source citation, and prompt differences across email, meeting, and document contexts.
Prompt Engineering Complete Guide 2026: Every Technique That Actually Works
Every major prompt engineering technique with real before-and-after examples. Zero-shot, CoT, system prompts, RAG, ReAct, and what does not work despite the hype.
Role Prompting: How to Use Personas to Get Better LLM Outputs
Role prompting assigns a persona to the model to shift its responses toward domain-specific language and reasoning. When it helps, when it backfires, and real before-and-after examples.
Getting Structured Output From LLMs: JSON, XML, and Format Control
Getting reliable structured output from LLMs requires more than asking for JSON. Three methods from least to most reliable, with real prompt examples and failure modes for each.
Prompt Chaining: How to Break Complex Tasks Into Reliable Steps
Prompt chaining passes the output of one LLM call as input to the next. Four patterns with real examples, and when chaining is worth the complexity vs. a single prompt.
Self-Consistency Prompting: How to Improve Accuracy Through Multiple Samples
Self-consistency runs the same prompt multiple times and takes the majority answer. Wang et al. showed 5-40% accuracy improvements on reasoning tasks. When the cost is worth it.
Prompt Injection Attacks: What They Are and How to Prevent Them
Prompt injection is when malicious input overrides your system prompt. Two attack types, documented real-world examples, and five defense strategies ranked by effectiveness.
Prompting for Code Generation: Techniques That Actually Improve Output Quality
Code prompting is different because outputs are verifiably correct or wrong. Six techniques that consistently improve code quality, with specific examples and the most underused application.
Tree of Thought Prompting: When to Use It and When It's Overkill
Tree of Thought has the model explore multiple reasoning paths and pick the best. Yao et al. 2023 showed significant gains on hard problems. Most tasks don't need it - here's when they do.
Chain of Thought Prompting: 8 Patterns With Real Before-and-After Examples
Chain of thought prompting improves accuracy on multi-step reasoning by 10-40%. Eight specific CoT patterns with real before-and-after prompt examples.
How to Write a System Prompt That Actually Works: Examples for Every Use Case
System prompts set the model's role, constraints, and output format. Six complete system prompt examples for customer support, code review, research, writing, data analysis, and project management.
Few-Shot Prompting: When It Works, When It Fails, With Real Examples
Few-shot prompting uses 3-5 examples to show the model the pattern you want. When it outperforms fine-tuning, when it fails, and how format sensitivity affects output quality.
Tree of Thoughts: Let LLMs Explore Multiple Reasoning Paths
Tree of Thoughts treats problem-solving as a search problem, having the LLM generate multiple reasoning branches, self-evaluate each, and backtrack when stuck - dramatically improving on hard reasoning tasks.
Chain-of-Thought Prompting: The Google Paper That Made LLMs Better at Math
Wei et al. 2022 showed that prompting LLMs to show their reasoning steps - chain-of-thought - dramatically improves performance on arithmetic and logical reasoning tasks.