coleam00 / bolt.new-any-llm

Prompt, run, edit, and deploy full-stack web applications using any LLM you want!
https://bolt.new
MIT License
620 stars 376 forks source link

Update prompts.ts #17

Open faddy19 opened 11 hours ago

faddy19 commented 11 hours ago

I optimized the prompt.ts for a better UI output.

kofi-bhr commented 5 hours ago

Hey! Thanks for looking into improving the UI output. The motivation is great, but having worked with LLMs a lot, I see some potential issues with this approach:

  1. Over-specification actually tends to make LLM output worse, not better. When we tell it to be "minimalistic, astonishing" etc, we're adding competing priorities that can confuse the model. Simple, clear instructions usually work better :)

  2. The huge list of technical requirements (shadcn, CSS-in-JS, Redux, etc) creates a lot of cognitive load for the LLM, which can often lead to lower quality output (especially with such particular params like here). There's a reason the original Bolt.new didn't have these specs.

  3. The separation between "creating UI/UX code" vs regular code creates an artificial split that can make prompts waaay less effective. LLMs work better with unified, consistent instructions.

Instead, I'd recommend the approach from my previous PR: focus on clear planning and structured thinking. For UI specifically, a prompt like:

1. Plan the component structure
2. Define key interactions
3. Implement core functionality
4. Add styling with Tailwind


This lets the LLM focus on one thing at a time while still creating great UI code. I've found it produces much more reliable, maintainable results.


Also worth noting - we should be careful about AI-generated code in general, especially for opening PRs on OSS projects :)


Happy to chat more about LLM prompting patterns if you're interested! Been deep in this space for a while and always enjoy sharing experiences 🙂


– kofi