D15Intermediate

Negative Prompting

30 minEvery time AI output is unsatisfactory

Format: Improve output by telling the AI "what not to do."

Comparison:

Positive instructions only:
"Write a user registration API"

With negative instructions:
"Write a user registration API.
Do not:
- Do not use var (use const/let)
- Do not hardcode any values
- Do not use console.log
- Do not omit error handling
- Do not use the any type (TypeScript)
- Do not do more than one thing per function
- Do not use callback functions (use async/await)"

Exercise: Write a "do not" list for the following tasks:

  1. Design a login page
  2. Write a product introduction
  3. Create a REST API
  4. Design a database schema

My Notes