How to Write Good AI Prompts: The R-T-F Framework

Photo by Glenn Carstens-Peters on Unsplash

To write good AI prompts, give the model three things: a role, a specific task, and the output format you want. Treating the AI like an expert assistant you're briefing — rather than a search box — is what separates a generic answer from a usable one.

🎯 The R-T-F Formula for Better Prompts

Think of a prompt as a briefing for a freelancer. A high-quality prompt typically follows the R-T-F structure: Role, Task, and Format.

  1. Role: Tell the AI who it should be (e.g., "Act as a senior marketing strategist").
  2. Task: Define exactly what you need (e.g., "Draft a 300-word email sequence for a product launch").
  3. Format: Specify the output structure (e.g., "Use bullet points, a professional tone, and include a call to action at the end").

When you write AI prompts, both major AI providers point to the same core idea in their official guidance: be explicit about what you want. See OpenAI's prompt engineering guide and Anthropic's prompt engineering overview.

💬 What Other Users Say: A frequently repeated tip in prompt-engineering discussions is that assigning a persona (“Act as a…”) reliably shifts tone and style without changing the accuracy of the underlying answer. Users who pair a persona with saved custom instructions report even more consistent tone across separate conversations, not just a single prompt.

🧩 Essential Elements of High-Quality AI Prompts

  • Context: Give the AI background information — who the audience is, what you've already tried, what the constraints are.
  • Constraints: Set boundaries, such as word counts, forbidden words, or specific style guidelines.
  • Examples: Provide a "few-shot" prompt by showing the AI an example of the quality or style you want. Modern models have large context windows, so including two or three examples is usually worth the tokens.

A close-up screenshot of an AI chat window showing an iterative prompt chain

Photo by Emiliano Vittoriosi on Unsplash

🔁 Iterative Refinement: Talk to It Like a Colleague

Rarely will your first prompt be perfect. If the output isn't quite right, follow up with clarifying instructions: "That was good, but make it more concise," or "Shift the perspective to focus more on the benefits than the features." Refining in two or three turns almost always beats writing one giant prompt.

⚠️ Common Mistakes to Avoid

  • Being too vague: Asking "write a post about AI" leads to generic results. Specificity is the single biggest lever you have.
  • Forgetting to iterate: Don't give up if the first output is poor; refine the instructions instead of starting over.
  • Piling on conflicting instructions: Contradictory constraints ("be thorough but keep it under 50 words") force the model to guess which one you meant.
  • Assuming the AI remembers: Context lives inside a single conversation. A new chat starts from zero.

📚 Four Prompt Patterns Worth Stealing

Once R-T-F is a habit, these named patterns cover most situations where a single instruction isn't enough:

  • The interview pattern. End your prompt with "Before answering, ask me up to 5 questions that would improve your answer." The model surfaces the context you forgot to give — usually the exact thing that would have ruined the first draft.
  • The critic pass. After any draft: "Now review your own answer as a skeptical editor. List the three weakest points, then rewrite." Self-critique costs one message and reliably tightens the result.
  • The rubric pattern. Define what "good" means before asking for the work: "A strong answer is under 300 words, cites a source for every claim, and ends with one action item. Now write it." You're grading the homework before assigning it.
  • The constraint ladder. When output is bland, add constraints one at a time — audience, banned words, sentence-length cap — rather than all at once. You learn which constraint actually moves quality, and you avoid the conflicting-instruction trap from earlier.

🗂 Build a Prompt Library (It Compounds)

A notebook filled with handwritten AI prompts and ideas

Photo by Mike Tinnion on Unsplash

The people who get outsized value from AI tools rarely write prompts from scratch. They keep a notes file of proven ones with blank slots: "Act as [role]. Rewrite the text below for [audience], keeping it under [N] words…" When something works, it goes in the file; when it fails twice, it gets edited or deleted.

Start with five slots — email reply, summary, brainstorm, critique, rewrite — and let the library grow from real use. Within a month you'll open the file more often than you open a blank chat. These patterns work in any assistant, so they carry over intact whether you use ChatGPT, Gemini, or a dedicated writing tool.

❓ Frequently Asked Questions

Does the length of the prompt matter?

Specificity matters more than length. A short, precise prompt beats a long, rambling one — but complex tasks genuinely need enough context to work with.

Does being polite ("please," "thank you") get better answers?

Probably not, and the evidence is genuinely mixed. A 2025 study on prompt politeness found that blunt prompts scored slightly higher on accuracy than very polite ones (84.8% vs 80.8%), possibly because polite phrasing adds indirect padding — "Could you please tell me…" — that muddies the actual request (Mind Your Tone, arXiv 2025). Other cross-language research found the effect flips depending on the language and model. The practical takeaway: politeness neither helps nor hurts much. Clarity does the work.

Should I start a new chat or keep going?

Keep going while the context is relevant — the model uses the whole thread. Start fresh when you switch topics, so earlier instructions don't bleed into the new task.