Prompt Engineering Patterns
15 Proven Patterns
Master prompt engineering with battle-tested patterns from industry leaders
15
Total Patterns
5
Categories
3
Skill Levels
76
Example Prompts
All Patterns
Role/Instruction
Reasoning
Structure/Format
Context Management
Advanced
All Levels
Beginner
Intermediate
Expert
Persona Pattern
Role/Instruction
Beginner
Instructs the AI to adopt a specific role or expert persona before performing a task.
Example:
Act as a [Persona X] expert. Perform [task Y] accordingly.Use Cases:
Complex technical tasks
Code review
Documentation
Product management
Audience Persona Pattern
Role/Instruction
Beginner
Tailors the response for a specific audience level or background.
Example:
Explain [concept] to a [audience type].Use Cases:
Technical documentation
Training materials
Stakeholder communication
Cognitive Verifier Pattern
Reasoning
Intermediate
Breaks down complex reasoning into smaller, verifiable questions.
Example:
When asked a question, generate additional questions that help verify the answer.Use Cases:
Complex problem solving
Debugging
Architecture decisions
Chain of Thought (CoT)
Reasoning
Beginner
Encourages step-by-step reasoning to improve accuracy.
Example:
Let's think step by step...Use Cases:
Math problems
Logic puzzles
Debugging
Planning
Question Refinement Pattern
Reasoning
Intermediate
AI suggests better versions of your question before answering.
Example:
Suggest a better version of my question, then answer both.Use Cases:
Unclear requirements
Exploratory research
Learning
Template Pattern
Structure/Format
Beginner
Provides a structured template for consistent output format.
Example:
Use this template: [template structure]Use Cases:
Reports
Documentation
Code generation
Standardization
Few-Shot Learning
Structure/Format
Intermediate
Provides examples to guide the AI's response style and format.
Example:
Here are examples: [examples]. Now do [task].Use Cases:
Code generation
Data transformation
Style matching
Context Control Pattern
Context Management
Intermediate
Explicitly manages what context the AI should focus on.
Example:
Focus only on [specific context]. Ignore [other context].Use Cases:
Large codebases
Focused analysis
Token optimization
Output Formatting Pattern
Context Management
Beginner
Specifies the exact output format (JSON, Markdown, etc.).
Example:
Return the result as JSON with these fields: [fields]Use Cases:
API integration
Data processing
Automation
Constraint Pattern
Context Management
Beginner
Sets clear boundaries and limitations for the response.
Example:
Answer in under 100 words. Do not use technical jargon.Use Cases:
Concise responses
Audience-appropriate content
Token limits
Tree of Thoughts (ToT)
Advanced
Expert
Explores multiple reasoning paths simultaneously.
Example:
Consider 3 different approaches to solve this problem.Use Cases:
Complex decisions
Strategy planning
Creative problem solving
ReAct Pattern
Advanced
Expert
Combines reasoning with actions in an iterative loop.
Example:
Think about what to do, take action, observe result, repeat.Use Cases:
Multi-step tasks
Tool usage
Autonomous agents
Self-Consistency
Advanced
Expert
Generates multiple reasoning paths and selects the most consistent answer.
Example:
Generate 3 different solutions and choose the most consistent one.Use Cases:
High-stakes decisions
Verification
Quality assurance
Meta-Prompting
Advanced
Expert
Uses AI to generate or improve prompts.
Example:
Generate a prompt that will help me accomplish [goal].Use Cases:
Prompt optimization
Automation
Prompt libraries
Retrieval Augmented Generation (RAG)
Advanced
Expert
Combines AI generation with external knowledge retrieval.
Example:
First retrieve relevant docs, then answer based on them.Use Cases:
Knowledge bases
Documentation
Fact-checking
Ready to use these patterns?
Browse our library of 76+ expert prompts that use these patterns
Browse Prompt Library