Comment by spockz
15 hours ago
Back in the good old days we would prevent these ux/ui issues by rigorously enforcing the use of our own stylesheets and classes. Later that grew to only using the company ux components. This was very successful in keeping everything neat and tidy. The only drawback was creating and curating new elements and getting consensus. But otherwise it works wonders.
Try constructing reusable components out of what you are doing instead of building everything up from basic building blocks. This also allows more concrete testing of individual parts and then if you want to change the look you can change it in one place and have it apply everywhere.
Agentic development doesn’t mean “throw all what we learned out of the window”, the same practices that helped speed up and improve quality of work of humans also helps agents. In fact, the multiplier is even bigger. You will notice it in development speed and reduced cost due to avoiding churn.
I use reusable components but the issue is that the model rarely checks to see if a component already exists. Or it will use the wrong one. Or if the component strays from the reusable component it doesn't extend it in a generalized way and will special case inline styles, or it'll create a new component. Rarely does it intelligently figure out the correct course of action.
I've also built up a suite of linter rules to catch the same mistakes the model makes over and over. Still, there are a lot of gaps. I think it's mostly because my codebase is massive at this point. It was easy when the codebase was small and didn't require context gathering to make good decisions.
I think this is a good example of "AI tools are not as good as users think they are". If you're having problems with AI tools not checking to see if a component already exists, then they're not ready for prime-time on your codebase. The solution isn't to stop caring whether or not you're using reusable components, the solution is just to acknowledge (regretfully!) that AI coding is not good enough to meet an appropriate quality standard without more supervision than you've been able to use it with in the past.
If you have reusable components it should be quite easy for you to add it yourself. Its okay to code by hand, especially when doing frontend.
When comes to frontend work, the handmade UX designed by a professional will always outperform whats made by an llm.
Sure its 10x slower, but you'll get 20x more usere because it will obvious it was made with care (if done well, and you should learn to do it well). Its the same reason handmade clothing, watches and other luxery items speak to us more, sometimes its marketing but often times its the craft.
There's a reason why all the companies selling the idea that web dev is dead, like lovable, still hire designers with 50k retainers to do their landing pages.
Start by adding more descriptions to the help and documentation docs of the components. Create an index. Forbid the llm to use any other component than on that list. Let another llm review the work. Forbid it to make custom html.
Then every time it tries to do so ask it why it didn’t use one of the ones from the list. Update the list with more ifthenusethis texts. Also negatives, if such then use y instead.