Prompt Engineering Basics
Basic Principles
"Explain the concept of machine learning to a 10-year-old"
Instead of: "Tell me about machine learning"
# Provide Context
"As a beginner in Python programming, explain how for loops work with examples"
# Specify Format
"List 5 benefits of renewable energy in bullet points"
# Set Constraints
"Write a 200-word summary of climate change for a middle school audience"
# Use Examples
"Create a recipe for chocolate chip cookies similar to this brownie recipe: [example]"
Prompt Structure
"Act as a [role] and [task]"
Example: "Act as a financial advisor and explain compound interest"
# Context-Instruction Pattern
"Given [context], [instruction]"
Example: "Given that I'm planning a trip to Japan, suggest a 7-day itinerary"
# Question-Answer Pattern
"Q: [question] A: [answer format]"
Example: "Q: What is photosynthesis? A: Provide a simple explanation with key steps"
# Step-by-Step Pattern
"First [step 1], then [step 2], finally [step 3]"
Example: "First explain the problem, then provide solutions, finally summarize key points"
Advanced Prompt Techniques
Chain of Thought
"Let's think step by step: [problem]"
# Example:
"If a store sells apples for $2 each and oranges for $3 each, and I buy 4 apples and 2 oranges, how much do I spend? Let's think step by step."
# Multi-step Complex Problems
"Solve this math problem by breaking it down into steps: [complex problem]"
# Reasoning with Intermediate Steps
"First, identify the key elements. Then, analyze their relationships. Finally, draw a conclusion."
Few-Shot Learning
"Example 1: [input] -> [output]"
"Example 2: [input] -> [output]"
"Now do this: [new input]"
# Classification Example:
"Classify the sentiment of these reviews:"
"Review: 'I love this product!' -> Sentiment: Positive"
"Review: 'This is the worst thing ever' -> Sentiment: Negative"
"Review: 'It's okay, nothing special' -> Sentiment: Neutral"
"Now classify: 'The service was excellent but the food was mediocre'"
# Translation Example:
"English: Hello, how are you? -> French: Bonjour, comment allez-vous?"
"English: Good morning -> French: Bonjour"
"Now translate: 'Thank you very much'"
Persona Pattern
"You are [persona]. [Task]"
# Expert Personas:
"You are a seasoned software engineer with 20 years of experience. Explain object-oriented programming."
# Creative Personas:
"You are a famous poet. Write a poem about the changing seasons."
# Educational Personas:
"You are a kindergarten teacher. Explain why the sky is blue to a 5-year-old."
# Professional Personas:
"You are a professional chef. Create a recipe for a healthy vegetarian lasagna."
Template Pattern
"Create a [document type] about [topic] with the following sections: [section 1], [section 2], [section 3]"
# Email Template:
"Write a professional email to [recipient] about [subject] with these key points: [point 1], [point 2], [point 3]"
# Business Plan Template:
"Create a business plan for [business idea] with these sections: Executive Summary, Market Analysis, Marketing Strategy, Financial Projections"
# Recipe Template:
"Create a recipe for [dish] with these sections: Ingredients, Instructions, Cooking Time, Serving Size"
ChatGPT Capabilities
Content Creation
"Write a 500-word blog post about [topic] for [audience]"
# Social Media Content
"Create 5 engaging Twitter threads about [topic]"
# Creative Writing
"Write a short story about [theme] with [characters] in [setting]"
# Technical Documentation
"Create documentation for [software feature] with examples"
# Marketing Copy
"Write compelling product descriptions for [product] highlighting [features]"
Analysis & Summarization
"Summarize the following text in 3 bullet points: [text]"
# Data Analysis
"Analyze this dataset and identify key trends: [data description]"
# Comparative Analysis
"Compare and contrast [concept A] and [concept B] in a table"
# Sentiment Analysis
"Analyze the sentiment of these customer reviews and categorize them"
# SWOT Analysis
"Perform a SWOT analysis for [company/product]"
Problem Solving
"Brainstorm 10 creative solutions for [problem]"
# Decision Making
"Help me decide between [option A] and [option B] by listing pros and cons"
# Troubleshooting
"I'm experiencing [problem]. What are possible causes and solutions?"
# Strategic Planning
"Create a step-by-step plan to achieve [goal]"
# Code Debugging
"Identify potential issues in this code and suggest fixes: [code snippet]"
Learning & Education
"Explain [complex concept] like I'm 10 years old"
# Study Guides
"Create a study guide for [subject] covering key topics"
# Quiz Generation
"Create a 10-question quiz about [topic] with answers"
# Analogies
"Explain [concept] using an analogy"
# Learning Path
"Create a 30-day learning plan for [skill]"
Best Practices
Effective Prompting
"Write a 300-word article about the benefits of meditation for college students"
Instead of: "Tell me about meditation"
# DO: Provide Context
"As a small business owner with limited budget, suggest marketing strategies"
# DO: Specify Format
"List 5 tips in bullet points with brief explanations"
# DO: Set Constraints
"Explain in simple terms without technical jargon"
# DON'T: Be Vague
Avoid: "Help me with my essay"
# DON'T: Overcomplicate
Avoid: "Using advanced computational linguistic frameworks, elucidate..."
Iterative Refinement
Initial: "Tell me about AI"
Refined: "Explain the difference between narrow AI and general AI"
More Refined: "Compare narrow AI and general AI in a table with examples"
# Use Follow-up Prompts
"Can you elaborate on point 3?"
"Provide more examples of this"
"Explain that in simpler terms"
# Correct and Redirect
"That's not quite what I meant. I'm looking for information about X, not Y"
# Ask for Alternatives
"Can you suggest a different approach?"
"What are other perspectives on this topic?"
Common Use Cases
Business & Productivity
- Email Writing: "Draft a professional email to [recipient] about [topic]"
- Business Plans: "Create a business plan outline for [business idea]"
- Meeting Agendas: "Create an agenda for a [type] meeting with key discussion points"
- Goal Setting: "Help me set SMART goals for [objective]"
- Presentations: "Outline a presentation about [topic] for [audience]"
- Proposals: "Draft a project proposal for [project] with budget and timeline"
Creative & Technical
- Programming: "Write Python code to [task] with comments"
- Creative Writing: "Write a [genre] story about [theme]"
- Content Ideas: "Generate 10 blog post ideas about [topic]"
- Translation: "Translate this text to [language] maintaining the original tone"
- Problem Solving: "Debug this code: [code snippet]"
- Brainstorming: "Brainstorm names for a [type] business"
Quick Reference
Prompt Templates
"Explain [concept] to a [audience] using [analogy/examples]"
# Comparison Template
"Compare [A] and [B] in terms of [criteria]. Present in a table."
# Step-by-Step Template
"Create a step-by-step guide for [task] for beginners"
# Analysis Template
"Analyze [text/data] and identify [key elements/patterns]"
# Creative Template
"Write a [type of content] about [topic] in the style of [influence]"
# Problem-Solving Template
"What are [number] solutions to [problem]? Evaluate pros and cons."
Useful Resources
- Official Docs: OpenAI API Documentation, ChatGPT Guide
- Books: "The Art of Prompt Engineering", "AI Communication"
- YouTube Channels: AI Explained, Two Minute Papers, Matt Wolfe
- Communities: Reddit (r/ChatGPT, r/PromptEngineering), Discord AI servers
- Practice Platforms: PromptHero, PromptBase, AI Test Kitchen
- Blogs: Towards AI, The Batch by DeepLearning.AI, AI News
Comprehensive ChatGPT Prompt Engineering Cheatsheet Reference
This ChatGPT Prompt Engineering cheatsheet on Nikhil Learn Hub collects syntax, commands, and practical snippets for quick revision. Learn ChatGPT prompt engineering techniques, AI prompting methods, templates, and practical examples for better results.
Use the reference cards and examples above during coding sessions; return here instead of scattered searches when you need dependable reminders. Follow the Generative AI learning roadmap when you want structured lessons beyond one-page lookups.
Quick lookup coverage
- Syntax, commands, and API signatures
- Copy-ready examples and common patterns
- Terminology for coursework and interviews
- Cross-links to the matching learning roadmap
How to study with this sheet
- Production debugging and tuning reminders
- Security, performance, or scale cautions
- Integration with adjacent stacks on this site
- Deeper study through tutorials and roadmaps
Who Should Use This Cheatsheet
Students, self-taught developers, and professionals who need fast ChatGPT Prompt Engineering lookups during labs, debugging, or interview revision should keep this page bookmarked.
Related Resources on Nikhil Learn Hub
- Generative AI learning roadmapstructured learning path for the same technology
- Cheatsheets hubbrowse all quick-reference sheets
- Technology hubtutorials, roadmaps, and practice hubs