Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project templates before start create #52

Closed
danielmeloalencar opened this issue Oct 22, 2024 · 7 comments
Closed

Project templates before start create #52

danielmeloalencar opened this issue Oct 22, 2024 · 7 comments
Labels
stale The pull / issue is stale and will be closed soon

Comments

@danielmeloalencar
Copy link

I noticed that the original Bolt.new uses project templates with the entire basic structure according to the project type (React, Vite, Express, Vue) when it recognizes the required project type based on the prompt. This helps prevent errors, such as occasionally adding unnecessary or non-existent dependencies to the package.json. I believe this could be done directly in the prompt within app\lib.server\llm\prompts.ts.

image

An alternative would be to choose the project type (template) before starting the prompt. That way, the entire project base (Vite/React, Node Express, Vue, etc.) would be set up correctly, and then the user could proceed with their prompt.

@danielmeloalencar danielmeloalencar changed the title Project templates Project templates before start create Oct 22, 2024
@faddy19
Copy link

faddy19 commented Oct 23, 2024

Absolutely right. This would make things much easier. We need to take out the guess work and channel the system so we get the endresult we want.

Any idea how to implement that?

@danielmeloalencar
Copy link
Author

Absolutely right. This would make things much easier. We need to take out the guess work and channel the system so we get the endresult we want.

Any idea how to implement that?

Yes, using the same concept already applied, but with an additional step beforehand. There would need to be another prompt to identify which template needs to be installed.

Example:

User: Create a Todo app with React and Vite.
The first interaction with the AI would be: Based on the user's statement, the AI needs to identify which template should be used and then write the files in the web container (based on template files already created beforehand).
Once everything is created, it starts editing the template according to the user's prompt.
An alternative would be to identify the necessary template and use it as context for the final prompt, but this would increase the processing cost and token usage.

@thecodacus
Copy link
Collaborator

I'm noticing an issue when comparing the output from the official bolt.new site with my local output. Even when using the Sonnet 3.5 model, the results still fall short of the quality seen on bolt.new.

And I found a .bolt folder that seems to contain the configuration settings for project templates. The config.json file within this folder shows a variety of available templates:

image

To improve this, I recommend creating a set of high-quality project templates and storing them in the Git repository. Each template should include a name and description, and we could make them selectable through a configuration panel.

When a user starts a new project, the system could first engage an LLM, supplying it with the list of templates and their descriptions. The LLM could then output a structured response indicating the chosen template, or it could suggest starting with a blank template.

Once a template is chosen, the system would clone it into the web container and proceed with the usual setup process.

Without these templating features, achieving high-quality code output is challenging, and this project risks being viewed as a toy if it can't support serious development.

(P.S: this comment is refined with AI for better readability 😆 , here us the prompt I am writing this comment in a github issue, rewrite it for better readability )

@danielmeloalencar
Copy link
Author

I'm noticing an issue when comparing the output from the official site with my local output. Even when using the Sonnet 3.5 model, the results still fall short of the quality seen on .bolt.new``bolt.new

And I found a folder that seems to contain the configuration settings for project templates. The config.json file within this folder shows a variety of available templates:.bolt

image To improve this, I recommend creating a set of high-quality project templates and storing them in the Git repository. Each template should include a name and description, and we could make them selectable through a configuration panel.

When a user starts a new project, the system could first engage an LLM, supplying it with the list of templates and their descriptions. The LLM could then output a structured response indicating the chosen template, or it could suggest starting with a blank template.

Once a template is chosen, the system would clone it into the web container and proceed with the usual setup process.

Without these templating features, achieving high-quality code output is challenging, and this project risks being viewed as a toy if it can't support serious development.

(P.S: this comment is refined with AI for better readability 😆 , here us the prompt I am writing this comment in a github issue, rewrite it for better readability )

I believe that with the use of agents (which is already on the project roadmap), this can be solved.
An agent can be run to choose a suitable template from the predefined options and then other agents follow the process of generating the code.

@thecodacus
Copy link
Collaborator

Working on a PR #266 which will allow you to start from a code template

@chrismahoney
Copy link
Collaborator

^^ Keep an eye on the above PR regarding templates, thanks @thecodacus for the work and also reminding me about the .bolt directory!

@thecodacus
Copy link
Collaborator

closed the previous PR, as @wonderwhy-er suggested it would be better to have text based approach for for tool calling.
submitted #302 with that solution in mind

@dustinwloring1988 dustinwloring1988 added the stale The pull / issue is stale and will be closed soon label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale The pull / issue is stale and will be closed soon
Projects
None yet
Development

No branches or pull requests

5 participants