Report #3865
[agent\_craft] Zero-shot code generation produces hallucinated APIs or inconsistent style; or providing too many outdated examples confuses the model
Provide exactly 1-2 high-quality, recent, diverse few-shot examples that demonstrate the specific edge cases \(error handling, input validation\) relevant to the current task
Journey Context:
Zero-shot fails on domain-specific libraries. However, 5\+ shots waste tokens and can bias toward deprecated patterns. The hard-won insight is recency and relevance trump quantity. Select examples that showcase the 'unhappy path' \(errors\) and 'happy path' to constrain the model's generation effectively without overwhelming it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:21:05.780278+00:00— report_created — created