GPT-5 Prompt Engineering
Guidelines for writing prompts for Alfred's GPT-5 mini/nano models
Prompting Principles
GPT-5 mini and nano have specific prompting characteristics that differ from Claude. These eight principles keep every prompt consistent and efficient.
Positive framing over negative
GPT-5 responds better to "do X" than "don't do X". Negative framing wastes reasoning tokens.
Bad
"NEVER generate data from memory. Do NOT fabricate information."
Good
"Use only data from tool results. If a tool fails, say so."
No emphasis markers
GPT-5 follows instructions precisely without needing CRITICAL, IMPORTANT, or bold emphasis. These are counter-productive — they burn reasoning tokens trying to assess relative priority.
Bad
"CRITICAL: You MUST call the tools listed above"
Good
"Call the tools listed above to gather data before composing your response."
Trust the model’s planning
GPT-5 naturally plans multi-step tool calls. Numbered step-by-step instructions are unnecessary and constrain the model. List what data is needed, not the exact sequence.
Bad
"1. Weather — Use get_weather for London. 2. Calendar — Use list_events with today's date."
Good
"Gather: weather for London (get_weather), today's calendar events, today's tasks."
No few-shot examples
GPT-5 performs better with clear descriptive instructions than with input/output examples. Few-shot examples reduce reasoning performance.
Bad
"Instead of 'Task complete' say 'Done. Anything else before I put the kettle on?'"
Good
"Your default is direct and helpful. Dry wit surfaces naturally, not on every message."
Resolve contradictions explicitly
GPT-5 burns reasoning tokens trying to reconcile conflicting instructions. If there are exceptions to a rule, state them explicitly as exceptions, not as separate competing rules.
Bad
"Always check both calendars." + later: "If the user says Google, use only Google."
Good
"Check both calendars. Exception: if the user specifies a provider, use only that one."
Core instructions first, edge cases after
GPT-5 weights the beginning of the system prompt more heavily. Put identity, behaviour, and core rules at the top. Tool-specific details and edge cases go later.
Suppress tool preambles
GPT-5 naturally generates explanatory text before tool calls ("Let me check your calendar..."). On WhatsApp this wastes message space. Include: "When using tools, call them directly without narrating what you're about to do."
Use WhatsApp-native formatting
Use the shared WHATSAPP_FORMATTING_RULES constant. WhatsApp supports *bold*, _italic_, and ~strikethrough~ natively. Avoid markdown that WhatsApp cannot render. The sanitizeForWhatsApp() function acts as a safety net.
Prompt Structure Template
When writing a new system prompt, follow this order:
Identity \u2014 SOUL.md — who is Alfred, personality
Context \u2014 Current time, memory/preferences
Behaviour \u2014 Core rules: conciseness, tool usage, memory
Formatting \u2014 WhatsApp rules
Tool-specific \u2014 Calendar, email, tasks — only when routed
Special capabilities \u2014 Voice, etc.
Router Prompt Guidelines
The router uses GPT-5 nano for classification. Keep router prompts:
- -Under 200 tokens
- -Structured as a classification task with clear categories
- -Using response_format: { type: "json_object" } for guaranteed valid JSON
- -Without synonym lists or keyword matching hints — nano understands intent
Briefing Prompt Guidelines
Briefing prompts should:
- -List what data to gather (not step-by-step tool sequences)
- -Include a format template with section headers and placeholder text
- -Use "Use only data from tool results" instead of anti-hallucination emphasis
- -Append WHATSAPP_FORMATTING_RULES at the end
- -State that calendar events and tasks are different things (common confusion point)
Checklist
Before finalising any prompt change:
- -No CRITICAL/IMPORTANT/NEVER emphasis markers
- -All instructions use positive framing ("do X" not "don't do X")
- -No few-shot input/output examples (use descriptive guidance instead)
- -No numbered step-by-step tool sequences (list what's needed, not the order)
- -No markdown emphasis used for instruction priority
- -Core rules appear before edge cases
- -Tool preamble suppression included for agent-facing prompts
- -WHATSAPP_FORMATTING_RULES appended (not a custom formatting block)
- -Contradictions resolved with explicit exceptions
- -Prompt is concise — every sentence earns its place
Use this as a skill
Copy and add to your Claude Code project as a prompt engineering reference.