Dynamic Prompt Templates That Adapt to User Context Automatically
Static prompts work everywhere, which means they work nowhere perfectly. Dynamic prompts detect context and adapt. If user is a CEO, output executive summary. If user is engineer, output technical detail. I've built systems where the same prompt adapts automatically. Results: satisfaction jumps because output matches user role.
Role Detection and Conditional Prompt Adjustment
Prompt layer 1: 'Detect user role from context: [MESSAGE / PROFILE]. Likely roles: C-level, manager, individual contributor, customer, other. Confidence 1-10.' Output: detected role. Prompt layer 2 (conditional): 'Detected role: [ROLE]. Generate output appropriate for [ROLE]. If C-level: focus on business impact and ROI, 1-page summary. If manager: include team implications and implementation steps, 2-3 pages. If IC: technical detail, code examples, 5+ pages. If customer: human-first tone, benefits-focused, no jargon.' Output adapts to role. Example: product roadmap. C-level gets one-pager on revenue impact. Manager gets roadmap + team resource needs. IC gets roadmap + architectural implications. Same prompt, three outputs. Testing: static prompt scores 6/10 for C-levels, 6/10 for ICs, 6/10 overall. Dynamic prompt scores 8.5/10 for C-levels, 8.5/10 for ICs, 8.5/10 overall.
Role detection can be explicit (user picks role) or inferred (prompt parses message for clues). Inferred is better UX; explicit is more reliable. Consider hybrid: infer, then ask 'Is this right?'
Detect role from context (message, profile, interaction history)
Conditional output: C-level (summary, ROI), manager (implementation, team), IC (technical, detailed)
Length and detail vary by role: executives brief, ICs deep
Tone: executives formal, customers friendly, ICs precise
Verification: ask user 'Got your role right?' and adjust if wrong