Skip to content

Writing Great Prompts

The quality of your prompts directly affects the quality of AI responses. This guide teaches you how to write effective prompts that get you better results.

What is a Prompt?

A prompt is your message to the AI. It can be:

  • A question
  • An instruction
  • A request
  • A conversation starter
  • A complex task description

The Golden Rules

1. Be Specific

Instead of vague prompts:

❌ "Help me with math"
❌ "Write code"
❌ "Tell me about history"

Be specific:

✅ "Explain how to solve quadratic equations step by step"
✅ "Write a Python function to calculate fibonacci numbers"
✅ "Summarize the causes of World War 2 in 5 bullet points"

2. Provide Context

Without context:

❌ "Is this good?"
❌ "Fix this"
❌ "What should I do?"

With context:

✅ "I'm writing an essay for my English class. Is this introduction paragraph good? [paragraph]"
✅ "This Python code has a bug in the sorting function. Can you fix it? [code]"
✅ "I have an exam tomorrow on derivatives. What should I focus on studying?"

3. Break Down Complex Tasks

Too much at once:

❌ "Help me write a complete website with login, database, and payment system"

Step by step:

✅ "I want to build a user login system. Let's start with the HTML form. Can you create one with username and password fields?"

Then: "Great! Now let's add JavaScript validation..."

Then: "Now help me with the backend authentication..."

4. Specify Format

Unclear format:

❌ "Tell me about Python"

Specify what you want:

✅ "List 5 key features of Python with one-sentence explanations for each"
✅ "Explain Python in a way a 10-year-old would understand"
✅ "Create a comparison table of Python vs JavaScript"

Prompt Templates

For Learning

Template:

Explain [topic] to me as if I'm [beginner/intermediate/expert].
Include [examples/analogies/diagrams] to help me understand.
Focus especially on [specific aspect].

Example:

Explain machine learning to me as if I'm a beginner.
Include real-world analogies to help me understand.
Focus especially on the difference between supervised and unsupervised learning.

For Problem Solving

Template:

I'm trying to [goal].
I've tried [what you've tried].
The problem is [specific issue].
Can you help me [what you need]?

Example:

I'm trying to sort a list of dictionaries by multiple keys in Python.
I've tried using sorted() with a lambda function.
The problem is it only sorts by the first key.
Can you help me sort by 'priority' first, then 'date'?

For Code Review

Template:

Please review this [language] code that [purpose].
Look for:
- [aspect 1]
- [aspect 2]
- [aspect 3]

[Your code here]

Example:

Please review this Python code that processes CSV files.
Look for:
- Potential bugs
- Performance issues
- Better error handling

[code]

For Writing

Template:

Write a [type] about [topic] that:
- Is [length]
- Has a [tone]
- Is intended for [audience]
- [Additional requirements]

Example:

Write a blog post about renewable energy that:
- Is approximately 500 words
- Has an optimistic and educational tone
- Is intended for high school students
- Includes statistics and examples

For Research

Template:

I'm researching [topic] for [purpose].
Can you help me:
1. [First need]
2. [Second need]
3. [Third need]

Focus on [specific aspect].

Example:

I'm researching artificial intelligence ethics for my thesis.
Can you help me:
1. List the main ethical concerns
2. Find recent developments (enable web search!)
3. Identify key researchers in this field

Focus on bias and fairness issues.

Prompt Techniques

The "Role" Technique

Ask the AI to take on a specific role:

✅ "Act as a Python expert and review my code"
✅ "Pretend you're a history teacher explaining the French Revolution"
✅ "You're a job interview coach. Help me prepare answers"

The "Step-by-Step" Technique

Request detailed breakdowns:

✅ "Explain how photosynthesis works, step by step"
✅ "Show me how to solve this equation with each step explained"
✅ "Walk me through building a REST API from scratch"

The "Example" Technique

Provide examples of what you want:

✅ "Write 3 similar questions like this one: [example]"
✅ "Format the output like this: [example format]"
✅ "Use this style: [example paragraph]"

The "Constraint" Technique

Set clear boundaries:

✅ "Explain in exactly 3 sentences"
✅ "Use only words a 5th grader would know"
✅ "Without using technical jargon"
✅ "In less than 200 words"

The "Comparison" Technique

Ask for comparisons:

✅ "Compare Python and JavaScript for web development"
✅ "What are the pros and cons of each approach?"
✅ "Which would be better for my use case: [describe]?"

Common Mistakes to Avoid

1. Too Vague

Bad:

❌ "Help"
❌ "I don't understand"
❌ "Do my homework"

Fix: Be specific about what you need help with.

2. No Context

Bad:

❌ "Is this right?" (without showing what "this" is)
❌ "Why isn't it working?" (without code or error)

Fix: Always include relevant information.

3. Assuming Knowledge

Bad:

❌ "Continue from where we left off" (in a new conversation)
❌ "Like I mentioned before" (without repeating it)

Fix: Each conversation needs its own context.

4. Multiple Unrelated Questions

Bad:

❌ "Explain quantum physics, help me with my resume, and write a Python script"

Fix: Ask one thing at a time, or clearly separate questions.

5. Expecting Mind Reading

Bad:

❌ "Write the code" (without saying what it should do)
❌ "Make it better" (without defining "better")

Fix: Specify exactly what you want.

Advanced Prompting

Chain of Thought

Ask the AI to think through problems:

✅ "Let's think through this step by step:
1. First, what are the key factors?
2. Then, how do they interact?
3. Finally, what's the conclusion?"

Iterative Refinement

Build on previous responses:

First prompt: "List the main features of a todo app"
Second: "Great! Now expand on the user authentication feature"
Third: "Perfect. Now let's design the database schema for this"

Multi-Part Instructions

Structure complex requests:

✅ "I need help with a Python project. Here's what I need:

PART 1: Code Review
[paste code]

PART 2: Optimization
Suggest ways to make it faster

PART 3: Documentation
Help me write docstrings"

Providing Examples

Show what you want:

✅ "Generate product descriptions in this style:

Example 1: [your example]
Example 2: [your example]

Now write one for: [new product]"

Prompts for Different Tasks

Homework Help

✅ "I'm working on [subject] homework about [topic].
I understand [what you know] but I'm confused about [specific issue].
Can you explain [specific question] without giving me the direct answer?
I want to learn, not just copy."

Code Debugging

✅ "I have a bug in my [language] code.
Expected behavior: [what should happen]
Actual behavior: [what actually happens]
Error message: [error if any]

Here's the code:
[code]

What might be wrong?"

Creative Writing

✅ "Write a [genre] story that:
- Is set in [setting]
- Features [character type]
- Has a theme of [theme]
- Is approximately [length]
- Has a [tone] tone"

Study Help

✅ "I'm studying for a [subject] exam on [topic].
Create 5 practice problems at [difficulty] level.
Include the answer key, but hide it so I can try first."

Career & Professional

✅ "I'm applying for a [position] role at [type of company].
Here's my experience: [brief background]
Help me write a cover letter that:
- Highlights my [skills]
- Shows enthusiasm for [aspect]
- Is professional but personable
- Is under 300 words"

Using Follow-Ups

Clarification

✅ "Can you explain the third point in more detail?"
✅ "I didn't understand the part about [specific thing]"
✅ "What do you mean by [term]?"

Expansion

✅ "That's helpful! Now can you show me an example?"
✅ "Can you go deeper into the [specific aspect]?"
✅ "What are some edge cases I should consider?"

Correction

✅ "Actually, I meant [clarification]"
✅ "Let me rephrase: [new explanation]"
✅ "That's not quite what I needed. Let me try again: [new prompt]"

Tips for Best Results

Do's ✅

  • Be polite (it helps you think clearly too!)
  • Use proper grammar (easier for the AI to understand)
  • Include examples when possible
  • Specify format you want
  • Ask follow-ups to refine answers
  • Provide feedback ("that's helpful, but...")

Don'ts ❌

  • Don't be rude (unnecessary and unhelpful)
  • Don't assume context from previous chats
  • Don't use only "fix this" or "help"
  • Don't expect perfect first answers
  • Don't rush - take time to write clear prompts

Practice Exercises

Try improving these prompts:

Exercise 1

Before: "Tell me about AI"

After: [Try it yourself!]

Suggestion:

Explain the three main types of artificial intelligence (narrow, general, and superintelligent AI) with one example of each. Use simple language suitable for someone with no technical background.

Exercise 2

Before: "My code doesn't work"

After: [Try it yourself!]

Suggestion:

My Python function for calculating averages returns incorrect results. When I input [1, 2, 3], I expect 2.0 but get 6. Here's my code: [code]. What's wrong?

Exercise 3

Before: "Help with essay"

After: [Try it yourself!]

Suggestion:

I'm writing a persuasive essay arguing for renewable energy adoption. Can you review my thesis statement and suggest improvements? Here it is: [thesis]. The essay is for my college English class.

Prompting Different Models

GPT-5 (Good for)

  • Problem-solving
  • Analysis
  • Structured outputs
  • Technical writing

Prompting style: Clear objectives with constraints

Claude (Good for)

  • Detailed explanations
  • Following complex instructions
  • Code with explanations
  • Creative writing

Prompting style: Detailed, structured prompts work best

Gemini (Good for)

  • Long documents
  • Research
  • Information synthesis
  • Multi-part tasks
  • Language translation

Prompting style: Can handle very long contexts

Conclusion

Great prompts = Great results. The key principles:

  1. Be specific about what you want
  2. Provide context for better understanding
  3. Structure complex requests clearly
  4. Iterate and refine based on responses
  5. Learn from what works and what doesn't

Practice Makes Perfect

The more you interact with AI, the better you'll get at prompting. Experiment, iterate, and learn from each conversation!

Next Steps

Made with ❤️ by KDMC (KMITL Data Management Center)