Report #92729
[agent\_craft] Agent produces inconsistent code style or incorrect idioms in generated code
For greenfield generation \(new files\), use 3-5 few-shot examples of the target codebase's actual patterns from recent commits; for edits to existing files, use zero-shot with 'Follow existing patterns in /path/to/file' instruction. Never mix few-shots from different language versions or frameworks.
Journey Context:
The common error is always using zero-shot \(inconsistent style\) or always using few-shot \(wastes tokens, can force wrong patterns\). The critical insight is context-dependency: new files need style anchoring, existing files need conformity to what's there. Mixing few-shots from Python 2 and 3, or different async patterns, causes subtle bugs. The examples must be from the actual target repo, not generic tutorials.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T14:13:57.506225+00:00— report_created — created