When you ask an out-of-the-box LLM to generate a component—say, an accessible modal dialog or an expandable disclosure widget—it almost always defaults to a sprawling mountain of JavaScript event listeners, manual ARIA state management, and nested wrapper divs (<div class="modal-backdrop"><div class="modal-dialog"><div class="modal-content">...</div></div></div>).
We call this div soup, and it is the primary culprit behind modern front-end bloat.
The Problem with Prompting in a Vacuum
LLMs reflect the aggregate noise of the public internet. Because the web spent a decade over-reliant on heavy JS component frameworks, AI models naturally echo that complexity back to us. If you don’t constrain the model with architectural guardrails, you get fragile code that requires endless CSS patches and JS duct tape.
Steering the AI with Native Primitives
The secret to effective “Zero-Patch Engineering” with AI isn’t writing longer prompts; it’s shifting the prompt’s underlying constraints to the platform itself. When collaborating with AI on UI architecture, enforce a strict HTML-First rule:
- Ban unnecessary wrapper elements: Instruct the model to rely on native structural elements.
- Mandate native interactive APIs: Force the use of
<dialog>for overlays,<details>and<summary>for accordions, and native<select>or popover attributes where applicable. - Shift accessibility left: Require native keyboard handling and semantic roles rather than custom JavaScript keydown listeners.
By forcing the AI to leverage native browser primitives, the code shrinks by 80%, assistive technology support comes built-in from the browser vendor, and your maintenance overhead drops to zero. The web platform finally won—our prompts just need to catch up.

Leave a Reply