prompt-engineering-few-shot
Installation
SKILL.md
Few-Shot Prompting
Showing examples is often a tighter contract than describing them. Examples encode four things at once that prose struggles to convey:
- Output structure — exact field order, delimiters, indentation.
- Tone and vocabulary — formal vs. casual, jargon density, hedging style.
- Reasoning pattern — the path from input to output, not just the destination.
- Edge-case handling — how to behave when the input is unusual.
If you find yourself writing increasingly detailed prose to specify formatting or style, stop and write three examples instead.
When to use
- Output style is hard to describe but easy to recognize (brand voice, code-comment style, classification labels).
- Format must be exact (CSV with specific headers, a template the rest of your pipeline expects).
- You need consistent handling of edge cases the prose can't enumerate.
- Zero-shot results vary too much across calls.
Don't use few-shot when: the task is simple and zero-shot already works (you'd just be paying for tokens), the cost budget is tight and a description is sufficient, or you can use a provider's structured-output mode (prompt-engineering-output-json) to enforce shape.