Skip to content
IndexRequest a UIAboutContact

Text Prompt: Role, Context, Task, Format

Toggle the four parts of a text prompt and watch it get clearer, with the assembled prompt shown live.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI IMAGE OR VIDEO TOOL
You are an experienced UX writer. Context: we are launching a free tool that turns screenshots into code, and users have complained that the empty state is confusing. Task: write three alternative headlines and one supporting sentence for the empty state. Format: a numbered list, each headline under eight words, a friendly and clear tone, no jargon. Variants: the same task with the role removed, with the context removed, and with the format removed, to show how each missing part changes the answer. Negative: vague asks like make it better, two tasks at once, pasted text without labels. Reduced motion: not applicable.

About this pattern

Definition

Prompts for chat assistants work best when they answer four questions: who should the assistant be (role), what does it need to know (context), what exactly should it do (task) and what should the answer look like (format). Missing parts are guessed, and guesses are where answers go wrong.

When to use it

  • Role sets the voice and expertise; context supplies the facts the model cannot know; task is one clear instruction; format fixes length and structure.
  • Keep each part to one or two sentences.
  • If the answer is off, find the missing part rather than adding more words everywhere.

What the controls do

  • Four toggles, a live assembled prompt, a clarity score and a Copy button.

Motion & timing

  • The prompt text updates instantly; the score bar eases over 200ms.
  • Reduced motion: the bar changes without easing.

Tips & variations

  • Put pasted material in the context part, clearly separated.
  • Do not give two tasks in one prompt.

Code of this live preview

HTML
<div class="bx"><fieldset class="tg"><legend class="sr-only">Prompt parts</legend><label><input type="checkbox" data-k="0" checked> Role</label><label><input type="checkbox" data-k="1" checked> Context</label><label><input type="checkbox" data-k="2" checked> Task</label><label><input type="checkbox" data-k="3" checked> Format</label></fieldset><div class="pm" id="pm"></div><div class="mt"><span id="sc">Clarity 4 of 4</span><i><u id="br"></u></i><button class="mini" id="cp" type="button">Copy</button></div></div>

Related patterns

Prompt Formula Builder

↗
Prompt Formula BuilderPrompt Formulas

Keyword Order & Emphasis

↗
Keyword Order & EmphasisPrompt Formulas

Prompt Detail Density

↗
Prompt Detail DensityBefore & After