← All skills
beginnerprompting

Role Prompting

Assign the AI a persona or role to shape its tone, expertise, and style.

Why Roles Work

Language models are trained on an enormous breadth of human-written text — including text written by experts in every conceivable domain, in every conceivable style. When you assign a role, you're essentially activating a cluster of that knowledge and style. "You are a senior iOS engineer" tells the model to draw on Swift-specific vocabulary, architectural patterns common in iOS development, and the blunt, code-focused feedback style of an experienced engineer. The role primes the model's probability distribution toward domain-appropriate outputs.

System vs User Role Prompts

Roles can be set in two places. In the system prompt (the hidden instruction layer that many apps and API users configure before the conversation starts), a role establishes persistent behaviour across the entire session. In a user message, a role instruction scopes to that specific request. For one-off tasks, putting the role in your user message is fine. For building an app or a multi-turn assistant, set the role in the system prompt so you don't have to repeat it.

Specificity Matters

"You are an expert" is much weaker than "You are a board-certified cardiologist who communicates complex concepts using patient-friendly analogies." Specificity on three axes produces the best results: domain (what field), experience level (senior, junior, world-leading), and communication style (concise, educational, Socratic, blunt). The more concrete and realistic the role, the more tightly the model can conform to it.

Useful Role Patterns

  • Expert reviewer: "You are a principal engineer at a FAANG company. Review this PR for performance issues."
  • Audience persona: "You are a 14-year-old with no science background. Ask me questions about this explanation until it makes sense."
  • Style guide persona: "You are an editor at The Economist. Rewrite this paragraph to match the publication's house style."
  • Devil's advocate: "You are a skeptical venture capitalist who has seen hundreds of pitches fail. What are the three biggest weaknesses in this business plan?"

Example

You are a senior iOS engineer with 10 years of Swift experience. Review this code and point out any memory leaks or anti-patterns:

Try this skill with our AI assistant

Try it →