
Gemini prompts work best when they state the task, provide the material to use, and describe the expected result. Keep the instructions specific and use settings and input ordering that match the selected model and modality.
State the task and output first
Name the action you want, the audience, and the shape of the answer. Put essential constraints and the output format in the system instruction or at the start of the prompt. Headings or XML-style tags can separate sections; use one structure consistently.
<task>{{task}}</task>
<context>{{context}}</context>
<constraints>
{{constraints}}
</constraints>
<output_format>{{output_format}}</output_format>Define terms that could be interpreted in different ways. For a document review, say which sections matter and what counts as evidence. For a coding task, include the relevant code, error, expected behavior, and limits on the change.
Show examples when the pattern matters
For a repeated classification, rewrite, or extraction task, add a few varied examples that show the desired input and output. Keep the format consistent across examples. This helps Gemini follow the shape without relying on a long list of abstract rules.