Google's 5-Step Prompt Framework That Changes Everything
Most people write prompts like they're asking a friend for help. Short, vague, hopeful. Then they wonder why the AI gives them generic garbage.
Google's prompt engineering guide introduced a framework that actually works: TCREI. Task, Context, References, Evaluate, Iterate. The problem? Everyone stops after step 2.
Here's why that's costing you hours of wasted output.
The Framework Breakdown
T - Task (What You Want)
Be specific about the deliverable. Not "write a blog post" but "write a 1200-word technical tutorial." Not "analyze this data" but "identify the top 3 customer churn drivers and rank them by revenue impact."
Bad task:
Write about marketing automation
Good task:
Write a 5-step implementation guide for marketing teams
to set up their first drip email campaign using free tools.
Include code snippets for Mailchimp API integration.
The difference? The second one tells the AI exactly what format, depth, and technical level to target.
C - Context (Why It Matters)
This is the secret weapon most people skip. Context tells the AI who it's writing for, what constraints exist, and what success looks like.
Without context, you get generic output calibrated for the average internet user. With context, you get output tuned to your exact situation.
Context:
- Audience: Technical founders building their first AI agents
- Current knowledge: Understands APIs, no ML background
- Goal: Ship a working prototype in 2 hours
- Constraints: Must use free-tier APIs only
- Tone: Direct, practical, no hand-holding
Notice how specific that is? That's what turns a generic tutorial into something you can actually use.
R - References (Show Examples)
This is where most prompts die. You assume the AI knows what "good" looks like. It doesn't.
References anchor the output. They show style, depth, format, and tone. You can reference:
- URLs to similar content you like
- Pasted snippets of your previous work
- Competitor examples to emulate or avoid
- Style guides or brand voice documents
Reference style from this article:
https://example.com/article
Match this tone (direct, no fluff):
"Most people overcomplicate this. Here's what actually works."
Avoid this style (too formal):
"In this comprehensive guide, we shall explore..."
The AI will pattern-match against your references. Good references = good output. No references = lottery.
E - Evaluate (Define Success)
Tell the AI how to judge its own work. This step unlocks self-correction.
Evaluation criteria:
✓ Every claim has a data source or example
✓ No marketing fluff or filler sentences
✓ Code snippets are copy-paste ready
✓ Stays under 1500 words
✓ Includes at least 2 real-world failure cases
When you define evaluation criteria upfront, the AI can course-correct during generation. You're building in quality control from the start.
I - Iterate (Make It Better)
This is the step that separates amateurs from professionals. First output is never final output.
Google's framework treats prompting as a conversation, not a command. You:
- Review the output against your evaluation criteria
- Identify specific gaps or misses
- Request targeted improvements
Iteration request:
The code example in section 2 won't work with Python 3.11
because of the outdated import. Fix it and add error handling
for the API timeout case.
Also, section 3 is too vague. Add a concrete example with
actual numbers showing the before/after improvement.
Notice that's not "make it better." It's precise feedback on specific problems. That's what gets you from 70% useful to 95% useful.
Why Steps 3-5 Matter More Than You Think
Most people stop at Task + Context. They get mediocre output and blame the AI.
The magic happens in References, Evaluate, and Iterate:
- References eliminate ambiguity about style and quality
- Evaluate builds in self-correction mechanisms
- Iterate compounds quality through targeted refinement
I've seen the same prompt go from "unusable" to "shipped to production" just by adding evaluation criteria and one iteration round.
Real Example: Before and After
Before (Task + Context only):
Write a Python script to scrape product prices from an e-commerce site.
Make it easy to use for non-programmers.
After (Full TCREI):
Task:
Write a Python script using BeautifulSoup4 that scrapes product
names and prices from Amazon search results. Output to CSV.
Context:
- User: Small business owner, knows how to run Python scripts
- Use case: Track competitor pricing daily
- Constraint: Must respect robots.txt and rate limits
- Environment: Windows 10, Python 3.11
References:
- Follow this code style: [paste example of clean scraper]
- Error handling approach from: [link to robust scraping tutorial]
Evaluate:
✓ Script runs without modification after pip install
✓ Handles connection timeouts gracefully
✓ Outputs CSV with headers: product_name, price, url, timestamp
✓ Includes comments explaining each function
✓ Rate limiting built in (2 sec delay between requests)
Iterate:
After first draft, I'll test it and request fixes for any
errors or missing edge cases.
The second prompt produces production-ready code. The first produces a starting point that needs hours of debugging.
When to Skip Steps
TCREI is a framework, not a religion. You can compress or skip steps when:
- You're exploring ideas, not shipping deliverables
- The task is simple and unambiguous
- You've already established context in previous messages
But for any work you plan to use in production, ship to clients, or publish publicly, walk through all five steps. The 3 extra minutes upfront saves you hours of revision.
The Bottom Line
Prompt engineering isn't about magic words. It's about complete specifications.
Task and Context tell the AI what to build. References show what good looks like. Evaluate defines the quality bar. Iterate closes the gap.
Most people stop at 40% of the framework and wonder why their output is 40% useful. Don't be most people.
"The quality of your AI output is directly proportional to the specificity of your prompt."
Use all five steps. Ship better work.
Want more like this?
Weekly AI automation insights, frameworks, and practical tips. No fluff.