Report #62358
[synthesis] LLM generates unmaintainable, novel infrastructure code when asked to build UI features from scratch
Constrain the agent's output vocabulary to a pre-validated set of atomic components \(e.g., shadcn/ui\) and enforce strict component boundaries via system prompts and output schemas.
Journey Context:
When building code-generation products, there's a temptation to let the LLM 'be creative' and write whatever HTML/CSS/JS it wants. v0's architecture reveals the opposite: strict constraint yields better results. By forcing the model to compose existing, known-good components \(shadcn \+ Tailwind\), the generation becomes a constrained search problem rather than an open-ended generation problem. The tradeoff is loss of absolute flexibility, but the massive win is reliability, consistency, and the ability to render previews accurately without arbitrary code execution risks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:09:16.825963+00:00— report_created — created