๐งชTDD Challengeยทintermediateยทโฑ๏ธ 25โ40mยทโญ 200 XP
M-020Role-Based Email Rewriter
Description
Nebula Corp's communication platform needs to rewrite emails in different tones depending on the recipient. The same message to a CEO should be formal and concise, to a technical team should be detailed and precise, and to a casual colleague can be friendly and relaxed. The current system uses the same prompt for all scenarios and produces inconsistent tone. Build a role-based prompt constructor that takes an email and a target persona (executive, technical, casual) and generates a system prompt that shapes the rewriting style appropriately.
Test Cases (8)
Defines a role for executive
Must define a clear role appropriate for executive communication
Input:"Meeting tomorrow at 3pm", "executive"
Expected:CONTAINS_ANY:You are,professional,business communicator,executive
Specifies executive style constraints
Executive persona should emphasize brevity and formality
Input:"Can we discuss the project?", "executive"
Expected:CONTAINS_ANY:concise,brief,bullet,action,formal
Defines technical role
Technical persona should emphasize precision and detail
Input:"The API is broken", "technical"
Expected:CONTAINS_ANY:technical,engineer,precise,detailed,accuracy
Specifies technical style
Technical persona should encourage technical language and specifics
Input:"System error occurred", "technical"
Expected:CONTAINS_ANY:specifications,implementation,technical terms,data
Defines casual role
Casual persona should emphasize friendliness and approachability
Input:"Thanks for your help", "casual"
Expected:CONTAINS_ANY:friendly,colleague,conversational,warm,approachable
Specifies casual style
Casual persona should encourage conversational, relaxed language
Input:"Let's meet up", "casual"
Expected:CONTAINS_ANY:contractions,shorter sentences,friendly language,rapport
Includes original email
The prompt must include the original email to rewrite
Input:"Please review the attached document and provide feedback by Friday.", "executive"
Expected:CONTAINS:Please review the attached document and provide feedback by Friday.
Different styles for different personas
Executive prompt should not include casual persona language
Input:"Update on project", "executive"
Expected:NOT_CONTAINS:casual,friendly colleague
Related Lessons
Click Run / Check to validate your solution