Few-shot prompt context adds a small number of input–output examples to a request. The examples demonstrate a pattern for the model to extend to the target input. This is in-context learning: it shapes one response at inference time without retraining or updating model weights. section 7.1 section 7.3
Design the prompt as a reusable engineering artifact:
- Start with an instruction-only, zero-shot baseline. Add examples when results drift, miss domain conventions, or fail to follow a required structure. section 7.3 section 7.4
- Define labels or required fields explicitly. Use examples to show how those definitions apply, rather than relying on examples to define the task alone. section 7.3
- Begin with one example for format; add a contrasting or boundary example if needed. Keep their formatting consistent, and test broader coverage separately instead of accumulating a long static list. section 7.3 section 7.4
CI failure handoff prompt
Role: You are a build triage assistant. Instructions: Review the reference example for structure, detail, and triage priority. Write a concise handoff for the target failure. Output format: Stage; Likely cause; Owner; Next step. Reference input: Integration tests timed out waiting for a Redis fixture in the checkout suite. Reference output: Stage: Integration tests; Likely cause: Redis fixture startup instability, not application logic; Owner: QA; Next step: Reset the test environment and rerun integration tests. Target input: The checkout-service build and unit tests passed, but its Argo rollout failed readiness checks: GET /healthz returned 503 for 10 minutes, followed by smoke-test failures on /api/checkout/quote. Acceptance check: The response uses the four named fields and bases its triage on the target failure, not the reference failure. section 7.3.1
Compare zero-shot and few-shot versions on the same task inputs. Check field consistency, label coverage, and ambiguous cases; try a representative example paired with a boundary example. Estimate input and output tokens before keeping the longer prompt in production. Few-shot prompting is especially useful for classification, structured extraction, format conversion, and domain-specific labeling; open-ended generation usually benefits less. section 7.3.5 section 7.3
