# How to write better prompts

> Practical prompting patterns that get better answers from ChatGPT, Claude, and similar tools.

*Source: https://velstech.net/better-prompts · Updated: 2026-08-24 · Category: AI · Tags: Prompting, Tools*

*Markdown version of [How to write better prompts](https://velstech.net/better-prompts). [Read the full guide with interactive tools](https://velstech.net/better-prompts).*
*Also as Markdown: [Hindi](https://velstech.net/better-prompts.hi.md) · [Tamil](https://velstech.net/better-prompts.ta.md).*

---

Getting a great answer from an LLM isn't luck – it's a skill. The model is a next-word
predictor, but it's also a mirror: vague prompt in, vague answer out. Here's how to
get what you actually want, every time.

## 1. Be specific, not polite

You don't need to say "please" or "could you". The model doesn't have feelings. What
it needs is **detail**. Compare:

```
❌ "Explain how DNS works."
✅ "Explain how DNS works. Assume I know what IP addresses are but nothing
   about nameservers or TTLs. Use plain English and keep it under 4 paragraphs."
```

The second prompt constrains the answer – format, audience, length. The model will
hit all three because it was told to.

## 2. Give it a role

Dropping the model into a persona immediately changes the quality of the output:

```
"You are a senior Python developer reviewing a junior's code. Look at the
function below and point out any bugs, style issues, or performance problems."
```

The role tells the model which "part" of its training data to draw from. "Senior
developer" pulls from the code-review patterns it learned, not the generic-conversation
ones.

## 3. Provide examples (few-shot prompting)

One of the most reliable techniques is showing the model exactly what you want:

```
"Convert these sentences into a formal tone:

  Informal: 'Hey, can you fix this bug?'
  Formal: 'Please address the identified issue at your earliest convenience.'

  Informal: 'This code is slow.'
  Formal:"
```

The model sees the pattern and continues it. You've effectively written the first
half of the answer yourself.

## 4. Chain of thought: ask it to think step by step

For reasoning-heavy tasks, add five words that dramatically improve accuracy:

```
"Think step by step before answering."
```

This forces the model to do its reasoning in the open, which reduces errors. It's
especially effective for math, logic, and planning questions.

> Why it works: the model's "reasoning" happens in the tokens it generates. If you
> make it write intermediate steps, those steps become part of the context for the
> final answer – and the next-token prediction is better informed.

## 5. Break it down

Complex requests get better results when split into steps. Instead of one giant
prompt, have a short conversation:

```
You: "I want to write a blog post about Docker. Give me 5 topic ideas."
Model: [lists ideas]
You: "I like idea #3. Write an outline for it."
Model: [outline]
You: "Now write the introduction based on that outline."
```

Each step's output feeds into the next, and the model has a focused task at every
stage. The result is much better than a single "Write a full blog post about Docker."

## 6. Tell it what NOT to do

Negative constraints are just as important as positive ones:

```
"Explain REST APIs to a beginner. Do not use any jargon. Do not mention
HTTP methods unless you define them first. Keep it under 200 words."
```

The model will actively avoid the things you listed, which is often more effective
than hoping it stays on track.

## 7. Iterate and refine

Rarely does the first output nail it. Treat the conversation like a collaboration:

- "Make it shorter." – the model will condense.

- "Rewrite this in a more casual tone." – adjusts style.

- "Add a concrete example." – fills in gaps.

- "What did I miss?" – the model will often spot gaps.

Each iteration gives you a better result, and you never have to start from scratch.

## Quick reference

```
Technique               When to use
─────────────────────────────────────────────────
Be specific             Always. Give format, length, audience.
Role prompt             Code reviews, domain-specific advice.
Examples                When output format is unusual.
Chain of thought        Math, logic, planning, analysis.
Break it down           Complex or multi-step requests.
Negative constraints    When the model goes off-track.
Iterate                 Always. The first answer is the rough draft.
```

The best prompters don't write perfect prompts – they write *effective* ones
and then refine. Start with any of the patterns above, see what you get, and tweak
from there.

## FAQ

**Why is being specific in a prompt important?**

LLMs answer based on the words you give them. Clear, specific instructions narrow the answer space, so you get relevant output instead of a generic guess.

**What if the model ignores my instructions?**

Try breaking the request into steps, giving an example of the format you want, or asking it to work through the problem before answering.

---

*VelsTech – technology explained for everyone. Original: https://velstech.net/better-prompts*
