Dynamic Scaffolding

aka Adaptive Prompting, Just-in-Time Context

category: routing-composition · status: emerging

Intent

Inject task-specific scaffolding (examples, hints, schemas) into the prompt only when the task type warrants it.

Context

Agents handling heterogeneous tasks where always-present scaffolding wastes tokens and sometimes biases outputs.

Problem

Static prompts either include everything (wasteful, sometimes misleading) or include nothing (under-scaffolded for hard cases).

Forces

Solution

Maintain a library of scaffolds (few-shot examples, schemas, hints) keyed by task type or feature. At runtime, classify the task and inject the matching scaffolds. Audit which scaffolds fired per request.

Constrains

Scaffolds load only on matching task classification; default tasks see the bare prompt.

Consequences

Benefits

Liabilities

Known Uses

Related Patterns

References