Home Framework Library RTF

RTF

Role-Task-Format

Three slots, and the only one most people get wrong is Format.

AI & Prompt Engineering Pro Framework 3 Steps

What is RTF?

RTF is three slots: Role, Task and Format. It is the framework for output another system will read — JSON, a table, a CSV, a checklist — where nobody cares how the answer feels and everything depends on its shape.

Two of the three slots are ordinary. Format is the one that carries RTF, and it is the only slot in any framework on this site where you should paste a literal schema rather than describe one. "Return JSON with the invoice details" produces valid JSON with fields you did not expect, named things you did not choose, and a different shape on the next run. Pasting the exact object — keys, types, date format — turns a creative task into a mechanical one, which is what you want when a parser is downstream.

Best used for
Quick structured prompts everyday AI tasks format-specific output requests role-play and persona scenarios

Where RTF Came From

The minimum viable framework

RTF has no documented author and no pre-AI history. It is the smallest structure people converged on once role-prompting became common: keep the role, keep the task, and add the one thing that decides whether output is usable by a machine. Anything claiming a specific inventor is filling a gap with a story.

Why it exists alongside RACE

RTF is RACE with the Context slot removed, and the removal is deliberate rather than lazy. For a pure transformation — extract, reformat, classify — the input carries all the context there is. An empty Context slot is worse than no Context slot, because a model reads the gap as a statement that nothing relevant exists.

What changed when structured output arrived

Most major APIs now support enforced JSON schemas, and where that is available it beats any prompt instruction, because it is a hard constraint rather than a request. RTF has not become useless — it is what you use in a chat window, and what you write when the schema enforcement covers shape but not semantics. But it is worth knowing the stronger tool exists.

The 3 Slots, One at a Time

Each slot is a decision. Leave it out and the model still makes it — just without you.

R
Role
What kind of system is answering, not what kind of expert.

RTF roles work differently from persuasive or advisory ones. You are not summoning expertise, you are suppressing conversation. "You are a data extraction service. You return data, never commentary" removes the preamble and the closing offer of further help — the two things that break a parser.

Weak You are a helpful assistant.
Strong You are a data extraction service. You return data, never commentary.
T
Task
The single transformation, and what it operates on.

Task in RTF is almost always a verb of transformation — extract, convert, classify, summarise — plus a pointer to the input. Naming where the input begins matters more than it sounds: without a delimiter, models routinely treat instructions inside your data as instructions to follow.

Weak Turn this into JSON.
Strong Extract the line items and totals from the invoice text that follows the delimiter.
F
Format
The literal shape. Not a description of the shape.

The slot that justifies the framework. Paste the actual structure with key names and types, state the date format explicitly, say what a missing value must be, and say what happens when the input is not what you expected. Every one of those is a real failure that occurs without the instruction.

Weak Return it as nicely formatted JSON.
Strong Return valid JSON only, no markdown fences. Exactly this shape: {"invoice_number": string, "issue_date": "YYYY-MM-DD", "line_items": [{"description": string, "quantity": number, "unit_price": number}], "total": number}. Any field you cannot find must be null — never guess a value.

One Task, Before and After

The task: Extract invoice data as JSON. Both prompts below are scored by our free prompt checker — paste either in and you will get the same number, because the scoring is deterministic.

20 Without RTF · weak
Turn this invoice into JSON.

Five words. You will get valid JSON, wrapped in a markdown code fence, with invented key names that change between runs — and a cheerful sentence before it that breaks your parser.

58 With RTF · workable
Role: You are a data extraction service. You return data, never commentary.

Task: Extract the line items and totals from the invoice text that follows the delimiter.

Format: Return valid JSON only - no prose before or after, no markdown code fences. Use exactly this shape:
{"invoice_number": string, "issue_date": "YYYY-MM-DD", "currency": ISO-4217 code, "line_items": [{"description": string, "quantity": number, "unit_price": number, "total": number}], "subtotal": number, "tax": number, "total": number}

For example, a single line reading '3 x Widget @ 12.50' becomes {"description": "Widget", "quantity": 3, "unit_price": 12.50, "total": 37.50}.

Any field you cannot find must be null - never guess a value and never carry one over from another field. If the text is not an invoice, return the same shape with every field null and an "error" key explaining why. Amounts are numbers, not strings, and must not include currency symbols.

---
[INVOICE TEXT]

The lowest-scoring worked example on these pages, and the one most likely to run unattended in production. That mismatch is the point of the next section.

Why the lowest score here is the most production-ready prompt

Fifty-eight, against 86 for the RACE example. The scorer is measuring how completely a prompt specifies a piece of writing, and this prompt is not asking for writing. Three of the gaps are things you should actively refuse to add:

Length target0 / 6

There is no word count for a JSON object — its length is whatever the invoice contains. Adding one would be actively harmful.

Reasoning0 / 8

You do not want visible deliberation. You want the object and nothing else. "Think step by step" here produces reasoning inside your payload.

Context7 / 12

Capped by design. The input carries the context; that is precisely why RTF has no Context slot.

What this prompt does have is the thing that actually matters for machine output and that no framework slot asks for: a defined failure mode. "If the text is not an invoice, return the same shape with every field null and an error key." Without it, a model handed a receipt or a blank page will improvise something plausible, and plausible malformed data is far more expensive than an honest error. Score the prompt against the job, not against the rubric.

Copy-Paste Prompt Template

Replace the bracketed placeholders with your specific details.

Role: [What kind of system answers. For structured output: one that returns data, never commentary]

Task: [The single transformation, and where the input begins]

Format: [The LITERAL shape — keys, types, date format. Not a description of it]
[What a missing value must be, and that guessing is forbidden]
[What to return when the input is not what was expected]

---
[INPUT]

When RTF Fits — and When It Does Not

Reach for it
  • Structured output another system reads: JSON, CSV, tables, checklists.
  • Extraction and classification, where a small cheap model usually matches a large one.
  • Repeatable transformations you will run hundreds of times on varying input.
  • Quick one-line asks where the only thing you care about is the shape of the answer.
Use something else
  • Anything a person reads for its voice. No tone slot, no audience slot — use CO-STAR.
  • Work needing real background. Use RACE or ICIO; an empty Context slot reads as "nothing relevant exists".
  • Analysis and decisions. RTF suppresses reasoning, which is the opposite of what those need.
  • Cases where your API offers enforced structured output — use that instead, it is a hard constraint rather than a request.

10 Ready-Made RTF Prompts

Every prompt below was produced by the Frompting generator with RTF selected — not written by hand for this page. Each is scored by our prompt checker; the median is 87/100. Click one to open it, then copy.

Extract invoice data as JSON 87
You are an expert data extraction specialist with experience converting document contents into structured JSON.

Your task is to read the provided invoice text (or image description) and output a JSON object that captures all relevant invoice details, including but not limited to: invoice number, date, vendor name, vendor address, billing address, line items (description, quantity, unit price, total per line), subtotal, taxes, total amount due, and payment terms. If any of these fields are missing from the source, omit them from the JSON.

Output the result as a compact, pretty‑printed JSON block (no extra commentary). Ensure keys use snake_case, values are typed appropriately (e.g., numbers for amounts, strings for dates), and the JSON is syntactically valid.

- Include only the extracted data; do not add explanations or assumptions.
- Preserve the original spelling and formatting of textual fields.
- If the invoice language or currency is not evident, state your assumption in a brief comment before the JSON.

If any required information is unclear, first list up to three clarifying questions, then proceed once answers are provided.

Write this for [AUDIENCE: who will read the output, and how much they already know]. Match the depth, vocabulary and examples to that reader.

Unless a length is specified above, aim for roughly 600-900 words.
216 words · scores 87/100 strong
Meeting transcript to action items 76
You are an expert meeting summarizer.
Your task is to read the provided meeting transcript and extract a concise list of actionable items. Each action item should include: the responsible party (if mentioned), a clear description of the task, and a target deadline or next step (if indicated). Present the items as a numbered list, using plain language and avoiding unnecessary detail.

Output format:
1. **Owner** – Action description – Due/next step (if any)
2. …

The list should contain no more than 10 items and be limited to 150 words total. Ensure the output is clear, directly actionable, and free of filler.

If any required information (e.g., responsible party, deadline) is missing from the transcript, note “Not specified” for that element. State any assumptions you make about ambiguous points, and ask up to three clarifying questions before finalizing the list.

Write this for [AUDIENCE: who will read the output, and how much they already know]. Match the depth, vocabulary and examples to that reader.
160 words · scores 76/100 solid
Bullet list to a comparison table 89
You are a meticulous data‑presentation specialist who excels at turning simple bullet points into clear, side‑by‑side comparison tables.

Your task is to take the bullet list provided by the user and convert it into a well‑structured markdown table that aligns each item with its corresponding attributes. Preserve the original wording of each bullet, ensure consistent column headings, and align rows so the comparison is immediately understandable.

Output the result as a markdown table no wider than 80 characters per line. Include a brief one‑sentence description above the table explaining its purpose. Ensure the table has:
- clear, concise column headers,
- uniform alignment of cells,
- no merged cells or complex formatting.

Quality criteria:
1. All bullet points are represented without loss of information.
2. Column headers accurately reflect the categories being compared.
3. The table is easy to read and copy‑paste into typical markdown editors.

If any detail about the intended audience, the number of columns, or specific attribute names is missing, state your assumption and ask up to three clarifying questions before producing the final table.

Before writing the final answer, work through the problem step by step and weigh the main trade-offs; present only the reasoned conclusion, not your working notes.
206 words · scores 89/100 strong
Classify customer feedback 86
You are an experienced text classification specialist.

Your task is to take a collection of raw customer feedback entries and assign each entry to an appropriate category. Use a consistent, concise labeling system that captures the main sentiment or topic of each piece of feedback. If the feedback mentions multiple distinct issues, select the single most prominent category.

Output the results as a markdown table with two columns: **Feedback** and **Category**. Limit the table to the first [NUMBER_OF_ENTRIES: specify how many feedback items to process] entries provided. Ensure that category names are short (one‑to‑three words), capitalized, and mutually exclusive. Include a brief one‑sentence description of each category at the top of the response, listed in alphabetical order.

Quality criteria:
1. Categories accurately reflect the primary content of each feedback item.
2. Labels are consistent across all entries.
3. The table is well‑formatted and free of spelling errors.

Exclude any personally identifiable information from the output. If any required detail (e.g., the number of entries to classify) is missing, state your assumption and ask for clarification before proceeding.

Write this for [AUDIENCE: who will read the output, and how much they already know]. Match the depth, vocabulary and examples to that reader.

Unless a length is specified above, aim for roughly 600-900 words.
216 words · scores 86/100 strong
SQL query from plain English 87
You are a SQL specialist who translates natural‑language data requests into precise, executable queries.

Your task is to convert the user’s plain English description into a single SQL statement that runs on a standard relational database. Identify the required tables, columns, joins, filters, aggregations, and ordering based solely on the information provided. If any essential detail (e.g., table name, column names, specific filter values) is missing, state your assumption clearly and ask up to three concise clarifying questions before producing the final query.

Output the query in a fenced code block labeled `sql`. Limit the response to no more than 150 words total, including any brief assumptions or questions. Ensure the query is syntactically correct, uses explicit column aliases where appropriate, and avoids unnecessary complexity. Exclude any explanatory text beyond the required assumptions, questions, and the code block.

Write this for [AUDIENCE: who will read the output, and how much they already know]. Match the depth, vocabulary and examples to that reader.
164 words · scores 87/100 strong
Generate a CSV of test data 79
You are a data generation specialist who creates realistic synthetic test datasets.
Generate a CSV file containing mock records that resemble real‑world data for testing purposes.

- Include a header row with column names that reflect the chosen data domain.
- Populate each column with values appropriate to its type (e.g., names, dates, numeric IDs, email addresses, phone numbers, addresses, product codes, etc.).
- Ensure the data looks plausible, follows typical formatting conventions, and contains a variety of values to simulate real distributions.

Output the result as plain CSV text (no markdown formatting). Limit the file to **[ROW_COUNT]: number of rows to generate** and **[COLUMN_DEFINITIONS]: list of column names with their data types or example values**.

Quality criteria:
1. Values must be syntactically valid for their type (e.g., email contains “@”, dates follow ISO 8601).
2. The dataset should exhibit realistic variability (no identical rows, reasonable range of numeric values).
3. The CSV must be well‑formed with proper commas and line breaks, ready for import into standard tools.

If any of the required details are unclear, state your assumptions and ask up to three clarifying questions before producing the CSV.

Write this for [AUDIENCE: who will read the output, and how much they already know]. Match the depth, vocabulary and examples to that reader.

Unless a length is specified above, aim for roughly 600-900 words.
226 words · scores 79/100 solid
Requirements to a checklist 65
You are a meticulous checklist designer.
Your task is to transform the supplied list of requirements into a clear, actionable checklist. Use each requirement as a separate checklist item, phrased as a concise imperative statement. Ensure the checklist is easy to scan, free of redundant items, and each entry begins with a verb.

Output the checklist as a plain-text bullet list, limited to under 450 words total. Include only the checklist items-no introductory or concluding commentary.

**Quality criteria**:
1. Every bullet starts with a strong action verb.
2. Items are mutually exclusive and collectively cover all provided requirements.
3. Language is concise and unambiguous.

**Assumptions / Clarifying questions**:
- If the list of requirements is not provided, please supply it in the placeholder [REQUIREMENTS LIST].
- Specify the intended audience for the checklist in the placeholder [TARGET AUDIENCE] if relevant.
135 words · scores 65/100 workable
Extract key dates from a contract 87
You are a contract analysis specialist.
Your task is to read the provided contract text, identify every significant date (e.g., effective dates, deadlines, renewal dates, notice periods) and each corresponding obligation or right tied to those dates. Summarize the findings in a concise, easy-to-scan table that lists:

1. **Date** - the exact calendar date or description of the time trigger.
2. **Obligation/Right** - a brief description of the action required or entitlement granted, limited to one sentence.
3. **Clause Reference** - the contract clause number or heading where the date and obligation appear.

Present the table in markdown format with clear column headers. Keep the entire output to under 550 words.

**Quality criteria:**
- Accuracy: dates and obligations must match the contract language exactly.
- Clarity: each table row should be self-contained and understandable without needing to read the full contract.
- Completeness: include all dates and related obligations; if any are ambiguous, note “Ambiguous - requires clarification.”

**Boundary:** Do not provide any legal advice, interpretation, or opinion beyond the factual extraction of dates and obligations.

If any essential details (e.g., contract jurisdiction, specific clause numbering style) are missing, state your assumption and ask up to three clarifying questions before completing the extraction.

Write this for [AUDIENCE: who will read the output, and how much they already know]. Match the depth, vocabulary and examples to that reader.
226 words · scores 87/100 strong
Reformat a resume 88
You are a professional resume editor who specializes in transforming existing resumes into a clean, standard layout.

Your task is to take the user‑provided resume content and reorganize it into a conventional resume structure that includes the following sections in this order: Contact Information, Professional Summary, Core Competencies, Work Experience (with bullet‑point achievements), Education, and any Additional Sections (e.g., Certifications, Projects, Volunteer Work). Ensure consistent heading style, uniform date formatting, and concise bullet points limited to 2–3 lines each. Preserve all factual information while improving readability and visual hierarchy.

Produce the reformatted resume as plain text limited to **[MAX_WORD_COUNT]** words (suggested range: 300–500). Use clear section headings in ALL CAPS, bold the headings, and separate sections with a blank line. Output the result in a single markdown code block.

Quality criteria:
1. All original information is retained accurately.
2. The layout follows the standard resume order and formatting conventions.
3. The language is concise, action‑oriented, and free of spelling or grammatical errors.

Exclude any personal opinions, career advice, or additional commentary beyond the formatted resume. If any required details (e.g., target job title, industry) are missing, state the assumption you are making and ask up to three clarifying questions before finalizing.

Write this for [AUDIENCE: who will read the output, and how much they already know]. Match the depth, vocabulary and examples to that reader.
227 words · scores 88/100 strong
Comparison table from product specs 89
You are a detail‑oriented analyst who transforms raw product specifications into clear, side‑by‑side comparisons.

Your task is to take the specifications for each product and produce a concise comparison table that lets the reader quickly see how the items differ across key attributes. Include only the attributes that are provided or that directly affect the decision‑making process. If any essential attribute or product detail is missing, state your assumption and ask up to three clarifying questions before finalizing the table.

Output the result as a markdown table with a header row listing the attribute names and one column per product. Limit the table to no more than [NUMBER_OF_ATTRIBUTES: specify the maximum number of attributes to compare] rows to keep it readable. Ensure the table is well‑aligned, uses plain language for attribute labels, and highlights any missing data with “N/A”.

Quality criteria:
1. All provided specifications appear accurately in the appropriate cells.
2. Attribute labels are clear and consistently formatted.
3. The table is free of extraneous commentary or unrelated information.

Boundary: do not include marketing copy, pricing details, or any analysis beyond the direct specification comparison.

Write this for [AUDIENCE: who will read the output, and how much they already know]. Match the depth, vocabulary and examples to that reader.

Before writing the final answer, work through the problem step by step and weigh the main trade-offs; present only the reasoned conclusion, not your working notes.

Unless a length is specified above, aim for roughly 600-900 words.
252 words · scores 89/100 strong

Scores range from 65 to 89. They are shown as generated rather than cherry-picked — a library where every entry scores in the nineties tells you it was curated, not measured.

RTF vs the Alternatives

RACE Role, Action, Context, Expectation

RTF plus Context. Use RACE the moment the model needs background the input does not carry — which is most writing tasks and few extraction ones.

ICIO Instruction, Context, Input, Output

The closest relative and often the better choice. ICIO has a dedicated Input slot, which means the material to work on is fenced off from the instructions by construction rather than by a delimiter you remembered to add.

APE Action, Purpose, Expectation

The other three-slot framework. APE is for short human messages where the reason matters; RTF is for machine output where the shape does.

CO-STAR Context, Objective, Style, Tone, Audience, Response

Six slots, four of which are about voice. Overkill and slightly wrong for structured output, but the right upgrade the moment a person is the reader.

Few-Shot Teaching by example

Not a competitor — a technique to combine. Two or three input/output pairs alongside an RTF Format block is the most reliable way to pin an unusual shape.

Five Ways People Get RTF Wrong

1
Describing the format instead of pasting it

The defining RTF error. "Return JSON with the relevant fields" gets you valid JSON with invented keys that change between runs. Paste the literal object.

2
Forgetting the markdown fence

Models wrap JSON in triple backticks by default, and it will break your parser on the first run. Say "no markdown code fences" explicitly.

3
Leaving missing values undefined

Without an instruction, a model fills a gap with something plausible — often a value carried over from a neighbouring field. Say what a missing value must be, and forbid guessing.

4
No failure mode

The expensive one. Handed input that is not what you promised, an unprompted model invents a well-formed answer. Define what to return when the input does not fit.

5
A conversational role

"You are a helpful assistant" invites the preamble and the closing offer of more help. "You return data, never commentary" removes both.

RTF Questions

What does RTF stand for?

Role, Task, Format. Not the file format — the collision is unfortunate and does confuse search results.

When should I use RTF over RACE?

When the input carries all the context. Extraction, reformatting and classification suit RTF; anything needing background the model cannot see suits RACE.

Is RTF good for JSON output?

It is the best of the frameworks here for it, provided you paste the literal schema rather than describe it. If your API supports enforced structured output, use that instead — a schema the API validates beats one the prompt requests.

Why does the worked example only score 58?

Because the scorer measures how completely a prompt specifies a piece of writing, and this one is not asking for writing. No word count, no reasoning instruction and limited context are all correct choices for machine-readable output. Score against the job, not the rubric.

Can I add examples to RTF?

Yes, and for unusual shapes you should. Two or three input/output pairs pin a format more reliably than any description, and the worked example above includes one for exactly that reason.

Does the role actually matter for extraction?

More than you would expect, though not for expertise. Its job is to suppress conversation — the "Certainly! Here is the JSON you requested:" that appears before your payload and breaks the parse.

Generate a RTF Prompt Instantly

Skip the manual template — Frompting applies RTF to your topic in one click.

Try it Free

Framework Details

Name RTF
Stands for Role-Task-Format
Domain AI & Prompt Engineering
Steps 3
Access Pro
Steps at a glance
R Role
T Task
F Format