Dynamic Scaffolding
Inject task-specific scaffolding (examples, hints, schemas) into the prompt only when the task type warrants it.
Problem
If the prompt always carries the full scaffolding library, easy requests waste tokens on examples they never needed and sometimes the irrelevant examples push the model toward a wrong shape of answer. If the prompt always carries nothing, the model under-performs on the hard cases that genuinely benefit from few-shot examples or explicit schemas. A single static prompt forces the team to choose between overshooting cost on easy tasks and undershooting quality on hard ones.
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.
When to use
- Some tasks need few-shot examples, schemas, or hints and others do not — static prompts overshoot or undershoot.
- A library of scaffolds keyed by task type or feature can be maintained.
- Task classification at runtime is reliable enough to route the right scaffold.
Open the full interactive page →
Diagram, neighbourhood map, code examples, related patterns and full provenance.