Prompt Engineering Best Practices

Chapter 1 of 6 · 4 practices · 3 min · 4-question quiz

Clear instructions and context

Most bad outputs come from prompts that leave the model to guess. These practices close the gaps a reader with no background would fall into.

Start: Write the prompt as a brief for a capable colleague with no background

4 practices in this chapter

  1. 1Write the prompt as a brief for a capable colleague with no backgroundAnthropic's prompting guide puts it as a golden rule: show your prompt to a colleague with minimal context on the task and ask them to follow it. If they would be confused, the model will be too.
  2. 2Explain why a rule exists instead of only stating itA bare rule gives the model one instruction. A rule with its reason lets it handle cases you did not list. Anthropic's guide shows the difference with a formatting rule: With the reason attached, the…
  3. 3Say what to do, not only what to avoidNegative instructions name the thing you do not want, which keeps it in view. Positive instructions describe the target directly.
  4. 4Use numbered steps when order matters and set a role in the system promptWhen the order or completeness of steps matters, write them as a numbered list. Anthropic's guide recommends sequential steps for exactly this case, and Google's Gemini guide lists step-by-step tasks…

Check yourself on this chapter

4 questions, right here once you are signed in. Your progress is saved as you read.

Sign up for the quiz