Crafting Clear Instructions › The Anatomy of a Good Prompt
AI Agent HandbookAll chapters Crafting Clear Instructions › The Anatomy of a Good PromptOne section · Sections in this chapter3 / 11 ↓
Let's break down what makes a prompt effective. A good prompt typically includes three elements:
1. The Task: What do you want the model to do?
Instead of "moon," try "Explain what causes the Moon's phases."
2. The Context: What constraints or requirements matter?
Add details like: "in 2-3 sentences," "for a high school science class," "using an analogy."
3. The Format: How should the response be structured?
Specify: "as a bulleted list," "in a table," "step by step."
You don't always need all three elements, but the more guidance you provide, the more likely you'll get what you want.
Think of these three elements as layers of specificity. The task tells the model what to generate. The context shapes how to generate it. The format structures the output. Each layer narrows the possibilities, steering the model toward your desired result. In practice, you'll develop intuition for which elements matter most for different types of requests. A creative writing task might need heavy context (tone, style, audience) but flexible format. A data extraction task might need rigid format but minimal context.