The role, task, context and format framework
Split a prompt into role, task, context and format, add one constraints line, and unpredictable output becomes predictable. Demonstrated on Secondary 3 Mathematics, Secondary 1 English Language and Secondary 5 Visual Arts.
以繁體中文閱讀Short answer: split every prompt into role, task, context and format, then add a constraints line, and you move from hoping for a good result to expecting one.
Why the same prompt works on Monday and fails on Friday
A Secondary 3 Mathematics teacher put it like this: "Last week I asked for ten quadratic equation questions and they were perfect. This week the same request gave me a pile of questions needing the quadratic formula, which my class has not met."
Both times she typed the same thing:
Give me ten quadratic equation questions.
The model is not unreliable. The sentence simply leaves too many blanks for it to fill in: which year level, which solving methods have been taught, answers or no answers, one difficulty or three. It fills those blanks differently each time, so of course the output moves.
The framework exists to fill every blank yourself.
Why this works
Think of a prompt as a job allocation slip in a school office. A good slip states who is doing it (role), what is to be done (task), the background (context), what must be handed back (format), and what must not happen (constraints).
A slip that reads "sort out the water thing" leaves the recipient guessing. AI is in exactly that position, except it cannot walk over and ask you a clarifying question. It simply hands you its best guess.
Each part does a distinct job:
- Role narrows the register. "You are a planning assistant for a Hong Kong primary General Studies teacher" pushes the model towards the vocabulary and structures of education writing rather than press releases or marketing copy.
- Task is one action. One verb — design, mark, rewrite, summarise — not four in a sentence.
- Context is the information only you hold. Year level, learning focus, pacing, class profile, prior knowledge. None of it exists online.
- Format decides whether you have to reorganise the answer afterwards. "A table with four columns" means you do not; "be more detailed" means you do.
- Constraints are the guard rails. Language and terminology, verify uncertain facts, do not rewrite student work — those three apply almost every time.
The skeleton
You are a [assistant type] for a Hong Kong [primary / secondary] [subject] teacher.
Task: [one verb plus one deliverable].
Context: [year level], unit "[name]", learning focus: [list]. Prior knowledge: [what students already know]. Class profile: [size, ability spread, special needs].
Output format: [layout], [how many items], each containing [fields or elements].
Constraints: use Hong Kong English and local curriculum terminology; where a fact, figure or date is uncertain, mark it "teacher to verify" instead of supplying one; if student work is involved, give suggestions only and do not rewrite the piece.
Example 1: Secondary 3 Mathematics, turning drift into consistency
You are a planning assistant for a Hong Kong secondary Mathematics teacher.
Task: design a set of classroom practice questions on quadratic equations.
Context: Secondary 3, unit "Quadratic equations", learning focus is solving quadratics by factorisation. Students have covered factorisation and the cross method; they have not met the quadratic formula or completing the square. The class has 32 students, about 8 of whom still need consolidation on factorisation.
Output format: ten questions in three groups — 4 consolidation, 4 core, 2 challenge; each with the answer and one sentence naming the key step; then a table mapping each group to the learning focus.
Constraints: every question must be solvable by factorisation and must not require the quadratic formula; keep coefficients as integers; if you are unsure whether a question has integer solutions, mark it "teacher to verify" rather than forcing an answer.
Run the same prompt next week and the result will be close to identical. That consistency is the point.
Example 2: Secondary 1 English Language, and which language to prompt in
A Secondary 1 English Language teacher needs controlled practice items. Here the prompt should be written in English, because the output is English teaching material and prompting in the target language avoids the small distortions that creep in when the model switches between languages mid-task.
You are a teaching assistant for a Hong Kong secondary English Language teacher.
Task: write a set of controlled practice items on the past continuous tense.
Context: Secondary 1, mixed ability, Chinese first language. Students know the simple past. The learning focus is contrasting an ongoing past action with an interrupting past action.
Output format: eight gap-fill items, then four sentence-combining items, then two short free-response items. Put the answer key at the end, not inline.
Constraints: keep vocabulary within a Secondary 1 range and avoid culture-specific references Hong Kong students would not recognise; if an item may have more than one acceptable answer, mark it "teacher to verify".
The rule of thumb is simple: prompt in the language the output will be in. Lesson plans, letters home and Chinese-language worksheets in Chinese; English reading comprehension and English writing feedback in English.
Example 3: Secondary 5 Visual Arts, where context does the heavy lifting
You are a teaching assistant for a Hong Kong secondary Visual Arts teacher.
Task: design a guided-question worksheet for artwork appreciation.
Context: Secondary 5, unit "Hong Kong cityscape and identity", students are preparing the appreciation component of their school-based assessment. They can describe visual elements but consistently stall at moving from description to interpretation. The class has 18 students, 3 of whom are weak in written expression.
Output format: four levels of questions with three questions each — describe, analyse, interpret, evaluate; each level with one sentence starter for students; plus a column listing common weak student responses and a follow-up question the teacher can use.
Constraints: do not name any specific artist or artwork — leave those for the teacher to fill in, as students choose their own; use Hong Kong Visual Arts curriculum terminology; if you refer to any art-historical fact you are unsure of, mark it "teacher to verify".
Common mistakes
- An inflated role. "You are the world's leading education expert" does nothing, because "world-leading" is not a register. What works is the concrete combination of region, phase, subject and assistant type.
- Two or three verbs in the task. "Design, then mark, then summarise" splits the model's effort three ways and all three come back thin. Ask three times, or number three explicit blocks in the format line.
- Context that stops at subject and year level. The detail that changes everything is what students have and have not yet been taught. That single sentence often lifts the usable proportion of the output from half to nearly all of it.
- A format written as "more detailed" or "more professional". Those adjectives have no executable meaning. Replace them with counts: how many items, how many columns, how many words each, table or prose.
Going further
- A different subject: for Chinese Language, add "use the Hong Kong curriculum's text-type terminology and not mainland textbook categories"; for General Studies, add "use examples Hong Kong students encounter in daily life".
- A different year level: the gap between Primary 4 and Secondary 5 lives in the context and constraints lines. Put prior knowledge in context and a language ceiling in constraints, for example "sentences of no more than 15 words, no idiomatic vocabulary".
- SEN needs: build the adaptation into the output format rather than asking afterwards. For example, "produce both a standard version and a step-by-step version, the latter with one instruction per step and a tick box before each step".
- Two classes at once: list both class profiles in context and ask the format line for "a Class A version and a Class B version, plus one sentence on how they differ".
Once the framework is in place, the next step is making the output look identical every time — that takes examples. See lesson 3, teaching by example. To fix the framework as a school-wide default, see lesson 5, system prompts and school-based personas.
Key takeaways
- The four parts in order are role, task, context and format, closed by a constraints line — and every later template in this course visibly follows those five lines.
- Context is the part teachers most often omit and the one with the highest return, because the model knows nothing about your class, your pacing or your textbook.
- An output format must be countable — how many items, what each contains, what layout — never "please be more detailed".
- Three constraints are worth repeating every time: language and terminology, flag uncertain facts for verification, and never rewrite a student's work wholesale.
FAQ
It is not a rule, but writing them in the order role, task, context, format makes omissions easy to spot, and placing format later helps the model treat it as the final specification. What actually matters is that all four are present.
Save the context as a fixed paragraph, refresh the class profile once a term, and change only the unit name day to day. On a school platform this step is handled for you — you pick the unit from a form.
Yes. The published prompting guides from the major providers agree on the principles: an explicit role, a specific task, sufficient context and a stated output format. The phrasing details differ, but those four parts are the common foundation.
- OpenAI — Prompt engineering guide
- Anthropic — Prompt engineering overview
- Google — Gemini API prompting strategies
- · All prices, features and specifications follow the official documentation linked above. Vendors may change them at any time — verify before you purchase.
- · Product names and trademarks mentioned belong to their respective owners. Edor.ai has no partnership, agency or sponsorship relationship with these companies.
- · This article is an independent review compiled for educational purposes and is not procurement advice or legal advice.
- · For any use involving student personal data, assess it against your school policy and the Personal Data (Privacy) Ordinance (PDPO) before rollout.