Basic Prompt Structure

One of the most common reasons an AI response falls short is not the AI itself — it is a poorly structured prompt. Just like a well-organized recipe leads to a better dish, a well-structured prompt leads to a better AI output.

This topic covers a simple, reliable framework for writing prompts that consistently produce clear and useful responses — even for beginners.

The Four-Part Prompt Framework

A well-structured prompt typically contains up to four elements. Not every prompt needs all four, but understanding each one helps in deciding what to include based on the task.

Part 1 — Task (Required)

The task is the core instruction. It tells the AI exactly what action to perform. Every prompt must have a task — without it, the AI has nothing to act on.

Common task verbs: Write, Summarize, Explain, List, Translate, Compare, Classify, Generate, Fix, Rewrite

Example: "Write a short birthday message."

Part 2 — Context (Recommended)

Context provides background information that helps the AI understand the situation. It answers questions like: Who is this for? What is the purpose? What is the setting?

Example: "Write a short birthday message for a colleague who is turning 40."

Adding context narrows the response and makes it more relevant to the actual need.

Part 3 — Format (Optional but Helpful)

Format specifies how the output should be presented. This could include things like bullet points, numbered lists, a table, paragraphs, a specific word count, or a certain tone.

Example: "Write a short birthday message for a colleague who is turning 40. Keep it warm and professional, under 50 words."

Without a format instruction, the AI picks a format on its own — which may or may not match what is needed.

Part 4 — Examples (Optional)

Examples show the AI what a good response looks like. They are especially useful when the expected output follows a specific style or pattern that words alone cannot fully describe.

Example with a sample:
"Write a short birthday message for a colleague who is turning 40. Keep it warm and professional, under 50 words. Here is an example of the tone I want: 'Happy birthday! Wishing you a year full of great achievements and moments worth celebrating.'"

Putting It All Together

Here is how a prompt evolves as each part is added:

VersionPromptWhat is Missing
Task only"Write a birthday message."No context, no format — very generic
Task + Context"Write a birthday message for a colleague turning 40."Better, but format and tone still undefined
Task + Context + Format"Write a birthday message for a colleague turning 40. Keep it warm and professional, under 50 words."Well-structured and clear
Full Prompt"Write a birthday message for a colleague turning 40. Keep it warm and professional, under 50 words. Example tone: 'Wishing you a wonderful year ahead.'"Nothing — this is a complete prompt

The CQFR Method — A Quick Memory Tool

A simple way to remember good prompt structure is the CQFR method:

  • C — Command: What should the AI do? (Task)
  • Q — Qualifiers: Who is the audience? What is the purpose? (Context)
  • F — Format: How should the output look? (Format)
  • R — Reference: Any examples or samples to guide the response? (Examples)

Not every prompt needs all four — use as many as the task requires.

Practical Examples of Structured Prompts

Example 1 — Content Writing

Weak Prompt: "Write about solar energy."

Structured Prompt: "Write a 150-word introductory paragraph about solar energy for a school newsletter aimed at students aged 12-15. Use simple language and an encouraging tone."

Example 2 — Customer Support

Weak Prompt: "Reply to this complaint."

Structured Prompt: "Write a polite and empathetic customer support reply to the following complaint from a customer who received a damaged product. Keep the reply under 80 words and offer a replacement. Complaint: 'The phone case I ordered arrived with a crack on it.'"

Example 3 — Code Generation

Weak Prompt: "Write a function."

Structured Prompt: "Write a JavaScript function that accepts an array of strings and returns a new array with all strings converted to uppercase. Include a comment explaining what the function does."

Example 4 — Data Analysis

Weak Prompt: "Analyze this data."

Structured Prompt: "Look at the following monthly sales figures and identify the three months with the highest growth compared to the previous month. Present the result in a numbered list with a brief explanation for each. Data: Jan: 1200, Feb: 1350, Mar: 1300, Apr: 1600, May: 1550, Jun: 1900"

Common Structural Mistakes to Avoid

  • Skipping the task: Saying "sales data from last year" without telling the AI what to do with it
  • No audience mentioned: Writing "explain this concept" without saying who the explanation is for — a child vs an expert needs very different explanations
  • Unclear format: Saying "give me information" instead of "list five points" or "write two paragraphs"
  • Too many tasks in one: Combining five different requests into one prompt, which confuses the output

How Long Should a Prompt Be?

There is no ideal length. A good prompt is as long as it needs to be — and not a word longer. A simple task might need only one sentence. A detailed task involving specific output, audience, tone, and constraints may need a short paragraph.

The goal is completeness with clarity — not length for its own sake.

Key Takeaway

A well-structured prompt has four potential parts: Task, Context, Format, and Examples. The task is essential. Context and format significantly improve output quality. Examples are optional but powerful when a specific style is needed. Using the CQFR method (Command, Qualifiers, Format, Reference) is a simple way to build prompts consistently.

In the next topic, we will explore Zero-Shot Prompting — writing prompts that produce great results with no examples at all.

Leave a Comment

Your email address will not be published. Required fields are marked *