The Prompt That Changed How I Think About Roles
I was working on a side project last year — a simple budgeting app — and I asked Claude to review my database schema. The answer I got back was... fine. Technically correct. But it felt generic, like something copied from a Stack Overflow thread.
Then I tried something different. Instead of just saying "act like a database expert," I gave it three roles at once: a senior database engineer, a security-minded developer who's paranoid about SQL injection, and a product manager who cares about keeping things simple for a small team. Same schema. Completely different answer.
That's role stacking. And once you get the hang of it, you'll never go back to single-role prompts again.
What Is Role Stacking, Exactly?
You've probably seen the advice "tell ChatGPT to act like an expert" a thousand times. Role stacking takes that idea further by combining multiple expert perspectives into one prompt — on purpose, with intention.
The core idea is that real problems are rarely one-dimensional. A good piece of writing needs a sharp editor and someone who understands SEO and someone who knows the audience. A solid API design needs a developer, a security engineer, and someone thinking about the developer experience on the other end.
When you give the AI a single role, you get one lens. When you stack roles, you get a multi-angle answer that actually reflects how complex problems work in the real world.
This is different from asking follow-up questions or chaining prompts (which are also useful techniques). Role stacking is about setting up the right mental model before the AI starts answering.
The Basic Structure of a Role Stack
Here's the pattern I use. It's simple enough to remember, flexible enough to adapt to almost anything:
# Role Stack Template
You are simultaneously:
→ [Role 1] who cares about [specific concern]
→ [Role 2] who prioritizes [different concern]
→ [Role 3] who thinks about [third concern]
With all three perspectives active, please [your actual task].
→ Where these roles conflict, flag it.
→ Where they agree, say so clearly.That last line — "where these roles conflict, flag it" — is one of my favorite tricks. Conflict between expert perspectives is usually where the most useful insight lives. When the security engineer and the product manager disagree, that's the thing you need to think hard about.
A Real Example: Reviewing a Landing Page
Let's say you've written a landing page for a freelance service and you want feedback. Compare these two prompts:
# Too simple
Act like a marketing expert and review my landing page copy.# Role-stacked version
You are simultaneously:
→ A direct-response copywriter who obsesses over headlines and CTAs
→ A skeptical first-time visitor who doesn't trust anyone yet
→ An SEO specialist who wants this page to rank for the right terms
Review the landing page copy below.
→ Give feedback from each perspective separately
→ Then give a combined priority list of the top 5 changes to make first
→ Flag any spots where these perspectives clashThe first prompt gets you a list of generic marketing tips. The second gets you a copywriter who wants a punchy headline, a skeptic poking holes in your trust signals, and an SEO person flagging that your H1 has zero search intent. That's three entirely different conversations collapsed into one useful answer.
How Many Roles Is Too Many?
I've tested this a lot. My honest answer: three roles is the sweet spot for most tasks. Two feels a little thin. Four starts to get muddled — the AI tries to balance so many voices that each one becomes shallower.
There are exceptions. For genuinely complex projects — like designing a system architecture or planning a product launch — I've stacked up to five roles with good results. But I always add this line at the end:
Keep Roles Distinct
Make sure each role you stack has a genuinely different concern or priority. "Senior developer" and "experienced engineer" are basically the same role — that's not stacking, that's just padding. Good stacks have real tension between the perspectives.
When I go above three, I add: If any role's perspective would be redundant, skip it and say why. This keeps the AI from blending everything into mush.
Role Stacks for Common Workflows
Here are a few stacks I actually use on a regular basis. Copy them, tweak them, make them yours.
For code review:
→ A senior dev who cares about readability and future maintainability
→ A security engineer looking for vulnerabilities and data leaks
→ A junior dev on the team who needs to understand this code in 6 monthsFor writing blog posts:
→ A tough editor who cuts anything that doesn't earn its place
→ A reader who's skeptical and needs proof before they trust a claim
→ An SEO specialist focused on search intent and keyword placementFor making a decision (like picking a tool or framework):
→ A pragmatist who wants the fastest path to a working solution
→ A long-term thinker worried about tech debt and scalability
→ Someone managing a tight budget who needs to justify every costOne Mistake I See Constantly
The biggest role stacking mistake is making all your roles agree with each other by default. I see this a lot when people choose roles that are just variations of the same expert — like "a Python developer," "a senior Python developer," and "a Python architect." Those three are going to give you the same answer with slightly different vocabulary.
The power of role stacking comes from genuine tension. A UX designer and a backend engineer often want opposite things. A legal compliance person and a marketing copywriter are practically natural enemies. Put them in the same prompt and watch what happens — the AI has to reconcile real trade-offs, which is exactly what you're going to have to do anyway. Better to see the conflict in text before you build the wrong thing.
The Conflict Test
Before you send a role stack, ask yourself: would these roles ever disagree in real life? If the honest answer is "not really," replace one of them with something that actually creates friction. The disagreement is where the value is.
Building Your Own Role Stack Library
Once you find a stack that works well for a recurring task, save it. I keep mine in a plain text file organized by use case. Takes about ten seconds to copy-paste and fill in the specific task, and it consistently produces better results than starting from scratch every time.
The goal is to build a small collection of go-to stacks for the kinds of work you do most. Over a few weeks, you'll have a library that makes every AI session faster and more useful — because you're not spending mental energy figuring out how to ask, you're spending it on the actual problem.
Role stacking isn't a magic trick. It's just a way of being more intentional about what kind of thinking you're asking the AI to do. And once that clicks, it becomes one of those techniques you reach for automatically — the same way you'd think to get a second opinion on anything that actually matters.
More tutorials in this category, or explore the full field guide.