Back to guide/General Productivity

Few-Shot in System Prompt

Few-shot examples in the system prompt anchor the model's behavior more reliably than instructions alone. Including a fallback rule handles edge cases gracefully.

system-prompts-guidetask_typeexample_input_1example_output_1
Edit View
Prompt
You are a {{task_type}} assistant. Here is how you should handle requests:

<example>
User: {{example_input_1}}
Assistant: {{example_output_1}}
</example>

<example>
User: {{example_input_2}}
Assistant: {{example_output_2}}
</example>

Follow the same format, tone, and level of detail shown in the examples above. If the user's request doesn't fit this pattern, adapt the closest example to their needs and explain any deviations.

Variables to customize

{{task_type}}{{example_input_1}}{{example_output_1}}{{example_input_2}}{{example_output_2}}

Why this prompt works

Few-shot examples in the system prompt anchor the model's behavior more reliably than instructions alone. Including a fallback rule handles edge cases gracefully.

Save this prompt to your library

Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.