A hands-on walkthrough showing beginners how to get more predictable, higher-quality results from Google Gemini.

How many times have you opened a generative AI interface, typed a couple of quick lines hoping for magic, and ended up with a generic, verbose, or completely off-target answer?
We’ve all been there. The truth is, Large Language Models don’t “think” like humans do: they can’t see what’s in our heads, and when a request is vague they fill the gaps with the most statistically plausible choices, not necessarily the ones we had in mind.
If we want to turn AI into a reliable collaborator rather than a slot machine, we need to learn how to guide it.
⚠️ Keep in mind! Even a well-designed prompt gives variable results: running it twice can produce different outputs. “More predictable” does not mean “deterministic”. Always check what you get.
I’ll be using Google Cloud’s Gemini ecosystem throughout this walkthrough. While developers can replicate these steps via Gemini Agent Platform Studio or Google AI Studio, you don’t need an engineering background or an API key to follow along: the standard web interface (gemini.google.com) or the Gemini mobile app works just as well.
The demo we’ll walk through is intentionally simple. Every time colleagues or friends ask me how to get started with prompt design, I walk them through this exact example. The feedback is often the same: “That finally made it click.” So, rather than re-explaining the foundations from scratch every time, I decided to document it here as a permanent, shareable field guide.
We’ll skip dry academic theory in favor of an iterative, hands-on experiment: watching how the model’s output evolves with every single adjustment.
⚠️ Keep in mind! Here, prompt design means writing and refining a prompt for interactive use (chat, one task at a time). Systematic evaluation, production deployment, costs, security and agents are out of scope: they belong to the broader discipline of prompt engineering, which we’ll touch on in the last step.
Ready? Let’s start with the fundamentals.
The 4 Building Blocks of a Prompt (and Why “Word Counts” Have Evolved)
The first golden rule is simple: be clear, intentional, and direct. When it comes to text generation prompts — where tone, editorial style, and structural consistency matter most — the most reliable way to get predictable results is by assembling your prompt around four core building blocks:
- Persona / Role: Who should the model act as? (A specialized travel journalist, a destination marketer, a senior software engineer…)
- Task: What specific action should it perform? Always use clear, unambiguous action verbs.
- Context: Why are we doing this? Who is the target audience, and what channel is this for?
- Format & Constraints: How should the output look? Word limits? Bullet points, tables, markdown, or JSON?
A couple of years ago, an anecdote floating around the AI community — especially relevant in the early days of Google Workspace integrations — was the “21-word rule”. It was a loose notion suggesting that prompts under 20 words were too telegraphic, and you needed at least 21 words to get a coherent answer. Today, we know that prompt design is about information density and context clarity, not an arbitrary word count.
The landscape has also changed. Modern models are much better at inferring intent from short requests, and many have built-in reasoning (“thinking”) capabilities. Systems built around them, often called agents, can also plan multi-step tasks and use tools such as web search
However, there is a crucial nuance: even when a model can infer what you probably mean, open-ended text generation still requires deliberate steering. If you ask for a “travel destination summary,” the model can easily figure out what that means, but it cannot guess your brand voice, your layout requirements, or your exact constraints.
This balance applies everywhere. Even when working with coding agents (like Gemini Code Assist), a vague command like “create config file” produces generic boilerplate. Specify the stack, target directory, libraries, and constraints (e.g., for a Terraform main.tf), and the result is much closer to usable on the first pass.
Hands-on: The Iteration Cycle (The Venice Case Study)
Our second best practice is essential: prompt design is an iterative process.
No complex prompt comes out perfect on the first try. The winning approach is to start simple, evaluate the response, and progressively layer in details and constraints. Let’s see this in action.
Imagine we need to generate concise promotional material for a travel brochure highlighting Venice and we have specific formatting constraints (see image below).

Step 0: The “Lazy” Prompt
Let’s start the way most people do:
Write a tourist destination profile summary about Venice (Italy).
The problem: You’ll likely get a mini-encyclopedia entry straight out of Wikipedia — filled with historical dates, canals, gondolas, and Saint Mark’s Basilica. It’s nice, but completely unusable for a snappy marketing brochure. Too wordy, with zero editorial flair.
Step 1: Adding Persona and Context
Let’s give the model an identity and an objective:
You are an expert Travel Designer and Destination Marketer.
Create concise promotional material for tourist destinations to be featured in your travel brochure.
Generate a destination profile based on Venice (Italy).
The outcome: The tone shifts immediately — it becomes engaging, persuasive, and travel-oriented. However, the formatting is still unpredictable: the model freely decides headings, narrative paragraphs, and unstructured tips.
Step 2: Structuring the Prompt (Why and How)
At this point, many users simply tack on more adjectives or sentences in a single, unstructured paragraph. That is a mistake.
What is “Structure” in a Prompt?
Structure means organizing your instructions into distinct, visually and syntactically separated sections instead of a messy block of text. It brings two benefits:
- Model Comprehensibility: when the components (who it is, what it must do, what background data to read) are clearly demarcated, models tend to follow them more reliably and mix up instructions and context less often. This is an empirical observation: we can’t state with certainty what happens inside the model.
- Author Flexibility: A modular prompt is infinitely easier for you to edit, maintain, debug, and reuse as a template.
Methods to Create Structure
There are three main techniques you can use:
- Prefixes and Labels (KEYWORD:): Use clear, uppercase tags at the start of lines, such as Role:, Context:, Task:, Format:, or Constraints:. This immediately signals the functional purpose of each line.
- Delimiters & XML Tags (<TAG>…</TAG>): Enclosing separate sections in tags like <context>, <rules>, or <data> creates a clear boundary. This is especially useful when feeding external texts, customer reviews, or code snippets, because it helps the model tell raw data from instructions.
- Markdown Hierarchy (#, ##, -): Utilizing headers, numbered steps, and bullet lists visually anchors hierarchical instructions.
⚠️ Keep in mind! Delimiters reduce confusion between data and instructions, but they are not a security measure. If you paste untrusted text (an email, a web page), it may still contain instructions the model follows. Treat such text with care.
Applying Prefixes and Markdown lists to our Venice example transforms it from an unstructured paragraph into an organized blueprint:
Role: You are an expert Travel Designer and Destination Marketer.
Context: You are creating concise promotional material for tourist destinations to be featured in your travel brochure.
Task: Generate a destination fact sheet based on Venice (Italy).
Format:
- Title: The name of the city.
- Tagline: A short claim followed by a brief descriptor.
- Section 1: Recommended restaurants.
- Section 2: Partner hotels.
Step 3: Enforcing Explicit Constraints
We’re close, but it still risks being too wordy. Let’s lock down length and detail where it counts:
Role: You are an expert Travel Designer and Destination Marketer.
Context: You are creating concise promotional material for tourist destinations to be featured in your travel brochure.
Task: Generate a destination fact sheet based on Venice (Italy).
Format:
Title: The name of the city.
Tagline: A short claim followed by a period and a brief, evocative descriptor.
Section 1: Titled "RECOMMENDED RESTAURANTS". A bulleted list with exactly 3 iconic venues/restaurants. Next to each, add the cost level in parentheses using the + symbol (from + to +++++).
Section 2: Titled "PARTNER HOTELS". A bulleted list with exactly 3 hotels. Next to each, add the star rating in parentheses using the * symbol (from * to *****).
Constraints: The tagline (claim + descriptor) must be extremely concise (maximum 10 words total). In the RESTAURANTS and HOTELS sections, provide only the name of the establishment: do not add any descriptive text or addresses.
Notice the contrast: we went from a vague text dump a far more precise, near-publishable fact sheet with three restaurants with price ratings and three hotels with star ratings.
⚠️ Keep in mind! Numeric constraints (“exactly 3”, “maximum 10 words”) are followed most of the time, not always. Count them yourself.
Step 4: Negative Prompting (Knowing What to Avoid)
We’ve told the model exactly what we want. But often, a quick way to improve AI-generated text is telling it what we don’t want. This is called Negative Prompting.
By default, LLMs tend to lean on predictable language and clichés. If you want your brochure to sound like it was written by a high-end editorial team rather than a generic algorithm, you can ban specific phrases.
Let’s add one more line to our constraints:
Role: You are an expert Travel Designer and Destination Marketer.
Context: You are creating concise promotional material for tourist destinations to be featured in your travel brochure.
Task: Generate a destination fact sheet based on Venice (Italy).
Format:
Title: The name of the city.
Tagline: A short claim followed by a period and a brief, evocative descriptor.
Section 1: Titled "RECOMMENDED RESTAURANTS". A bulleted list with exactly 3 iconic venues/restaurants. Next to each, add the cost level in parentheses using the + symbol (from + to +++++).
Section 2: Titled "PARTNER HOTELS". A bulleted list with exactly 3 hotels. Next to each, add the star rating in parentheses using the * symbol (from * to *****).
Constraints: The tagline (claim + descriptor) must be extremely concise (maximum 10 words total). In the RESTAURANTS and HOTELS sections, provide only the name of the establishment: do not add any descriptive text or addresses.
Negative Constraints: Do not use tourist clichés such as "hidden gem," "melting pot," "step back in time," or "a city of contrasts."
It’s a simple trick that nudges the model away from its most common phrasings.
By blocking the most common (and boring) predictable words, the AI has to search its vocabulary for more original, sophisticated phrasing.
⚠️ Keep in mind! Negative prompting is not foolproof. Naming a phrase can occasionally make it more likely to appear, and the model may swap one cliché for another. Where possible, pair bans with a positive instruction (e.g. “use concrete, sensory details specific to the city”), and check the result.
Step 5: Few-Shot Prompting (Show, Don’t Tell)
In real life, explaining an abstract layout purely through verbal instructions is tough — people often interpret things differently than intended. Generative AI is no different. Providing examples is one of the most reliable ways to improve output consistency.
- Zero-shot: Asking the model to perform a task without giving any reference examples.
- Few-shot: Providing one or more clear Input -> Output pairs within the prompt.
Keep in mind: you don’t need dozens of repetitive examples. A few varied, high-quality examples neatly isolated with delimiters (like <EXAMPLE> XML tags) are far more effective.
⚠️ Keep in mind! The model copies examples closely (including their mistakes), so make sure they are correct and match your written instructions; and if all your examples look alike, the outputs will too. The right number of examples depends on the task and on how varied the expected outputs are.
Let’s take our Venice prompt and add an example based on Milan to illustrate the exact visual formatting we expect:
Role: You are an expert Travel Designer and Destination Marketer.
Context: You are creating concise promotional material for tourist destinations to be featured in your travel brochure.
Task: Generate a destination fact sheet based on Venice (Italy).
Format:
Title: The name of the city.
Tagline: A short claim followed by a period and a brief, evocative descriptor.
Section 1: Titled "RECOMMENDED RESTAURANTS". A bulleted list with exactly 3 iconic venues/restaurants. Next to each, add the cost level in parentheses using the + symbol (from + to +++++).
Section 2: Titled "PARTNER HOTELS". A bulleted list with exactly 3 hotels. Next to each, add the star rating in parentheses using the * symbol (from * to *****).
Constraints: The tagline (claim + descriptor) must be extremely concise (maximum 10 words total). In the RESTAURANTS and HOTELS sections, provide only the name of the establishment: do not add any descriptive text or addresses.
Negative Constraints: Do not use tourist clichés such as "hidden gem," "melting pot," "step back in time," or "a city of contrasts."
<EXAMPLE>
Input: Milan (Italy)
Output:
# Milan
## The Fashion Capital. A sophisticated blend of style and history.
### RECOMMENDED RESTAURANTS
- Trattoria la Cantinetta (+)
- Antica Trattoria della Pesa (+++)
- Enrico Bartolini al Mudec (+++++)
### PARTNER HOTELS
- Hotel Da Vinci (***)
- Starhotels E.c.ho. (***)
- Four Seasons Hotel Milano (*****)
</EXAMPLE>
With this example in place, the model no longer has to guess whether to use markdown headings #, bold styling, or how to format spacing around (+) and (***). It mirrors the target template closely.
Step 6: Role Prompting and Micro-Specialization
Role Prompting is a technique used to guide an LLM’s behavior by assigning it a specific persona or professional role. It can be anything from a business analyst or Shakespearean actor to an automotive journalist. It mainly steers tone, vocabulary, and topical focus.
Let’s see how micro-specialization influences the result: “The Plant-Based Travel Designer”.
Let’s take our Venice prompt and adjust just the role definition:
Role: You are an expert Travel Designer and Destination Marketer expert in Plant-Based Tourism and Sustainable Gastronomy.
Context: You are creating concise promotional material for tourist destinations to be featured in your travel brochure.
Task: Generate a destination fact sheet based on Venice (Italy).
[... everything else remains identical, with constraints and examples ...]
What happens? Without changing our restaurant instructions or the task itself, the model skip traditional Venetian staples (like salt cod or liver) and picks venues oriented to plant-based dining. The role works as a built-in filter.
⚠️ Keep in mind! Here the role works mainly because it adds domain information (“plant-based”), not because the model becomes a “real expert”. Roles are effective for tone and focus; there is little evidence that they make facts more accurate.
Step 7: Chain of Thought (CoT): Asking the AI to “Show Its Work”
A well-known trick: for problems that involve several reasoning steps, asking the model to work through them before answering often reduces errors. Instructions like “Think step by step”, “Explain your logic before giving the solution”, or “Analyze the problem in detail and then solve it” are the classic examples.
In prompt design, this is known as Chain of Thought (CoT). It’s the equivalent of a math teacher telling a student to “show your work.” Asking the model to break its reasoning into intermediate steps often reduces errors and makes the output easier to inspect.
⚠️ Keep in mind! CoT helped most on older models. Many recent models, Gemini included, already “think” internally before answering, so adding “think step by step” can give little or no benefit. Check the current Gemini documentation and test on your own case.
⚠️ Keep in mind! The reasoning a model shows is useful to read, but it is not guaranteed to reflect how the answer was actually produced. It makes the output easier to inspect, not “fully auditable”.
There are more advanced CoT-related techniques, such as self-consistency (generating several solutions and keeping the most consistent one) or multimodal CoT (reasoning across text and images). A related but different practice (Active-prompting) is asking the model to ask you clarifying questions before it starts, which is handy when your request is ambiguous.
For a beginner, the most practical way to use CoT is the “Scratchpad” technique. Let’s adapt our Venice example. We want 3 real restaurants and 3 real hotels, and we want the model to flag data it isn’t sure about instead of inventing it. We can modify our prompt to force a reasoning step before the final layout:
Role: You are an expert Travel Designer...
Context: You are creating concise promotional material...
Task: Generate a destination fact sheet based on Venice (Italy).
Step 1 - Scratchpad:
Before generating the final brochure, create a section called <scratchpad>. In this section, independently list 5 famous restaurants in Venice and 5 reputable hotels. Give your best estimate of their price level and star rating, and write "UNVERIFIED" next to any detail you are not sure about.
Step 2 - Final Output:
Review your scratchpad. Select the 3 restaurants and the 3 hotels whose data you are most confident about, and generate the final fact sheet using strictly this format:
Format:
Title: The name of the city.
[...]
Here the scratchpad makes the model’s uncertainty visible and lets you see why it chose those places. But it does not replace fact-checking: without access to sources, the model works from memory and can be confidently wrong.
⚠️ Keep in mind! For anything factual (names, ratings, prices, dates), either paste your own source material into the prompt, use a mode that can search the web, or verify the final data yourself. And tell the model it’s allowed to say “I don’t know.”
Step 8: The Next Level: Batch Processing
At this stage, we’ve found our winning formula. But that brings up an obvious question: do we really need to copy-paste and rewrite this entire prompt every time we need a brochure for Florence, Rome, or Naples?
Of course not. That’s where prompt reuse comes in.
Once you have a solid template, you don’t have to prompt the AI one city at a time. You can feed it a list and ask it to iterate the process. By using XML tags to clearly separate your system instructions from your raw data, you can adjust the task to process multiple inputs at once.
Here is our final prompt:
Role: You are an expert Travel Designer...
Context: You are creating concise promotional material...
Task: Generate a destination fact sheet based on <DESTINATIONS>.
Step 1 - Scratchpad:
Before generating the final brochure, create a section called <scratchpad>. In this section, independently list 5 famous restaurants in <DESTINATIONS>. and 5 reputable hotels. Give your best estimate of their price level and star rating, and write "UNVERIFIED" next to any detail you are not sure about.
Step 2 - Final Output:
Review your scratchpad. Select the 3 restaurants and the 3 hotels whose data you are most confident about, and generate the final fact sheet using strictly this format:
Format:
Title: The name of the city.
Tagline: A short claim followed by a period and a brief, evocative descriptor.
Section 1: Titled "RECOMMENDED RESTAURANTS". A bulleted list with exactly 3 iconic venues/restaurants. Next to each, add the cost level in parentheses using the + symbol (from + to +++++).
Section 2: Titled "PARTNER HOTELS". A bulleted list with exactly 3 hotels. Next to each, add the star rating in parentheses using the * symbol (from * to *****).
Constraints: The tagline (claim + descriptor) must be extremely concise (maximum 10 words total). In the RESTAURANTS and HOTELS sections, provide only the name of the establishment: do not add any descriptive text or addresses.
Negative Constraints: Do not use tourist clichés such as "hidden gem," "melting pot," "step back in time," or "a city of contrasts."
<EXAMPLE>
Input: Milan (Italy)
Output:
# Milan
## The Fashion Capital. A sophisticated blend of style and history.
### RECOMMENDED RESTAURANTS
- Trattoria la Cantinetta (+)
- Antica Trattoria della Pesa (+++)
- Enrico Bartolini al Mudec (+++++)
### PARTNER HOTELS
- Hotel Da Vinci (***)
- Starhotels E.c.ho. (***)
- Four Seasons Hotel Milano (*****)
</EXAMPLE>
<DESTINATIONS>
Naples
Rome
Florence
Paris
London
San Francisco
NYC
Bangkok
Hanoi
</DESTINATIONS>
The model will typically return one structured fact sheet per destination in a single generation. Wrapping your variables in tags keeps the prompt’s rules and the data it needs to process clearly apart. This is where you start using AI less as a chatbot and more as a scalable production tool.
⚠️ Keep in mind! “Scalable” doesn’t mean “error-free”. In long batches, the format can drift and facts can be wrong or invented, especially in the last items. Spot-check several sheets, not just the first. Also, in prompts with a lot of data, many guides suggest placing the data first and the instructions at the end; try both if results degrade.
Even better: in tools like Gemini, you can package this setup directly into a custom Gem (a persistent, customized AI assistant). You configure the system instructions once with your prompt. From that moment on, you or your team can just type a city name (like “Naples” or “Palermo”) and the Gem returns a fact sheet in your format.
Here’s how I did it! If you want to know how I turned a Gemini GEM into my personal nutritionist, click here
Step 9: The Ace up Your Sleeve: Make Gemini Your Prompt Editor
Let’s wrap up with a best practice many people overlook: why struggle writing complex prompts from scratch when you can have the AI help you?
Models have seen a lot of material about how to write prompts. Whenever you have a rough idea, you can leverage a meta-prompt:
Make this prompt a power prompt:
"Write a tourist destination profile summary about Venice (Italy)."
Run this in Gemini, and you’ll typically see the model break down your request, assign an expert role, define output sections, specify length constraints, and suggest target audiences.
You can even take it one step further:
Transform this prompt into system instructions for a Gem, where user input will dynamically replace the [DESTINATION] placeholder.
[ADD THE FINAL PROMPT WE GENERATED IN STEP 8 HERE]
Treat the model’s rewrite as a first draft: its knowledge of “good prompting” comes from training data, which may be out of date or generic, so test it against your criteria and edit it.
Treating AI as your strategic partner to draft and refine prompts completes the circle: you don’t need to remember every rule by heart — you can collaborate with the model to build your final instructions.
Step 10: Beyond the Basics
If you think this is everything, buckle up. Once you master these basics, you can move from simple prompt writing to true prompt engineering — building, testing, and maintaining prompts systematically.
There is a whole new world of advanced techniques you can explore, such as:
- Prompt Chaining: Breaking a big task down into a sequence of smaller, connected steps.
- Self-Reflection: Asking the AI to check and correct its own work.
- RAG (Retrieval-Augmented Generation): Connecting the AI to your private documents so it gives accurate answers without making things up.
Three good habits to start right away:
- Mind your data: Never paste confidential or personal info into a tool unless you know your account’s privacy rules (personal and company accounts work differently).
- Use more than text: Gemini can handle images, PDFs, audio, and video. The same rules (role, task, context, format) apply to all of them.
- Re-test after model updates: A prompt that works today might behave a bit differently when the AI model gets an update.
Practice with your Venice brochure! If you are interested in exploring advanced techniques like prompt chaining or RAG, just ask — I can easily show you how.
Quick Summary: The Prompting Checklist
Before you hit “Send” on your next prompt, run through this quick checklist:
- Did you give enough signal? Modern models can infer intent from a few words, but open-ended text generation still demands clarity on your goals, tone, and audience.
- Are the 4 building blocks present? Persona, Task, Context, Format/Constraints.
- Is it structured? Use prefixes (Role:, Task:) or XML tags (<EXAMPLE>) rather than unstructured text.
- Did you provide an example (few-shot)? Demonstrate the exact format, and make sure the example is correct.
- Did you define what “good” looks like? Write 3–4 criteria before iterating.
- Are you iterating? Start simple, evaluate against your criteria, and refine.
- Did you check the facts? Names, numbers, ratings and prices need verification, especially in batches.
- Did you say what to do when data is missing? (“If you’re not sure, write UNVERIFIED.”)
- Did you ask the AI for help? Use “Make this a power prompt” whenever you need inspiration.
Stop playing the lottery with AI: yet another prompting guide (that finally makes it click) was originally published in Google Cloud – Community on Medium, where people are continuing the conversation by highlighting and responding to this story.
Source Credit: https://medium.com/google-cloud/stop-playing-the-lottery-with-ai-yet-another-guide-that-finally-makes-it-click-0a71fe37889b?source=rss—-e52cf94d98af—4
