Skip to content

Instantly share code, notes, and snippets.

@mike-at-redspace
Last active July 17, 2025 08:25
Show Gist options
  • Save mike-at-redspace/3e420f77fc6cbf544ce0430ded9d0240 to your computer and use it in GitHub Desktop.
Save mike-at-redspace/3e420f77fc6cbf544ce0430ded9d0240 to your computer and use it in GitHub Desktop.
Prompting Cheat Sheet (summer 2025)

Advanced Prompting Cheat Sheet


1. How to Choose a Model

OpenAI Family

  • GPT-4o: Ideal for quick and straightforward tasks, multimodal capabilities with excellent image understanding.
  • GPT-o1: Best for critical tasks requiring advanced reasoning, mathematical proofs, and complex problem-solving (slower but highly capable).
  • GPT-4 Turbo: Perfect for creative writing, idea exploration, and long-form content generation.
  • GPT-3.5 Turbo: Cost-effective for high-volume, simple tasks and basic conversational AI.
  • GPT-4o mini: Lightweight version for simple tasks requiring multimodal understanding.
  • Advanced Voice Mode: Real-time conversational AI with natural speech patterns.

Strengths:

  • Strong multimodal capabilities (text, image, audio)
  • Excellent creative writing and brainstorming
  • Robust API ecosystem and integrations
  • Fine-tuning capabilities for specialized tasks

Anthropic Claude Family

  • Claude 3 Haiku: Lightweight and fast, great for everyday tasks and high-throughput applications.
  • Claude 3 Sonnet: Balanced performance for versatile use cases, excellent for analysis and writing.
  • Claude 3 Opus: High-capacity model excelling in complex reasoning and nuanced understanding.
  • Claude 3.5 Sonnet: Enhanced reasoning with improved coding and mathematical capabilities.
  • Claude 4 Sonnet & Opus (2025): Next-generation models with enhanced speed and quality.

Strengths:

  • Large context windows up to ~200k tokens
  • Strong focus on factual alignment and safety via Constitutional AI
  • Excellent for coding, analysis, and sensitive conversations
  • Superior performance on complex reasoning tasks
  • Built-in artifact creation for structured outputs

Google Gemini Family

  • Gemini 1.0: Available in Nano, Pro, Ultra sizes---versatile multimodal LLM.
  • Gemini 1.5 Pro: Extended context window (up to 1M tokens), excellent for document analysis.
  • Gemini 2.0 Flash: Agent-mode with audio/image output and tool integration.
  • Gemini 2.5:
    • 2.5 Pro ("diamond"): Advanced reasoning, coding, and multimodal capabilities.
    • 2.5 Flash ("spark"): Balanced speed and cost performance.
    • 2.5 Flash-Lite: Cost-efficient for high-throughput tasks.

Strengths:

  • Built-in "thinking" steps for improved accuracy
  • True multimodal processing of text, images, audio, and video
  • Massive context window capabilities (up to 2M tokens)
  • Integrated with Google's ecosystem and real-time data

Emerging Models

  • Anthropic's Claude Computer Use: Specialized for computer interaction and automation tasks.
  • OpenAI's Sora: Video generation and understanding capabilities.
  • Meta's Llama 3: Open-source alternative with strong performance.
  • Mistral AI: European alternative with focus on efficiency and multilingual support.
  • Cohere Command: Enterprise-focused with strong retrieval-augmented generation.

Advanced Model Selection Framework

Use Case Primary Choice Alternative Specialized Option
Fast, simple write-ups GPT-4o, Claude Haiku Gemini 2.5 Flash Mistral 7B
Complex coding & analysis Claude 3.5 Sonnet, GPT-o1 Gemini 2.5 Pro Codex/GitHub Copilot
Creative and exploratory GPT-4 Turbo, Claude Opus Gemini 2.0 Flash Stable Diffusion + LLM
Large document analysis Gemini 1.5 Pro, Claude Opus GPT-4 Turbo Anthropic Claude Computer
Fact-safe responses Claude with Constitutional AI GPT-4o with RAG Perplexity AI
Real-time reasoning Gemini 2.5 Pro GPT-o1 Custom fine-tuned model
Multimodal projects GPT-4o, Gemini 2.5 Pro Claude 3.5 Sonnet Specialized vision models
Enterprise/Safety Claude Opus, Cohere Command GPT-4 Enterprise Custom deployment

2. Advanced Prompting Techniques

Core Techniques

  • Act as [role] → Define a role to set the tone and expertise level
  • Create a task → Specify your request clearly with success criteria
  • Rewrite → Improve or rephrase existing content with specific improvements
  • Define the format → Specify how the output should be structured (JSON, markdown, diagram etc.)
  • Add context → Provide relevant details, constraints, and background information
  • Set guidelines → Specify what to avoid, include, or emphasize in the response
  • Tip and penalize → Offer suggestions for better answers and consequences for poor ones
  • Critique → Highlight pros and cons for refinement and improvement

Advanced Techniques

  • Chain of Thought (CoT) → Ask the model to show its reasoning step-by-step
  • Few-Shot Learning → Provide examples of input-output pairs for pattern recognition
  • Zero-Shot Chain of Thought → Add "Let's think step by step" to improve reasoning
  • Tree of Thoughts → Explore multiple reasoning paths before selecting the best one
  • Self-Consistency → Generate multiple answers and select the most consistent one
  • Constitutional AI → Use principles and rules to guide model behavior
  • Retrieval-Augmented Generation → Combine external knowledge with model reasoning
  • Prompt Chaining → Break complex tasks into sequential, connected prompts

3. Comprehensive Prompt Structures

Classic Frameworks

  • R-A-I-N → Role - Aim - Input - Numeric Target
  • R-T-F → Role - Task - Format
  • R-I-S-E → Role - Input - Steps - Expectation
  • F-L-O-W → Function - Level - Output - Win Metric
  • R-O-S-E → Role - Objective - Steps - Expected Result
  • P-I-V-O → Problem - Insight - Voice - Outcome
  • P-L-A-N → Problem - Limit - Action - Number

Advanced Frameworks

  • C-R-E-A-T-E → Context - Role - Examples - Action - Template - Evaluation
  • S-T-A-R-T → Situation - Task - Action - Result - Twist
  • A-P-E-X → Action - Purpose - Example - eXpectation
  • B-R-I-D-G-E → Background - Role - Instructions - Desired outcome - Given constraints - Examples
  • S-C-A-L-E → Situation - Constraints - Audience - Length - Examples
  • F-R-A-M-E → Function - Role - Audience - Message - Examples

4. Enhanced Perspective Mirror Techniques

1. Expert Ensemble

  • Outcome: Synthesize insights from multiple specialized perspectives
  • Prompt seed: "Answer as a team of [virologist, ethicist, economist]. Each expert should contribute their unique perspective, then collaborate on a unified recommendation."

2. Temporal Perspective

  • Outcome: Analyze problems across different time horizons
  • Prompt seed: "Evaluate this decision from three perspectives: immediate impact (1 week), medium-term consequences (1 year), and long-term implications (10 years)."

3. Stakeholder Analysis

  • Outcome: Consider all affected parties and their interests
  • Prompt seed: "Analyze this proposal from the perspectives of: customers, employees, shareholders, regulators, and society at large."

4. Devil's Advocate Plus

  • Outcome: Generate comprehensive counter-arguments and steel-man opposing views
  • Prompt seed: "First, argue strongly against this position using the best possible counter-arguments. Then, defend the original position against these objections."

5. Cultural Lens

  • Outcome: Understand how different cultures might interpret or respond
  • Prompt seed: "How would this proposal be received in [Western, Eastern, Indigenous, Global South] cultural contexts?"

6. Cognitive Bias Hunter

  • Outcome: Identify and mitigate potential cognitive biases
  • Prompt seed: "What cognitive biases might be influencing this decision? How can we account for confirmation bias, anchoring, and availability heuristic?"

5. Master-Level Prompt Rules

✅ Essential Elements

Role + Specific Guidelines:

  • Define expertise level and perspective clearly
  • Include domain-specific knowledge requirements
  • Set behavioral guidelines and constraints

Concrete Examples of Excellence:

  • Provide 2-3 examples of desired output quality
  • Include both positive and negative examples
  • Show format, tone, and depth expectations

Iterative Refinement Process:

  • Request initial draft with specific feedback criteria
  • Define improvement metrics and success indicators
  • Build in self-correction and quality assessment

Context-Rich Background:

  • Include relevant domain knowledge and constraints
  • Specify target audience and use case
  • Provide historical context and current situation

❌ Anti-Patterns to Avoid

Generic AI Language: Replace: "Let's dive into this amazing tool" With: "Here's how it works."

Replace: "I'd be happy to help you with that!" With: "Here's your analysis:"

Replace: "This is a great question!" With: [Direct answer]

Vague Instructions: Replace: "Make it better" With: "Increase clarity by 30%, reduce jargon, add specific examples"

Replace: "Be creative" With: "Generate 3 novel approaches using design thinking principles"


6. Advanced Verification and Quality Control

Fact-Checking Protocols

  • Claim Extraction: "After your response, list all factual claims that require verification."
  • Source Integration: "Cite authoritative sources within 24 hours of each statistic."
  • Uncertainty Quantification: "Rate your confidence (0-100%) for each major claim."
  • Cross-Reference Check: "Compare your answer against 3 different authoritative sources."

Logic and Reasoning Verification

  • Assumption Audit: "List all assumptions underlying your recommendations."
  • Logical Flow Check: "Number each reasoning step and verify logical connections."
  • Contradiction Scanner: "Identify any internal contradictions in your response."
  • Alternative Path Exploration: "What if your key assumption is wrong? Provide alternative analysis."

Quality Assurance Loops

  • Completeness Check: "Have you addressed all aspects of the original question?"
  • Audience Appropriateness: "Is this response suitable for [specific audience]?"
  • Actionability Assessment: "Can someone immediately act on this advice?"
  • Edge Case Analysis: "In what scenarios would this advice fail or backfire?"

7. Advanced Prompt Engineering Patterns

Meta-Prompting Techniques

  • Prompt Optimization: "Improve this prompt to get better results: [original prompt]"
  • Self-Evaluation: "Rate your response quality (1-10) and suggest improvements"
  • Recursive Refinement: "Take your previous answer and make it 20% more [specific quality]"

Dynamic Adaptation

  • Context Switching: "Now analyze the same problem as a [different role]"
  • Complexity Scaling: "Explain this concept at elementary, high school, and graduate levels"
  • Format Flexibility: "Provide the same information as: bullet points, narrative, table, flowchart"

Constraint-Based Prompting

  • Resource Limitations: "Solve this with only [specific constraints]"
  • Time Pressure: "Provide a 2-minute, 10-minute, and 1-hour solution"
  • Audience Constraints: "Explain to someone who is [specific background/limitations]"

8. Specialized Use Cases

Research and Analysis

  • Literature Review: "Conduct a systematic review of [topic] including methodology, findings, and gaps"
  • Data Analysis: "Analyze this dataset for patterns, anomalies, and actionable insights"
  • Competitive Intelligence: "Map the competitive landscape for [industry/product]"

Creative and Innovation

  • Ideation Sessions: "Generate 50 innovative solutions using SCAMPER methodology"
  • Storytelling: "Create a narrative arc with specific emotional journey and character development"
  • Design Thinking: "Use double diamond process to solve [specific problem]"

Business and Strategy

  • Decision Frameworks: "Apply decision trees and risk matrices to evaluate [options]"
  • Market Analysis: "Perform SWOT, PESTLE, and Porter's Five Forces analysis"
  • Process Optimization: "Map current state, identify bottlenecks, design future state"

Technical and Development

  • Code Review: "Review this code for security, performance, and maintainability"
  • Architecture Design: "Design system architecture considering scalability, reliability, and cost"
  • Debugging: "Systematically diagnose and fix this issue using root cause analysis"

9. Model-Specific Optimization

OpenAI Models

  • Use system messages effectively for consistent behavior
  • Leverage function calling for structured outputs
  • Optimize for token efficiency in high-volume applications
  • Use fine-tuning for specialized domains

Anthropic Claude

  • Take advantage of large context windows for document analysis
  • Use Constitutional AI principles for ethical constraints
  • Leverage thinking tags for complex reasoning
  • Optimize for safety-critical applications

Google Gemini

  • Maximize multimodal capabilities with rich media inputs
  • Use massive context windows for comprehensive analysis
  • Leverage real-time data integration
  • Optimize for multilingual applications

10. Emerging Trends and Future Considerations

Multimodal Integration

  • Combine text, image, audio, and video inputs strategically
  • Design prompts that leverage cross-modal understanding
  • Consider accessibility and inclusive design principles

Agent-Based Systems

  • Design for autonomous task execution
  • Build in safety constraints and human oversight
  • Plan for multi-agent collaboration scenarios

Personalization and Adaptation

  • Design prompts that adapt to user preferences
  • Build in learning and memory capabilities
  • Consider privacy and data protection requirements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment