Prompt Engineering & Vibe Coding

Lesson 2 of 6

Writing Clear, Specific Prompts

A vague prompt gets a vague, or wrong, result. The single biggest lever you have over an AI's output is how clearly you describe the task.

Vague vs. specific

❌ "Fix the login bug"

✅ "Users can't log in with an uppercase email address. The login
route at apps/api/src/routes/auth.ts compares email exactly instead
of case-insensitively. Make the comparison case-insensitive without
changing how emails are stored."

The second prompt tells the AI what's broken, where, why, and what not to change, four things a vague one-liner leaves it to guess.

A simple checklist

  • Goal, what should be true when you're done?
  • Location, which file(s), function(s), or area of the app?
  • Constraints, what should stay the same? Anything to avoid?
  • Examples, a sample input/output, or a similar pattern already in the codebase, if one exists.

Iterate, don't restart

If the first result isn't quite right, you rarely need to throw it away and start over. Point at exactly what's wrong:

"Close, but this also matches emails that are subsets of each other,
like 'a@b.com' matching 'aa@b.com'. Only treat them as equal if they
match exactly, ignoring case."

TIP

Treat your prompt like a well-written bug report or a ticket for a new teammate, if it would confuse a human collaborator, it'll confuse the AI too.

📝 Clear Prompts Quiz

Passing score: 70%
  1. 1.Which of these is most likely to produce a good result from an AI coding assistant?

  2. 2.When a result isn't quite right, it's usually more effective to describe exactly what's wrong than to ____ from scratch.

  3. 3.Providing an example of the desired input/output typically improves an AI's response.