Learn / Chapter 1 of 4

Fundamentals: what makes a good prompt?

About 6 minutes reading time.

A prompt is a work instruction for a language model. Most weak results happen not because the model can't do something – but because the instruction leaves room that the model fills differently than you intended. Four building blocks close that gap:

1. Role

Tell the model who it should answer as. A role bundles hundreds of individual instructions: an "experienced code reviewer who is constructive but direct" automatically prioritizes differently than a "patient tutor for beginners".

You are an experienced technical writer.
You write precisely, without filler words, and prefer active phrasing.

2. Context

Everything the model needs to know but cannot know: audience, prior knowledge, project conventions, what has already been tried. Rule of thumb: whatever you would have to explain to a new colleague on day one belongs in the context.

3. Task

A clear, verifiable task – ideally with criteria. "Summarize this" is vague; "Summarize in at most five bullet points, one sentence each, most important first" is verifiable. If you can't say what a good result looks like, neither can the model.

4. Format

Specify the output form explicitly: Markdown table, JSON with fixed fields, numbered list, just the code without explanation. Models follow format instructions remarkably reliably – when they exist.

Putting it together

You are an experienced code reviewer.                  ← Role
The team uses PHP 8.3 and Laravel, with a focus on
readability and security.                              ← Context
Review the following code for bugs, security issues,
and style. Name at most the 5 most important points,
sorted by severity.                                    ← Task
Answer as a Markdown list: **Title** – explanation
– suggestion as a code block.                          ← Format

You'll find many community prompts following exactly this pattern – for example under Coding & Development. Read two or three of them with these four building blocks in mind: you'll recognize the pattern immediately.