role prompting

Instructing the model to adopt a specific expert persona before responding. Leverages the model's knowledge of how experts in that role communicate.

Syntax

prompt-engineering
"Act as a [expert role]. [Task]..."

Example

prompt-engineering
"Act as a senior database architect with 15 years of PostgreSQL experience. Review this query and suggest performance improvements:

[SQL query here]"

Other patterns:
"You are an expert Python security auditor..."
"Respond as a friendly 5th-grade science teacher..."