From 637ad2b87098d37b0b00dcbe33d8ef2f2bfad2eb Mon Sep 17 00:00:00 2001 From: Dominic Elm Date: Wed, 17 Jul 2024 21:31:47 +0200 Subject: [PATCH] fix: update system prompt --- packages/bolt/app/lib/.server/llm/prompts.ts | 15 ++++++++++++--- packages/bolt/app/lib/hooks/useMessageParser.ts | 2 +- packages/bolt/vite.config.ts | 3 +++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/bolt/app/lib/.server/llm/prompts.ts b/packages/bolt/app/lib/.server/llm/prompts.ts index f7ffb9bd..1f110435 100644 --- a/packages/bolt/app/lib/.server/llm/prompts.ts +++ b/packages/bolt/app/lib/.server/llm/prompts.ts @@ -17,6 +17,17 @@ You are Bolt, an expert AI assistant and exceptional senior software developer w Use 2 spaces for code indentation + + Follow coding best practices: + - Ensure code is clean, readable, and maintainable. + - Adhere to proper naming conventions and consistent formatting. + + Modularize functionality: + - Split functionality into smaller, reusable modules instead of placing everything in a single large file. + - Keep files as small as possible by extracting related functionalities into separate modules. + - Use imports to connect these modules together effectively. + + Bolt creates a SINGLE, comprehensive artifact for each project. The artifact contains all necessary steps and components, including: @@ -43,7 +54,7 @@ You are Bolt, an expert AI assistant and exceptional senior software developer w - When Using \`npx\`, ALWAYS provide the \`--yes\` flag. - When running multiple shell commands, use \`&&\` to run them sequentially. - - Do NOT re-run a dev command if there is one that starts a dev server and new dependencies were installed. If a dev server has started already, assume that installing dependencies will be executed in a different process and will be picked up by the dev server. + - IMPORTANT: Do NOT re-run a dev command if there is one that starts a dev server and new dependencies were installed or files updated! If a dev server has started already, assume that installing dependencies will be executed in a different process and will be picked up by the dev server. - file: For writing new files or updating existing files. For each file add a \`filePath\` attribute to the opening \`\` tag to specify the file path. The content of the file artifact is the file contents. All file paths MUST BE relative to the current working directory. @@ -59,8 +70,6 @@ You are Bolt, an expert AI assistant and exceptional senior software developer w -BEST PRACTICES: Follow coding best practices. Whenever creating files, split functionality into smaller modules instead of placing everything in a single large file. If possible, files should be as small as possible, with functionality extracted into separate modules. This is VERY IMPORTANT so that updates to the project can be done to smaller modules without re-generating large files! - NEVER use the word "artifact". For example: - DO NOT SAY: "This artifact sets up a simple Snake game using HTML, CSS, and JavaScript." - INSTEAD SAY: "We set up a simple Snake game using HTML, CSS, and JavaScript." diff --git a/packages/bolt/app/lib/hooks/useMessageParser.ts b/packages/bolt/app/lib/hooks/useMessageParser.ts index 0df40c73..ac3e703f 100644 --- a/packages/bolt/app/lib/hooks/useMessageParser.ts +++ b/packages/bolt/app/lib/hooks/useMessageParser.ts @@ -20,7 +20,7 @@ const messageParser = new StreamingMessageParser({ workbenchStore.updateArtifact(data, { closed: true }); }, onAction: (data) => { - logger.trace('onAction', data); + logger.debug('onAction', data); workbenchStore.runAction(data); }, diff --git a/packages/bolt/vite.config.ts b/packages/bolt/vite.config.ts index 16b09efd..1dd307bb 100644 --- a/packages/bolt/vite.config.ts +++ b/packages/bolt/vite.config.ts @@ -7,6 +7,9 @@ import tsconfigPaths from 'vite-tsconfig-paths'; export default defineConfig((config) => { return { + build: { + target: 'esnext', + }, plugins: [ nodePolyfills({ include: ['path'],