Prompt Engineering Cheatsheet
Quick-reference prompt engineering techniques and examples for effective AI interactions.

Introduction
This cheatsheet distills key prompt engineering strategies into actionable examples you can copy, adapt, and reuse. Pair it with the Prompt Engineering Guide for deeper explanations.
General Strategies
- Be specific: Define the task, length, and format.
- Provide context: Assign roles or background.
- Structure the output: Request bullet points, steps, or JSON.
- Iterate: Refine prompts based on results.
Prompt Patterns
Role Prompting
- “You are a cybersecurity analyst. Summarize the top 3 risks in this report.”
Format Control
- “List the steps as bullet points.”
- “Return the answer in JSON: {title, summary, tags}.”
Step-by-Step Reasoning
- “Explain your reasoning step by step before the final answer.”
Few-Shot Examples
- “Translate the following sentences to French. Example: ‘Hello’ → ‘Bonjour’. Now: ‘Good night’ → ?”
Constraints
- “Write a 150-word summary, professional tone, suitable for executives.”
Reusable Templates
Summarization
“Summarize the following text in 5 bullet points, each under 15 words.”
Comparison
“Compare technology A and B in a table with columns: Feature, A, B.”
Explanation
“Explain [concept] as if to a beginner, using analogies and a simple example.”
Brainstorming
“Generate 10 creative ideas for [topic], grouped into categories.”
Editing
“Rewrite the following paragraph in a more concise, persuasive style.”
Common Fixes
- Too vague? → Add role, context, or output format.
- Too long? → Set a word limit.
- Disorganized? → Request numbered lists or sections.
- Hallucinated facts? → Ask for sources or caveats.
Quick Best Practices
✅ Clear, specific instructions ✅ Role assignment when useful ✅ Step-by-step reasoning for complex tasks ✅ Examples to guide style or format ✅ Iteration to refine results