Prompting Basics: How to Write Clear Instructions for AI
Typed a question into ChatGPT or Gemini and gotten a weird answer? The problem is usually the prompt, not the model. Prompt design is the skill of writing clear, specific requests, and four habits cover most of it.
Know your input type
Every prompt falls into one of four groups. Question input: you ask, it answers, like "What is a good name for a flower shop selling dried bouquets? Give 5 options." Task input: you ask it to do something, like "List 5 things I must bring camping." Entity input: you hand over items to work on, like "Classify as large or small: Elephant, Mouse, Snail." Completion input: you start the pattern and the model finishes it.
Show, do not tell
Models are excellent at continuing patterns. Show one example of the output you want, then give the next input and let the model finish in the same style. Want JSON? Paste one filled-in example. Showing beats long instructions in English almost every time.
Set constraints and name the format
Say what to do and what not to do. The most common constraint is length: "Summarize this in one sentence." Then name the output format explicitly: table, bullet list, JSON, essay outline. Or start the response yourself, like an outline beginning with "I. Introduction", and the model continues in that format.
The trade-off
Specificity improves results until it straitjackets them. A prompt with ten constraints produces rigid output that misses obvious things outside the rules. One well-chosen example often replaces three sentences of instructions, so spend your prompt budget on examples before rules.
The smallest test
Take your last bad prompt, add one constraint and an explicit format, and rerun it.
Based on: Gemini API Prompting Strategies (ai.google.dev)
Recommended for you
- PromptingClaude Code
Understanding AI Model Parameters: Temperature, Top-K, and Top-P
Hidden settings control how AI picks its words: temperature, top-K, top-P, max tokens, and stop sequences. Here is what each one does, in plain English.
- PromptingClaude Code
The System Prompt Your Coding Agent Actually Needs
A coding agent without a custom system prompt is a chatbot that writes code. The default prompt runs it like a generic assistant. Yours should run it like an engineer on your team.
- PromptingClaude Code
Choosing the Right Claude Model: Haiku, Sonnet, and Opus Explained Simply
Claude has three models: Haiku, Sonnet, and Opus. This guide explains which one to pick for each task and how to avoid wasting your usage limits.
- PromptingClaude Code
Adding Context and Breaking Down Complex Prompts
AI does not know your situation unless you tell it. Learn to add context and to split big tasks into small steps using chaining and aggregation.
Enjoyed this article?
Subscribe for new articles. No spam. Unsubscribe anytime.