Skip to content
IndexRequest a UIAboutContact

Role, Context, Task, Format

Fill four fields to build a clear text prompt for a language model, with presets for email, summary and code review.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI IMAGE OR VIDEO TOOL
Clean infographic of a prompt template broken into four labelled blocks stacked vertically, Role, Context, Task and Format, each a rounded card with a small icon and a short example line, thin arrows joining them into a single combined prompt box at the bottom, light neutral palette with one accent colour, flat vector style, generous spacing, legible type. Negative: robots, circuit patterns, gradients, text errors, clutter. Reduced motion: static infographic.

About this pattern

Definition

A reliable text prompt for a language model has four parts: who the model should act as, the context it needs, the single task to do, and the exact format of the answer. Filling all four removes most guesswork and gives repeatable results.

When to use it

  • Role: one line on expertise and audience.
  • Context: the facts the model cannot guess, such as the product, the reader, the constraints.
  • Task: one clear action in the imperative.
  • Format: length, structure and tone of the answer.
  • Leave out any part you do not need, but never leave out the task.

What the controls do

  • Three presets and four editable fields with a live assembled prompt.

Motion & timing

  • The prompt updates as you type.
  • Reduced motion: nothing animates.

Tips & variations

  • Keep each part short; long walls of text bury the task.
  • Put examples in the context part when the style matters.

Code of this live preview

HTML
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Preset"><button data-p="0" aria-pressed="true">Email</button><button data-p="1" aria-pressed="false">Summary</button><button data-p="2" aria-pressed="false">Code review</button></div><label class="fl">Role<input id="f0" type="text"></label><label class="fl">Context<input id="f1" type="text"></label><label class="fl">Task<input id="f2" type="text"></label><label class="fl">Format<input id="f3" type="text"></label><pre class="ou" id="ou" aria-live="polite"></pre><p class="out" id="out"></p></div>

Related patterns

Text Prompt: Role, Context, Task, Format

↗
Text Prompt: Role, Context, Task, FormatPrompt Formulas

Prompt Formula Builder

↗
Prompt Formula BuilderPrompt Formulas

Say What You Want, Not What You Don't

↗
Say What You Want, Not What You Don'tPrompt Formulas