Crafting Clear Instructions › Putting It Into Practice
Michael BrenndoerferJune 11, 20252 min read
AI Agent HandbookAll chapters Part 3 of 15Prompting - Communicating with Your AI
Crafting Clear Instructions › Putting It Into PracticeOne section · Sections in this chapter8 / 11 ↓
Sections in this chapter11
Let's apply what we've learned to our personal assistant. Imagine you want it to help you plan your day. Here's how you might structure the prompt:
Example (GPT-5)
In[5]:
Codefrom openai import OpenAI
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
prompt = """I have these tasks today:
- Write project proposal (2 hours)
- Team meeting (1 hour, at 2 PM)
- Review code (1 hour)
- Respond to emails (30 minutes)
I'm available from 9 AM to 6 PM, with a 1-hour lunch break at noon.
Create a schedule that:
1. Puts focused work (writing, code review) in the morning when I'm most productive
2. Leaves buffer time between tasks
3. Accounts for the fixed 2 PM meeting
4. Includes the lunch break
Format: Simple time-blocked schedule"""
## Using GPT-5 for its reliable text generation and structured output
response = client.chat.completions.create(
model="gpt-5", messages=[{"role": "user", "content": prompt}]
)
print(response.choices[0].message.content)Out[5]:
Console9:00–10:30 AM — Write project proposal (Part 1) 10:30–10:45 AM — Buffer 10:45–11:45 AM — Review code 11:45 AM–12:00 PM — Buffer 12:00–1:00 PM — Lunch 1:00–1:30 PM — Write project proposal (Part 2 / polish) 1:30–2:00 PM — Buffer / meeting prep 2:00–3:00 PM — Team meeting 3:00–3:15 PM — Buffer 3:15–3:45 PM — Respond to emails 3:45–4:00 PM — Buffer 4:00–6:00 PM — Buffer / overflow (meeting follow-ups, proposal/code review fixes)
This prompt works because it:
- Provides all necessary information (tasks, time constraints, preferences)
- Specifies clear requirements (what the schedule should optimize for)
- Defines the desired format
- Gives the model enough context to make smart decisions
The model might respond with:
Here's your schedule for today:
9:00 AM - 11:00 AM: Write project proposal (2 hours)
11:00 AM - 11:15 AM: Buffer / Break
11:15 AM - 12:00 PM: Review code (45 minutes)
12:00 PM - 1:00 PM: Lunch break
1:00 PM - 1:30 PM: Respond to emails (30 minutes)
1:30 PM - 2:00 PM: Buffer / Prep for meeting
2:00 PM - 3:00 PM: Team meeting
3:00 PM - 3:15 PM: Review code (finish remaining 15 minutes)
3:15 PM - 6:00 PM: Available for additional tasks or wrap-up
This schedule places your focused work in the morning when you're most productive, includes buffer time between tasks, and accounts for your fixed meeting and lunch break.Perfect. The model understood exactly what you wanted because you gave it clear, specific instructions.