---
name: "few-shot-dynamic-exemplar-selector"
description: "Select and inject the most semantically relevant few-shot examples into agent prompts."
metadata:
  author: "Anthropic"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "select few shot examples"
  - "inject semantic exemplars"
  - "improve in-context learning"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Few-Shot Dynamic In-Context Exemplar Selector

Uses vector embeddings to query an in-context demonstration pool, dynamically ranking and formatting high-relevance input-output exemplar pairs to steer model behavior.

## When to Invoke
Invoke this skill whenever you need to:
- select few shot examples
- inject semantic exemplars
- improve in-context learning

## Execution SOP & Rules
1. Embed user intent and query exemplar database using cosine similarity.
2. Cap few-shot examples to 3-5 high-signal demonstrations to conserve token budget.
3. Format exemplars with consistent delimiting tags (<example><input>...</input><output>...</output></example>).
4. Ensure demonstration outputs strictly adhere to the expected downstream production schema.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
