Prompt Engineering Best Practices
Master the art of prompt engineering with these proven best practices and guidelines.
Core Principles
Section titled “Core Principles”1. Be Specific and Clear
Section titled “1. Be Specific and Clear”Bad:
Write something about marketing.
Good:
Write a 500-word blog post about email marketing best practices for small businesses, focusing on subject lines, personalization, and automation.
2. Provide Context
Section titled “2. Provide Context”Bad:
Explain this error.
Good:
I'm getting a "TypeError: Cannot read property 'map' of undefined" error in my React component when trying to render a list of users. Here's my code: [CODE]. The users array should come from an API call. What's causing this error and how do I fix it?
3. Use Examples
Section titled “3. Use Examples”Bad:
Format this data nicely.
Good:
Format this sales data as a table. Here's an example of the desired output:
| Product | Q1 Sales | Q2 Sales | Growth ||---------|----------|----------|--------|| Widget A | $10,000 | $12,000 | +20% |
Now format this data: [YOUR DATA]
Structure Your Prompts
Section titled “Structure Your Prompts”The CRISP Framework
Section titled “The CRISP Framework”Use this structure for consistent results:
- Context: Set the scene
- Role: Define the AI’s persona
- Instructions: Clear, specific directions
- Samples: Provide examples
- Parameters: Set constraints and format
Example CRISP Prompt
Section titled “Example CRISP Prompt”Context: I'm launching a new SaaS product for project management.
Role: You are a senior marketing copywriter with expertise in SaaS products.
Instructions: Write compelling product descriptions that highlight key benefits and address common pain points.
Samples: Here's an example for a similar product:"Streamline your workflow with intuitive task management that keeps your team aligned and productive."
Parameters:- Length: 2-3 sentences- Tone: Professional yet approachable- Include one key benefit- End with a call-to-action
Writing Effective Instructions
Section titled “Writing Effective Instructions”Use Action Words
Section titled “Use Action Words”- Write a summary
- Analyze the data
- Compare options
- Generate ideas
- Explain the concept
Be Precise About Format
Section titled “Be Precise About Format”Instead of “make a list,” specify:
- Numbered list
- Bullet points
- Table format
- JSON structure
- Paragraph form
Set Clear Boundaries
Section titled “Set Clear Boundaries”Write a product review that:✓ Is between 150-200 words✓ Includes 3 pros and 2 cons✓ Uses a balanced, objective tone✓ Ends with a 1-5 star rating✗ Does not mention competitor brands✗ Avoids technical jargon
Working with Variables
Section titled “Working with Variables”Template Structure
Section titled “Template Structure”You are a [ROLE] helping [AUDIENCE] with [TASK].
Goal: [SPECIFIC_OBJECTIVE]
Context: [BACKGROUND_INFO]
Requirements:- [REQUIREMENT_1]- [REQUIREMENT_2]- [REQUIREMENT_3]
Format: [OUTPUT_FORMAT]
Input: [USER_INPUT]
Variable Best Practices
Section titled “Variable Best Practices”- Use descriptive brackets:
[TARGET_AUDIENCE]
not[X]
- Provide defaults:
[TONE: professional]
- Group related variables:
[PRODUCT_NAME]
,[PRODUCT_FEATURES]
- Include validation:
[WORD_COUNT: 100-300 words]
Quality Control
Section titled “Quality Control”Testing Your Prompts
Section titled “Testing Your Prompts”- Run Multiple Tests: Try different inputs
- Check Edge Cases: Test with unusual scenarios
- Validate Output: Ensure results meet requirements
- Compare Versions: A/B test prompt variations
Iteration Process
Section titled “Iteration Process”- Start Simple: Begin with basic prompt
- Add Specificity: Include more details
- Test Results: Evaluate output quality
- Refine Language: Adjust wording
- Optimize Performance: Fine-tune for consistency
Platform-Specific Tips
Section titled “Platform-Specific Tips”ChatGPT
Section titled “ChatGPT”- Works well with conversational tone
- Responds to “Let’s think step by step”
- Good at maintaining context across messages
Claude
Section titled “Claude”- Excels at analytical tasks
- Prefers structured instructions
- Strong at following complex formatting rules
Gemini
Section titled “Gemini”- Good at creative tasks
- Responds well to examples
- Effective with multimodal inputs
Common Mistakes to Avoid
Section titled “Common Mistakes to Avoid”❌ Don’t Do This
Section titled “❌ Don’t Do This”-
Vague Instructions
- “Make it better”
- “Fix this”
- “Write something”
-
Overloading with Information
- Too many requirements in one prompt
- Conflicting instructions
- Information overload
-
Assuming Context
- Not explaining background
- Using undefined terms
- Skipping important details
-
Ignoring Output Format
- No format specifications
- Unclear structure requirements
- Missing examples
✅ Do This Instead
Section titled “✅ Do This Instead”-
Specific Instructions
- “Rewrite this paragraph to be more concise while maintaining the key points”
- “Debug this code by identifying the syntax error”
- “Write a 300-word product description”
-
Focused Requests
- Break complex tasks into steps
- One main objective per prompt
- Clear priority order
-
Providing Context
- Explain the situation
- Define technical terms
- Share relevant background
-
Clear Formatting
- Specify desired structure
- Provide output examples
- Set length requirements
Measuring Success
Section titled “Measuring Success”Key Metrics
Section titled “Key Metrics”- Relevance: Does the output address your needs?
- Accuracy: Is the information correct?
- Consistency: Do you get similar results each time?
- Efficiency: How many iterations does it take?
Improvement Strategies
Section titled “Improvement Strategies”- Keep a Prompt Library: Save your best prompts
- Track Performance: Note what works well
- Document Variations: Record different versions
- Share with Team: Collaborate on improvements
Next Steps
Section titled “Next Steps”Ready to apply these best practices?
- Practice with Prompt Templates
- Explore Advanced Techniques
- Try Optimization Strategies
- See Real Examples