PromptisePromptise
Why PromptiseUse casesRoadmapDocs
GitHubGet started
Promptise - AI Framework LogoPromptise

The foundation layer for agentic intelligence. Build, secure and operate autonomous AI systems with Promptise Foundry.

pip install promptise

[01] Foundry

  • MCPcast
  • The Promptise Agent
  • Reasoning Engine
  • MCP
  • Agent Runtime
  • Prompt Engineering
  • Execution Engine
  • Agent Identity

[02] Resources

  • Documentation
  • GitHub
  • Guides
  • Learning Paths
  • Questions

[03] Company

  • About
  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Subprocessors

© 2026 Promptise by Manser Ventures. All rights reserved.

Open source · Python

← Guides> Prompt Engineering

How to Write Clear Prompts: Ask, Role, Constraints, Format

Write prompts the model can't misread: state the ask, set a role, add constraints and fix the format. A real product-description prompt, before and after.

Level
Beginner
Reading time
6 min
Published
Sep 4, 2025
Last updated
Oct 23, 2026
By
Promptise Team
  • Prompt Writing Basics
  • Role Prompting
Contents · 8 sections↓
  1. 01How do you write a clear prompt?
  2. 02How the four parts work
  3. 03Worked example: a product description
  4. 04When to use this (and when not to)
  5. 05A reusable template
  6. 06Common mistakes
  7. 07Frequently asked questions
  8. 08Next steps

A clear prompt tells the model four things: what to do, who it is writing as or for, what limits apply, and what shape the answer takes. This guide is for people who get vague, padded or made-up output and want a repeatable way to fix it. You will write one real prompt, a product description for an online store, in a weak and a strong version, and see what the model returns for each.

[01]

How do you write a clear prompt?

Give the model five things: a role, a task, the context it needs, the output format and the constraints. State one task, say who is writing and for whom, paste the source material (the context) in a fenced block so the model can tell it apart from your instructions, say exactly what the answer looks like, and add the limits that matter. Then run the prompt on real inputs and tighten whatever comes back wrong. This guide calls the task the ask and treats the context as the material the prompt carries, so its four parts are ask, role, constraints and format.

Key takeaways:

  • Ask (the task): one task, with a verb and an object ("write the product description for this bottle").

  • Context: the facts the model must use, such as a spec or a document, in a fenced block.

  • Role: who is writing and for whom. The audience usually matters more than the persona.

  • Constraints: length, sources, banned words, must-include facts. Make them checkable.

  • Format: say exactly what comes back and in what order, and say "nothing else".


[02]

How the four parts work

Each part removes a guess the model would otherwise make.

Part

The guess it removes

Weak

Clear

Ask

What "done" means

"Help with our bottle"

"Write the product page description for this bottle"

Role

Tone, vocabulary, audience

(none)

"Copy for our store; buyers are commuters and day hikers who compare specs"

Constraints

How long, what's allowed

(none)

"50 to 70 words. Only facts in the spec. No 'best' or 'ultimate'."

Format

What the output looks like

(none)

"Body text, a blank line, then exactly 3 bullets. Nothing else."

Constraints work best when you could check them with a ruler: a word range, a list of required facts, a list of banned words. "Make it good" and "be concise" are not checkable, so the model interprets them its own way.


[03]

Worked example: a product description

The spec, which both prompts include:

Text
1
2
3
4
5
6
7
Product: Trailhead 750 bottle
- 750 ml, double-wall stainless steel
- Keeps drinks cold 24 h, hot 12 h (lab test, 20 °C room)
- Weight 340 g
- Leak-proof screw lid, fits most car cup holders (7.3 cm base)
- Hand wash only, not dishwasher safe
- Price: $34

The weak prompt

Text
Write a product description for our water bottle.

<spec pasted here>

The output (trimmed):

Output
Trailhead 750 — go farther, drink smarter.

Built for day hikes, commutes, gym sessions and long drives, the Trailhead 750 keeps your drink exactly how you like it. …
Rugged yet lightweight at 340 g, it’s the practical companion for every outing.

Key features
- Capacity: 750 ml
…
Why choose the Trailhead 750
- Reliable temperature retention for long days outdoors or at the office
- Secure, leak-proof screw lid for worry-free travel
- Compact base fits most cup holders for easy hands-free carrying
- Clean, durable stainless finish built to last

Available now for $34.

About 180 words, a tagline nobody asked for, two bullet lists that repeat each other, and claims the spec doesn't support: "gym sessions", "rugged", "durable … built to last". If this goes on a product page, someone has to fact-check every line.

The clear prompt

Text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
You are writing copy for our online store's product page. Our customers are commuters and day hikers who compare specs before buying.

Write the product description for the bottle below.

Constraints:
- 50 to 70 words of body text, then exactly 3 bullet points with the most useful specs.
- Use only the facts in the spec. No claims the spec doesn't support (no "best", "ultimate", "eco-friendly").
- Mention that it is hand wash only.
- Plain, friendly tone. No exclamation marks.

Output: the body text, a blank line, the 3 bullets. Nothing else, no headline.

<spec>
…spec…
</spec>

The output:

Output
The Trailhead 750 is a 750 ml double-wall stainless steel bottle for commuting and day hikes. Lab tests (20 °C room) show it keeps drinks cold for 24 hours and hot for 12 hours. It weighs 340 g and has a leak-proof screw lid. Fits most car cup holders. Hand wash only. Price $34.

- 750 ml double-wall stainless steel; cold 24 h / hot 12 h (lab test, 20 °C room)
- Weight 340 g; 7.3 cm base fits most car cup holders
- Leak-proof screw lid; hand wash only; Price $34

Every claim is in the spec, the length fits, and the format is ready to paste. It now reads a little flat. That is the next iteration, and it's an easy one: add a line like "Open with the benefit for a commuter in one sentence" or give one example description in your brand voice (see few-shot examples). Fix one thing at a time and rerun, so you know which change helped. Results vary by model; the pattern holds.

The weak prompt, an ask and the spec, returned about 180 words with a tagline and unsupported claims. The clear prompt adds a role, a specific ask, checkable constraints and an exact format around the same spec, and every claim in its output is in the spec.
FigureThe weak and the clear product description prompt, and what each returned

[04]

When to use this (and when not to)

Use the four-part structure for any prompt you will run more than once or whose output goes somewhere real: a product page, an email, a ticket, a report.

Skip most of it for quick, throwaway questions. "What's the Python equivalent of JavaScript's Array.find?" needs no role or format.

The structure won't help when the model lacks the facts. If the spec isn't in the prompt, "use only the facts in the spec" can't work. Paste the source in, as covered in grounding.


[05]

A reusable template

Text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<Role / audience: who writes this, who reads it, what they care about>

<Ask: one task, verb + object>

Constraints:
- <length, as a range>
- <sources: "only facts in the text below">
- <must include / must not include>
- <tone, in concrete terms>

Output: <exact shape and order>. Nothing else.

<source>
…
</source>

If you reuse the same rules in every request, move the role and constraints into the system prompt and keep only the task and source in the user message. System vs user prompts explains the split.


[06]

Common mistakes

Mistake

Why it fails

Fix

Two or three tasks in one prompt

The model blends them or drops one

One task per prompt, or number the steps

"Be concise"

Not checkable, so it gets interpreted loosely

"50 to 70 words" or "max 3 bullets"

Only saying what not to do

The model still has to guess what you want

Pair each "don't" with a "do"

Format described loosely ("a few bullets")

Count and order drift between runs

"Exactly 3 bullets, then nothing else"

No source for factual copy

The model fills gaps with plausible claims

Paste the facts and say "only these facts"

Changing five things at once

You can't tell which change helped

One change per run, same test inputs


[07]

Frequently asked questions

What are role, task, context, format and constraints in a prompt?

They are the five parts of a clear prompt. The role says who is writing and for whom. The task is the one thing the model should do. The context is the material it must use, such as a spec, a document or data. The format is the exact shape of the answer. The constraints are checkable limits: length, allowed sources, words to avoid and facts to include. Leave one out and the model guesses it.

Do I always need a role?

No. The audience and purpose ("for commuters who compare specs") usually do more than a persona ("you are a world-class copywriter"). Research on personas finds they don't reliably improve accuracy; see role prompting.

How long should a prompt be?

As long as it takes to remove the guesses, and no longer. The clear prompt above is about 90 words of instructions. Long prompts are fine when every line does a job; padding just adds noise.

Should I use delimiters like XML tags?

Yes, for any pasted material. Tags such as <spec> or <email> make it clear which text is instructions and which is data. Both OpenAI and Anthropic recommend clear delimiters in their prompting guides.

Why does the model ignore my word limit?

Models count words poorly and tend to run long. Give a range, ask for a fixed number of sentences or bullets instead, and check the length in code if it matters.

What if the output is right but the tone is off?

Add one concrete tone rule ("no exclamation marks", "write like a helpful store clerk") or show a single example in your voice. Examples carry tone better than adjectives.


[08]

Next steps

  • Previous in the path: system vs user prompts.

  • Next: give the model the facts with grounding.

  • Get machine-readable output with structured outputs.

  • Tune tone and style with polish and style controls.

  • Back to the pillar: what is prompt engineering?

Further reading: OpenAI prompt engineering guide and Anthropic prompt engineering overview.

Contents

  1. 01How do you write a clear prompt?
  2. 02How the four parts work
  3. 03Worked example: a product description
  4. 04When to use this (and when not to)
  5. 05A reusable template
  6. 06Common mistakes
  7. 07Frequently asked questions
  8. 08Next steps

Learning paths

Want more structure? Paths put guides in order, like a short course.

See the paths →

> Read next

Related guides

  • // 01Beginner · 7 minWhat Is Prompt Engineering? A Beginner's Guide with ExamplesWhat prompt engineering is, how a prompt works, and the five parts of a good one, with a real before-and-after example and a map of the beginner path.
  • // 02Intermediate · 5 minCan LLMs Simulate Users? Role-Play, Personas and LimitsCan LLMs simulate users or customers? The simulator view of LLMs, what research says about personas, two real role-plays that went wrong, and fixes.
  • // 03Beginner · 5 minHow to Brief an LLM: Context Gaps and Clarifying QuestionsHow to brief an LLM like a new colleague: why it lacks your context and won't ask, the jagged frontier, and a real example of guesses swapped for asks.
  • // 04Beginner · 7 minGrounding LLM Answers: Give the Model the Right ContextGround LLM answers in your own text: paste the source, fence it with delimiters, require citations and handle gaps. Real return-policy example.
  • // 05Beginner · 7 minRole Prompting: When Personas Help and When They Don'tRole prompting explained: when a persona improves output, when it doesn't, and how to write a role that works. Real example: a price-change email.
  • // 06Beginner · 13 minLong-Running AI Tasks: Write a Brief That Lasts HoursHow to brief an AI agent for a long-running task: a done list, milestones, a progress log, stop rules and handoff notes, with real prompts and a template.

Keep going.

Browse every guide by topic and level, or follow a learning path that puts them in order.

All guidesLearning paths