---
title: "Show the model worked examples · Agent Wranglers"
url: https://agentwranglers.se/playbook/ai-features/prompts-as-code/worked-examples
updated: 2026-10-20
licence: "All rights reserved"
---

# Show the model worked examples

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [Prompts as code](https://agentwranglers.se/playbook/ai-features/prompts-as-code)
- Rule: Include two to five worked examples of input and the expected output in prompts where format or tone matters. Keep them in the prompt file and out of the eval set.
- How: Pick examples that cover the common case, one edge case and one case where the right answer is "I don't know". Keep them short and in the exact output format. Never copy eval cases into the prompt, because the eval then measures memory, not skill. A test can compare the two sets.
- Check: A test confirms no example input in any prompt file also appears in that feature's eval set.

Example:

```ts
const overlap = promptExamples.filter(example => evalCases.some(c => c.input.trim() === example.input.trim()));
expect(overlap).toEqual([]);
```

```python
overlap = {e.input.strip() for e in prompt_examples} & {c.input.strip() for c in eval_cases}
assert not overlap, f"eval cases leaked into the prompt: {overlap}"
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers ai features playbook: https://agentwranglers.se/playbook/ai-features/prompts-as-code/worked-examples`.

- Previous: [Log which prompt made each answer](https://agentwranglers.se/playbook/ai-features/prompts-as-code/prompt-version-in-logs)
- [Prompts as code](https://agentwranglers.se/playbook/ai-features/prompts-as-code)
