Prompt Engineering Best Practices

Chapter 1 · Practice 4 of 4

Use numbered steps when order matters and set a role in the system prompt

From Clear instructions and context

Why it matters

When 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 as one of the clearest instruction forms.

text
1. Read the support ticket.
2. Pick one category from the list in <categories>.
3. If no category fits, use "other" and explain why in one sentence.
4. Return the result in the format shown in <format>.

Put stable instructions, including any role, in the system or developer message. Anthropic notes that even a single sentence of role in the system prompt focuses behaviour and tone. OpenAI's guide describes developer messages as the application's rules, which take priority over user messages.

Keep the changing input, such as the user's question or the document, in the user turn. This split makes prompts easier to cache, test and reuse.