The Pattern

Each technique improves your prompt in a different way. But you don't have to choose just one — stack them together. A single prompt can set a role, specify an audience, show examples, and define a format all at once.

Think of it as: Role + Audience + Examples + Format + Constraints = One precise prompt

Example: Stacked Documentation Prompt

Here's how individual techniques combine into a single prompt:

Give It a Role
You are an experienced technical writer who specializes in making complex topics accessible.
Tell It Who It's For
Write for junior developers who know JavaScript basics but haven't used async/await before.
Show by Example
Follow this style: Start with a real-world analogy. Show the "old way" first, then the "new way." Include a gotcha section for common mistakes. Here's an example of the tone I want: "Think of callbacks like leaving a note for someone..."
Set the Format
Structure: (1) Analogy hook, (2) The problem with callbacks, (3) Promises as the solution, (4) Async/await syntax, (5) Common mistakes, (6) Practice exercise. Keep each section under 200 words.
Combined Prompt
You are an experienced technical writer who specializes in making complex topics accessible. Write for junior developers who know JavaScript basics but haven't used async/await before.

Follow this style: Start with a real-world analogy. Show the "old way" first, then the "new way." Include a gotcha section. Here's an example of the tone I want: "Think of callbacks like leaving a note for someone..."

Structure: (1) Analogy hook, (2) The problem with callbacks, (3) Promises, (4) Async/await syntax, (5) Common mistakes, (6) Practice exercise. Keep each section under 200 words.

Write a tutorial on async/await in JavaScript.

Why Stacking Works

Each technique solves a different problem. Role sets expertise. Audience sets depth. Examples set style. Format sets structure. When you stack them, you're giving AI all the guidance it needs in one shot.

A stacked prompt narrows the space of possible outputs. Instead of getting "any explanation of async/await," you get one that matches your specific needs across multiple dimensions.

Think of it like ordering food: "A sandwich" gives you anything. "A turkey sandwich on sourdough, toasted, with mustard, for here" gives you exactly what you want.

The Technique

Pick the techniques that matter for your task. Write each one as a sentence or paragraph. Combine them into a single prompt. The order usually doesn't matter — clarity does.

Common Stacks

Some combinations work particularly well together:

The Expert Explainer
Role Audience Examples

Perfect for tutorials and documentation. Role brings expertise, audience sets the level, examples set the voice.

The Structured Analyzer
Role Format Step-by-Step

Great for analysis and reviews. Role sets the lens, format ensures scannable output, step-by-step ensures thoroughness.

The Consistent Creator
Examples Format Constraints

Ideal for batch content creation. Examples establish the pattern, format ensures consistency, constraints keep scope tight.

The Thoughtful Advisor
Role Audience Constraints

Best for advice and recommendations. Role brings expertise, audience personalizes it, constraints focus the scope.

Tips for Effective Stacking

Start with 2-3 Techniques

You don't need to use every technique in every prompt. Pick the ones that address your biggest concerns. Build up as needed.

Put the Most Important First

While order doesn't strictly matter, leading with the role or the most critical constraint helps set the frame for everything that follows.

The Task Comes Last

After all your technique layers, end with the actual task. All that context should flow into the final instruction: "Now, write the tutorial."

Stacking vs. Chaining

Stacking combines techniques in one prompt. You get one response that incorporates everything.

Chaining uses multiple prompts in sequence, where each prompt's output feeds into the next.

Use stacking when you want a single, well-shaped output. Use chaining when you need to review intermediate results.