RACE Framework: Role-Aligned Contextual Expertise

A structured approach to AI prompting that leverages specific roles, actions, context, and expectations to produce highly targeted outputs

Last updated: April 28, 2025
Category: Expert PromptingComplexity: Intermediate
RACE

Framework Structure

The key components of the RACE Framework framework

Role
Define the specific professional identity the AI should emulate
Action
Articulate the precise actions you want the AI to perform
Context
Provide relevant situation-specific information
Expectations
Clarify the specific qualities, format, and criteria for the output

Core Example Prompt

A practical template following the RACE Framework structure

plaintextExample Prompt
As a senior UX researcher with expertise in qualitative methods (Role), review the following user interview transcript and identify key usability issues and emotional pain points (Action). The interview was conducted with a 65-year-old first-time user of our healthcare management app who expressed frustration with the appointment booking process (Context). Present your findings as a prioritized list of issues with severity ratings and include direct quotes from the transcript to support each finding. Focus on actionable insights our design team can immediately address (Expectations).

Usage Tips

Best practices for applying the RACE Framework framework

  • Choose roles that have specialized knowledge and methodology rather than general ones
  • Specify concrete actions using precise verbs and outputs
  • Include only relevant contextual information that impacts the response
  • Set explicit quality standards and format requirements for the output
  • Balance comprehensive framing with concise direction

Detailed Breakdown

In-depth explanation of the framework components

R.A.C.E. Framework

The R.A.C.E. framework—Role, Action, Context, Expectations—provides a structured approach to AI prompting that leverages specific professional personas, clear actions, situational context, and defined quality standards to produce highly effective outputs.

Introduction

The R.A.C.E. FrameworkRole, Action, Context, Expectations—is a structured approach to prompt engineering designed for obtaining specialized, expert-level outputs from AI systems. This framework is built on the principle that by assigning a specific professional identity and providing detailed parameters, you can elicit responses that mimic the expertise, methodology, and communication style of domain experts.

This framework produces outputs that are:

  • Role-Specialized – Grounded in domain expertise and professional methodologies
  • Action-Oriented – Focused on specific professional tasks
  • Contextually Informed – Tailored to the specific situation
  • Expectation-Guided – Formatted to precise quality standards and criteria
The R.A.C.E. framework is particularly valuable for:

  • Technical, professional, or specialized knowledge tasks
  • Situations requiring a specific methodology or approach
  • Projects needing well-structured, formatted outputs
  • Complex requests requiring precise framing
  • Collaborative workflows where outputs will be used by others

R.A.C.E. Framework Structure

1. Role

Define the specific professional identity the AI should emulate

Assigning a definitive professional role to the AI activates relevant domain knowledge, methodology, and perspective. Choose roles with specialized expertise rather than general identities to produce responses grounded in proper terminology, frameworks, and best practices.

Good examples:
  • Senior data privacy attorney specializing in GDPR compliance
  • Full-stack developer with 10+ years experience in React and Node.js
  • Clinical psychologist specializing in cognitive-behavioral therapy for anxiety disorders
Bad examples:
  • Legal expert (too general)
  • Developer (lacks specialization)
  • Doctor (undefined specialty or experience)

2. Action

Articulate the precise actions you want the AI to perform

Clearly state what you want the AI to do using specific, directive verbs that indicate both the task and expected deliverable. The action component bridges the assigned role with concrete outputs.

Good examples:
  • "Develop a comprehensive troubleshooting decision tree for network connectivity issues"
  • "Analyze this marketing copy for persuasive techniques and suggest improvements"
  • "Create a step-by-step implementation plan for migrating from MySQL to PostgreSQL"
Bad examples:
  • "Help with my database" (vague action)
  • "Write something about networking" (undefined deliverable)
  • "Give advice" (lacks specificity)

3. Context

Provide relevant situation-specific information

Supply background information that helps the AI understand the specific circumstances, constraints, and relevant factors for your request. Good context is concise but complete, avoiding extraneous details while including all pertinent information.

Good examples:
  • "Our target audience is marketing professionals at mid-size B2B companies who are familiar with basic analytics but lack data science expertise"
  • "The application currently handles 10,000 requests per minute and experiences timeout errors during peak loads"
  • "Previous user testing revealed confusion about the checkout process, specifically around shipping options"
Bad examples:
  • Providing the company's entire history (excessive)
  • "It needs to be good" (insufficient)
  • Including irrelevant technical specifications (distracting)

4. Expectations

Clarify the specific qualities, format, and criteria for the output

Explicitly state what the final output should look like, including format, style, length, level of detail, and any specific requirements or constraints. This component ensures the response matches your exact needs and can be immediately useful.

Good examples:
  • "Present findings as a 2-page executive summary with bullet points, followed by a detailed technical appendix"
  • "Format the code as a complete React component with comments explaining key functionality"
  • "Structure the response as a comparison table with criteria in rows and options in columns, followed by a clear recommendation"
Bad examples:
  • "Make it professional" (subjective and vague)
  • "Write a lot of information" (unspecified amount and structure)
  • "Use good examples" (undefined quality standard)

Example Prompts Using the R.A.C.E. Framework

Example 1: Technical Troubleshooting

Prompt:

R.A.C.E. Breakdown:

  • Role: Senior DevOps engineer specializing in Kubernetes and microservices
  • Action: Diagnose causes of intermittent 503 errors and develop investigation/resolution plan
  • Context: Microservice architecture (12 services), Kubernetes v1.25, autoscaling, error pattern (4-6 hours, 3-5 minutes, multiple services)
  • Expectations: Systematic diagnostic approach with prioritized causes, commands/tools, log patterns, mitigation steps, and architectural recommendations

Example 2: Content Strategy

Prompt:

R.A.C.E. Breakdown:

  • Role: Senior content strategist specializing in B2B SaaS marketing and customer journey mapping
  • Action: Develop a comprehensive content strategy for lead nurturing enterprise security decision-makers
  • Context: Zero-trust security platform, 9-month sales cycle, strong awareness content but weak conversion content, CISO/IT Director personas at 1000+ employee companies
  • Expectations: Content mapping by journey stage, decision-tree for personalization, core content pillars, KPIs, and quarterly calendar template

Best Use Cases for the R.A.C.E. Framework

1. Technical Problem-Solving

  • Troubleshooting complex systems
  • Architecture and design planning
  • Code review and optimization
  • Technical documentation
Example Prompt:

2. Strategic Analysis

  • Market research
  • Competitive analysis
  • Investment recommendations
  • Strategic planning
Example Prompt:

3. Expert Consultation

  • Professional advice
  • Specialized analysis
  • Expert opinions
  • Educational content
Example Prompt:

4. Creative Professional Work

  • Design briefs
  • Creative direction
  • Brand development
  • Content production
Example Prompt:

Bonus Tips for Using R.A.C.E. Effectively

💡 Select roles with credentials: Include specific qualifications, years of experience, or specializations

🎯 Use action verbs from the profession: Employ terminology that the professional would use (e.g., "diagnose" for medical, "analyze" for analytical roles)

🔍 Provide contextual constraints: Include limitations, requirements, or parameters that would influence a professional's approach

📊 Specify deliverable formats: Name the exact type of document or output a professional would produce

⚙️ Match expectations to the role: Ensure the expected output aligns with what the specified professional would typically deliver

Conclusion

The R.A.C.E. Framework provides a powerful approach to prompt engineering that consistently delivers expert-level, professionally formatted outputs. By systematically defining the professional role, specific action, relevant context, and detailed expectations, you create prompts that generate responses with specialized expertise and methodology.

The framework can be extended with additional components for more specialized needs:

  • Resources: Specifying particular sources, tools, or references to use
  • Audience: Defining who will consume the final output
  • Constraints: Adding explicit limitations or boundaries
  • Examples: Providing sample outputs that illustrate desired style or approach
Remember that effective prompting is about creating a clear brief for the AI. The R.A.C.E. framework helps ensure that your prompts leverage specific expertise for professional-quality outputs that meet precise requirements.

Framework in Action: Examples

See how RACE Framework transforms basic prompts into powerful instructions

Before & After Examples

See how this framework transforms basic prompts into powerful instructions for AI

Basic PromptBefore
Review this user test and tell me the problems.
Effectiveness
Based on structure, specificity, clarity, and actionable content
Low
Role-Action-Context-Expectations EnhancedAfter
Role: Act as a senior UX researcher with 10+ years of experience in cognitive psychology and digital accessibility, specializing in interfaces for users with limited technical proficiency. Action: Analyze the attached user test video and transcript to identify critical usability barriers, cognitive friction points, and accessibility issues in our mobile banking app's funds transfer flow. Context: This test was conducted with a 67-year-old retiree who reports using smartphones "occasionally" (2-3 times weekly) and has never used mobile banking before. She attempted to complete a transfer between her checking and savings accounts. She abandoned the task after 4 minutes of attempting various navigation paths. This feature has a 43% abandonment rate among users 65+, compared to 12% for users under 35. Expectations: Deliver your analysis as: 1. A severity-ranked list of the top 5 usability issues with timestamps from the video 2. For each issue, provide: a) specific violation of UX heuristics, b) direct user quote demonstrating the pain point, c) recommended fix with mockup/wireframe sketch if possible 3. Focus on fixes that maintain our brand language while addressing cognitive load and accessibility concerns 4. Keep recommendations feasible for our next 2-week sprint cycle
Effectiveness
Based on structure, specificity, clarity, and actionable content
High

Response Comparison

Basic AI ResponseBefore
Quality:
# User Test Review

Here's what I found after watching the user test:

1. The user couldn't find the transfer button easily and kept looking in different menus.

2. The confirmation process confused the user because it asked for too much information.

3. Text size was too small for the user to read properly.

4. The user didn't understand what some of the banking terms meant.

5. Error messages weren't clear when the user made mistakes.

6. The back button sometimes didn't work as expected.

7. The user got frustrated trying to input account numbers.

You should fix these issues to make the app more user-friendly, especially for older users who aren't as familiar with technology.
Generic information
Lacks structure
Limited detail
Role-Action-Context-Expectations Enhanced ResponseAfter
Quality:
# Senior User Mobile Banking Analysis: Critical Transfer Flow Barriers

## Severity-Ranked Usability Issues

### 1. Hidden Navigation Path to Transfer Function (Severity: Critical)
**Timestamp:** 0:37-1:42

**Heuristic Violation:** Visibility of System Status & User Control and Freedom

**User Quote:** "I don't see anywhere to move my money. Maybe it's in Accounts? No... Settings? I don't know where they've hidden it." [shows visible frustration at 1:23]

**Recommended Fix:** 
- Implement persistent "Quick Actions" bar at bottom of home screen with Transfer as one of 4 primary functions
- Wireframe: [simple sketch showing bottom navigation with Home, Transfer, Pay, More icons]
- This maintains our existing UI pattern while elevating high-frequency actions

### 2. Account Selection Visual Ambiguity (Severity: High)
**Timestamp:** 2:05-2:43

**Heuristic Violation:** Recognition Rather Than Recall & Match Between System and Real World

**User Quote:** "I can't tell which account I'm taking money from and which one I'm putting it into. The arrows don't make sense to me."

**Recommended Fix:** 
- Replace current "From ↓ / To ↑" abstract indicators with explicit labeled sections
- Add account cards with visual differentiation between checking/savings (match physical card colors)
- Show balance prominently within each account card
- Wireframe includes directional arrow visualization between cards to reinforce money movement

### 3. Technical Terminology Barrier (Severity: High)
**Timestamp:** 3:10-3:28

**Heuristic Violation:** Match Between System and Real World

**User Quote:** "What's ACH? It's asking if I want ACH or Wire transfer. I just want to move my own money to my own account."

**Recommended Fix:** 
- Remove technical terminology from user-facing internal transfer flow
- For internal transfers, default to standard transfer method with simple confirmation
- Add optional "Transfer Details" expandable section for users who want to specify method
- For implementation, we can reuse the expandable component from the account details screen

### 4. Excessive Confirmation Steps (Severity: Medium)
**Timestamp:** 2:50-3:42

**Heuristic Violation:** Flexibility and Efficiency of Use

**User Quote:** "It keeps asking me to check things. I've already said where the money is going. Why is it asking me three more times if I'm sure?"

**Recommended Fix:** 
- Consolidate three-step confirmation process into single screen with all details
- Implement large, high-contrast "Confirm Transfer" button
- Show a simple animation confirming success rather than additional confirmation screens
- Can be implemented using existing confirmation components with modified flow

### 5. Error Recovery Failure (Severity: Medium)
**Timestamp:** 3:51-4:05 (abandonment point)

**Heuristic Violation:** Error Prevention & Help Users Recognize and Recover from Errors

**User Quote:** "I don't know what I did wrong. It says 'transfer cannot be processed' but doesn't tell me how to fix it."

**Recommended Fix:** 
- Implement inline field validation with specific error messages
- Add visual cues highlighting exactly which field needs correction
- Include specific resolution instructions (e.g., "Please enter an amount less than your available balance of $X")
- Remove technical error codes from user-facing messages

## Implementation Priorities for Next Sprint

1. Quick Actions bar with Transfer prominence (#1) - Estimated 3 developer days
2. Redesigned account selection with visual differentiation (#2) - Estimated 4 developer days
3. Simplified terminology on transfer flow (#3) - Estimated 1 developer day
4. Consolidated confirmation screen (#4) - Estimated 2 developer days
5. Improved error messaging (#5) - Estimated 2 developer days

Additional recommendation: Schedule follow-up testing with 3-5 senior users before release to validate improvements, focusing on time-to-completion and task success rate metrics.
Professional format
Expert insights
Actionable content

Key Improvements with the Framework

Professional Structure

Clear organization with logical sections

Targeted Focus

Precisely aligned with specific outcomes

Enhanced Clarity

Clear intent and specific requirements

Actionable Output

Concrete recommendations and detailed analysis

Framework Component Breakdown

Role
Define the specific professional identity the AI should emulate
Action
Articulate the precise actions you want the AI to perform
Context
Provide relevant situation-specific information
Expectations
Clarify the specific qualities, format, and criteria for the output