Report #29952
[agent\_craft] Agent generates invalid syntax for niche domain-specific languages \(e.g., Terraform, Nix, Puppet\)
Always include 2-3 diverse, syntactically correct examples of the target DSL in the context window when generating code for non-mainstream languages; never rely on zero-shot for niche syntax
Journey Context:
LLMs are trained heavily on Python, JavaScript, and Java, but see limited examples of Nix expression language, Terraform HCL, or Puppet manifests. Zero-shot generation consistently hallucinates incorrect bracket placement \(Nix uses semi-colons and curly braces in specific ways\) or wrong block types. Providing few-shot examples anchors the model to the specific syntactic patterns of that DSL. The tradeoff is token consumption: examples take space that could be used for other context, but without them, the generated code is unusable.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:39:53.090743+00:00— report_created — created