A prompt is a spec for the AI. The more precise the task, the context and the answer format, the less filler and rework you get. The principles below work with any provider (ChatGPT, Claude, Gemini, DeepSeek, a local Ollama).
🧭 The big picture
The main idea: an AI doesn't read minds — it answers what you wrote, exactly as you wrote it. 80% of "bad answers" are a badly posed question, not a "stupid model". Once you've internalized the structure of a prompt, you get the result you need in 1–2 attempts instead of ten.
What you end up with: the skeleton of a good prompt (5 blocks) that works with any AI, a set of techniques that actually move quality, and an understanding of where AI lies — so you don't get caught.
Think of a prompt as an assignment to an employee: who they are (role), what to do (task), what they need to know (context), in what form to hand it in (format) and how we'll know it was done well (the acceptance criterion).
Step 1. Learn the skeleton of a good prompt (5 blocks)
What we're doing: filling in 5 blocks instead of one vague phrase.
- Role/mode: "You are an experienced
". This sets the tone, the vocabulary and the depth. - Task: what exactly to do — in one clear sentence.
- Context: facts, constraints, input data (stack, audience, size).
- Answer format: list / table / code / JSON; length; language.
- The "done" criterion: how we'll know the answer is good (what to check).
Role: you're a senior backend engineer.
Task: design a database schema for notes with tags.
Context: PostgreSQL, ~100k users, search by tags is needed.
Format: DDL + a short explanation of each table.
Done when: there are indexes for tag search and it's explained why.
How to tell it worked: re-read your prompt through a stranger's eyes — if it's clear from it what you want and in what form, the model will get it too. The answer arrives in the right format immediately, with no "what did you mean?".
Common mistakes:
- You skipped the format → you got a wall of text instead of a list/code. Always state the shape of the answer.
- No "done" criterion → the answer is generic and says nothing. Say what to check.
Step 2. Add a technique that fits the type of task
What we're doing: strengthening the prompt with a trick that fits the job.
- Few-shot (examples): show 1–2 examples of "input → desired output" — the model copies the style and structure. It's the best way to specify a format that's hard to describe in words.
- Chain-of-Thought (step by step): for logic/maths, add "think step by step, then give the answer" — accuracy goes up noticeably.
- Decomposition: break a big task into sub-prompts (a plan → then each item separately) instead of one wall of text.
- Iteration beats a "perfect" first prompt: get a draft → "shorter / add X / change the tone" → you converge in 2–3 moves.
- Ask for the format explicitly: "return a table", "code only, no explanations", "the answer must be strict JSON matching this schema".
- Ground it in sources: "rely on the attached text/docs, don't invent; if the data isn't there, say so".
How to tell it worked: on logic tasks CoT removes arithmetic slips; few-shot returns the answer in exactly your format; decomposition turns "vague mush" into clear points.
Common mistakes:
- CoT on a trivial question ("what's 2+2") — pure filler. Use it on genuinely logical tasks.
- A few-shot example contradicts the instruction → the model gets confused. The examples and the text must agree in style.
Step 3. Iterate and verify
What we're doing: finishing the answer with short edits and checking the facts.
- Got a draft → edit surgically: "make it shorter", "add error handling", "a more formal tone".
- Not sure about the facts/code → check (run the code, look at the source). AI is confidently wrong.
How to tell it worked: the answer converged on your task in 2–3 moves; the code runs; the facts were checked and held up.
Common mistakes:
- Starting a new huge prompt instead of a short edit → you lose the conversation's context. Edit more, rewrite from scratch less.
- Taking the answer on faith. That's the most expensive mistake — see the block below.
⚠️ Common mistakes and warnings
- Too generic ("make it nice") → a generic, useless answer. Give criteria.
- Several different tasks in one prompt → the model spreads itself thin. Split them up.
- No format given → you get a wall of text instead of a list or code.
- Hallucinations (invention). AI confidently makes up functions, quotes, facts and links that don't exist. Check facts and code before using them — especially API names, numbers, and legal or medical claims.
- Prompt security: don't put secrets/passwords/personal data into a prompt — they go to the provider's servers (for anything private, use a local Ollama). And remember prompt injection: don't let an AI agent blindly execute instructions from downloaded files and web pages.
🧠 For the senior
- System vs user. Keep stable rules (role, format, constraints) in the system prompt and the variable task in the user message. That reduces drift and makes reuse easier.
- Structured output. Ask for strict JSON matching a schema (or use structured outputs / tool use / function calling) — it parses far more reliably than "text with markup".
- Self-check/critic. A two-pass scheme: "generate → critique your own answer against a checklist → produce a corrected version". For high stakes — several independent answers → synthesize the best.
- Temperature/decoding. Lower the temperature for facts and code, raise it for brainstorming. Control determinism where you need reproducibility.
- Context engineering > a long prompt. Feed the relevant chunks (RAG) rather than "everything at once": surplus context dilutes attention and drops quality.
🆘 Rescue prompt (a meta trick: improve your own prompt)
Here's my prompt: <paste your prompt>.
THE GOAL I want to reach: <what kind of answer I actually need>.
Rewrite my prompt so the answer is more precise:
1) Add a role, the missing context, an explicit answer format and a done criterion.
2) If something is missing for a good result — ask me clarifying questions FIRST, before answering.
3) Show the improved prompt as a separate block so I can copy it.
💎 Depth and value
- Prompting is the new literacy. Being able to state a task clearly for an AI will soon be as basic a skill as being able to google. Whoever phrases things precisely gets many times more out of the same models.
- It pays off on every task. This skill isn't "about one topic" — it multiplies your results everywhere: code, writing, analysis, learning, video. Learn the structure once and you save hours every day.
- Protection from illusions. Understanding that AI lies confidently, and the habit of checking, is what separates someone who uses AI as a tool from someone who one day gets embarrassed by an invented fact or broken code.