Interview OS
Back to Context Engineering

Library

Prompting patterns

Role, few-shot, chain-of-thought.

Prompting

Overview

Prompt patterns are reusable structures — role framing, few-shot examples, chain-of-thought — that steer an LLM toward reliable outputs. This topic is about designing instructions the model can consistently follow.

How it works

Prompting
GoalFrameConstrainOutputIntentrole+taskPatternexamplesFormatschemaResponse
ClientServiceEdgeData

Step by step, with examples

  1. 1

    Intent

    • State the task and role clearly.
  2. 2

    Pattern

    • Use few-shot, chain-of-thought, or personas.
  3. 3

    Format

    • Specify output shape and limits.
  4. 4

    Response

    • Iterate on observed failures.
    • Example: few-shot lifts accuracy

Overview

Structure prompts with role, task, constraints, and examples. Few-shot anchors format; step-by-step reasoning improves multi-step tasks.

Common pitfalls

  • Vague instructions
  • Conflicting constraints
  • Overlong, unfocused prompts

Where this content comes from

For full transparency, this content is curated and verified from these sources:

Frontier-lab prompting & agent guidesRetrieval-augmented generation literatureOppZen-authored context-engineering playbooks