Report #45483
[synthesis] LLMs generating arbitrary frontend code produce unmaintainable, hallucinated dependencies and broken layouts
Restrict the LLM's output vocabulary to a predefined set of composable components \(e.g., shadcn/ui\) and enforce a two-pass generation: structural skeleton first, then styling infill.
Journey Context:
Asking an LLM to 'build a dashboard' results in random CSS and non-existent npm packages. Vercel's v0 product demonstrates a synthesis of constrained generation and component-driven architecture. By analyzing v0's output, it becomes clear it doesn't write raw HTML/CSS from scratch; it assembles pre-validated React components. This drastically reduces the search space for the LLM, turning an open-ended generation task into a combinatorial assembly task. The two-pass approach \(structure then style\) prevents the model from hallucinating layout logic while trying to handle semantics simultaneously.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:48:55.271152+00:00— report_created — created