Advanced Prompt Engineering
0/15 complete

Module 01 · Structural Prompt Frameworks

The CO-STAR Framework: A Structured Prompt Checklist

CO-STAR is a checklist for specifying Context, Objective, Style, Tone, Audience, and Response format. Singapore GovTech’s official Prompt Engineering Playbook presents it as a way to make a request clearer—not as an industry standard or a formula that guarantees a good answer.

Use it when a work output has several constraints or will be reused. By the end of this lesson, you will have converted one real task into a complete CO-STAR prompt and tested whether each field earns its place.

// concept

CO-STAR Anatomy: Six Decisions, Not Six Decorations

FieldDecision it recordsUseful detailWeak detail
ContextWhat verified background does the model need?Product facts, source text, business constraintYour whole company history
ObjectiveWhat single job should be completed?Draft one listing from supplied facts“Help with marketing”
StyleWhat observable writing pattern should appear?Short sentences and scannable bullets“Amazing writing”
ToneWhat attitude should the words convey?Helpful, factual, not pushy“Make it viral”
AudienceWho will read and act on the answer?Phone-first shoppers comparing practical features“Everyone”
ResponseWhat exact shape and limits should the answer follow?Title, five bullets, description, missing-data list“Whatever works”

The fields solve different problems. Style describes construction: sentence length, vocabulary, and layout. Tone describes attitude: formal, reassuring, direct, or cautious. Audience changes which details need explanation. Response makes the answer inspectable by defining sections, length, and exclusions.

Do not fill a field merely to honour the acronym. If the audience and tone do not affect a private grocery list, omit them. If a client-facing listing must respect supplied evidence, brand voice, and a marketplace layout, the fuller checklist is worth the extra minute.

// concept

From a Lazy One-Liner to a Testable Brief

Here is the bad prompt for a fictional Daraz listing:

// prompt — copy me1 line
Write a great Daraz listing for my rechargeable desk fan.

The model has to guess the fan’s specifications, buyer, tone, length, and listing structure. A plausible-looking answer may add an unsupported battery-runtime claim, warranty, discount, or superlative. The problem is not that the sentence is short; it is that the missing decisions matter.

Here is the good prompt, using the same task and clearly labelled sample input:

// prompt — copy me34 lines
CONTEXT
You are drafting a sample Daraz Pakistan listing for a fictional seller.
Use only these supplied product facts:
- Product: BreezeDesk-01 rechargeable desk fan
- Three speed settings
- USB-C charging
- 4,000 mAh battery capacity
- Box contents: fan, USB-C cable, user guide
No tested runtime, warranty, price, discount, noise rating, or safety
certification has been supplied.

OBJECTIVE
Draft accurate listing copy that helps a shopper understand the supplied
features. Do not infer missing specifications or invent performance claims.

STYLE
Use plain English, short sentences, and feature-to-use explanations.
Avoid repeated adjectives, exclamation marks, and keyword stuffing.

TONE
Practical and confident, never urgent or exaggerated.

AUDIENCE
Pakistani students and home-office users browsing on a phone and comparing
compact desk fans.

RESPONSE
Return, in this order:
1. One product title of no more than 120 characters.
2. Five bullets, each containing one supplied feature and its practical use.
3. One description of 90–120 words.
4. A section called “Seller must confirm” listing every missing fact that
   would materially affect purchase.
Do not claim “best”, “silent”, “all-night”, “lowest price”, or a warranty.

This prompt does not guarantee accurate copy. It makes accuracy easier to inspect: every product claim must trace to the sample facts, and every unsupplied purchase detail has an explicit destination.

// concept

When CO-STAR Earns the Overhead

Use task stakes, ambiguity, and reuse—not acronym loyalty—as the decision rule.

SituationPrompt weightReason
Rename three file labelsDirect instructionLow stakes; format is obvious
Turn notes into a private checklistDirect instruction plus formatOne constraint matters
Draft a routine internal updateA lighter framework such as RTFRole, task, and format may be enough
Write evidence-bound client copyCO-STARAudience, tone, source limits, and output shape matter
Build a prompt used weekly by a teamCO-STAR plus examples and testsReuse makes ambiguity expensive
Produce regulated or high-impact adviceA full specification plus qualified human reviewA framework cannot supply professional accountability

CO-STAR becomes bureaucracy when the task is obvious and easy to check. It pays off when a wrong assumption could reach a customer, another person must reuse the prompt, or success needs a reviewable format.

Use this blank template for your own task:

// prompt — copy me17 lines
CONTEXT
[Verified background, source material, constraints, and missing information]

OBJECTIVE
[One concrete outcome; use a verb such as draft, classify, compare, or extract]

STYLE
[Observable structure, vocabulary, sentence pattern, or reference style]

TONE
[Attitude appropriate to the situation]

AUDIENCE
[Who will use the output, what they know, and what decision they face]

RESPONSE
[Sections, fields, length, order, exclusions, and how to mark uncertainty]

// worked_example

Worked Example

Run the lazy one-liner with the sample fan facts in mind. A realistic sample output excerpt might say:

“Enjoy silent all-night cooling with Pakistan’s best-value rechargeable fan. Buy now for guaranteed comfort.”

That draft sounds fluent but fails four checks. “Silent,” “all-night,” and “best-value” are unsupported; “guaranteed” overstates the evidence; the answer has no comparison-friendly structure. The model filled gaps because the prompt never told it which facts were authoritative or how to handle missing ones.

Now run the filled CO-STAR prompt. A realistic sample output excerpt is:

BreezeDesk-01 Rechargeable Desk Fan | 3 Speeds | USB-C | 4,000 mAh Battery

Three speed settings: choose a lower or higher airflow setting for desk use.

Seller must confirm: tested runtime, charging time, warranty, price, dimensions, noise rating, and any safety certification.

Draft two is traceable, but one phrase still needs fixing: “lower or higher airflow” is reasonable, yet it does not tell the shopper anything beyond the existence of three settings. Revise only the failed field instead of rewriting the entire framework:

// prompt — copy me6 lines
Revise the RESPONSE from the previous CO-STAR task.
For each bullet, separate the verified product fact from the use case with an
em dash. Do not imply measured airflow, runtime, quietness, or suitability for
sleep. Keep every other CO-STAR field unchanged.

Return only the five revised bullets and the “Seller must confirm” list.

A realistic corrected bullet is: “Three speed settings — select among the available settings for desk use.” It is modest, but defensible. This is the practical value of the framework: when an output fails, you can locate whether the missing control belongs in Context, Objective, Style, Tone, Audience, or Response.

// failure_cases

Failure Cases to Diagnose

6 cases to diagnose

  • Context becomes a data dump

    The actual source facts disappear inside irrelevant history. Keep only information that changes the requested output, and clearly label unknowns.

  • Objective contains several competing jobs

    “Research, strategize, write, and approve” makes completion unclear. Split the work or choose one deliverable for this prompt.

  • Style and tone repeat each other

    “Professional” in both fields adds no control. Specify observable style and a distinct reader-facing attitude.

  • Audience is a demographic label only

    “Pakistani customers” does not explain knowledge or intent. State what the reader is comparing or deciding.

  • Response format lacks acceptance limits

    “Write a listing” cannot be checked consistently. Add sections, order, length, exclusions, and uncertainty handling.

  • The framework is mistaken for verification

    A well-structured prompt can still produce false content. Compare claims with the supplied source and review before publishing.

// pakistan_angle

Pakistan Angle

For a Daraz Pakistan listing, supply the actual PKR price, delivery terms, return information, and warranty only after checking the seller’s current records and platform fields. Do not ask a model to invent a discount or write “cash on delivery available” unless the seller has verified that option for the listing and buyer location.

Many Pakistani sellers coordinate drafts through WhatsApp on phones. Remove customer phone numbers, home addresses, CNIC images, order IDs, and payment screenshots before pasting context into any AI chat. Keep a lightweight text version of the CO-STAR brief locally so a weak connection or load-shedding does not erase the source facts.

Roman Urdu can fit a local social caption, but a marketplace specification should stay unambiguous. If you request bilingual copy, state which product terms remain in English and ask a fluent reviewer to check meaning and spelling before publication; do not assume machine-generated Urdu preserves a technical claim.

// hands_on

Hands-On Exercise

5 steps

Choose one real recurring work task: a product listing, a client email, a university study summary using material you are authorized to use, or an internal report.

  1. Paste the lazy one-line version into your document; do not run it with private or identifying data.

  2. Fill all six CO-STAR fields using the blank template. Label source facts, unknowns, and forbidden inferences in Context.

  3. Run both prompts in the same model with the same safe sample input.

  4. Save one short output excerpt from each and compare factual support, audience fit, and format compliance.

  5. Revise only the field responsible for the most important failure, then run it once more.

// completion_rubric

Completion Rubric

6 checks — tick as you verify

0/6

// sources

Sources

// check_yourself

Check yourself

4 questions · answers and options are taken word-for-word from this course

0/4
  1. 1 / 4 · diagnose

    Your work shows this failure mode: “Context becomes a data dump.” The lesson describes it like this: “The actual source facts disappear inside irrelevant history.” What does the lesson tell you to do about it?